summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2016-06-02 16:24:22 +0200
committerCedric Nugteren <web@cedricnugteren.nl>2016-06-02 16:24:22 +0200
commite561e3fbd5d8fc598af120c17162b95bc8b8743b (patch)
tree400bec346d9c2982330826c6525cfab8cf9415f4 /scripts
parent137d1d870890f4f9f8c43d06aef9d404a5b4a77e (diff)
Added return value to the test binaries (0: success, 1: failure), allowing it to work under CTest properly
Diffstat (limited to 'scripts')
-rw-r--r--scripts/generator/generator.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/generator/generator.py b/scripts/generator/generator.py
index f5fc5ecf..7113ad56 100644
--- a/scripts/generator/generator.py
+++ b/scripts/generator/generator.py
@@ -414,12 +414,13 @@ for level in [1,2,3]:
body += "using double2 = clblast::double2;\n\n"
body += "// Main function (not within the clblast namespace)\n"
body += "int main(int argc, char *argv[]) {\n"
+ body += " auto errors = size_t{0};\n"
not_first = "false"
for flavour in routine.flavours:
- body += " clblast::RunTests<clblast::TestX"+routine.name+flavour.TestTemplate()
+ body += " errors += clblast::RunTests<clblast::TestX"+routine.name+flavour.TestTemplate()
body += ">(argc, argv, "+not_first+", \""+flavour.name+routine.name.upper()+"\");\n"
not_first = "true"
- body += " return 0;\n"
+ body += " if (errors > 0) { return 1; } else { return 0; }\n"
body += "}\n"
f.write(header+"\n")
f.write(body)