@@ -6,7 +6,7 @@ use eval_stack::{case::run_test_cases, compile::Language, config::JudgeOptions};
6
6
#[ tokio:: test]
7
7
async fn test_rust_judge ( ) -> Result < ( ) > {
8
8
let current_dir = std:: env:: current_dir ( ) ?;
9
- let workspace_path = current_dir. join ( "workspace " ) ;
9
+ let workspace_path = current_dir. join ( "rust_workspace " ) ;
10
10
let tests_path = current_dir. join ( "tests" ) ;
11
11
12
12
let results = run_test_cases (
@@ -61,7 +61,7 @@ async fn test_rust_judge() -> Result<()> {
61
61
#[ tokio:: test]
62
62
async fn test_cpp_judge ( ) -> Result < ( ) > {
63
63
let current_dir = std:: env:: current_dir ( ) ?;
64
- let workspace_path = current_dir. join ( "workspace " ) ;
64
+ let workspace_path = current_dir. join ( "cpp_workspace " ) ;
65
65
let tests_path = current_dir. join ( "tests" ) ;
66
66
67
67
let results = run_test_cases (
@@ -90,10 +90,42 @@ async fn test_cpp_judge() -> Result<()> {
90
90
Ok ( ( ) )
91
91
}
92
92
93
+ #[ tokio:: test]
94
+ async fn test_c_judge ( ) -> Result < ( ) > {
95
+ let current_dir = std:: env:: current_dir ( ) ?;
96
+ let workspace_path = current_dir. join ( "c_workspace" ) ;
97
+ let tests_path = current_dir. join ( "tests" ) ;
98
+
99
+ let results = run_test_cases (
100
+ Language :: C ,
101
+ & workspace_path,
102
+ & tests_path. join ( "test.c" ) ,
103
+ JudgeOptions {
104
+ time_limit : Duration :: from_secs ( 1 ) ,
105
+ memory_limit : 128 * 1024 * 1024 ,
106
+ fail_fast : true ,
107
+ no_startup_limits : false ,
108
+ } ,
109
+ vec ! [
110
+ ( tests_path. join( "1.in" ) , tests_path. join( "1.out" ) ) ,
111
+ ( tests_path. join( "2.in" ) , tests_path. join( "2.out" ) ) ,
112
+ ] ,
113
+ true ,
114
+ )
115
+ . await ?;
116
+
117
+ for result in results {
118
+ println ! ( "{:?}" , result) ;
119
+ assert ! ( result. is_accepted( ) )
120
+ }
121
+
122
+ Ok ( ( ) )
123
+ }
124
+
93
125
#[ tokio:: test]
94
126
async fn test_python_judge ( ) -> Result < ( ) > {
95
127
let current_dir = std:: env:: current_dir ( ) ?;
96
- let workspace_path = current_dir. join ( "workspace " ) ;
128
+ let workspace_path = current_dir. join ( "python_workspace " ) ;
97
129
let tests_path = current_dir. join ( "tests" ) ;
98
130
99
131
let results = run_test_cases (
@@ -125,7 +157,7 @@ async fn test_python_judge() -> Result<()> {
125
157
#[ tokio:: test]
126
158
async fn test_nodejs_judge ( ) -> Result < ( ) > {
127
159
let current_dir = std:: env:: current_dir ( ) ?;
128
- let workspace_path = current_dir. join ( "workspace " ) ;
160
+ let workspace_path = current_dir. join ( "nodejs_workspace " ) ;
129
161
let tests_path = current_dir. join ( "tests" ) ;
130
162
131
163
let results = run_test_cases (
@@ -142,7 +174,71 @@ async fn test_nodejs_judge() -> Result<()> {
142
174
( tests_path. join( "1.in" ) , tests_path. join( "1.out" ) ) ,
143
175
( tests_path. join( "2.in" ) , tests_path. join( "2.out" ) ) ,
144
176
] ,
145
- false ,
177
+ true ,
178
+ )
179
+ . await ?;
180
+
181
+ for result in results {
182
+ println ! ( "{:?}" , result) ;
183
+ assert ! ( result. is_accepted( ) )
184
+ }
185
+
186
+ Ok ( ( ) )
187
+ }
188
+
189
+ #[ tokio:: test]
190
+ async fn test_golang_judge ( ) -> Result < ( ) > {
191
+ let current_dir = std:: env:: current_dir ( ) ?;
192
+ let workspace_path = current_dir. join ( "golang_workspace" ) ;
193
+ let tests_path = current_dir. join ( "tests" ) ;
194
+
195
+ let results = run_test_cases (
196
+ Language :: Golang ,
197
+ & workspace_path,
198
+ & tests_path. join ( "test.go" ) ,
199
+ JudgeOptions {
200
+ time_limit : Duration :: from_secs ( 1 ) ,
201
+ memory_limit : 128 * 1024 * 1024 ,
202
+ fail_fast : true ,
203
+ no_startup_limits : true ,
204
+ } ,
205
+ vec ! [
206
+ ( tests_path. join( "1.in" ) , tests_path. join( "1.out" ) ) ,
207
+ ( tests_path. join( "2.in" ) , tests_path. join( "2.out" ) ) ,
208
+ ] ,
209
+ true ,
210
+ )
211
+ . await ?;
212
+
213
+ for result in results {
214
+ println ! ( "{:?}" , result) ;
215
+ assert ! ( result. is_accepted( ) )
216
+ }
217
+
218
+ Ok ( ( ) )
219
+ }
220
+
221
+ #[ tokio:: test]
222
+ async fn test_java_judge ( ) -> Result < ( ) > {
223
+ let current_dir = std:: env:: current_dir ( ) ?;
224
+ let workspace_path = current_dir. join ( "java_workspace" ) ;
225
+ let tests_path = current_dir. join ( "tests" ) ;
226
+
227
+ let results = run_test_cases (
228
+ Language :: Java ,
229
+ & workspace_path,
230
+ & tests_path. join ( "test.java" ) ,
231
+ JudgeOptions {
232
+ time_limit : Duration :: from_secs ( 1 ) ,
233
+ memory_limit : 128 * 1024 * 1024 ,
234
+ fail_fast : true ,
235
+ no_startup_limits : true ,
236
+ } ,
237
+ vec ! [
238
+ ( tests_path. join( "1.in" ) , tests_path. join( "1.out" ) ) ,
239
+ ( tests_path. join( "2.in" ) , tests_path. join( "2.out" ) ) ,
240
+ ] ,
241
+ true ,
146
242
)
147
243
. await ?;
148
244
0 commit comments