diff --git a/bin/run-in-docker.sh b/bin/run-in-docker.sh old mode 100755 new mode 100644 diff --git a/bin/run-tests-in-docker.sh b/bin/run-tests-in-docker.sh old mode 100755 new mode 100644 diff --git a/bin/run-tests.sh b/bin/run-tests.sh old mode 100755 new mode 100644 diff --git a/bin/run.ex b/bin/run.ex index d781265..70e91fc 100644 --- a/bin/run.ex +++ b/bin/run.ex @@ -15,6 +15,11 @@ integer false = 0 integer true = not false re:regex err_id = re:new("<([0-9]+)>::(.*)") +function tee_name_and_contents(sequence filename) + -- display the filename then read and display contents + return filename +end function + function first_failure(sequence lines, sequence fallback) for i = 1 to length(lines) do sequence line = lines[i] @@ -71,19 +76,21 @@ procedure process(sequence slug, sequence soln_folder, sequence outp_folder) sequence output_dir = canonical_path(outp_folder) sequence results_file = join_path({output_dir, "/results.json"}) - --puts(1, solution_dir & "\n") - --puts(1, output_dir & "\n") - --puts(1, results_file & "\n") + puts(1, solution_dir & "\n") + puts(1, output_dir & "\n") + puts(1, results_file & "\n") create_directory(output_dir) printf(1, "%s: testing...", {slug}) sequence outfile = join_path({output_dir,"t_" & slug & ".out"}) + -- echo the outfile sequence cmd = build_commandline({"eutest",join_path({solution_dir,"t_" & slug & ".e"}),">", outfile}) system(cmd,2) - + -- echo the test file's path and contents atom ifh = open(outfile, "r") sequence data = read_lines(ifh) close(ifh) + -- echo the contents of the outfile sequence status = "pass" sequence message = "" @@ -117,11 +124,13 @@ procedure process(sequence slug, sequence soln_folder, sequence outp_folder) atom ofh = open(results_file,"w") json_print(ofh, JSON, false) close(ofh) + -- echo the contents of the results_file end procedure sequence cmdline = command_line() if (length(cmdline) < 5) then puts(1, "usage: eui ./bin/run.ex exercise-slug path/to/solution/folder/ path/to/output/directory/\n") else + -- echo the invocation process(cmdline[3], cmdline[4], cmdline[5]) end if diff --git a/bin/run.sh b/bin/run.sh old mode 100755 new mode 100644 diff --git a/tests/all-fail/expected_results.json b/tests/all-fail/expected_results.json index fc0bcd5..b1cab86 100644 --- a/tests/all-fail/expected_results.json +++ b/tests/all-fail/expected_results.json @@ -1 +1 @@ -{"version":1,"status":"fail","message":"Files (run: 1) (failed: 1) (0% success)"} \ No newline at end of file +{"version":1,"status":"fail","message":"failed: year not divisible by 4 in common year, expected: FALSE but got: TRUE"} \ No newline at end of file diff --git a/tests/empty-file/expected_results.json b/tests/empty-file/expected_results.json index fc0bcd5..84c2549 100644 --- a/tests/empty-file/expected_results.json +++ b/tests/empty-file/expected_results.json @@ -1 +1 @@ -{"version":1,"status":"fail","message":"Files (run: 1) (failed: 1) (0% success)"} \ No newline at end of file +{"version":1,"status":"error","message":"<0074>:: Errors resolving the following references: 'leap' (tests/empty-file/t_empty-file.e:7) has not been declared."} \ No newline at end of file diff --git a/tests/partial-fail/expected_results.json b/tests/partial-fail/expected_results.json index fc0bcd5..b1cab86 100644 --- a/tests/partial-fail/expected_results.json +++ b/tests/partial-fail/expected_results.json @@ -1 +1 @@ -{"version":1,"status":"fail","message":"Files (run: 1) (failed: 1) (0% success)"} \ No newline at end of file +{"version":1,"status":"fail","message":"failed: year not divisible by 4 in common year, expected: FALSE but got: TRUE"} \ No newline at end of file diff --git a/tests/syntax-error/expected_results.json b/tests/syntax-error/expected_results.json index fc0bcd5..ea301af 100644 --- a/tests/syntax-error/expected_results.json +++ b/tests/syntax-error/expected_results.json @@ -1 +1 @@ -{"version":1,"status":"fail","message":"Files (run: 1) (failed: 1) (0% success)"} \ No newline at end of file +{"version":1,"status":"error","message":"<0076>:: expected to see an assignment after 'publ1367A', such as =, +=, -=, *=, /= or &="} \ No newline at end of file