@@ -22,50 +22,13 @@ OUTPUT_DIR="$SCRIPT_DIR/twister-out.unit_testing"
2222
2323# Set platform to unit testing to avoid building for ALL platforms
2424TWISTER_PLATFORM=" unit_testing"
25- NATIVE_SIM_PLATFORM=" native_sim"
26-
27- cleanup_twister_output_dir () {
28- local output_dir=" $1 "
29-
30- find " $output_dir " -name ' CMakeFiles' -exec rm -rf {} \; 2> /dev/null
31- find " $output_dir " -name ' modules' -exec rm -rf {} \; 2> /dev/null
32- find " $output_dir " -name ' app' -exec rm -rf \
33- ' {}/../zephyr/arch
34- {}/../zephyr/boards
35- {}/../zephyr/cmake
36- {}/../zephyr/CMakeFiles
37- {}/../zephyr/dev_graph.dot
38- {}/../zephyr/drivers
39- {}/../zephyr/dts.cmake
40- {}/../zephyr/edt.pickle
41- {}/../zephyr/include
42- {}/../zephyr/isrList.bin
43- {}/../zephyr/kconfig
44- {}/../zephyr/kernel
45- {}/../zephyr/lib
46- {}/../zephyr/libzephyr.a
47- {}/../zephyr/misc
48- {}/../zephyr/modules
49- {}/../zephyr/soc
50- {}/../zephyr/subsys
51- {}/../Makefile
52- {}/../Kconfig
53- {}/../cmake_install.cmake
54- {}/../CMakeCache.txt' \; 2> /dev/null
55- find " $output_dir " -name ' app' -exec rm -rf ' {}' \; 2> /dev/null
56- }
5725
5826# Remove the output directory
5927rm -rf " $OUTPUT_DIR "
60- rm -rf " $NATIVE_SIM_OUTPUT_DIR "
6128
6229# Run twister with the specified test cases and output directory
6330" $TWISTER_EXE " -O " $OUTPUT_DIR " -p " $TWISTER_PLATFORM " -T " $TEST_CASES_DIR "
64- UNIT_TEST_RC=$?
65-
66- # Run twister for native_sim-only functional tests
67- " $TWISTER_EXE " -O " $NATIVE_SIM_OUTPUT_DIR " -p " $NATIVE_SIM_PLATFORM " -T " $NATIVE_SIM_TEST_CASES_DIR "
68- NATIVE_SIM_RC=$?
31+ TWISTER_RC=$?
6932
7033# twister output directory cleanup files we do not archive
7134find " $OUTPUT_DIR " -name ' CMakeFiles' -exec rm -rf {} \; 2> /dev/null
@@ -97,7 +60,7 @@ find "$OUTPUT_DIR" -name 'app' -exec rm -rf '{}' \; 2>/dev/null
9760echo " Twister unit_testing output cleanup completed successfully."
9861
9962# Check if twister ran successfully
100- if [ $? -eq 0 ]; then
63+ if [ $TWISTER_RC -eq 0 ]; then
10164 echo " Twister unit_testing completed successfully."
10265else
10366 echo " Twister unit_testing failed."
0 commit comments