Skip to content

Commit 90fe1cd

Browse files
committed
Ensure multiple library-test can be executed within single OS boot
1 parent abc8de2 commit 90fe1cd

File tree

4 files changed

+19
-13
lines changed

4 files changed

+19
-13
lines changed

src/usr/include/testing.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ static int test_count_failure;
4444
} while (0)
4545
#define TEST_SUMMARY() \
4646
do { \
47-
std::printf("TEST_SUCCESS_COUNT: %d\n", test_count_success); \
48-
std::printf("TEST_FAILURE_COUNT: %d\n", test_count_failure); \
47+
std::printf("[%s] TEST_SUCCESS_COUNT: %d\n", __FILE__, \
48+
test_count_success); \
49+
std::printf("[%s] TEST_FAILURE_COUNT: %d\n", __FILE__, \
50+
test_count_failure); \
4951
} while (0)
5052

5153
#ifdef __cplusplus

tests/app/libraries/usr_lib_string_test.sh

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
# Test is supposed to be sourced from shell_test.sh
4+
5+
function add_library_unit_test {
6+
QEMU_SCREENSHOT_NAME="usr_lib_${1:?}.ppm"
7+
8+
python3 -m tests.qemu.monitor -p ${MONITOR_PORT:?} -sc ${1:?}
9+
10+
test_create_screen_dump
11+
test_screen_content $LINENO "\[.*/usr/local/src/${1:?}.cpp\] TEST_FAILURE_COUNT: 0"
12+
}
13+
14+
add_library_unit_test "test-string"

tests/app/shell_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ source tests/app/ls_test.sh
99
source tests/app/tictactoe_test.sh
1010
source tests/app/cat_test.sh
1111
source tests/app/multiprocessing_test.sh
12-
source tests/app/libraries/usr_lib_string_test.sh
12+
source tests/app/libraries/usr_lib_test.sh

0 commit comments

Comments
 (0)