Commit
·
903ed69
1
Parent(s):
60275de
Removes python 3 10 feature.
Browse files- execute.py +37 -25
execute.py
CHANGED
|
@@ -30,14 +30,17 @@ def check_correctness(candidate, reference, cpp_type, task_id, completion_id):
|
|
| 30 |
base_run_result,
|
| 31 |
"c++17",
|
| 32 |
)
|
| 33 |
-
result
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
base_run_result[0] == "passed"
|
| 37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
),
|
| 39 |
-
|
| 40 |
-
)
|
| 41 |
elif cpp_type == "sfinae":
|
| 42 |
sfinae_run_result = manager.list()
|
| 43 |
process_case(
|
|
@@ -55,16 +58,19 @@ def check_correctness(candidate, reference, cpp_type, task_id, completion_id):
|
|
| 55 |
sfinae_constrain_result,
|
| 56 |
"c++17",
|
| 57 |
)
|
| 58 |
-
result
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
sfinae_run_result[0] == "passed"
|
| 62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
),
|
| 64 |
-
|
| 65 |
-
sfinae_constrain_passed=sfinae_constrain_result[0] == "passed",
|
| 66 |
-
sfinae_constrain_result=sfinae_constrain_result[0],
|
| 67 |
-
)
|
| 68 |
elif cpp_type == "concepts":
|
| 69 |
concepts_run_result = manager.list()
|
| 70 |
process_case(
|
|
@@ -82,16 +88,22 @@ def check_correctness(candidate, reference, cpp_type, task_id, completion_id):
|
|
| 82 |
concepts_constrain_result,
|
| 83 |
"c++20",
|
| 84 |
)
|
| 85 |
-
result
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
concepts_run_result[0] == "passed"
|
| 89 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
),
|
| 91 |
-
|
| 92 |
-
concepts_constrain_passed=concepts_constrain_result[0] == "passed",
|
| 93 |
-
concepts_constrain_result=concepts_constrain_result[0],
|
| 94 |
-
)
|
| 95 |
else:
|
| 96 |
raise ValueError(f"Unknown cpp_type: {cpp_type}")
|
| 97 |
|
|
|
|
| 30 |
base_run_result,
|
| 31 |
"c++17",
|
| 32 |
)
|
| 33 |
+
result = {
|
| 34 |
+
**result,
|
| 35 |
+
**dict(
|
| 36 |
+
base_run_passed=base_run_result[0] == "passed",
|
| 37 |
+
base_run_compiled=(
|
| 38 |
+
base_run_result[0] == "passed"
|
| 39 |
+
or base_run_result[0].startswith("failed: runtime error:")
|
| 40 |
+
),
|
| 41 |
+
base_run_result=base_run_result[0],
|
| 42 |
),
|
| 43 |
+
}
|
|
|
|
| 44 |
elif cpp_type == "sfinae":
|
| 45 |
sfinae_run_result = manager.list()
|
| 46 |
process_case(
|
|
|
|
| 58 |
sfinae_constrain_result,
|
| 59 |
"c++17",
|
| 60 |
)
|
| 61 |
+
result = {
|
| 62 |
+
**result,
|
| 63 |
+
**dict(
|
| 64 |
+
sfinae_run_passed=sfinae_run_result[0] == "passed",
|
| 65 |
+
sfinae_run_compiled=(
|
| 66 |
+
sfinae_run_result[0] == "passed"
|
| 67 |
+
or sfinae_run_result[0].startswith("failed: runtime error:")
|
| 68 |
+
),
|
| 69 |
+
sfinae_run_result=sfinae_run_result[0],
|
| 70 |
+
sfinae_constrain_passed=sfinae_constrain_result[0] == "passed",
|
| 71 |
+
sfinae_constrain_result=sfinae_constrain_result[0],
|
| 72 |
),
|
| 73 |
+
}
|
|
|
|
|
|
|
|
|
|
| 74 |
elif cpp_type == "concepts":
|
| 75 |
concepts_run_result = manager.list()
|
| 76 |
process_case(
|
|
|
|
| 88 |
concepts_constrain_result,
|
| 89 |
"c++20",
|
| 90 |
)
|
| 91 |
+
result = {
|
| 92 |
+
**result,
|
| 93 |
+
**dict(
|
| 94 |
+
concepts_run_passed=concepts_run_result[0] == "passed",
|
| 95 |
+
concepts_run_compiled=(
|
| 96 |
+
concepts_run_result[0] == "passed"
|
| 97 |
+
or concepts_run_result[0].startswith(
|
| 98 |
+
"failed: runtime error:"
|
| 99 |
+
)
|
| 100 |
+
),
|
| 101 |
+
concepts_run_result=concepts_run_result[0],
|
| 102 |
+
concepts_constrain_passed=concepts_constrain_result[0]
|
| 103 |
+
== "passed",
|
| 104 |
+
concepts_constrain_result=concepts_constrain_result[0],
|
| 105 |
),
|
| 106 |
+
}
|
|
|
|
|
|
|
|
|
|
| 107 |
else:
|
| 108 |
raise ValueError(f"Unknown cpp_type: {cpp_type}")
|
| 109 |
|