From 7316c75fa351ae552eae87d15ffa35c85bdcb4e7 Mon Sep 17 00:00:00 2001 From: Peter Willendrup Date: Tue, 28 Apr 2026 11:56:21 +0200 Subject: [PATCH 01/15] Add visible RUNTIME ERROR in output if test failed --- tools/Python/mctest/mctest.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/Python/mctest/mctest.py b/tools/Python/mctest/mctest.py index 831a36109..69cb55763 100755 --- a/tools/Python/mctest/mctest.py +++ b/tools/Python/mctest/mctest.py @@ -421,6 +421,8 @@ def mccode_test(branchdir, testdir, limitinstrs=None, instrfilter=None, compfilt logging.info(formatstr % test.get_display_name() + " [val: " + str(test.testval) + " / " + str(test.targetval) + " = " + str(round(100.0*test.testval/test.targetval)) + " %]" + suffix) else: # Special case, expected test target value is 0 logging.info(formatstr % test.get_display_name() + " [val: " + str(test.testval) + " vs " + str(test.targetval) + " (absolute vs 0) ]" + suffix) + else: + logging.info(formatstr % test.get_display_name() + " !! [TEST RUNTIME ERROR] !!") # save test result to disk test.testcomplete = True From f419993a8739a5bd12be1a1457b70e51ffee4bf7 Mon Sep 17 00:00:00 2001 From: Peter Willendrup Date: Tue, 28 Apr 2026 12:07:16 +0200 Subject: [PATCH 02/15] Cover more combinations of errors/not --- tools/Python/mctest/mctest.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/Python/mctest/mctest.py b/tools/Python/mctest/mctest.py index 69cb55763..aec6c77a8 100755 --- a/tools/Python/mctest/mctest.py +++ b/tools/Python/mctest/mctest.py @@ -414,7 +414,9 @@ def mccode_test(branchdir, testdir, limitinstrs=None, instrfilter=None, compfilt test.testval=-1 failed=True - if test.didrun and not failed: + if test.didrun: + if failed: + suffix += " AND RUNTIME FAILURE?!" formatstr = "%-" + "%ds: " % (maxnamelen+1) + \ "{:3d}.".format(math.floor(test.runtime)) + str(test.runtime-int(test.runtime)).split('.')[1][:2] if test.targetval!=0: # Normal situation, non-zero target value @@ -422,7 +424,7 @@ def mccode_test(branchdir, testdir, limitinstrs=None, instrfilter=None, compfilt else: # Special case, expected test target value is 0 logging.info(formatstr % test.get_display_name() + " [val: " + str(test.testval) + " vs " + str(test.targetval) + " (absolute vs 0) ]" + suffix) else: - logging.info(formatstr % test.get_display_name() + " !! [TEST RUNTIME ERROR] !!") + logging.info(formatstr % test.get_display_name() + " !! [TEST INDICATES RUNTIME ERROR - see run_stdout_[N].txt ] !!") # save test result to disk test.testcomplete = True From 715c421d316d2e4f83bcb79e60a0ec47573d599f Mon Sep 17 00:00:00 2001 From: Peter Willendrup Date: Tue, 28 Apr 2026 12:56:50 +0200 Subject: [PATCH 03/15] Fix info string --- tools/Python/mctest/mctest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/Python/mctest/mctest.py b/tools/Python/mctest/mctest.py index aec6c77a8..0ac55b48c 100755 --- a/tools/Python/mctest/mctest.py +++ b/tools/Python/mctest/mctest.py @@ -416,7 +416,7 @@ def mccode_test(branchdir, testdir, limitinstrs=None, instrfilter=None, compfilt if test.didrun: if failed: - suffix += " AND RUNTIME FAILURE?!" + suffix += " + RUNTIME FAILURE!" formatstr = "%-" + "%ds: " % (maxnamelen+1) + \ "{:3d}.".format(math.floor(test.runtime)) + str(test.runtime-int(test.runtime)).split('.')[1][:2] if test.targetval!=0: # Normal situation, non-zero target value From 01feb34790fd73611bb77cb2d6a5d8010a7d10fd Mon Sep 17 00:00:00 2001 From: Peter Willendrup Date: Tue, 28 Apr 2026 12:58:25 +0200 Subject: [PATCH 04/15] Ensure reset of suffix var --- tools/Python/mctest/mctest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/Python/mctest/mctest.py b/tools/Python/mctest/mctest.py index 0ac55b48c..92d1c477a 100755 --- a/tools/Python/mctest/mctest.py +++ b/tools/Python/mctest/mctest.py @@ -425,7 +425,7 @@ def mccode_test(branchdir, testdir, limitinstrs=None, instrfilter=None, compfilt logging.info(formatstr % test.get_display_name() + " [val: " + str(test.testval) + " vs " + str(test.targetval) + " (absolute vs 0) ]" + suffix) else: logging.info(formatstr % test.get_display_name() + " !! [TEST INDICATES RUNTIME ERROR - see run_stdout_[N].txt ] !!") - + suffix="" # save test result to disk test.testcomplete = True if not skipped: From df039800a98bc24261ad3ead4b0b6b802ae79fd5 Mon Sep 17 00:00:00 2001 From: Peter Willendrup Date: Tue, 28 Apr 2026 13:02:30 +0200 Subject: [PATCH 05/15] Refer to resfile --- tools/Python/mctest/mctest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/Python/mctest/mctest.py b/tools/Python/mctest/mctest.py index 92d1c477a..8dad57a24 100755 --- a/tools/Python/mctest/mctest.py +++ b/tools/Python/mctest/mctest.py @@ -416,7 +416,7 @@ def mccode_test(branchdir, testdir, limitinstrs=None, instrfilter=None, compfilt if test.didrun: if failed: - suffix += " + RUNTIME FAILURE!" + suffix += " + !! RUNTIME FAILURE - see % !! " % (resfile) formatstr = "%-" + "%ds: " % (maxnamelen+1) + \ "{:3d}.".format(math.floor(test.runtime)) + str(test.runtime-int(test.runtime)).split('.')[1][:2] if test.targetval!=0: # Normal situation, non-zero target value @@ -424,7 +424,7 @@ def mccode_test(branchdir, testdir, limitinstrs=None, instrfilter=None, compfilt else: # Special case, expected test target value is 0 logging.info(formatstr % test.get_display_name() + " [val: " + str(test.testval) + " vs " + str(test.targetval) + " (absolute vs 0) ]" + suffix) else: - logging.info(formatstr % test.get_display_name() + " !! [TEST INDICATES RUNTIME ERROR - see run_stdout_[N].txt ] !!") + logging.info(formatstr % test.get_display_name() + " !! [TEST INDICATES RUNTIME ERROR - see % ] !!" % (resfile) suffix="" # save test result to disk test.testcomplete = True From fddd4dddadb31ecd4e067a3e9f3a9152aaa1d842 Mon Sep 17 00:00:00 2001 From: Peter Willendrup Date: Tue, 28 Apr 2026 13:04:22 +0200 Subject: [PATCH 06/15] Close bracket --- tools/Python/mctest/mctest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/Python/mctest/mctest.py b/tools/Python/mctest/mctest.py index 8dad57a24..9a01f9b1c 100755 --- a/tools/Python/mctest/mctest.py +++ b/tools/Python/mctest/mctest.py @@ -424,7 +424,7 @@ def mccode_test(branchdir, testdir, limitinstrs=None, instrfilter=None, compfilt else: # Special case, expected test target value is 0 logging.info(formatstr % test.get_display_name() + " [val: " + str(test.testval) + " vs " + str(test.targetval) + " (absolute vs 0) ]" + suffix) else: - logging.info(formatstr % test.get_display_name() + " !! [TEST INDICATES RUNTIME ERROR - see % ] !!" % (resfile) + logging.info(formatstr % test.get_display_name() + " !! [TEST INDICATES RUNTIME ERROR - see % ] !!" % (resfile)) suffix="" # save test result to disk test.testcomplete = True From ad0b6b66e41cc5831de196c56766ba7a412066e3 Mon Sep 17 00:00:00 2001 From: Peter Willendrup Date: Tue, 28 Apr 2026 13:34:37 +0200 Subject: [PATCH 07/15] More information from failures to logs --- tools/Python/mctest/mctest.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/Python/mctest/mctest.py b/tools/Python/mctest/mctest.py index 9a01f9b1c..8ac72db94 100755 --- a/tools/Python/mctest/mctest.py +++ b/tools/Python/mctest/mctest.py @@ -394,6 +394,7 @@ def mccode_test(branchdir, testdir, limitinstrs=None, instrfilter=None, compfilt failed=True continue + resfile="(No file)" # test value extraction if not didwrite_nexus: extraction = extract_testvals(join(testdir, test.instrname, str(test.testnb)), test.detector) @@ -414,17 +415,21 @@ def mccode_test(branchdir, testdir, limitinstrs=None, instrfilter=None, compfilt test.testval=-1 failed=True + percent=0 if test.didrun: if failed: suffix += " + !! RUNTIME FAILURE - see % !! " % (resfile) formatstr = "%-" + "%ds: " % (maxnamelen+1) + \ "{:3d}.".format(math.floor(test.runtime)) + str(test.runtime-int(test.runtime)).split('.')[1][:2] if test.targetval!=0: # Normal situation, non-zero target value - logging.info(formatstr % test.get_display_name() + " [val: " + str(test.testval) + " / " + str(test.targetval) + " = " + str(round(100.0*test.testval/test.targetval)) + " %]" + suffix) + percent=round(100.0*test.testval/test.targetval) + if percent<80 or percent>120 + suffix += " <--- BIG DISCREPANCY??" + logging.info(formatstr % test.get_display_name() + " [val: " + str(test.testval) + " / " + str(test.targetval) + " = " + str(percent) + " %]" + suffix) else: # Special case, expected test target value is 0 logging.info(formatstr % test.get_display_name() + " [val: " + str(test.testval) + " vs " + str(test.targetval) + " (absolute vs 0) ]" + suffix) else: - logging.info(formatstr % test.get_display_name() + " !! [TEST INDICATES RUNTIME ERROR - see % ] !!" % (resfile)) + logging.info(formatstr % test.get_display_name() + " !! [TEST INDICATES RUNTIME ERROR - see % + suffix ] !!" % (resfile)) suffix="" # save test result to disk test.testcomplete = True From a4546b4d89730b5c2bd9894bd9ec1a28b0973e68 Mon Sep 17 00:00:00 2001 From: Peter Willendrup Date: Tue, 28 Apr 2026 13:36:32 +0200 Subject: [PATCH 08/15] Fix malformed if statement --- tools/Python/mctest/mctest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/Python/mctest/mctest.py b/tools/Python/mctest/mctest.py index 8ac72db94..d9b62c372 100755 --- a/tools/Python/mctest/mctest.py +++ b/tools/Python/mctest/mctest.py @@ -423,7 +423,7 @@ def mccode_test(branchdir, testdir, limitinstrs=None, instrfilter=None, compfilt "{:3d}.".format(math.floor(test.runtime)) + str(test.runtime-int(test.runtime)).split('.')[1][:2] if test.targetval!=0: # Normal situation, non-zero target value percent=round(100.0*test.testval/test.targetval) - if percent<80 or percent>120 + if percent<80 or percent>120: suffix += " <--- BIG DISCREPANCY??" logging.info(formatstr % test.get_display_name() + " [val: " + str(test.testval) + " / " + str(test.targetval) + " = " + str(percent) + " %]" + suffix) else: # Special case, expected test target value is 0 From d4a714ce7bf7560153a8ca61dd182648730369aa Mon Sep 17 00:00:00 2001 From: Peter Willendrup Date: Tue, 28 Apr 2026 13:44:15 +0200 Subject: [PATCH 09/15] Initialize 'resfile' also in non-NeXus case --- tools/Python/mctest/mctest.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/Python/mctest/mctest.py b/tools/Python/mctest/mctest.py index d9b62c372..1fc58786e 100755 --- a/tools/Python/mctest/mctest.py +++ b/tools/Python/mctest/mctest.py @@ -403,6 +403,7 @@ def mccode_test(branchdir, testdir, limitinstrs=None, instrfilter=None, compfilt else: test.testval = -1 failed=True + resfile = join(testdir,test.instrname,"run_stdout_%d.txt" % (test.testnb)) # Look for detector output in run_stdout else: metalog = LineLogger() @@ -418,7 +419,7 @@ def mccode_test(branchdir, testdir, limitinstrs=None, instrfilter=None, compfilt percent=0 if test.didrun: if failed: - suffix += " + !! RUNTIME FAILURE - see % !! " % (resfile) + suffix += " + !! RUNTIME FAILURE - see %s !! " % (resfile) formatstr = "%-" + "%ds: " % (maxnamelen+1) + \ "{:3d}.".format(math.floor(test.runtime)) + str(test.runtime-int(test.runtime)).split('.')[1][:2] if test.targetval!=0: # Normal situation, non-zero target value @@ -429,7 +430,7 @@ def mccode_test(branchdir, testdir, limitinstrs=None, instrfilter=None, compfilt else: # Special case, expected test target value is 0 logging.info(formatstr % test.get_display_name() + " [val: " + str(test.testval) + " vs " + str(test.targetval) + " (absolute vs 0) ]" + suffix) else: - logging.info(formatstr % test.get_display_name() + " !! [TEST INDICATES RUNTIME ERROR - see % + suffix ] !!" % (resfile)) + logging.info((formatstr % test.get_display_name()) + (" !! [TEST INDICATES RUNTIME ERROR - see %s + suffix ] !!" % (resfile))) suffix="" # save test result to disk test.testcomplete = True From 7975c7363e6170171e2c4aaa12fb174a2f534fd0 Mon Sep 17 00:00:00 2001 From: Peter Willendrup Date: Tue, 28 Apr 2026 14:58:37 +0200 Subject: [PATCH 10/15] Use basename in the error log output --- tools/Python/mctest/mctest.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/Python/mctest/mctest.py b/tools/Python/mctest/mctest.py index 1fc58786e..0bba73298 100755 --- a/tools/Python/mctest/mctest.py +++ b/tools/Python/mctest/mctest.py @@ -394,7 +394,7 @@ def mccode_test(branchdir, testdir, limitinstrs=None, instrfilter=None, compfilt failed=True continue - resfile="(No file)" + resbase="(No file)" # test value extraction if not didwrite_nexus: extraction = extract_testvals(join(testdir, test.instrname, str(test.testnb)), test.detector) @@ -403,11 +403,13 @@ def mccode_test(branchdir, testdir, limitinstrs=None, instrfilter=None, compfilt else: test.testval = -1 failed=True - resfile = join(testdir,test.instrname,"run_stdout_%d.txt" % (test.testnb)) + resbase =" run_stdout_%d.txt" % (test.testnb) + resfile = join(testdir,test.instrname,resbase) # Look for detector output in run_stdout else: metalog = LineLogger() - resfile = join(testdir,test.instrname,"run_stdout_%d.txt" % (test.testnb)) + resbase =" run_stdout_%d.txt" % (test.testnb) + resfile = join(testdir,test.instrname,resbase) cmd = r"grep %s_I= %s | head -1 | cut -f2 -d= | cut -f1 -d' '" %(test.detector, resfile) utils.run_subtool_to_completion(cmd, stdout_cb=metalog.logline) try: @@ -419,7 +421,7 @@ def mccode_test(branchdir, testdir, limitinstrs=None, instrfilter=None, compfilt percent=0 if test.didrun: if failed: - suffix += " + !! RUNTIME FAILURE - see %s !! " % (resfile) + suffix += " + !! RUNTIME FAILURE - see %s !! " % (resbase) formatstr = "%-" + "%ds: " % (maxnamelen+1) + \ "{:3d}.".format(math.floor(test.runtime)) + str(test.runtime-int(test.runtime)).split('.')[1][:2] if test.targetval!=0: # Normal situation, non-zero target value @@ -430,7 +432,7 @@ def mccode_test(branchdir, testdir, limitinstrs=None, instrfilter=None, compfilt else: # Special case, expected test target value is 0 logging.info(formatstr % test.get_display_name() + " [val: " + str(test.testval) + " vs " + str(test.targetval) + " (absolute vs 0) ]" + suffix) else: - logging.info((formatstr % test.get_display_name()) + (" !! [TEST INDICATES RUNTIME ERROR - see %s + suffix ] !!" % (resfile))) + logging.info((formatstr % test.get_display_name()) + (" !! [TEST INDICATES RUNTIME ERROR - see %s + suffix ] !!" % (resbase))) suffix="" # save test result to disk test.testcomplete = True From 1e73812e7e33088647109181d008ce986c82abb0 Mon Sep 17 00:00:00 2001 From: Peter Willendrup Date: Tue, 28 Apr 2026 15:18:16 +0200 Subject: [PATCH 11/15] Remove superfluous whitespace --- tools/Python/mctest/mctest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/Python/mctest/mctest.py b/tools/Python/mctest/mctest.py index 0bba73298..3e9fecc38 100755 --- a/tools/Python/mctest/mctest.py +++ b/tools/Python/mctest/mctest.py @@ -403,12 +403,12 @@ def mccode_test(branchdir, testdir, limitinstrs=None, instrfilter=None, compfilt else: test.testval = -1 failed=True - resbase =" run_stdout_%d.txt" % (test.testnb) + resbase ="run_stdout_%d.txt" % (test.testnb) resfile = join(testdir,test.instrname,resbase) # Look for detector output in run_stdout else: metalog = LineLogger() - resbase =" run_stdout_%d.txt" % (test.testnb) + resbase ="run_stdout_%d.txt" % (test.testnb) resfile = join(testdir,test.instrname,resbase) cmd = r"grep %s_I= %s | head -1 | cut -f2 -d= | cut -f1 -d' '" %(test.detector, resfile) utils.run_subtool_to_completion(cmd, stdout_cb=metalog.logline) From 508cbca81dc7eff0fa862cbf870265411be63452 Mon Sep 17 00:00:00 2001 From: Peter Willendrup Date: Tue, 28 Apr 2026 15:46:55 +0200 Subject: [PATCH 12/15] Get rid of grep requirement --- tools/Python/mctest/mctest.py | 48 ++++++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 7 deletions(-) mode change 100755 => 100644 tools/Python/mctest/mctest.py diff --git a/tools/Python/mctest/mctest.py b/tools/Python/mctest/mctest.py old mode 100755 new mode 100644 index 3e9fecc38..a7a4db9af --- a/tools/Python/mctest/mctest.py +++ b/tools/Python/mctest/mctest.py @@ -16,6 +16,7 @@ import shutil import platform import subprocess +import io sys.path.append(os.path.join(os.path.dirname(__file__), '..')) from mccodelib import utils, mccode_config @@ -195,6 +196,35 @@ def extract_testvals(datafolder, monitorname): return (I, I_err, N) break +def parse_detector_I_value(resfile_path, detector_name): + """ + Return (value_float, success_bool, raw_value_str_or_None). + value_float is the parsed float (or -1.0 on failure). + success_bool is True when a value was parsed successfully. + raw_value_str_or_None is the string extracted (before conversion) or None. + """ + prefix = f"Detector: {detector_name}_I=" + print(prefix) + try: + with open(resfile_path, "r", encoding="utf-8", errors="replace") as f: + for line in f: + if line.startswith(prefix): + # extract after first '=' then take up to first whitespace + # matches the shell pipeline: cut -f2 -d= | cut -f1 -d' ' + _, _, after_eq = line.partition("=") + raw = after_eq.split()[0] if after_eq else "" + if raw == "": + return -1.0, False, None + try: + return float(raw), True, raw + except ValueError: + return -1.0, False, raw + return -1.0, False, None + except FileNotFoundError: + return -1.0, False, None + except OSError: + return -1.0, False, None + def mccode_test(branchdir, testdir, limitinstrs=None, instrfilter=None, compfilter=None, version=None): ''' this main test function tests the given mccode branch/version ''' skipped=False @@ -410,13 +440,17 @@ def mccode_test(branchdir, testdir, limitinstrs=None, instrfilter=None, compfilt metalog = LineLogger() resbase ="run_stdout_%d.txt" % (test.testnb) resfile = join(testdir,test.instrname,resbase) - cmd = r"grep %s_I= %s | head -1 | cut -f2 -d= | cut -f1 -d' '" %(test.detector, resfile) - utils.run_subtool_to_completion(cmd, stdout_cb=metalog.logline) - try: - test.testval=float(metalog.lst[0]) - except: - test.testval=-1 - failed=True + val, ok, raw = parse_detector_I_value(resfile, test.detector) + print(resfile) + print(test.detector) + print(val) + print(ok) + print(raw) + if ok: + test.testval = val + else: + test.testval = -1 + failed = True percent=0 if test.didrun: From 073703219740ca783d3e18de30bc3d9a9f13f7d8 Mon Sep 17 00:00:00 2001 From: Peter Willendrup Date: Tue, 28 Apr 2026 15:57:47 +0200 Subject: [PATCH 13/15] Suppress varius debugging printfs --- tools/Python/mctest/mctest.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tools/Python/mctest/mctest.py b/tools/Python/mctest/mctest.py index a7a4db9af..923c16cdb 100644 --- a/tools/Python/mctest/mctest.py +++ b/tools/Python/mctest/mctest.py @@ -203,8 +203,7 @@ def parse_detector_I_value(resfile_path, detector_name): success_bool is True when a value was parsed successfully. raw_value_str_or_None is the string extracted (before conversion) or None. """ - prefix = f"Detector: {detector_name}_I=" - print(prefix) + try: with open(resfile_path, "r", encoding="utf-8", errors="replace") as f: for line in f: @@ -441,11 +440,6 @@ def mccode_test(branchdir, testdir, limitinstrs=None, instrfilter=None, compfilt resbase ="run_stdout_%d.txt" % (test.testnb) resfile = join(testdir,test.instrname,resbase) val, ok, raw = parse_detector_I_value(resfile, test.detector) - print(resfile) - print(test.detector) - print(val) - print(ok) - print(raw) if ok: test.testval = val else: From 1ccfb4916fbffe1a5299fbb023542c66f20eb382 Mon Sep 17 00:00:00 2001 From: Peter Willendrup Date: Tue, 28 Apr 2026 16:00:11 +0200 Subject: [PATCH 14/15] Repair, prefix is required for parsing --- tools/Python/mctest/mctest.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/Python/mctest/mctest.py b/tools/Python/mctest/mctest.py index 923c16cdb..a7e06b7a2 100644 --- a/tools/Python/mctest/mctest.py +++ b/tools/Python/mctest/mctest.py @@ -203,7 +203,7 @@ def parse_detector_I_value(resfile_path, detector_name): success_bool is True when a value was parsed successfully. raw_value_str_or_None is the string extracted (before conversion) or None. """ - + prefix = f"Detector: {detector_name}_I=" try: with open(resfile_path, "r", encoding="utf-8", errors="replace") as f: for line in f: @@ -440,11 +440,10 @@ def mccode_test(branchdir, testdir, limitinstrs=None, instrfilter=None, compfilt resbase ="run_stdout_%d.txt" % (test.testnb) resfile = join(testdir,test.instrname,resbase) val, ok, raw = parse_detector_I_value(resfile, test.detector) - if ok: - test.testval = val + test.testval=val else: - test.testval = -1 - failed = True + test.testval=-1 + failed=True percent=0 if test.didrun: From e01519988e4b998cdf0e3a8abe30762a26462c97 Mon Sep 17 00:00:00 2001 From: Peter Willendrup Date: Tue, 28 Apr 2026 16:03:30 +0200 Subject: [PATCH 15/15] Another repair from excessive debug print cutting... --- tools/Python/mctest/mctest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/Python/mctest/mctest.py b/tools/Python/mctest/mctest.py index a7e06b7a2..47b9ac251 100644 --- a/tools/Python/mctest/mctest.py +++ b/tools/Python/mctest/mctest.py @@ -440,7 +440,8 @@ def mccode_test(branchdir, testdir, limitinstrs=None, instrfilter=None, compfilt resbase ="run_stdout_%d.txt" % (test.testnb) resfile = join(testdir,test.instrname,resbase) val, ok, raw = parse_detector_I_value(resfile, test.detector) - test.testval=val + if ok: + test.testval = val else: test.testval=-1 failed=True