Baller
This commit is contained in:
parent
f52fb42f88
commit
9bae27c366
5
ucompile
5
ucompile
@ -15,6 +15,7 @@ def run_input_cases(program, verbose, output):
|
|||||||
print("Input:")
|
print("Input:")
|
||||||
system(f"cat {input_file}")
|
system(f"cat {input_file}")
|
||||||
print("")
|
print("")
|
||||||
|
try:
|
||||||
if (out := glob(input_file.replace(".in", ".out"))[0]):
|
if (out := glob(input_file.replace(".in", ".out"))[0]):
|
||||||
if verbose:
|
if verbose:
|
||||||
print("Expected output:")
|
print("Expected output:")
|
||||||
@ -22,6 +23,8 @@ def run_input_cases(program, verbose, output):
|
|||||||
print("")
|
print("")
|
||||||
if output:
|
if output:
|
||||||
end_command += f" | diff {out} -"
|
end_command += f" | diff {out} -"
|
||||||
|
except IndexError:
|
||||||
|
pass
|
||||||
print(popen(end_command).read())
|
print(popen(end_command).read())
|
||||||
|
|
||||||
print("-----------")
|
print("-----------")
|
||||||
@ -43,6 +46,8 @@ def java_compile(file_name, maven=False, verbose=False):
|
|||||||
return
|
return
|
||||||
|
|
||||||
def c_compile(file_name, verbose=False, output=False):
|
def c_compile(file_name, verbose=False, output=False):
|
||||||
|
# Style the code in Meijster's way
|
||||||
|
system("astyle -A2s2cxgk3W3xbj " + file_name)
|
||||||
system("gcc -Wall -pedantic --std=c99 -g -o program -lm -Wno-unused-result " + file_name)
|
system("gcc -Wall -pedantic --std=c99 -g -o program -lm -Wno-unused-result " + file_name)
|
||||||
run_input_cases("./program", verbose, output)
|
run_input_cases("./program", verbose, output)
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user