summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorVictor van den Elzen <victor.vde@gmail.com>2009-11-11 07:47:39 +0100
committerVictor van den Elzen <victor.vde@gmail.com>2009-11-11 07:47:39 +0100
commit30621f4d0cfbd2d4f8238770980fe757d3c928a0 (patch)
tree4da0df738828e3e4f704aa1eafd8961dff86d40a /test
parentb9856a266e1c7d4638a50ab09f49421a9258b4cd (diff)
downloadnasm-30621f4d0cfbd2d4f8238770980fe757d3c928a0.tar.gz
Add test/bisect.sh for use with "git bisect"
Diffstat (limited to 'test')
-rwxr-xr-xtest/bisect.sh22
-rwxr-xr-xtest/performtest.pl6
2 files changed, 27 insertions, 1 deletions
diff --git a/test/bisect.sh b/test/bisect.sh
new file mode 100755
index 00000000..98bdb37d
--- /dev/null
+++ b/test/bisect.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+# Usage:
+
+# Make a test and a golden file, read ./performtest.pl --help
+
+# cd nasm
+# cp -r test somewhere (copy test dir out of the tree)
+# git bisect start HEAD nasm-2.07 (where HEAD is bad and nasm-2.07 is good)
+# git bisect run somewhere/test/bisect.sh br2148476 (what you want to test)
+
+# Done
+
+
+# Slow but sure
+./autogen.sh
+./configure
+make
+
+NASMDIR=$(pwd)
+cd $(dirname "$0")
+./performtest.pl "--nasm=$NASMDIR/nasm" "$1.asm" --verbose
diff --git a/test/performtest.pl b/test/performtest.pl
index f9b7bb2c..f7865b39 100755
--- a/test/performtest.pl
+++ b/test/performtest.pl
@@ -15,6 +15,8 @@ use File::Path qw(mkpath rmtree);
#sub debugprint { print (pop() . "\n"); }
sub debugprint { }
+my $globalresult = 0;
+
#Process one testfile
sub perform {
my ($clean, $diff, $golden, $nasm, $quiet, $testpath) = @_;
@@ -80,6 +82,7 @@ sub perform {
if($temp == 1) {
#different
$result = 1;
+ $globalresult = 1;
push @failedfiles, $_;
} elsif($temp == -1) {
#error
@@ -89,6 +92,7 @@ sub perform {
} elsif (-f "golden/$testname/$subname/$_") {
#File exists in golden but not in output
$result = 1;
+ $globalresult = 1;
push @failedfiles, $_;
}
}
@@ -139,7 +143,7 @@ unless (!defined $nasm or -x $nasm) {
}
perform($clean, $diff, $golden, $nasm, ! $verbose, $_) foreach @ARGV;
-
+exit $globalresult;
__END__