Skip to content

Commit

Permalink
Add new option: run in run_tests to save the runtime error or output
Browse files Browse the repository at this point in the history
  • Loading branch information
Thirumalai-Shaktivel committed Oct 20, 2022
1 parent 41bc6fc commit c6349e5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def is_included(backend):
cpp = is_included("cpp")
c = is_included("c")
wat = is_included("wat")
run = is_included("run")
pass_ = test.get("pass", None)
optimization_passes = ["flip_sign", "div_to_mul", "fma", "sign_from_value",
"inline_function_calls", "loop_unroll",
Expand Down Expand Up @@ -102,7 +103,9 @@ def is_included(backend):
run_test(filename, "wat", "lpython --no-color --show-wat {infile}",
filename, update_reference, extra_args)


if run:
run_test(filename, "runtime", "lpython {infile}",
filename, update_reference, extra_args)

if __name__ == "__main__":
tester_main("LPython", single_test)
2 changes: 2 additions & 0 deletions tests/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# asr ... run the Semantics and output ASR, compare against reference version
# llvm ... run the Semantics and output LLVM, compare against reference version
# tokens ... output Tokens, compare against reference version
# run ... compiles and executes the specified file;
# checks both runtime errors and successful runs

# tests

Expand Down

0 comments on commit c6349e5

Please sign in to comment.