@@ -134,8 +134,8 @@ pub unsafe fn execute_test(
134134) -> Option < Outcome > {
135135 // TODO: add timeouts for running and building in case they go into infinite loop or something
136136 let input_path = temp_sprintf ( c ! ( "%s/%s.b" ) , test_folder, name) ;
137- let program_path = temp_sprintf ( c ! ( "%s/%s.%s%s" ) , GARBAGE_FOLDER , name, target. api . name , target. api . file_ext ) ;
138- let stdout_path = temp_sprintf ( c ! ( "%s/%s.%s.stdout.txt" ) , GARBAGE_FOLDER , name, target. api . name ) ;
137+ let program_path = temp_sprintf ( c ! ( "%s/%s.%s%s" ) , GARBAGE_FOLDER , name, target. api . name ( ) , target. file_ext ( ) ) ;
138+ let stdout_path = temp_sprintf ( c ! ( "%s/%s.%s.stdout.txt" ) , GARBAGE_FOLDER , name, target. api . name ( ) ) ;
139139 cmd_append ! {
140140 cmd,
141141 if cfg!( target_os = "windows" ) {
@@ -144,7 +144,7 @@ pub unsafe fn execute_test(
144144 c!( "./build/b" )
145145 } ,
146146 input_path,
147- c!( "-t" ) , target. api. name,
147+ c!( "-t" ) , target. api. name( ) ,
148148 c!( "-o" ) , program_path,
149149 }
150150 if quiet {
@@ -162,14 +162,14 @@ pub unsafe fn execute_test(
162162 c!( "./build/b" )
163163 } ,
164164 input_path,
165- c!( "-t" ) , target. api. name,
165+ c!( "-t" ) , target. api. name( ) ,
166166 c!( "-o" ) , program_path,
167167 c!( "-q" ) ,
168168 c!( "-nobuild" ) ,
169169 c!( "-run" ) ,
170170 }
171171 // Hack for Uxn
172- if strcmp ( target. api . name , c ! ( "uxn" ) ) == 0 {
172+ if strcmp ( target. api . name ( ) , c ! ( "uxn" ) ) == 0 {
173173 cmd_append ! ( cmd, c!( "-C" ) , c!( "runner=uxncli" ) ) ;
174174 }
175175 let mut fdout = fd_open_for_write ( stdout_path) ;
@@ -235,7 +235,7 @@ pub unsafe fn print_top_labels(targets: *const [Target], stats_by_target: *const
235235 printf ( c ! ( "│ " ) ) ;
236236 }
237237 // TODO: these fancy unicode characters don't work well on mingw32 build via wine
238- printf ( c ! ( "┌─%-*s" ) , col_width - 2 * j, target. api . name ) ;
238+ printf ( c ! ( "┌─%-*s" ) , col_width - 2 * j, target. api . name ( ) ) ;
239239 print_report_stats ( stats)
240240 }
241241}
@@ -249,7 +249,7 @@ pub unsafe fn print_bottom_labels(targets: *const [Target], stats_by_target: *co
249249 for _ in 0 ..j {
250250 printf ( c ! ( "│ " ) ) ;
251251 }
252- printf ( c ! ( "└─%-*s" ) , col_width - 2 * j, target. api . name ) ;
252+ printf ( c ! ( "└─%-*s" ) , col_width - 2 * j, target. api . name ( ) ) ;
253253 print_report_stats ( stats)
254254 }
255255}
@@ -383,7 +383,7 @@ pub unsafe fn generate_report(reports: *const [Report], stats_by_target: *const
383383 let mut col_width = 0 ;
384384 for j in 0 ..targets. len ( ) {
385385 let target = ( * targets) [ j] ;
386- let width = 2 * ( j + 1 ) + strlen ( target. api . name ) ;
386+ let width = 2 * ( j + 1 ) + strlen ( target. api . name ( ) ) ;
387387 col_width = cmp:: max ( col_width, width) ;
388388 }
389389
@@ -423,7 +423,7 @@ type TestTable = Array<TestRow>;
423423pub unsafe fn test_table_find_row ( tt : * mut TestTable , case_name : * const c_char , target : Target ) -> Option < * mut TestRow > {
424424 for i in 0 ..( * tt) . count {
425425 let row = ( * tt) . items . add ( i) ;
426- if strcmp ( ( * row) . target . api . name , target. api . name ) == 0 && strcmp ( ( * row) . case_name , case_name) == 0 {
426+ if strcmp ( ( * row) . target . api . name ( ) , target. api . name ( ) ) == 0 && strcmp ( ( * row) . case_name , case_name) == 0 {
427427 return Some ( row)
428428 }
429429 }
@@ -516,15 +516,15 @@ pub unsafe fn load_tt_from_json_file_if_exists(
516516 // TODO: report the location of existing_row here as a NOTE
517517 // This requires keeping track of location in TestRow structure. Which requires location tracking capabilities
518518 // comparable to lexer.rs but in jim/jimp.
519- jimp_diagf ( jimp, c ! ( "WARNING: Redefinition of the row case `%s`, target `%s`. We are using only the first definition. All the rest are gonna be prunned" ) , case_name, target. api . name ) ;
519+ jimp_diagf ( jimp, c ! ( "WARNING: Redefinition of the row case `%s`, target `%s`. We are using only the first definition. All the rest are gonna be prunned" ) , case_name, target. api . name ( ) ) ;
520520 // TODO: memory leak, we are dropping the whole row here
521521 continue ' table;
522522 }
523523
524524 let case_path = temp_sprintf ( c ! ( "%s/%s.b" ) , test_folder, case_name) ;
525525 if !file_exists ( case_path) ? {
526526 ( * jimp) . token_start = saved_point;
527- jimp_diagf ( jimp, c ! ( "WARNING: %s does not exist. Ignoring case `%s`, target `%s` ...\n " ) , case_path, case_name, target. api . name ) ;
527+ jimp_diagf ( jimp, c ! ( "WARNING: %s does not exist. Ignoring case `%s`, target `%s` ...\n " ) , case_path, case_name, target. api . name ( ) ) ;
528528 // TODO: memory leak, we are dropping the whole row here
529529 continue ' table;
530530 }
@@ -559,7 +559,7 @@ pub unsafe fn save_tt_to_json_file(
559559 jim_member_key ( jim, c ! ( "case" ) ) ;
560560 jim_string ( jim, ( * row) . case_name ) ;
561561 jim_member_key ( jim, c ! ( "target" ) ) ;
562- jim_string ( jim, ( * row) . target . api . name ) ;
562+ jim_string ( jim, ( * row) . target . api . name ( ) ) ;
563563 jim_member_key ( jim, c ! ( "expected_stdout" ) ) ;
564564 jim_string ( jim, ( * row) . expected_stdout ) ;
565565 jim_member_key ( jim, c ! ( "state" ) ) ;
@@ -776,7 +776,7 @@ pub unsafe fn main(argc: i32, argv: *mut*mut c_char) -> Option<()> {
776776 let pattern = * ( * target_flags) . items . add ( j) ;
777777 for j in 0 ..all_targets. count {
778778 let target = * all_targets. items . add ( j) ;
779- let name = target. api . name ;
779+ let name = target. api . name ( ) ;
780780 if matches_glob ( pattern, name) ? {
781781 da_append ( & mut selected_targets, target) ;
782782 added_anything = true ;
@@ -794,7 +794,7 @@ pub unsafe fn main(argc: i32, argv: *mut*mut c_char) -> Option<()> {
794794 let mut matches_any = false ;
795795 ' exclude: for j in 0 ..( * exclude_target_flags) . count {
796796 let pattern = * ( * exclude_target_flags) . items . add ( j) ;
797- if matches_glob ( pattern, target. api . name ) ? {
797+ if matches_glob ( pattern, target. api . name ( ) ) ? {
798798 matches_any = true ;
799799 break ' exclude;
800800 }
@@ -858,7 +858,7 @@ pub unsafe fn main(argc: i32, argv: *mut*mut c_char) -> Option<()> {
858858 fprintf ( stderr ( ) , c ! ( "Compilation targets:\n " ) ) ;
859859 for i in 0 ..targets. count {
860860 let target = * targets. items . add ( i) ;
861- fprintf ( stderr ( ) , c ! ( " %s\n " ) , target. api . name ) ;
861+ fprintf ( stderr ( ) , c ! ( " %s\n " ) , target. api . name ( ) ) ;
862862 }
863863 return Some ( ( ) ) ;
864864 }
@@ -913,15 +913,15 @@ pub unsafe fn main(argc: i32, argv: *mut*mut c_char) -> Option<()> {
913913 let mut target_width = 0 ;
914914 for j in 0 ..targets. count {
915915 let target = * targets. items . add ( j) ;
916- target_width = cmp:: max ( target_width, strlen ( target. api . name ) ) ;
916+ target_width = cmp:: max ( target_width, strlen ( target. api . name ( ) ) ) ;
917917 }
918918
919919 let mut tt = load_tt_from_json_file_if_exists ( da_slice ( all_targets) , json_path, * test_folder, & mut sb, & mut jimp) ?;
920920 for i in 0 ..cases. count {
921921 let case_name = * cases. items . add ( i) ;
922922 for j in 0 ..targets. count {
923923 let target = * targets. items . add ( j) ;
924- log ( Log_Level :: INFO , c ! ( "disabling %-*s for %-*s" ) , case_width, case_name, target_width, target. api . name ) ;
924+ log ( Log_Level :: INFO , c ! ( "disabling %-*s for %-*s" ) , case_width, case_name, target_width, target. api . name ( ) ) ;
925925 if let Some ( row) = test_table_find_row ( & mut tt, case_name, target) {
926926 ( * row) . state = TestState :: Disabled ;
927927 if !( * comment) . is_null ( ) {
0 commit comments