@@ -124,6 +124,7 @@ def test_writer(
124
124
if not os .path .exists ("results/writer/" + subdir ):
125
125
os .mkdir ("results/writer/" + subdir )
126
126
127
+ print ("" )
127
128
print ("" )
128
129
print ("TESTING ARGUMENTS" )
129
130
print (" test_type: " + test_type )
@@ -133,7 +134,6 @@ def test_writer(
133
134
print (" subdir: " + subdir )
134
135
print (" timeout: " + str (timeout ))
135
136
print (" ntrials: " + str (ntrials ))
136
- print ("" )
137
137
138
138
for model in models :
139
139
config_name = None
@@ -208,8 +208,8 @@ def test_writer(
208
208
)
209
209
else :
210
210
print (
211
- ". ERROR {}: rc={} output='{}'" .format (
212
- timefile , p .returncode , results
211
+ ". ERROR (test_writer) {}:\n \t cmd={} rc={} output='{}'" .format (
212
+ timefile , " " . join ( run ), p .returncode , results
213
213
)
214
214
)
215
215
if os .path .exists (timefile ):
@@ -218,7 +218,7 @@ def test_writer(
218
218
except subprocess .TimeoutExpired :
219
219
os .killpg (os .getpgid (p .pid ), signal .SIGTERM )
220
220
errors .append (timefile )
221
- print (". TIMEOUT {} cmd={}" .format (timefile , " " .join (run )))
221
+ print (". TIMEOUT (test_writer) {} cmd={}" .format (timefile , " " .join (run )))
222
222
with open (timefile , "w" ) as OUTPUT :
223
223
OUTPUT .write ("timeout {}" .format (timeout ))
224
224
@@ -241,6 +241,7 @@ def test_solve0(
241
241
if not os .path .exists ("results/solve0/" + subdir ):
242
242
os .mkdir ("results/solve0/" + subdir )
243
243
244
+ print ("" )
244
245
print ("" )
245
246
print ("TESTING ARGUMENTS" )
246
247
print (" test_type: " + test_type )
@@ -250,7 +251,6 @@ def test_solve0(
250
251
print (" subdir: " + subdir )
251
252
print (" timeout: " + str (timeout ))
252
253
print (" ntrials: " + str (ntrials ))
253
- print ("" )
254
254
255
255
for model in models :
256
256
config_name = None
@@ -313,14 +313,14 @@ def test_solve0(
313
313
if p .returncode == 0 :
314
314
print (". OK {}: rc={}" .format (timefile , p .returncode ))
315
315
else :
316
- print (". ERROR {}: rc={}" .format (timefile , p .returncode ))
316
+ print (". ERROR (test_solve0) {}:\n \t cmd={} rc={}" .format (timefile , " " . join ( run ) , p .returncode ))
317
317
if os .path .exists (timefile ):
318
318
os .remove (timefile )
319
319
errors .append (timefile )
320
320
except subprocess .TimeoutExpired :
321
321
os .killpg (os .getpgid (p .pid ), signal .SIGTERM )
322
322
errors .append (timefile )
323
- print (". TIMEOUT {} cmd={}" .format (timefile , " " .join (run )))
323
+ print (". TIMEOUT (test_solve0) {} cmd={}" .format (timefile , " " .join (run )))
324
324
with open (timefile , "w" ) as OUTPUT :
325
325
OUTPUT .write ("timeout {}" .format (timeout ))
326
326
@@ -337,22 +337,10 @@ if __name__ == "__main__":
337
337
else :
338
338
ntrials = 1
339
339
340
- build_dir = None
341
- if os .path .exists ("coek/coek_writer" ):
342
- build_dir = "."
343
- elif os .path .exists (
344
- os .path .join (currdir , "../../../build/test/aml_comparisons/coek/coek_writer" )
345
- ):
346
- build_dir = os .path .join (currdir , "../../../build" )
347
- if build_dir is None :
348
- print ("Cannot find Coek build directory" )
349
- print (
350
- os .path .join (
351
- currdir , "../../../build/test/aml_comparisons/coek/coek_writer"
352
- )
353
- )
340
+ if not os .path .exists ("test/aml_comparisons/coek/coek_writer" ):
341
+ print ("Must execute 'run' in the coek build directory" )
354
342
sys .exit (1 )
355
- build_dir = os .path .abspath (build_dir )
343
+ build_dir = os .path .abspath ("." )
356
344
357
345
errors = []
358
346
@@ -366,6 +354,15 @@ if __name__ == "__main__":
366
354
ntrials = ntrials ,
367
355
errors = errors ,
368
356
)
357
+ test_solve0 (
358
+ test_type = "small" ,
359
+ models = all_gurobi_models ,
360
+ solvers = ["gurobi" ],
361
+ executable = os .path .join (build_dir , "test/aml_comparisons/gurobi/gurobi_solve0" ),
362
+ subdir = "gurobi" ,
363
+ ntrials = ntrials ,
364
+ errors = errors ,
365
+ )
369
366
370
367
elif sys .argv [1 ] == "bench_coek" :
371
368
test_solve0 (
0 commit comments