Fix a diff|head race condition; Fix regression error messages to indicate the new waf commands to run regression tests.
1.1 --- a/wscript Sun Apr 06 19:54:39 2008 +0100
1.2 +++ b/wscript Sun Apr 06 19:58:29 2008 +0100
1.3 @@ -127,7 +127,7 @@
1.4 help=("Enable regression testing; only used for the 'check' target"),
1.5 default=False, dest='regression', action="store_true")
1.6 opt.add_option('--regression-generate',
1.7 - help=("Generate new regression test traces; only used for the 'check' target"),
1.8 + help=("Generate new regression test traces."),
1.9 default=False, dest='regression_generate', action="store_true")
1.10 opt.add_option('--regression-tests',
1.11 help=('For regression testing, only run/generate the indicated regression tests, '
1.12 @@ -678,10 +678,12 @@
1.13
1.14 if verbose:
1.15 #diffCmd = "diff traces " + refTestDirName + " | head"
1.16 - diffCmd = subprocess.Popen(args=["diff", "traces", refTestDirName], stdout=subprocess.PIPE)
1.17 - headCmd = subprocess.Popen(args=["diff", "traces", refTestDirName], stdin=diffCmd.stdout)
1.18 + diffCmd = subprocess.Popen(["diff", "traces", refTestDirName],
1.19 + stderr=subprocess.PIPE, stdout=subprocess.PIPE)
1.20 + headCmd = subprocess.Popen("head", stdin=diffCmd.stdout)
1.21 + rc2 = headCmd.wait()
1.22 + diffCmd.stdout.close()
1.23 rc1 = diffCmd.wait()
1.24 - rc2 = headCmd.wait()
1.25 rc = rc1 or rc2
1.26 else:
1.27 diffCmd = "diff traces " + refTestDirName + \
1.28 @@ -690,11 +692,11 @@
1.29 if rc:
1.30 print "----------"
1.31 print "Traces differ in test: test-" + testName
1.32 - print "Reference traces in directory: " + refTestDirName
1.33 + print "Reference traces in directory: regression/" + refTestDirName
1.34 print "Traces in directory: traces"
1.35 print "Rerun regression test as: " + \
1.36 - "\"python regression.py test-" + testName + "\""
1.37 - print "Then do \"diff -u traces " + refTestDirName + \
1.38 + "\"./waf --regression --regression-tests=test-" + testName + "\""
1.39 + print "Then do \"diff -u regression/traces regression/" + refTestDirName + \
1.40 "\" for details"
1.41 print "----------"
1.42 return rc