Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on May 27, 2021. It is now read-only.

Commit fbf9d58

Browse files
committed
accounting for difference in compile errors in travis
1 parent 1b587fc commit fbf9d58

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

framework/test_runner_cpp.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from framework.Classes import Status
2+
from framework.runner import run
3+
from framework.test_data import tc1, c_source_code_add_two_numbers, c_source_code_add_two_numbers_compile_error
4+
5+
6+
def test_c_add_two_numbers_code():
7+
out = run(c_source_code_add_two_numbers, "c", ["gcc", "-o", "program"], ["./program"], [tc1])
8+
assert 1 == len(out)
9+
assert '57' == out[0].stdout
10+
assert Status.OK == out[0].status
11+
12+
13+
def test_c_add_two_numbers_code_compile_error():
14+
out = run(c_source_code_add_two_numbers_compile_error, "c", ["gcc", "-o", "program"], ["./program"], [tc1])
15+
print(out)
16+
assert 1 == len(out)
17+
assert "error: expected ';'" in out[0].stderr
18+
assert Status.COMPILE_ERROR == out[0].status

0 commit comments

Comments
 (0)