-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
run-tests.sh
executable file
·46 lines (37 loc) · 1.05 KB
/
run-tests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
# Remove our WASM test.
if [ -d "wasm/" ]; then
rm -rf wasm/
fi
# Run our golang tests
go test ./... -race
# If that worked build our examples, to ensure they work
# and that we've not broken compatibility
for i in _examples/embedded/*; do
if [ -d $i ]; then
pushd $i
echo "Building example in $(pwd)"
go build .
popd
else
echo "Skipping non-directory $i"
fi
done
# Build the helper
start=$(pwd)
cd cmd/evalfilter && go build .
cd ${start}
# Now make sure there are no errors in our examples
for src in _examples/scripts/*.script; do
# Is there a JSON file too?
name=$(basename ${src} .script)
if [ -e "_examples/scripts/${name}.json" ]; then
echo "Running ${src} with JSON input ${name}.json"
./cmd/evalfilter/evalfilter run -json "_examples/scripts/${name}.json" ${src}
else
echo "Running ${src}"
./cmd/evalfilter/evalfilter run ${src}
fi
done
# Finally run our benchmarks for completeness
go test -test.bench=evalfilter -benchtime=1s -run=^t