Lines Matching refs:bindings
15 First, `bindgen` is run on the input header. Then the emitted bindings are
16 compiled with `rustc`. Finally, the compiled bindings' layout tests are run.
25 behavior. In this mode, you might expect that the emitted bindings fail to
46 help="An argument string that `bindgen` should be invoked with. By default, all traits are derived. Note that the input header and output bindings file will automatically be provided by this script, and you should not manually specify them.")
75 help="Exit non-zero if `bindgen` successfully emits bindings.")
81 "--bindings-grep",
84 help="Exit non-zero if the given regexp pattern is not found in the emitted bindings.")
87 "--no-compile-bindings",
90 help="Do not attempt to compile the emitted bindings with `rustc`.")
94 help="Append the content of this extra file to the end of the emitted bindings just before compiling it.")
98 help="Exit non-zero if `rustc` successfully compiles the emitted bindings.")
102 help="Exit non-zero if the output from compiling the bindings with `rustc` does not contain the given regexp pattern")
108 help="Do not run the compiled bindings' layout tests.")
112 help="Exit non-zero if the compiled bindings' layout tests pass.")
116 help="Exit non-zero if the output of running the compiled bindings' layout tests does not contain the given regexp pattern.")
146 bindings = new_temp_file(prefix="bindings-", suffix=".rs")
147 run_bindgen(args, bindings)
151 run_rustc(args, bindings, test_exe)
198 def run_bindgen(args, bindings):
205 command += ["--", args.input, "-o", bindings]
224 with open(bindings, mode="r") as f:
226 print("Error: expected the emitted bindings to contain '{}', but they didn't".format(arg))
227 print("---------- {} ----------------------------------------------".format(bindings))
232 def run_rustc(args, bindings, test_exe):
234 with open(bindings, mode="a") as outfile:
238 ["rustc", "--crate-type", "lib", "--test", "-o", test_exe, bindings],
249 exit_1("Error: expected running `rustc` on the emitted bindings to fail, but it didn't", child)
252 exit_1("Error: running `rustc` on the emitted bindings failed", child)
264 exit_1("Error: did not find '{}' in the compiled bindings' layout tests' output".format(args.layout_tests_grep), child)
267 exit_1("Error: expected running the compiled bindings' layout tests to fail, but it didn't", child)
270 exit_1("Error: running the compiled bindings' layout tests failed", child)