[llvm] 33601f4 - [llvm-lit][test] Fix regex to capture scientific notation

via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 25 08:05:51 PDT 2022


Author: gbreynoo
Date: 2022-10-25T16:05:35+01:00
New Revision: 33601f4255402c5cffbefc836f35678d368906de

URL: https://github.com/llvm/llvm-project/commit/33601f4255402c5cffbefc836f35678d368906de
DIFF: https://github.com/llvm/llvm-project/commit/33601f4255402c5cffbefc836f35678d368906de.diff

LOG: [llvm-lit][test] Fix regex to capture scientific notation

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/utils/lit/tests/test-output-micro.py b/llvm/utils/lit/tests/test-output-micro.py
index 2f49cfbfb126c..9c855b3cdcacd 100644
--- a/llvm/utils/lit/tests/test-output-micro.py
+++ b/llvm/utils/lit/tests/test-output-micro.py
@@ -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

diff  --git a/llvm/utils/lit/tests/test-output.py b/llvm/utils/lit/tests/test-output.py
index b6640be96547d..d0d01202330f0 100644
--- a/llvm/utils/lit/tests/test-output.py
+++ b/llvm/utils/lit/tests/test-output.py
@@ -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


        


More information about the llvm-commits mailing list