-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtester.py
35 lines (27 loc) · 821 Bytes
/
tester.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import os
print("""
USAGE:
Execute the program in the PRO1 general directory with the structure:
PRO1
|- tester.py
|- Exercises
|- P34279_en
|- P34279.cc
|- P34279.x
|- sample-1.inp
|- sample-1.cor
|- ...
|- P37297_es
|- ...
""")
name = input("Test: ")
num = input("Num of tests: ")
language = input("Language (en, es, ca): ")
dir = "~/universidad/PRO1/Ejercicios/" + name + "_" + language + "/"
os.system("g++ " + dir + name + ".cc -o " + dir + name + ".x")
for i in range(1, 1 + int(num)):
print("-------------------")
print(i)
print("-------------------")
os.system(dir + name + ".x < " + dir + "sample" + str(i) + ".inp > " + dir + "sample" + str(i) + ".out")
os.system("diff " + dir + "sample" + str(i) + ".out " + dir + "sample" + str(i) + ".cor")