Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
MBI: display the expected diagnostic on error
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Tue, 25 Oct 2022 22:28:43 +0000 (00:28 +0200)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 30 Oct 2022 22:41:34 +0000 (23:41 +0100)
teshsuite/smpi/MBI/MBI.py
teshsuite/smpi/MBI/MBIutils.py

index 54040a8..e04fc4e 100755 (executable)
@@ -43,5 +43,5 @@ for test in mbi.parse_one_code(filename):
 
     if res_category != "TRUE_NEG" and res_category != "TRUE_POS":
         print("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n")
-        print(f"SimGrid gave the wrong result on {binary} ({outcome} instead of {test['expect']}).")
+        print(f"SimGrid gave the wrong result on {binary} ({outcome} instead of {test['detail']}).\nExpected diagnostic: {test['diagnostic']}")
         sys.exit(1)
index 1d79bac..c422cca 100644 (file)
@@ -138,7 +138,14 @@ def parse_one_code(filename):
                     if detail not in possible_details:
                         raise ValueError(
                             f"\n{filename}:{line_num}: MBI parse error: Detailled outcome {detail} is not one of the allowed ones.")
-                test = {'filename': filename, 'id': test_num, 'cmd': cmd, 'expect': expect, 'detail': detail}
+
+                nextline = next(input_file)
+                m = re.match('[ |]*(.*)', nextline)
+                if not m:
+                    raise ValueError(f"\n{filename}:{line_num}: MBI parse error: Expected diagnostic of the test not found.\n")
+                diagnostic = m.group(1)
+
+                test = {'filename': filename, 'id': test_num, 'cmd': cmd, 'expect': expect, 'detail': detail, 'diagnostic': diagnostic}
                 res.append(test.copy())
                 test_num += 1
                 line_num += 1