[llvm-lit][test] Fix regex to capture scientific notation
authorgbreynoo <owen.reynolds@sony.com>
Tue, 25 Oct 2022 14:29:58 +0000 (15:29 +0100)
committergbreynoo <owen.reynolds@sony.com>
Tue, 25 Oct 2022 15:05:35 +0000 (16:05 +0100)
We were seeing an intermittent local test failure of
utils\lit\tests\test-output.py in which the elapsed time output was
being given in scientific notation. Python automatically represents
small floating-point values in scientific notation so I have altered
these tests regex to capture output in that format.

Differential Revision: https://reviews.llvm.org/D136469

llvm/utils/lit/tests/test-output-micro.py
llvm/utils/lit/tests/test-output.py

index 2f49cfb..9c855b3 100644 (file)
@@ -39,7 +39,7 @@
 # CHECK-NEXT:   },
 # CHECK-NEXT:   {
 # CHECK-NEXT:     "code": "PASS",
-# CHECK-NEXT:     "elapsed": {{[0-9.]+}},
+# CHECK-NEXT:     "elapsed": {{[-+0-9.eE]+}},
 # CHECK-NEXT:     "metrics": {
 # CHECK-NEXT:       "value0": 1,
 # CHECK-NEXT:       "value1": 2.3456
index b6640be..d0d0120 100644 (file)
@@ -7,7 +7,7 @@
 # CHECK-NEXT: "tests": [
 # CHECK-NEXT:   {
 # CHECK-NEXT:     "code": "PASS",
-# CHECK-NEXT:     "elapsed": {{[0-9.]+}},
+# CHECK-NEXT:     "elapsed": {{[-+0-9.eE]+}},
 # CHECK-NEXT:     "metrics": {
 # CHECK-NEXT:       "value0": 1,
 # CHECK-NEXT:       "value1": 2.3456