mirror of
https://github.com/QingdaoU/Judger.git
synced 2024-12-29 08:21:41 +00:00
add env test
This commit is contained in:
parent
baa924ec52
commit
92d1f7fb61
8
tests/9/Main.c
Normal file
8
tests/9/Main.c
Normal file
@ -0,0 +1,8 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
printf("%s\n%s\n", getenv("hello"), getenv("123"));
|
||||
return 0;
|
||||
}
|
1
tests/9/config
Normal file
1
tests/9/config
Normal file
@ -0,0 +1 @@
|
||||
{"language": "c", "max_cpu_time": 2000, "max_memory": 200000000, "env": ["hello=world", "123=456"]}
|
0
tests/9/in
Normal file
0
tests/9/in
Normal file
2
tests/9/out
Normal file
2
tests/9/out
Normal file
@ -0,0 +1,2 @@
|
||||
world
|
||||
456
|
1
tests/9/result
Normal file
1
tests/9/result
Normal file
@ -0,0 +1 @@
|
||||
{"flag": 0, "signal": 0}
|
@ -23,7 +23,11 @@ class JudgerTest(TestCase):
|
||||
def test_run(self):
|
||||
shutil.rmtree(self.tmp_path, ignore_errors=True)
|
||||
os.mkdir(self.tmp_path)
|
||||
for i in range(1, 9):
|
||||
for i in os.listdir("."):
|
||||
try:
|
||||
int(i)
|
||||
except Exception:
|
||||
continue
|
||||
test_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), str(i))
|
||||
exe_path = os.path.join("/tmp/judger_test", str(i))
|
||||
config = json.loads(open(os.path.join(test_dir, "config")).read())
|
||||
|
Loading…
Reference in New Issue
Block a user