Skip to content

Ensure multiple library unit-test can be executed within single OS boot #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/usr/include/testing.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ static int test_count_failure;
} while (0)
#define TEST_SUMMARY() \
do { \
std::printf("TEST_SUCCESS_COUNT: %d\n", test_count_success); \
std::printf("TEST_FAILURE_COUNT: %d\n", test_count_failure); \
std::printf("[%s] TEST_SUCCESS_COUNT: %d\n", __FILE__, \
test_count_success); \
std::printf("[%s] TEST_FAILURE_COUNT: %d\n", __FILE__, \
test_count_failure); \
} while (0)

#ifdef __cplusplus
Expand Down
10 changes: 0 additions & 10 deletions tests/app/libraries/usr_lib_string_test.sh

This file was deleted.

14 changes: 14 additions & 0 deletions tests/app/libraries/usr_lib_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

# Test is supposed to be sourced from shell_test.sh

function add_library_unit_test {
QEMU_SCREENSHOT_NAME="usr_lib_${1:?}.ppm"

python3 -m tests.qemu.monitor -p ${MONITOR_PORT:?} -sc ${1:?}

test_create_screen_dump
test_screen_content $LINENO "\[.*/usr/local/src/${1:?}.cpp\] TEST_FAILURE_COUNT: 0"
}

add_library_unit_test "test-string"
2 changes: 1 addition & 1 deletion tests/app/shell_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ source tests/app/ls_test.sh
source tests/app/tictactoe_test.sh
source tests/app/cat_test.sh
source tests/app/multiprocessing_test.sh
source tests/app/libraries/usr_lib_string_test.sh
source tests/app/libraries/usr_lib_test.sh