Skip to content

Commit

Permalink
run_tests: get AST, ASR, CPP, LLVM working
Browse files Browse the repository at this point in the history
All other things were removed for now. We can add more test kinds later as we
see fit.
  • Loading branch information
certik committed Jan 18, 2022
1 parent 67bb65a commit 1bdb4e8
Showing 1 changed file with 2 additions and 42 deletions.
44 changes: 2 additions & 42 deletions run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ def main():

extra_args = "--no-error-banner"

if tokens:
run_test("tokens", "lfortran --no-color --show-tokens {infile} -o {outfile}",
filename, update_reference, extra_args)

if ast:
run_test("ast", "lpython --show-ast --no-color {infile} -o {outfile}",
filename, update_reference, extra_args)
Expand All @@ -74,53 +70,17 @@ def main():
run_test("asr", "lpython --show-asr --no-color {infile} -o {outfile}",
filename, update_reference, extra_args)

if asr_preprocess:
run_test("asr_preprocess", "lfortran --cpp --show-asr --no-color {infile} -o {outfile}",
filename, update_reference, extra_args)

if asr_indent:
run_test("asr_indent", "lfortran --show-asr --indent --no-color {infile} -o {outfile}",
filename, update_reference, extra_args)

if mod_to_asr:
run_test("mod_to_asr", "lfortran mod --show-asr --no-color {infile}",
filename, update_reference)

if pass_ == "do_loops":
run_test("pass_do_loops", "lfortran --pass=do_loops --show-asr --no-color {infile} -o {outfile}",
filename, update_reference, extra_args)

if pass_ == "global_stmts":
run_test("pass_global_stmts", "lfortran --pass=global_stmts --show-asr --no-color {infile} -o {outfile}",
filename, update_reference, extra_args)

if llvm:
if no_llvm:
print(" * llvm SKIPPED as requested")
else:
run_test("llvm", "lfortran --no-color --show-llvm {infile} -o {outfile}",
run_test("llvm", "lpython --no-color --show-llvm {infile} -o {outfile}",
filename, update_reference, extra_args)

if cpp:
run_test("cpp", "lfortran --no-color --show-cpp {infile}",
run_test("cpp", "lpython --no-color --show-cpp {infile}",
filename, update_reference, extra_args)

if obj:
if no_llvm:
print(" * obj SKIPPED as requested")
else:
run_test("obj", "lfortran --no-color -c {infile} -o output.o",
filename, update_reference, extra_args)

if x86:
run_test("x86", "lfortran --no-color --backend=x86 {infile} -o output",
filename, update_reference, extra_args)

if bin_:
run_test("bin", "lfortran --no-color {infile} -o {outfile}",
filename, update_reference, extra_args)


print()

if list_tests:
Expand Down

0 comments on commit 1bdb4e8

Please sign in to comment.