Skip to content

Commit 0af9c89

Browse files
author
bors-servo
authored
Auto merge of #1163 - fitzgen:remove-unnecessary-ci-jobs, r=emilio
Remove unnecessary ci jobs And then in the process I noticed that we weren't running the layout tests for any of the libclang version-specific expectation files, so I also fixed that. r? @emilio or @pepyakin
2 parents 75f9e1c + 1c2172f commit 0af9c89

File tree

3 files changed

+61
-4
lines changed

3 files changed

+61
-4
lines changed

.travis.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,10 @@ env:
2121
- LLVM_VERSION="3.8.1" BINDGEN_JOB="test" BINDGEN_PROFILE="--release"
2222
- LLVM_VERSION="3.8.1" BINDGEN_JOB="integration" BINDGEN_PROFILE=
2323
- LLVM_VERSION="3.8.1" BINDGEN_JOB="integration" BINDGEN_PROFILE="--release"
24-
- LLVM_VERSION="3.8.1" BINDGEN_JOB="expectations" BINDGEN_PROFILE=
25-
- LLVM_VERSION="3.8.1" BINDGEN_JOB="expectations" BINDGEN_PROFILE="--release"
2624
- LLVM_VERSION="3.9.0" BINDGEN_JOB="test" BINDGEN_PROFILE=
2725
- LLVM_VERSION="3.9.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release"
2826
- LLVM_VERSION="3.9.0" BINDGEN_JOB="integration" BINDGEN_PROFILE=
2927
- LLVM_VERSION="3.9.0" BINDGEN_JOB="integration" BINDGEN_PROFILE="--release"
30-
- LLVM_VERSION="3.9.0" BINDGEN_JOB="expectations" BINDGEN_PROFILE=
31-
- LLVM_VERSION="3.9.0" BINDGEN_JOB="expectations" BINDGEN_PROFILE="--release"
3228
- LLVM_VERSION="4.0.0" BINDGEN_JOB="test" BINDGEN_PROFILE=
3329
- LLVM_VERSION="4.0.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release"
3430
- LLVM_VERSION="4.0.0" BINDGEN_JOB="test" BINDGEN_PROFILE= BINDGEN_FEATURES="testing_only_extra_assertions"

tests/expectations/build.rs

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
//! Generate a module with a custom `#[path=...]` for each of the files in our
2+
//! libclang version-specific test expectations so that they get their layout
3+
//! tests run. We need to do this because cargo doesn't automatically detect
4+
//! tests subdirectories.
5+
6+
use std::env;
7+
use std::fs;
8+
use std::io::Write;
9+
use std::path::Path;
10+
11+
const LIBCLANG_VERSION_DIRS: &'static [&'static str] =
12+
&["libclang-3.8", "libclang-3.9", "libclang-4"];
13+
14+
fn main() {
15+
println!("cargo:rerun-if-changed=build.rs");
16+
17+
let mut test_string = String::new();
18+
19+
for dir in LIBCLANG_VERSION_DIRS {
20+
let dir = Path::new(&env::var_os("CARGO_MANIFEST_DIR").unwrap())
21+
.join("tests")
22+
.join(dir);
23+
24+
println!("cargo:rerun-if-changed={}", dir.display());
25+
26+
for entry in fs::read_dir(dir).unwrap() {
27+
let entry = entry.unwrap();
28+
let path = entry.path();
29+
let path = path.canonicalize().unwrap_or_else(|_| path.into());
30+
if path.extension().map(|e| e.to_string_lossy()) != Some("rs".into()) {
31+
continue;
32+
}
33+
34+
println!("cargo:rerun-if-changed={}", path.display());
35+
36+
let module_name: String = path.display()
37+
.to_string()
38+
.chars()
39+
.map(|c| match c {
40+
'a'...'z' | 'A'...'Z' | '0'...'9' => c,
41+
_ => '_',
42+
})
43+
.collect();
44+
45+
test_string.push_str(&format!(
46+
r###"
47+
#[path = "{}"]
48+
mod {};
49+
"###,
50+
path.display(),
51+
module_name,
52+
));
53+
}
54+
}
55+
56+
let out_path = Path::new(&env::var_os("OUT_DIR").unwrap())
57+
.join("libclang_version_specific_generated_tests.rs");
58+
let mut test_file = fs::File::create(out_path).unwrap();
59+
test_file.write_all(test_string.as_bytes()).unwrap();
60+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include!(concat!(env!("OUT_DIR"), "/libclang_version_specific_generated_tests.rs"));

0 commit comments

Comments
 (0)