Skip to content

Commit

Permalink
Add a test for cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
certik committed Aug 11, 2020
1 parent 5cc309b commit 57b6f4d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
6 changes: 6 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)
cpp = test.get("cpp", False)
obj = test.get("obj", False)
bin_ = test.get("bin", False)

Expand Down Expand Up @@ -85,6 +86,11 @@ def main():
else:
run_test("llvm", "lfortran --show-llvm {infile} -o {outfile}",
filename, update_reference)

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

if obj:
if no_llvm:
print(" * obj SKIPPED as requested")
Expand Down
13 changes: 13 additions & 0 deletions tests/reference/cpp-program1-1f9dddd.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"basename": "cpp-program1-1f9dddd",
"cmd": "lfortran --show-cpp {infile}",
"infile": "tests/program1.f90",
"infile_hash": "ec4ccdfed01d45648718ca57a9ceb3e5aa82e55e57d8906636902e7b",
"outfile": null,
"outfile_hash": null,
"stdout": "cpp-program1-1f9dddd.stdout",
"stdout_hash": "ddc89093984deb702b806404031ee1178023c01be77917f2b60d532a",
"stderr": null,
"stderr_hash": null,
"returncode": 0
}
4 changes: 4 additions & 0 deletions tests/reference/cpp-program1-1f9dddd.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
int main()
{
return 0;
}
1 change: 1 addition & 0 deletions tests/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ ast = true
asr = true
llvm = true
obj = true
cpp = true

[[test]]
filename = "../integration_tests/program_cmake_01.f90"
Expand Down

0 comments on commit 57b6f4d

Please sign in to comment.