1- use crate :: build_system:: build_sysroot:: SYSROOT_SRC ;
2-
3- use super :: build_sysroot;
1+ use super :: bench:: SIMPLE_RAYTRACER ;
2+ use super :: build_sysroot:: { self , SYSROOT_SRC } ;
43use super :: config;
54use super :: path:: { Dirs , RelPath } ;
65use super :: prepare:: GitRepo ;
7- use super :: rustc_info:: { get_file_name, get_wrapper_file_name} ;
8- use super :: utils:: {
9- hyperfine_command, is_ci, spawn_and_wait, spawn_and_wait_with_input, CargoProject , Compiler ,
10- } ;
6+ use super :: utils:: { spawn_and_wait, spawn_and_wait_with_input, CargoProject , Compiler } ;
117use super :: SysrootKind ;
128use std:: env;
139use std:: ffi:: OsStr ;
@@ -253,16 +249,6 @@ pub(crate) static PORTABLE_SIMD_REPO: GitRepo = GitRepo::github(
253249static PORTABLE_SIMD : CargoProject =
254250 CargoProject :: new ( & PORTABLE_SIMD_REPO . source_dir ( ) , "portable_simd" ) ;
255251
256- pub ( crate ) static SIMPLE_RAYTRACER_REPO : GitRepo = GitRepo :: github (
257- "ebobby" ,
258- "simple-raytracer" ,
259- "804a7a21b9e673a482797aa289a18ed480e4d813" ,
260- "<none>" ,
261- ) ;
262-
263- pub ( crate ) static SIMPLE_RAYTRACER : CargoProject =
264- CargoProject :: new ( & SIMPLE_RAYTRACER_REPO . source_dir ( ) , "simple_raytracer" ) ;
265-
266252static LIBCORE_TESTS : CargoProject =
267253 CargoProject :: new ( & SYSROOT_SRC . join ( "library/core/tests" ) , "core_tests" ) ;
268254
@@ -282,67 +268,9 @@ const EXTENDED_SYSROOT_SUITE: &[TestCase] = &[
282268 spawn_and_wait ( build_cmd) ;
283269 }
284270 } ) ,
285- TestCase :: new ( "bench.simple-raytracer" , & |runner| {
286- let run_runs = env:: var ( "RUN_RUNS" )
287- . unwrap_or ( if is_ci ( ) { "2" } else { "10" } . to_string ( ) )
288- . parse ( )
289- . unwrap ( ) ;
290-
291- if runner. is_native {
292- eprintln ! ( "[BENCH COMPILE] ebobby/simple-raytracer" ) ;
293- let cargo_clif = RelPath :: DIST
294- . to_path ( & runner. dirs )
295- . join ( get_wrapper_file_name ( "cargo-clif" , "bin" ) ) ;
296- let manifest_path = SIMPLE_RAYTRACER . manifest_path ( & runner. dirs ) ;
297- let target_dir = SIMPLE_RAYTRACER . target_dir ( & runner. dirs ) ;
298-
299- let clean_cmd = format ! (
300- "cargo clean --manifest-path {manifest_path} --target-dir {target_dir}" ,
301- manifest_path = manifest_path. display( ) ,
302- target_dir = target_dir. display( ) ,
303- ) ;
304- let llvm_build_cmd = format ! (
305- "cargo build --manifest-path {manifest_path} --target-dir {target_dir}" ,
306- manifest_path = manifest_path. display( ) ,
307- target_dir = target_dir. display( ) ,
308- ) ;
309- let clif_build_cmd = format ! (
310- "{cargo_clif} build --manifest-path {manifest_path} --target-dir {target_dir}" ,
311- cargo_clif = cargo_clif. display( ) ,
312- manifest_path = manifest_path. display( ) ,
313- target_dir = target_dir. display( ) ,
314- ) ;
315-
316- let bench_compile =
317- hyperfine_command ( 1 , run_runs, Some ( & clean_cmd) , & llvm_build_cmd, & clif_build_cmd) ;
318-
319- spawn_and_wait ( bench_compile) ;
320-
321- eprintln ! ( "[BENCH RUN] ebobby/simple-raytracer" ) ;
322- fs:: copy (
323- target_dir. join ( "debug" ) . join ( get_file_name ( "main" , "bin" ) ) ,
324- RelPath :: BUILD
325- . to_path ( & runner. dirs )
326- . join ( get_file_name ( "raytracer_cg_clif" , "bin" ) ) ,
327- )
328- . unwrap ( ) ;
329-
330- let mut bench_run = hyperfine_command (
331- 0 ,
332- run_runs,
333- None ,
334- Path :: new ( "." ) . join ( get_file_name ( "raytracer_cg_llvm" , "bin" ) ) . to_str ( ) . unwrap ( ) ,
335- Path :: new ( "." ) . join ( get_file_name ( "raytracer_cg_clif" , "bin" ) ) . to_str ( ) . unwrap ( ) ,
336- ) ;
337- bench_run. current_dir ( RelPath :: BUILD . to_path ( & runner. dirs ) ) ;
338- spawn_and_wait ( bench_run) ;
339- } else {
340- spawn_and_wait ( SIMPLE_RAYTRACER . clean ( & runner. target_compiler . cargo , & runner. dirs ) ) ;
341- eprintln ! ( "[BENCH COMPILE] ebobby/simple-raytracer (skipped)" ) ;
342- eprintln ! ( "[COMPILE] ebobby/simple-raytracer" ) ;
343- spawn_and_wait ( SIMPLE_RAYTRACER . build ( & runner. target_compiler , & runner. dirs ) ) ;
344- eprintln ! ( "[BENCH RUN] ebobby/simple-raytracer (skipped)" ) ;
345- }
271+ TestCase :: new ( "test.simple-raytracer" , & |runner| {
272+ spawn_and_wait ( SIMPLE_RAYTRACER . clean ( & runner. host_compiler . cargo , & runner. dirs ) ) ;
273+ spawn_and_wait ( SIMPLE_RAYTRACER . build ( & runner. target_compiler , & runner. dirs ) ) ;
346274 } ) ,
347275 TestCase :: new ( "test.libcore" , & |runner| {
348276 spawn_and_wait ( LIBCORE_TESTS . clean ( & runner. host_compiler . cargo , & runner. dirs ) ) ;
0 commit comments