-
Notifications
You must be signed in to change notification settings - Fork 12
/
with_constraints_py.rs
76 lines (71 loc) · 2.81 KB
/
with_constraints_py.rs
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
use task_maker_format::ioi::TestcaseEvaluationStatus::*;
mod common;
use common::TestInterface;
fn classic(test: TestInterface) {
let test = test
.success()
.time_limit(1.0)
.memory_limit(64)
.max_score(100.0)
.subtask_scores(vec![5.0, 45.0, 50.0])
.must_compile("generatore.cpp")
.must_compile("mle.cpp")
.must_compile("float_error.cpp")
.must_compile("nonzero.cpp")
.must_compile("sigsegv.c")
.must_compile("tle.cpp")
.must_compile("wa.cpp")
.must_compile("wrong_file.cpp")
.must_not_compile("not_compile.cpp")
// .not_compiled(".ignoreme.cpp")
.not_compiled("bash.sh")
.not_compiled("noop.py")
.not_compiled("soluzione.py")
.solution_score("soluzione.py", vec![5.0, 45.0, 50.0])
.solution_score("bash.sh", vec![5.0, 45.0, 50.0])
.solution_score("float_error.cpp", vec![0.0, 0.0, 0.0])
.solution_score("mle.cpp", vec![0.0, 0.0, 0.0])
.solution_score("noop.py", vec![0.0, 0.0, 0.0])
.solution_score("nonzero.cpp", vec![0.0, 0.0, 0.0])
.solution_score("sigsegv.c", vec![0.0, 0.0, 0.0])
.solution_score("tle.cpp", vec![5.0, 45.0, 0.0])
.solution_score("wa.cpp", vec![0.0, 0.0, 0.0])
.solution_score("wrong_file.cpp", vec![0.0, 0.0, 0.0])
.solution_statuses("soluzione.py", vec![Accepted("Output is correct".into())])
.solution_statuses("bash.sh", vec![Accepted("Output is correct".into())])
// .solution_statuses("mle.cpp", vec![RuntimeError]) // pretty unreliable
.solution_statuses("nonzero.cpp", vec![RuntimeError])
.solution_statuses("sigsegv.c", vec![RuntimeError])
.solution_statuses(
"tle.cpp",
vec![
Accepted("Output is correct".into()),
Accepted("Output is correct".into()),
Accepted("Output is correct".into()),
Accepted("Output is correct".into()),
TimeLimitExceeded,
TimeLimitExceeded,
],
)
.solution_statuses("wa.cpp", vec![WrongAnswer("Output is incorrect".into())])
.solution_statuses(
"wrong_file.cpp",
vec![WrongAnswer("Output is incorrect".into())],
)
.not_has_diagnostic("Found Latex errors");
if which::which("fpc").is_ok() {
test.must_compile("pascal.pas")
.solution_score("pascal.pas", vec![5.0, 45.0, 50.0])
.solution_statuses("pascal.pas", vec![Accepted("Output is correct".into())]);
}
}
#[test]
fn classic_local() {
better_panic::install();
classic(TestInterface::run_local("with_constraints_py"));
}
#[test]
fn classic_remote() {
better_panic::install();
classic(TestInterface::run_remote("with_constraints_py"));
}