Skip to content

Commit

Permalink
Add tests for compilation to object files
Browse files Browse the repository at this point in the history
  • Loading branch information
certik committed Aug 1, 2020
1 parent 49df404 commit a931dcd
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 0 deletions.
7 changes: 7 additions & 0 deletions run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def main():
ast_openmp = test.get("ast_openmp", False)
asr = test.get("asr", False)
llvm = test.get("llvm", False)
obj = test.get("obj", False)
bin_ = test.get("bin", False)

print(color(style.bold)+"TEST:"+color(style.reset), filename)
Expand Down Expand Up @@ -84,6 +85,12 @@ def main():
else:
run_test("llvm", "lfortran --show-llvm {infile} -o {outfile}",
filename, update_reference)
if obj:
if no_llvm:
print(" * obj SKIPPED as requested")
else:
run_test("obj", "lfortran -c {infile} -o output.o",
filename, update_reference)

if bin_:
run_test("bin", "lfortran {infile} -o {outfile}",
Expand Down
13 changes: 13 additions & 0 deletions tests/reference/obj-expr2-3ef5568.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"basename": "obj-expr2-3ef5568",
"cmd": "lfortran -c {infile} -o output.o",
"infile": "tests/expr2.f90",
"infile_hash": "d666975e3f2e2c0cc5c739b85bb21073accdf5692bcb64c9e0278d62",
"outfile": null,
"outfile_hash": null,
"stdout": null,
"stdout_hash": null,
"stderr": null,
"stderr_hash": null,
"returncode": 0
}
13 changes: 13 additions & 0 deletions tests/reference/obj-program1-9a460a3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"basename": "obj-program1-9a460a3",
"cmd": "lfortran -c {infile} -o output.o",
"infile": "tests/program1.f90",
"infile_hash": "ec4ccdfed01d45648718ca57a9ceb3e5aa82e55e57d8906636902e7b",
"outfile": null,
"outfile_hash": null,
"stdout": null,
"stdout_hash": null,
"stderr": null,
"stderr_hash": null,
"returncode": 0
}
13 changes: 13 additions & 0 deletions tests/reference/obj-subroutine3-74fd66c.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"basename": "obj-subroutine3-74fd66c",
"cmd": "lfortran -c {infile} -o output.o",
"infile": "tests/subroutine3.f90",
"infile_hash": "a524604ef3f17ed8a7b81b5ac3b03932cbc3ec6f308982532b4d9900",
"outfile": null,
"outfile_hash": null,
"stdout": null,
"stdout_hash": null,
"stderr": null,
"stderr_hash": null,
"returncode": 0
}
3 changes: 3 additions & 0 deletions tests/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ filename = "subroutine3.f90"
ast = true
asr = true
llvm = true
obj = true

[[test]]
filename = "subroutine3b.f90"
Expand Down Expand Up @@ -78,6 +79,7 @@ filename = "expr2.f90"
ast = true
asr = true
llvm = true
obj = true

[[test]]
filename = "expr3.f90"
Expand All @@ -94,3 +96,4 @@ filename = "program1.f90"
ast = true
asr = true
llvm = true
obj = true

0 comments on commit a931dcd

Please sign in to comment.