Skip to content

Commit 9cbe5c5

Browse files
committed
Added unit test shell script for twister
1 parent 2c00daa commit 9cbe5c5

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

unittest.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
3+
# Set the path to the twister executable
4+
TWISTER_EXE="../zephyr/scripts/twister"
5+
6+
# Set the path to the test cases directory
7+
TEST_CASES_DIR="zephyr/tests"
8+
9+
# Set the output directory for test results
10+
OUTPUT_DIR="twister-out.unit_testing"
11+
12+
TWISTER_PLATFORM="unit_testing"
13+
14+
# Remove the output directory
15+
rm -rf "$OUTPUT_DIR"
16+
17+
# Run twister with the specified test cases and output directory
18+
"$TWISTER_EXE" -O "$OUTPUT_DIR" -p "$TWISTER_PLATFORM" -T "$TEST_CASES_DIR"
19+
20+
# Check if twister ran successfully
21+
if [ $? -eq 0 ]; then
22+
echo "Twister testing completed successfully."
23+
else
24+
echo "Twister testing failed."
25+
exit 1
26+
fi

0 commit comments

Comments
 (0)