Skip to content

Commit 3f263f6

Browse files
committed
Update test script.
1 parent 6e5dead commit 3f263f6

File tree

4 files changed

+58
-49
lines changed

4 files changed

+58
-49
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

python/__init__.py

Whitespace-only changes.

python/test.sh

Lines changed: 0 additions & 48 deletions
This file was deleted.

scripts/test.sh

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/bin/bash
2+
# shellcheck disable=SC1091
3+
4+
module="$1"
5+
6+
if [ ! "$module" ]; then
7+
echo "Argument not passed, please add argument {rust | python}"
8+
exit 1
9+
fi
10+
11+
python() {
12+
# Ensure we are in the project root
13+
cd "$(dirname "$0")/.." || exit
14+
15+
VENV="venv"
16+
17+
# Check if the virtual environment exists
18+
if [ ! -d "$VENV" ]; then
19+
echo "Error: Virtual environment not found at $VENV"
20+
exit 1
21+
fi
22+
23+
# Activate virtual environment
24+
source venv/bin/activate
25+
26+
# Run Python tests inside the virtual environment directly
27+
if cd python; then
28+
maturin develop
29+
python3 -m unittest discover
30+
fi
31+
32+
}
33+
34+
rust() {
35+
if cd rust; then
36+
cargo test -- --nocapture
37+
fi
38+
}
39+
40+
options() {
41+
echo "Which tests would you like to run?"
42+
echo "1 - rust"
43+
echo "2 - python"
44+
45+
}
46+
47+
# Main
48+
case "$module" in
49+
python)
50+
python
51+
;;
52+
rust)
53+
rust
54+
;;
55+
*) echo "Invalid argument, valid arguments {rust|python}" ;;
56+
57+
esac

0 commit comments

Comments
 (0)