Add contributors and test.

This commit is contained in:
Wilson Snyder 2019-06-10 20:29:58 -04:00
parent 10e3cc6e3b
commit 6c1782e4de
3 changed files with 94 additions and 0 deletions

View File

@ -124,6 +124,7 @@ DISTFILES_INC = $(INFOS) .gitignore Artistic COPYING COPYING.LESSER \
bin/verilator_gantt \
bin/verilator_includer \
bin/verilator_profcfunc \
docs/CONTRIBUTORS \
doxygen-mainpage doxygen.config verilator_logo.png \
install-sh configure *.pod \
include/*.[chv]* \

11
docs/CONTRIBUTORS Normal file
View File

@ -0,0 +1,11 @@
The contributors listed below have certified their Verilator contributions
under the Developer Certificate of Origin
(https://developercertificate.org/).
Please see the Verilator manual for additional contributors.
Jeremy Bennett
John Coiner
Kanad Kanhere
Stefan Wallentowitz
Wilson Snyder

View File

@ -0,0 +1,82 @@
#!/usr/bin/perl
if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
#
# Copyright 2003 by Wilson Snyder. This program is free software; you can
# redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
use IO::File;
use strict;
use vars qw($Self);
scenarios(dist => 1);
my $root = "..";
my $Debug;
my %Contributors;
my %Authors;
if (!-r "$root/.git") {
skip("Not in a git repository");
} else {
check();
}
ok(1);
1;
sub check {
read_contributors("$root/docs/CONTRIBUTORS");
read_user();
read_authors();
for my $author (sort keys %Authors) {
print "Check: $author\n" if $Self->{verbose};
if ($author =~ /(<[^>]+>)/) {
my $email = $1;
if (!$Contributors{$email}) {
error("Certify your contribution by appending '$author' to CONTRIBUTORS");
}
}
}
}
sub read_contributors {
my $filename = shift;
my $fh = IO::File->new("<$filename")
or error("$! $filename");
# Assumes git .mailmap format
while (my $line = ($fh && $fh->getline)) {
while ($line =~ /(<[^>]+>)/g) {
$line =~ s/ *<[^>]+>//;
$Contributors{$1} = 1;
}
}
}
sub read_user {
my $changes = `cd $root ; git diff-index --quiet HEAD --`;
chomp $changes;
if (!$changes) {
print "No git changes\n" if $Self->{verbose};
} else {
# Uncommitted changes, so check the user's git name
my $user = `git config user.name`;
chomp $user;
my $email = `git config user.email`;
chomp $email;
if ($user && $email) {
$Authors{"$user <$email>"} = 1;
}
}
}
sub read_authors {
# Check recent commits in case did commit
my $git_auths = `git log '--pretty=format:%aN <%aE>' | head -20`;
foreach my $line (split /\n/, $git_auths) {
$line =~ s/ *<[^>]+>//;
$Authors{$line} = 1;
}
}