mirror of
https://github.com/QingdaoU/Judger.git
synced 2024-12-28 16:01:41 +00:00
add gcc compile demo
This commit is contained in:
parent
b2bf385d5c
commit
0e5021b33d
2
.gitignore
vendored
2
.gitignore
vendored
@ -5,4 +5,4 @@ limit
|
||||
runner
|
||||
CMakeLists.txt
|
||||
main
|
||||
demo/out
|
||||
demo
|
||||
|
13
demo/demo.py
13
demo/demo.py
@ -5,8 +5,19 @@ import judger
|
||||
base_path = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
def _compile():
|
||||
return judger.run(path="/usr/bin/gcc",
|
||||
in_file=os.path.join(base_path, "in"),
|
||||
out_file=os.path.join(base_path, "gcc_out"),
|
||||
max_cpu_time=2000,
|
||||
max_memory=200000000,
|
||||
args=[os.path.join(base_path, "demo.c"), "-o", os.path.join(base_path, "demo")],
|
||||
env=["PATH=" + os.environ["PATH"]],
|
||||
use_sandbox=False)
|
||||
|
||||
|
||||
def run(use_sandbox):
|
||||
os.system("gcc demo.c -o demo")
|
||||
_compile()
|
||||
path = os.path.join(base_path, "demo")
|
||||
return judger.run(path=path,
|
||||
in_file=os.path.join(base_path, "in"),
|
||||
|
Loading…
Reference in New Issue
Block a user