Fix case of 'diff xxx | head' appearing to succeed even if the diff command returned non-zero exit statux.

This commit is contained in:
Gustavo J. A. M. Carneiro
2008-04-06 19:22:39 +01:00
parent 737bc7cd00
commit 0c393e38c4

10
wscript
View File

@@ -677,12 +677,16 @@ class Regression(object):
run_program(testName, command_template=get_command_template())
if verbose:
diffCmd = "diff traces " + refTestDirName + " | head"
#diffCmd = "diff traces " + refTestDirName + " | head"
diffCmd = subprocess.Popen(args=["diff", "traces", refTestDirName], stdout=subprocess.PIPE)
headCmd = subprocess.Popen(args=["diff", "traces", refTestDirName], stdin=diffCmd.stdout)
rc1 = diffCmd.wait()
rc2 = headCmd.wait()
rc = rc1 or rc2
else:
diffCmd = "diff traces " + refTestDirName + \
" > /dev/null 2>&1"
rc = os.system(diffCmd)
rc = os.system(diffCmd)
if rc:
print "----------"
print "Traces differ in test: test-" + testName