-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest
More file actions
executable file
·55 lines (44 loc) · 959 Bytes
/
test
File metadata and controls
executable file
·55 lines (44 loc) · 959 Bytes
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
47
48
49
50
51
52
53
54
55
#!/bin/bash
set -e
# Run workspace tests.
#
# Usage:
# ./test # unit tests only
# ./test --full # unit + stress + integration tests
# ./test -p fbuild-core # single crate
# ./test -p fbuild-core -- name # single test by name
FULL=false
ARGS=()
for arg in "$@"; do
if [ "$arg" = "--full" ]; then
FULL=true
else
ARGS+=("$arg")
fi
done
# Split on "--" to separate cargo args from test-binary args
CARGO_ARGS=()
TEST_ARGS=()
FOUND_SEP=false
for arg in "${ARGS[@]}"; do
if [ "$arg" = "--" ]; then
FOUND_SEP=true
continue
fi
if $FOUND_SEP; then
TEST_ARGS+=("$arg")
else
CARGO_ARGS+=("$arg")
fi
done
CMD=(uv run cargo test)
if [ ${#CARGO_ARGS[@]} -eq 0 ]; then
CMD+=(--workspace)
fi
CMD+=("${CARGO_ARGS[@]}")
CMD+=(--)
if $FULL; then
CMD+=(--include-ignored)
fi
CMD+=("${TEST_ARGS[@]}")
exec "${CMD[@]}"