Skip to content

Commit 3ca7a49

Browse files
authored
Changed to use compile_command in the toml file when test and submit (#246)
* fix function to specify compile_command on option file * Fix for style violations
1 parent 1a0acfb commit 3ca7a49

File tree

15 files changed

+77
-1
lines changed

15 files changed

+77
-1
lines changed

atcodertools/config/config.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ def get_config_dic(config_dic, config_type: ConfigType, lang=None):
4444
else:
4545
result[k] = v
4646
result = _update_config_dict(result, lang_dic)
47+
48+
if config_type == ConfigType.TESTER:
49+
compiler_dic = config_dic.get("compiler", {})
50+
compile_command = compiler_dic.get("compile_command", None)
51+
result = _update_config_dict(
52+
result, {"compile_command": compile_command})
53+
4754
return result
4855

4956

atcodertools/tools/tester.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,10 @@ def main(prog, args) -> bool:
390390
elif config.tester_config.compile_before_testing:
391391
# Use atcoder-tools's functionality to compile source code
392392
force_compile = not config.tester_config.compile_only_when_diff_detected
393-
compile_command = config.tester_config.compile_command
393+
if args.compile_command:
394+
compile_command = args.compile_command
395+
else:
396+
compile_command = config.tester_config.compile_command
394397
if compile_command:
395398
compile_command = lang.get_compile_command("main", compile_command)
396399
try:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
50 100 120
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
500 100 1000
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
19 123 143
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
19 123 142
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#include <bits/stdc++.h>
2+
3+
using namespace std;
4+
5+
int main(){
6+
int A, B, C;
7+
cin>>A>>B>>C;
8+
if(A + B >= C)cout<<"Yes"<<endl;
9+
else cout<<"No"<<endl;
10+
}
11+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"code_filename": "main.cpp",
3+
"judge": {
4+
"judge_type": "normal"
5+
},
6+
"lang": "cpp",
7+
"problem": {
8+
"alphabet": "A",
9+
"contest": {
10+
"contest_id": "abc091"
11+
},
12+
"problem_id": "abc091_a"
13+
},
14+
"sample_in_pattern": "in_*.txt",
15+
"sample_out_pattern": "out_*.txt"
16+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Yes
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
No

0 commit comments

Comments
 (0)