diff --git a/utah/scripts/jxyang/parallel_test.pl b/utah/scripts/jxyang/parallel_test.pl index e32664d12..7f5255021 100644 --- a/utah/scripts/jxyang/parallel_test.pl +++ b/utah/scripts/jxyang/parallel_test.pl @@ -1,21 +1,20 @@ #!/usr/bin/perl -w - use strict; -use warnings; -#use Sys::CPU; +use strict; +use warnings; sub usage () { - die "usage: parallel_test.pl \n"; + die "usage: parallel_test.pl \n"; } -my $CPUS = 2; #Sys::CPU::cpu_count(); - -if (scalar (@ARGV) != 2 || !(-e $ARGV[0]) ) { +if (scalar (@ARGV) != 3 || $ARGV[0] < 2 || !(-e $ARGV[1])) { usage(); } -print "looks like we have $CPUS cpus\n"; -my $CONFIG_FILE = $ARGV[0]; -my $CSMITH_OPTION = $ARGV[1]; +my $CPUS = $ARGV[0]; +print "running on $CPUS cpus\n"; + +my $CONFIG_FILE = $ARGV[1]; +my $CSMITH_OPTION = $ARGV[2]; my @ALT_OPTIONS = (); if ($CSMITH_OPTION =~ /--no-(.*)/) { diff --git a/utah/scripts/jxyang/test.pl b/utah/scripts/jxyang/test.pl index c3f011f6e..6a66e058c 100644 --- a/utah/scripts/jxyang/test.pl +++ b/utah/scripts/jxyang/test.pl @@ -48,7 +48,8 @@ my $PROG_TIMEOUT = 8; # extra options here -my $CSMITH_USER_OPTIONS = " --bitfields --packed-struct"; +my $CSMITH_USER_OPTIONS = " --bitfields --packed-struct"; +my $CSMITH_EXTRA_OPTIONS = ""; ################# end user-configurable stuff ################### @@ -225,7 +226,7 @@ ($) # run Csmith until generate a big enough program while (1) { unlink $cfile; - my $cmd = "$CSMITH_HOME/src/csmith $CSMITH_USER_OPTIONS --output $cfile"; + my $cmd = "$CSMITH_HOME/src/csmith $CSMITH_USER_OPTIONS $CSMITH_EXTRA_OPTIONS --output $cfile"; my ($res, $exitcode) = runit($cmd, $CSMITH_TIMEOUT, "csmith.out"); # print "after run csmith: $res, $exitcode\n"; @@ -297,7 +298,7 @@ () $RUN_PROGRAM = 1; } } else { - usage(); + $CSMITH_EXTRA_OPTIONS = $ARGV[2]; } } else { usage(); @@ -306,28 +307,21 @@ () my $cnt = $ARGV[0]; usage() unless ($cnt =~ /^[0-9]+$/ && $cnt >= 0); -my ($second0, $minute0, $hour0, $dayOfMonth, $month) = localtime(); -$month++; -print "start time: $month/$dayOfMonth $hour0:$minute0\n"; +my ($second0, $minute0, $hour0, $dayOfMonth0, $month0) = localtime(); +$month0++; +print "start time: $month0/$dayOfMonth0 $hour0:$minute0\n"; # figure out what compilers to test my $infile = $ARGV[1]; open INF, "<$infile" or die "Cannot read configuration file ${infile}.\n"; while (my $line = ) { - chomp $line; + $line =~ s/\r?\n?$//; # get rid of LF/CR if ($line && !($line =~ /^\s*#/)) { my $res = system ("echo \"int main() { return 0;}\" > foo.c ; $line foo.c > /dev/null 2>&1"); unlink "foo.c", "a.out"; die "cannot execute compiler $line\n" if ($res); push @COMPILERS, $line; } - - # print out time once per day - my ($second, $minute, $hour, $dayOfMonth, $month) = localtime(); - if ($hour == $hour0 && $minute == $minute0 && $second == $second0) { - $month++; - print "current time: $month/$dayOfMonth $hour:$minute"; - } } close INF; @@ -338,6 +332,13 @@ () $i++; } print "\n"; + # print out time once per day + my ($second, $minute, $hour, $dayOfMonth, $month) = localtime(); + if ($hour == $hour0 && $minute == $minute0 && $second == $second0 && $dayOfMonth != $dayOfMonth0) { + $month++; + $dayOfMonth0 = $dayOfMonth; + print "current time: $month/$dayOfMonth $hour:$minute\n"; + } } print "Total csmith errors found: $csmith_bug\n";