glsl/tests/glcpp: reinstate "error out if no tests found"
authorEmil Velikov <emil.velikov@collabora.com>
Tue, 24 Apr 2018 17:49:22 +0000 (18:49 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 21 Jun 2018 11:09:39 +0000 (12:09 +0100)
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.

v2: use raise Exception() over  print() & return false (Dylan)

Fixes: db8cd8e36771 ("glcpp/tests: Convert shell scripts to a python
script")
Cc: Dylan Baker <dylan@pnwbakers.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
src/compiler/glsl/glcpp/tests/glcpp_test.py

index cdc63b3ac2a0d6595829e26608f55ecabefc0647..8ac5d7cb0a1b9d05c1c293d58c2a1a8ac55a13ac 100755 (executable)
@@ -119,6 +119,9 @@ def test_unix(args):
             for l in diff:
                 print(l, file=sys.stderr)
 
+    if not total:
+        raise Exception('Could not find any tests.')
+
     print('{}/{}'.format(passed, total), 'tests returned correct results')
     return total == passed
 
@@ -155,6 +158,9 @@ def _replace_test(args, replace):
             for l in diff:
                 print(l, file=sys.stderr)
 
+    if not total:
+        raise Exception('Could not find any tests.')
+
     print('{}/{}'.format(passed, total), 'tests returned correct results')
     return total == passed
 
@@ -197,6 +203,9 @@ def test_valgrind(args):
             print('FAIL')
             print(log, file=sys.stderr)
 
+    if not total:
+        raise Exception('Could not find any tests.')
+
     print('{}/{}'.format(passed, total), 'tests returned correct results')
     return total == passed