HelloWorld/tests/test_c.py
2022-08-29 00:10:10 -05:00

25 lines
575 B
Python

import os
import re
import shutil
from tests.global_fns import *
def test_compile_c():
fh = os.popen("gcc -o HelloWorld ./HelloWorld.c", mode='r', buffering=-1)
output = fh.read()
retcode = fh.close()
assert retcode == None
def test_c():
fh = os.popen("./HelloWorld", mode='r', buffering=-1)
output = fh.read()
retcode = fh.close()
assert retcode == None and checkOutput(output)
def test_c_cleanup():
fh = os.popen("rm ./HelloWorld", mode='r', buffering=-1)
output = fh.read()
retcode = fh.close()
assert retcode == None