(run_bindgen: P, let bindgen = bindgen.as_ref(); let header = header.as_ref(); - // Convert from "tests/headers/foo.hpp" to "tests/expectations/foo.rs" by + // Convert from "tests/headers/foo.hpp" to "tests/expectations/tests/foo.rs" by // saving the filename, popping off "headers/foo.hpp", pushing - // "expectations", pushing the saved filename, and finally modifying the + // "expectations/tests", pushing the saved filename, and finally modifying the // extension. let mut expected = PathBuf::from(header); @@ -36,6 +36,7 @@ fn spawn_run_bindgen
(run_bindgen: P, expected.pop(); expected.pop(); expected.push("expectations"); + expected.push("tests"); expected.push(file_name); expected.set_extension("rs"); diff --git a/tests/tools/run-bindgen.py b/tests/tools/run-bindgen.py index 1f5f504e2b..aad210da53 100755 --- a/tests/tools/run-bindgen.py +++ b/tests/tools/run-bindgen.py @@ -130,16 +130,6 @@ def generate_bindings(bindgen, dummy_uses, flags, header, output): command.append(header) run_cmd(command, cwd=os.getcwd(), env=make_bindgen_env()) -def test_generated_bindings(bindings): - """Run the generated bindings's #[test]s.""" - name = None - # Do not delete the temp file, because we need to end the with block before - # we can run the tests. - with tempfile.NamedTemporaryFile(delete=False) as tests: - name = tests.name - run_cmd(["rustc", "--test", bindings, "-o", name]) - run_cmd([name]) - def check_actual_vs_expected(expected_bindings, rust_bindings_path): """ Check the actual generated rust bindings versus our expected generated rust @@ -177,7 +167,6 @@ def main(): test_flags, args.header, args.rust_bindings) - test_generated_bindings(args.rust_bindings) check_actual_vs_expected(expected_bindings, args.rust_bindings) sys.exit(0)