@@ -5,30 +5,7 @@ use std::path::{Path, PathBuf};
5
5
use std:: process:: Command ;
6
6
7
7
use super :: rustc_info:: { get_file_name, get_rustc_path, get_rustc_version} ;
8
- use super :: utils:: { cargo_command, copy_dir_recursively, spawn_and_wait} ;
9
-
10
- pub ( crate ) const ABI_CAFE : GitRepo =
11
- GitRepo :: github ( "Gankra" , "abi-cafe" , "4c6dc8c9c687e2b3a760ff2176ce236872b37212" , "abi-cafe" ) ;
12
-
13
- pub ( crate ) const RAND : GitRepo =
14
- GitRepo :: github ( "rust-random" , "rand" , "0f933f9c7176e53b2a3c7952ded484e1783f0bf1" , "rand" ) ;
15
-
16
- pub ( crate ) const REGEX : GitRepo =
17
- GitRepo :: github ( "rust-lang" , "regex" , "341f207c1071f7290e3f228c710817c280c8dca1" , "regex" ) ;
18
-
19
- pub ( crate ) const PORTABLE_SIMD : GitRepo = GitRepo :: github (
20
- "rust-lang" ,
21
- "portable-simd" ,
22
- "d5cd4a8112d958bd3a252327e0d069a6363249bd" ,
23
- "portable-simd" ,
24
- ) ;
25
-
26
- pub ( crate ) const SIMPLE_RAYTRACER : GitRepo = GitRepo :: github (
27
- "ebobby" ,
28
- "simple-raytracer" ,
29
- "804a7a21b9e673a482797aa289a18ed480e4d813" ,
30
- "<none>" ,
31
- ) ;
8
+ use super :: utils:: { copy_dir_recursively, spawn_and_wait, Compiler } ;
32
9
33
10
pub ( crate ) fn prepare ( ) {
34
11
if Path :: new ( "download" ) . exists ( ) {
@@ -42,22 +19,25 @@ pub(crate) fn prepare() {
42
19
eprintln ! ( "[INSTALL] hyperfine" ) ;
43
20
Command :: new ( "cargo" ) . arg ( "install" ) . arg ( "hyperfine" ) . spawn ( ) . unwrap ( ) . wait ( ) . unwrap ( ) ;
44
21
45
- ABI_CAFE . fetch ( ) ;
46
- RAND . fetch ( ) ;
47
- REGEX . fetch ( ) ;
48
- PORTABLE_SIMD . fetch ( ) ;
49
- SIMPLE_RAYTRACER . fetch ( ) ;
22
+ super :: abi_cafe :: ABI_CAFE_REPO . fetch ( ) ;
23
+ super :: tests :: RAND_REPO . fetch ( ) ;
24
+ super :: tests :: REGEX_REPO . fetch ( ) ;
25
+ super :: tests :: PORTABLE_SIMD_REPO . fetch ( ) ;
26
+ super :: tests :: SIMPLE_RAYTRACER_REPO . fetch ( ) ;
50
27
51
28
eprintln ! ( "[LLVM BUILD] simple-raytracer" ) ;
52
- let build_cmd = cargo_command ( "cargo" , "build" , None , & SIMPLE_RAYTRACER . source_dir ( ) ) ;
29
+ let host_compiler = Compiler :: host ( ) ;
30
+ let build_cmd = super :: tests:: SIMPLE_RAYTRACER . build ( & host_compiler) ;
53
31
spawn_and_wait ( build_cmd) ;
54
32
fs:: copy (
55
- SIMPLE_RAYTRACER
56
- . source_dir ( )
57
- . join ( "target" )
33
+ super :: tests :: SIMPLE_RAYTRACER
34
+ . target_dir ( )
35
+ . join ( & host_compiler . triple )
58
36
. join ( "debug" )
59
37
. join ( get_file_name ( "main" , "bin" ) ) ,
60
- SIMPLE_RAYTRACER . source_dir ( ) . join ( get_file_name ( "raytracer_cg_llvm" , "bin" ) ) ,
38
+ super :: tests:: SIMPLE_RAYTRACER_REPO
39
+ . source_dir ( )
40
+ . join ( get_file_name ( "raytracer_cg_llvm" , "bin" ) ) ,
61
41
)
62
42
. unwrap ( ) ;
63
43
}
@@ -100,7 +80,7 @@ enum GitRepoUrl {
100
80
}
101
81
102
82
impl GitRepo {
103
- const fn github (
83
+ pub ( crate ) const fn github (
104
84
user : & ' static str ,
105
85
repo : & ' static str ,
106
86
rev : & ' static str ,
0 commit comments