@@ -161,8 +161,6 @@ def compile_solutions(self, solutions):
161
161
print ("Compiling %d solutions..." % len (solutions ))
162
162
with mp .Pool (self .cpus ) as pool :
163
163
compilation_results = pool .map (self .compile , solutions )
164
- if not all (compilation_results ):
165
- util .exit_with_error ("\n Compilation failed." )
166
164
return compilation_results
167
165
168
166
@@ -473,12 +471,20 @@ def calculate_points(self, results):
473
471
474
472
def compile_and_run (self , solutions ):
475
473
compilation_results = self .compile_solutions (solutions )
474
+ compiled_solutions = []
475
+ for i in range (len (solutions )):
476
+ if compilation_results [i ]:
477
+ compiled_solutions .append (solutions [i ])
478
+ else :
479
+ self .failed_compilations .append (solutions [i ])
480
+ compilation_results = [result for result in compilation_results if result ]
481
+
476
482
os .makedirs (self .EXECUTIONS_DIR , exist_ok = True )
477
483
executables = [os .path .join (self .EXECUTABLES_DIR , package_util .get_executable (solution ))
478
- for solution in solutions ]
479
- compiled_commands = zip (solutions , executables , compilation_results )
480
- names = solutions
481
- return self .run_solutions (compiled_commands , names , solutions , self .args .solutions_report )
484
+ for solution in compiled_solutions ]
485
+ compiled_commands = zip (compiled_solutions , executables , compilation_results )
486
+ names = compiled_solutions
487
+ return self .run_solutions (compiled_commands , names , compiled_solutions , self .args .solutions_report )
482
488
483
489
484
490
def print_expected_scores (self , expected_scores ):
@@ -499,6 +505,11 @@ def validate_expected_scores(self, results):
499
505
used_solutions = results .keys ()
500
506
if self .args .solutions == None and config_expected_scores : # If no solutions were specified, use all solutions from config
501
507
used_solutions = config_expected_scores .keys ()
508
+ used_solutions = list (used_solutions )
509
+
510
+ for solution in self .failed_compilations :
511
+ if solution in used_solutions :
512
+ used_solutions .remove (solution )
502
513
503
514
used_groups = set ()
504
515
if self .args .tests == None and config_expected_scores : # If no groups were specified, use all groups from config
@@ -660,6 +671,11 @@ def validate_arguments(self, args):
660
671
661
672
return compilers , timetool_path
662
673
674
+ def exit (self ):
675
+ if len (self .failed_compilations ) > 0 :
676
+ util .exit_with_error ('Compilation failed for {cnt} solution{letter}.' .format (
677
+ cnt = len (self .failed_compilations ), letter = '' if len (self .failed_compilations ) == 1 else 's' ))
678
+
663
679
def set_scores (self ):
664
680
self .tests = package_util .get_tests (self .args .tests )
665
681
self .groups = list (sorted (set ([self .get_group (test ) for test in self .tests ])))
@@ -750,7 +766,9 @@ def run(self, args):
750
766
else :
751
767
print (util .warning ('There are no tests to run.' ))
752
768
769
+ self .failed_compilations = []
753
770
solutions = self .get_solutions (self .args .solutions )
754
771
results = self .compile_and_run (solutions )
755
772
validation_results = self .validate_expected_scores (results )
756
773
self .print_expected_scores_diff (validation_results )
774
+ self .exit ()
0 commit comments