summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmil Velikov <emil.velikov@collabora.com>2018-04-24 18:49:22 +0100
committerDylan Baker <dylan@pnwbakers.com>2018-06-21 08:13:05 -0700
commit2a0015de3f2ed8b2117e09ecf8fa8bb9042c85b6 (patch)
tree78e11aeee4f58ca9afc4d81c10168b611a7ac894
parent3c1eaa596f68249423a7315e600245fbe92db1d4 (diff)
glsl/tests/glcpp: reinstate "error out if no tests found"
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> (cherry picked from commit d589eddc8be5240632d42ae1931b0b6a82ff524c)
-rwxr-xr-xsrc/compiler/glsl/glcpp/tests/glcpp_test.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/compiler/glsl/glcpp/tests/glcpp_test.py b/src/compiler/glsl/glcpp/tests/glcpp_test.py
index cdc63b3ac2..8ac5d7cb0a 100755
--- a/src/compiler/glsl/glcpp/tests/glcpp_test.py
+++ b/src/compiler/glsl/glcpp/tests/glcpp_test.py
@@ -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