-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·58 lines (50 loc) · 1.43 KB
/
test.sh
File metadata and controls
executable file
·58 lines (50 loc) · 1.43 KB
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
56
57
58
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "$0")" && pwd)"
REPORT=0
LARGE=0
while [[ $# -gt 0 ]]; do
case "$1" in
--security)
cd "$ROOT_DIR/rust"
exec cargo test -p bioscript-runtime --test security -- --nocapture
;;
--report)
REPORT=1
shift
;;
--large)
LARGE=1
shift
;;
*)
echo "Unknown argument: $1" >&2
exit 1
;;
esac
done
cd "$ROOT_DIR/rust"
TEST_RUSTFLAGS="${RUSTFLAGS:-} -Aunused-assignments -Amissing-docs"
cargo_test() {
RUSTFLAGS="$TEST_RUSTFLAGS" cargo test "$@"
}
if [[ "$LARGE" == "1" ]]; then
export BIOSCRIPT_RUN_LARGE_TESTS=1
else
unset BIOSCRIPT_RUN_LARGE_TESTS
fi
cargo_test -p bioscript-formats --test file_formats --lib --test inspect --test prepare -- --nocapture
cargo_test -p bioscript-cli --test cli --bin bioscript -- --nocapture
cargo_test -p bioscript-schema --test validate_variants -- --nocapture
cargo_test -p bioscript-core --lib --test source_size -- --nocapture
cargo_test -p bioscript-runtime --lib --test security --test resources_coverage -- --nocapture
if [[ "$REPORT" == "1" ]]; then
cargo build -p bioscript-cli
cd "$ROOT_DIR"
REPORT_PATH="$ROOT_DIR/test-reports/file-formats.html"
python3 "$ROOT_DIR/tools/generate_file_format_report.py" \
--bioscript "$ROOT_DIR/rust/target/debug/bioscript" \
--root "$ROOT_DIR" \
--output "$REPORT_PATH"
echo "HTML report: $REPORT_PATH"
fi