Skip to content

Commit 5788ef9

Browse files
committed
- Changed make run-tests to use the testrunner.clv
1 parent ecd0a3d commit 5788ef9

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,9 @@ endif()
219219

220220
# Test runner
221221
# ---------------------------------------------------------------------------
222-
set(TEST_RUNNER_BIN ${CMAKE_BINARY_DIR}/testrunner${CMAKE_EXECUTABLE_SUFFIX})
222+
set(TEST_RUNNER_BIN ${CMAKE_BINARY_DIR}/clever extra/testrunner.clv)
223223
add_custom_target(run-tests
224-
COMMAND ${TEST_RUNNER_BIN} -q;${CMAKE_CURRENT_SOURCE_DIR}/tests
224+
COMMAND ${TEST_RUNNER_BIN}
225225
COMMENT "Running tests")
226226
add_dependencies(run-tests clever-cli)
227227
add_dependencies(run-tests testrunner)

extra/testrunner.clv

+3-7
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ function runtest(file) {
4545
var title = title_re.group(0) + " (" + file + ")";
4646
var code_re = regex:Regex.new("==CODE==\s*((?s:(?!==RESULT==).)+)");
4747

48-
io:print("\r[....] " + title);
49-
io:flush();
50-
5148
if (code_re.match(content)) {
5249
var status;
5350
var ts1 = sys:microtime();
@@ -60,19 +57,18 @@ function runtest(file) {
6057
var result_re2 = regex:Regex.new(result_re.group(1).trim());
6158

6259
if (result_re2.test(result)) {
63-
status = "PASS";
6460
++passed;
6561

6662
file:remove(file + ".tmp");
6763
file:remove(file + ".tmp.out");
6864
} else {
6965
status = "FAIL";
7066
++failed;
67+
68+
io:println("\r[" + status + "] " + title + " - " + (ts2 - ts1) + " ms");
7169
}
7270

7371
time_taken += (ts2 - ts1);
74-
75-
io:println("\r[" + status + "] " + title + " - " + (ts2 - ts1) + " ms");
7672
} else {
7773
io:println("Error: malformed test detected!");
7874
sys:exit(1);
@@ -99,6 +95,6 @@ if (passed > 0 || failed > 0) {
9995
io:println("Passed tests: " + passed);
10096
io:println("Failed tests: " + failed);
10197
io:println("-----------------------------------");
102-
io:println("Time taken: " + time_taken);
98+
io:println("Time taken: " + time_taken + " ms");
10399
io:println("-----------------------------------");
104100
}

0 commit comments

Comments
 (0)