Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated expected results #26

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified bin/run-in-docker.sh
100755 → 100644
Empty file.
Empty file modified bin/run-tests-in-docker.sh
100755 → 100644
Empty file.
Empty file modified bin/run-tests.sh
100755 → 100644
Empty file.
17 changes: 13 additions & 4 deletions bin/run.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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 = ""
Expand Down Expand Up @@ -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
Empty file modified bin/run.sh
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion tests/all-fail/expected_results.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":1,"status":"fail","message":"Files (run: 1) (failed: 1) (0% success)"}
{"version":1,"status":"fail","message":"failed: year not divisible by 4 in common year, expected: FALSE but got: TRUE"}
2 changes: 1 addition & 1 deletion tests/empty-file/expected_results.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":1,"status":"fail","message":"Files (run: 1) (failed: 1) (0% success)"}
{"version":1,"status":"error","message":"<0074>:: Errors resolving the following references: 'leap' (tests/empty-file/t_empty-file.e:7) has not been declared."}
2 changes: 1 addition & 1 deletion tests/partial-fail/expected_results.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":1,"status":"fail","message":"Files (run: 1) (failed: 1) (0% success)"}
{"version":1,"status":"fail","message":"failed: year not divisible by 4 in common year, expected: FALSE but got: TRUE"}
2 changes: 1 addition & 1 deletion tests/syntax-error/expected_results.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":1,"status":"fail","message":"Files (run: 1) (failed: 1) (0% success)"}
{"version":1,"status":"error","message":"<0076>:: expected to see an assignment after 'publ1367A', such as =, +=, -=, *=, /= or &="}
Loading