Skip to content

Commit 01cda7d

Browse files
Ignore compile/simd-ffi.rs test on m68k target
1 parent ec14a11 commit 01cda7d

File tree

1 file changed

+29
-4
lines changed

1 file changed

+29
-4
lines changed

tests/lang_tests.rs

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ fn build_test_runner(
6565
test_kind: &str,
6666
test_dir: &str,
6767
run_binary: bool,
68+
files_to_ignore_on_m68k: &'static [&'static str],
6869
) {
6970
fn rust_filter(path: &Path) -> bool {
7071
path.is_file() && path.extension().expect("extension").to_str().expect("to_str") == "rs"
@@ -87,9 +88,25 @@ fn build_test_runner(
8788

8889
println!("=== {test_kind} tests ===");
8990

91+
// TODO(antoyo): find a way to send this via a cli argument.
92+
let test_target = std::env::var("CG_GCC_TEST_TARGET").ok();
93+
let test_target_filter = test_target.clone();
94+
9095
LangTester::new()
9196
.test_dir(test_dir)
92-
.test_path_filter(filter)
97+
.test_path_filter(move |filename| {
98+
if !filter(filename) {
99+
return false;
100+
}
101+
if test_target_filter.is_some()
102+
&& let Some(filename) = filename.file_name()
103+
&& let Some(filename) = filename.to_str()
104+
&& files_to_ignore_on_m68k.contains(&filename)
105+
{
106+
return false;
107+
}
108+
true
109+
})
93110
.test_extract(|path| {
94111
std::fs::read_to_string(path)
95112
.expect("read file")
@@ -117,8 +134,6 @@ fn build_test_runner(
117134
exe.to_str().expect("to_str").into(),
118135
path.to_str().expect("to_str").into(),
119136
];
120-
// TODO(antoyo): find a way to send this via a cli argument.
121-
let test_target = std::env::var("CG_GCC_TEST_TARGET").ok();
122137

123138
if let Some(ref target) = test_target {
124139
compiler_args.extend_from_slice(&["--target".into(), target.into()]);
@@ -155,7 +170,15 @@ fn build_test_runner(
155170
}
156171

157172
fn compile_tests(tempdir: PathBuf, current_dir: String) {
158-
build_test_runner(tempdir, current_dir, true, "lang compile", "tests/compile", false);
173+
build_test_runner(
174+
tempdir,
175+
current_dir,
176+
true,
177+
"lang compile",
178+
"tests/compile",
179+
false,
180+
&["simd-ffi.rs"],
181+
);
159182
}
160183

161184
fn run_tests(tempdir: PathBuf, current_dir: String) {
@@ -166,6 +189,7 @@ fn run_tests(tempdir: PathBuf, current_dir: String) {
166189
"[DEBUG] lang run",
167190
"tests/run",
168191
true,
192+
&[],
169193
);
170194
build_test_runner(
171195
tempdir,
@@ -174,6 +198,7 @@ fn run_tests(tempdir: PathBuf, current_dir: String) {
174198
"[RELEASE] lang run",
175199
"tests/run",
176200
true,
201+
&[],
177202
);
178203
}
179204

0 commit comments

Comments
 (0)