Tests: Add driver --hashset for Travis.
This commit is contained in:
parent
e2dec043a0
commit
328fef8190
|
|
@ -59,9 +59,14 @@ jobs:
|
||||||
script: ci/test.sh vlt
|
script: ci/test.sh vlt
|
||||||
- if: type != cron
|
- if: type != cron
|
||||||
stage: test
|
stage: test
|
||||||
name: Vltmt test
|
name: Vltmt set 0 test
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
script: ci/test.sh vltmt
|
script: ci/test.sh vltmt0
|
||||||
|
- if: type != cron
|
||||||
|
stage: test
|
||||||
|
name: Vltmt set 1 test
|
||||||
|
compiler: gcc
|
||||||
|
script: ci/test.sh vltmt1
|
||||||
# Cron builds try different OS/compiler combinations
|
# Cron builds try different OS/compiler combinations
|
||||||
- if: type = cron
|
- if: type = cron
|
||||||
stage: "Build Verilator"
|
stage: "Build Verilator"
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,12 @@ case $1 in
|
||||||
vltmt)
|
vltmt)
|
||||||
make -C test_regress SCENARIOS=--vltmt
|
make -C test_regress SCENARIOS=--vltmt
|
||||||
;;
|
;;
|
||||||
|
vltmt0)
|
||||||
|
make -C test_regress SCENARIOS=--vltmt HASHSET=--hashset=0/2
|
||||||
|
;;
|
||||||
|
vltmt1)
|
||||||
|
make -C test_regress SCENARIOS=--vltmt HASHSET=--hashset=1/2
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Usage: test.sh (dist|vlt|vltmt)"
|
echo "Usage: test.sh (dist|vlt|vltmt)"
|
||||||
exit -1
|
exit -1
|
||||||
|
|
|
||||||
|
|
@ -43,10 +43,11 @@ endif
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
SCENARIOS ?= --vlt --vltmt --dist
|
SCENARIOS ?= --vlt --vltmt --dist
|
||||||
|
DRIVER_HASHSET ?=
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test:
|
test:
|
||||||
$(PERL) driver.pl $(DRIVER_FLAGS) $(SCENARIOS)
|
$(PERL) driver.pl $(DRIVER_FLAGS) $(SCENARIOS) $(DRIVER_HASHSET)
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,7 @@ my $opt_gdb;
|
||||||
my $opt_rr;
|
my $opt_rr;
|
||||||
my $opt_gdbbt;
|
my $opt_gdbbt;
|
||||||
my $opt_gdbsim;
|
my $opt_gdbsim;
|
||||||
|
my $opt_hashset;
|
||||||
my $opt_jobs = 1;
|
my $opt_jobs = 1;
|
||||||
my $opt_optimize;
|
my $opt_optimize;
|
||||||
my $opt_quiet;
|
my $opt_quiet;
|
||||||
|
|
@ -90,6 +91,7 @@ if (! GetOptions(
|
||||||
"gdbbt!" => \$opt_gdbbt,
|
"gdbbt!" => \$opt_gdbbt,
|
||||||
"gdbsim!" => \$opt_gdbsim,
|
"gdbsim!" => \$opt_gdbsim,
|
||||||
"golden!" => sub { $ENV{HARNESS_UPDATE_GOLDEN} = 1; },
|
"golden!" => sub { $ENV{HARNESS_UPDATE_GOLDEN} = 1; },
|
||||||
|
"hashset=s" => \$opt_hashset,
|
||||||
"help" => \&usage,
|
"help" => \&usage,
|
||||||
"j=i" => \$opt_jobs,
|
"j=i" => \$opt_jobs,
|
||||||
"optimize:s" => \$opt_optimize,
|
"optimize:s" => \$opt_optimize,
|
||||||
|
|
@ -141,6 +143,8 @@ if ($#opt_tests<0) { # Run everything
|
||||||
push @opt_tests, sort(glob("${dir}/t_*.pl"));
|
push @opt_tests, sort(glob("${dir}/t_*.pl"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@opt_tests = _calc_hashset(@opt_tests) if $opt_hashset;
|
||||||
|
|
||||||
if ($#opt_tests>=2 && $opt_jobs>=2) {
|
if ($#opt_tests>=2 && $opt_jobs>=2) {
|
||||||
# Without this tests such as t_debug_sigsegv_bt_bad.pl will occasionally
|
# Without this tests such as t_debug_sigsegv_bt_bad.pl will occasionally
|
||||||
# block on input and cause a SIGSTOP, then a "fg" was needed to resume testing.
|
# block on input and cause a SIGSTOP, then a "fg" was needed to resume testing.
|
||||||
|
|
@ -261,6 +265,25 @@ sub calc_jobs {
|
||||||
return $ok + 1;
|
return $ok + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub _calc_hashset {
|
||||||
|
my @in = @_;
|
||||||
|
return @in if !$opt_hashset;
|
||||||
|
$opt_hashset =~ m!^(\d+)/(\d+)$!
|
||||||
|
or die "%Error: Need number/number format for --hashset: $opt_hashset\n";
|
||||||
|
my ($set, $nsets) = ($1, $2);
|
||||||
|
my @new;
|
||||||
|
foreach my $t (@opt_tests) {
|
||||||
|
my $checksum = do {
|
||||||
|
local $/;
|
||||||
|
unpack("%32W*", $t);
|
||||||
|
};
|
||||||
|
if ($set == ($checksum % $nsets)) {
|
||||||
|
push @new, $t;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return @new;
|
||||||
|
}
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
#######################################################################
|
#######################################################################
|
||||||
#######################################################################
|
#######################################################################
|
||||||
|
|
@ -2503,6 +2526,11 @@ Run Verilator generated executable under the debugger.
|
||||||
|
|
||||||
Update golden files, equivalent to setting HARNESS_UPDATE_GOLDEN=1.
|
Update golden files, equivalent to setting HARNESS_UPDATE_GOLDEN=1.
|
||||||
|
|
||||||
|
=item --hashset I<set>/I<numsets>
|
||||||
|
|
||||||
|
Split tests based on a hash of the test names into I<numsets> and run only
|
||||||
|
tests in set number I<set> (0..I<numsets>-1).
|
||||||
|
|
||||||
=item --help
|
=item --help
|
||||||
|
|
||||||
Displays this message and program version and exits.
|
Displays this message and program version and exits.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue