Skip to content

Commit 50077c5

Browse files
committed
test(static inlined): refactor paths once again
- Because directory structure is confusing to the author of this commit rust-langGH-1090
1 parent d2cbe87 commit 50077c5

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

bindgen-tests/tests/tests.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -719,27 +719,27 @@ fn test_extern_generated_headers() {
719719
// This test is for testing diffs of the generated C source and header files
720720
// TODO: If another such feature is added, convert this test into a more generic
721721
// test that looks at `tests/headers/generated` directory.
722-
let in_path = PathBuf::from("tests/headers/generated");
723-
println!("In path is ::: {}", in_path.to_str().unwrap());
722+
let expect_path = PathBuf::from("tests/expectations/tests/generated");
723+
println!("In path is ::: {}", expect_path.to_str().unwrap());
724724

725-
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
726-
println!("Out path is ::: {}", out_path.to_str().unwrap());
725+
let generated_path = PathBuf::from(env::var("OUT_DIR").unwrap());
726+
println!("Out path is ::: {}", generated_path.to_str().unwrap());
727727

728728
let _bindings = Builder::default()
729729
.header("tests/headers/generate-extern-functions.h")
730730
.generate_extern_functions(true)
731-
.extern_functions_directory(out_path.display().to_string())
731+
.extern_functions_directory(generated_path.display().to_string())
732732
.generate()
733733
.expect("Failed to generate bindings");
734734

735-
let expected_c = fs::read_to_string(in_path.join("extern.c"))
735+
let expected_c = fs::read_to_string(expect_path.join("extern.c"))
736736
.expect("Could not read generated extern.c");
737-
let expected_h = fs::read_to_string(in_path.join("extern.h"))
737+
let expected_h = fs::read_to_string(expect_path.join("extern.h"))
738738
.expect("Could not read generated extern.h");
739739

740-
let actual_c = fs::read_to_string(out_path.join("extern.c"))
740+
let actual_c = fs::read_to_string(generated_path.join("extern.c"))
741741
.expect("Could not read actual extern.c");
742-
let actual_h = fs::read_to_string(out_path.join("extern.h"))
742+
let actual_h = fs::read_to_string(generated_path.join("extern.h"))
743743
.expect("Could not read actual extern.h");
744744

745745
assert_eq!(expected_c, actual_c);

0 commit comments

Comments
 (0)