[Mesa-dev] [PATCH 4/4] glsl/tests/glcpp: reinstate "error out if no tests found"

Emil Velikov emil.l.velikov at gmail.com
Tue Apr 24 17:49:22 UTC 2018


From: Emil Velikov <emil.velikov at collabora.com>

With the recent rework of converting the shell script to a python one
the check for actual tests was dropped.

Bring that back, since it was explicitly added considering we had a ~2
year period, during which the tests were not run.

Fixes: db8cd8e36771 ("glcpp/tests: Convert shell scripts to a python
script")
Cc: Dylan Baker <dylan at pnwbakers.com>
Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
One might be interested in folding some of the duplication/boilerplate
at a later stage. I'm trying to bring back the normal behaviour for now
;-)
---
 src/compiler/glsl/glcpp/tests/glcpp_test.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/compiler/glsl/glcpp/tests/glcpp_test.py b/src/compiler/glsl/glcpp/tests/glcpp_test.py
index 751bd40028..cb0f16f4e7 100644
--- a/src/compiler/glsl/glcpp/tests/glcpp_test.py
+++ b/src/compiler/glsl/glcpp/tests/glcpp_test.py
@@ -118,6 +118,10 @@ def test_unix(args):
             for l in diff:
                 print(l, file=sys.stderr)
 
+    if not total:
+        print ('Could not find any tests.')
+        return False
+
     print('{}/{}'.format(passed, total), 'tests returned correct results')
     return total == passed
 
@@ -154,6 +158,10 @@ def _replace_test(args, replace):
             for l in diff:
                 print(l, file=sys.stderr)
 
+    if not total:
+        print ('Could not find any tests.')
+        return False
+
     print('{}/{}'.format(passed, total), 'tests returned correct results')
     return total == passed
 
@@ -196,6 +204,10 @@ def test_valgrind(args):
             print('FAIL')
             print(log, file=sys.stderr)
 
+    if not total:
+        print ('Could not find any tests.')
+        return False
+
     print('{}/{}'.format(passed, total), 'tests returned correct results')
     return total == passed
 
-- 
2.16.0



More information about the mesa-dev mailing list