File tree Expand file tree Collapse file tree 2 files changed +28
-3
lines changed Expand file tree Collapse file tree 2 files changed +28
-3
lines changed Original file line number Diff line number Diff line change 4
4
bindgen-integration /Cargo.lock
5
5
tests /expectations /Cargo.lock
6
6
# *#
7
+
8
+ # Test script output
9
+ ir.dot
10
+ ir.png
Original file line number Diff line number Diff line change 10
10
11
11
set -eu
12
12
13
- cd $( dirname $0 )
13
+ if [ $# -ne 1 ]; then
14
+ echo " Usage: $0 <fuzzy-name>"
15
+ exit 1
16
+ fi
17
+
18
+ cd " $( dirname " $0 " ) "
14
19
cd ..
15
20
16
21
export RUST_BACKTRACE=1
17
22
18
- # Grab the first match
19
- TEST=$( find ./tests/headers -type f -iname " *$1 *" | head -n 1)
23
+ unique_fuzzy_file () {
24
+ local pattern=" $1 "
25
+ local results=" $( find ./tests/headers -type f -iname " *$pattern *" ) "
26
+ local num_results=$( echo " $results " | wc -l)
27
+
28
+ if [[ -z " $results " ]]; then
29
+ >&2 echo " ERROR: no files found with pattern \" $pattern \" "
30
+ exit 1
31
+ elif [[ " $num_results " -ne 1 ]]; then
32
+ >&2 echo " ERROR: Expected exactly 1 result, got $num_results :"
33
+ >&2 echo " $results "
34
+ exit 1
35
+ fi
36
+
37
+ echo " $results "
38
+ }
39
+
40
+ TEST=" $( unique_fuzzy_file " $1 " ) "
20
41
21
42
BINDINGS=$( mktemp -t bindings.rs.XXXXXX)
22
43
TEST_BINDINGS_BINARY=$( mktemp -t bindings.XXXXXX)
You can’t perform that action at this time.
0 commit comments