File tree 1 file changed +24
-2
lines changed
1 file changed +24
-2
lines changed Original file line number Diff line number Diff line change 8
8
# `rustc` to compile the bindings with unit tests enabled, and run the generated
9
9
# layout tests.
10
10
11
- set -eux
11
+ set -eu
12
12
13
13
cd $( dirname $0 )
14
14
cd ..
@@ -21,7 +21,7 @@ TEST=$(find ./tests/headers -type f -iname "*$1*" | head -n 1)
21
21
BINDINGS=$( mktemp -t bindings.rs.XXXXXX)
22
22
TEST_BINDINGS_BINARY=$( mktemp -t bindings.XXXXXX)
23
23
24
- FLAGS=" $( grep " // bindgen-flags: " " $TEST " ) "
24
+ FLAGS=" $( grep " // bindgen-flags: " " $TEST " || echo ) "
25
25
FLAGS=" ${FLAGS/ \/\/ bindgen\- flags:/ } "
26
26
27
27
eval ./target/debug/bindgen \
@@ -34,14 +34,36 @@ eval ./target/debug/bindgen \
34
34
35
35
dot -Tpng ir.dot -o ir.png
36
36
37
+ echo
37
38
echo " === Input header ========================================================"
39
+ echo
40
+
38
41
cat " $TEST "
39
42
43
+ echo
40
44
echo " === Generated bindings =================================================="
45
+ echo
46
+
41
47
cat " $BINDINGS "
42
48
49
+ echo
50
+ echo " === Diff w/ expected bindings ==========================================="
51
+ echo
52
+
53
+ EXPECTED=${TEST/ headers/ expectations\/ tests}
54
+ EXPECTED=${EXPECTED/ .hpp/ .rs}
55
+
56
+ # Don't exit early if there is a diff.
57
+ diff -U8 " $EXPECTED " " $BINDINGS " || true
58
+
59
+ echo
43
60
echo " === Building bindings ==================================================="
61
+ echo
62
+
44
63
rustc --test -o " $TEST_BINDINGS_BINARY " " $BINDINGS " --crate-name bindgen_test_one
45
64
65
+ echo
46
66
echo " === Testing bindings ===================================================="
67
+ echo
68
+
47
69
" $TEST_BINDINGS_BINARY "
You can’t perform that action at this time.
0 commit comments