@@ -29,11 +29,7 @@ impl MakePlugin {
2929
3030 /// Parses tmc_available_points.txt which is output by the TMC tests and
3131 /// contains lines like "[test] [test_one] 1.1 1.2 1.3" = "[type] [name] points".
32- fn parse_exercise_desc (
33- & self ,
34- available_points : & Path ,
35- exercise_name : String ,
36- ) -> Result < ExerciseDesc , MakeError > {
32+ fn parse_available_points ( & self , available_points : & Path ) -> Result < Vec < TestDesc > , MakeError > {
3733 // "[test] [test_one] 1.1 1.2 1.3" = "[type] [name] points"
3834 // TODO: use parser lib
3935 #[ allow( clippy:: unwrap_used) ]
@@ -60,11 +56,7 @@ impl MakePlugin {
6056 }
6157 }
6258 }
63-
64- Ok ( ExerciseDesc {
65- name : exercise_name,
66- tests,
67- } )
59+ Ok ( tests)
6860 }
6961
7062 /// Runs tests with or without valgrind according to the argument.
@@ -123,6 +115,7 @@ impl MakePlugin {
123115/// Contains a src directory and a Makefile file
124116impl LanguagePlugin for MakePlugin {
125117 const PLUGIN_NAME : & ' static str = "make" ;
118+ const DEFAULT_SANDBOX_IMAGE : & ' static str = "eu.gcr.io/moocfi-public/tmc-sandbox-make:latest" ;
126119 const LINE_COMMENT : & ' static str = "//" ;
127120 const BLOCK_COMMENT : Option < ( & ' static str , & ' static str ) > = Some ( ( "/*" , "*/" ) ) ;
128121 type StudentFilePolicy = MakeStudentFilePolicy ;
@@ -140,7 +133,11 @@ impl LanguagePlugin for MakePlugin {
140133 return MakeError :: CantFindAvailablePoints ( available_points_path) . into ( ) ;
141134 }
142135
143- Ok ( self . parse_exercise_desc ( & available_points_path, exercise_name) ?)
136+ let tests = self . parse_available_points ( & available_points_path) ?;
137+ Ok ( ExerciseDesc {
138+ name : exercise_name,
139+ tests,
140+ } )
144141 }
145142
146143 fn run_tests_with_timeout (
@@ -229,9 +226,7 @@ impl LanguagePlugin for MakePlugin {
229226
230227 // parse available points into a mapping from test name to test point list
231228 let available_points_path = base_test_path. join ( "tmc_available_points.txt" ) ;
232- let tests = self
233- . parse_exercise_desc ( & available_points_path, "unused" . to_string ( ) ) ?
234- . tests ;
229+ let tests = self . parse_available_points ( & available_points_path) ?;
235230 let mut ids_to_points = HashMap :: new ( ) ;
236231 for test in tests {
237232 ids_to_points. insert ( test. name , test. points ) ;
@@ -503,11 +498,9 @@ test [invalid] point6
503498 ) ;
504499
505500 let plugin = MakePlugin :: new ( ) ;
506- let exercise_desc = plugin
507- . parse_exercise_desc ( & available_points, "ex" . to_string ( ) )
508- . unwrap ( ) ;
509- assert_eq ! ( exercise_desc. tests. len( ) , 2 ) ;
510- assert_eq ! ( exercise_desc. tests[ 0 ] . points. len( ) , 4 ) ;
501+ let exercise_desc = plugin. parse_available_points ( & available_points) . unwrap ( ) ;
502+ assert_eq ! ( exercise_desc. len( ) , 2 ) ;
503+ assert_eq ! ( exercise_desc[ 0 ] . points. len( ) , 4 ) ;
511504 }
512505
513506 #[ test]
0 commit comments