From 30621f4d0cfbd2d4f8238770980fe757d3c928a0 Mon Sep 17 00:00:00 2001 From: Victor van den Elzen Date: Wed, 11 Nov 2009 07:47:39 +0100 Subject: [PATCH] Add test/bisect.sh for use with "git bisect" --- test/bisect.sh | 22 ++++++++++++++++++++++ test/performtest.pl | 6 +++++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100755 test/bisect.sh 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__ -- 2.11.4.GIT