Skip to content
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

Refactor/simplify test management #495

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions bats/sanity-check/10-yaml-validate.bats
Expand Up @@ -14,13 +14,13 @@ load ../testenv
}

@test "Verify that the python yaml module can import failure output" {
for test in selftest_failinit selftest_fail selftest_freeze selftest_sigkill; do
run $SANDSTONE --no-triage --retest-on-failure=1 --on-crash=kill --on-hang=kill --timeout=2s --selftest -o output.yaml -Y2 -e $test
for test in selftest_failinit selftest_fail selftest_freeze selftest_sigill; do
run $SANDSTONE --no-triage --retest-on-failure=1 --on-crash=kill --on-hang=kill --timeout=2s --selftest -o output-${test}.yaml -Y2 -e $test
if [[ "$status" = 0 ]]; then
printf "%s: status is 0\n" $test
exit 1
fi

python3 $BATS_TEST_COMMONDIR/yamltest.py output.yaml
python3 $BATS_TEST_COMMONDIR/yamltest.py output-${test}.yaml
done
}
3 changes: 2 additions & 1 deletion bats/sanity-check/20-selftests.bats
Expand Up @@ -167,7 +167,8 @@ tap_negative_check() {
case "$line" in
\#* | \
"$exit_line" | \
"THIS IS AN UNOPTIMIZED BUILD"*)
"THIS IS AN UNOPTIMIZED BUILD"* | \
"ok"*"mce_check")
# acceptable line
;;
"not ok"*)
Expand Down
7 changes: 3 additions & 4 deletions framework/logging.cpp
Expand Up @@ -2599,19 +2599,18 @@ void YamlLogger::print_tests_header(TestHeaderTime mode)

/// prints the results from running the test \c{test} (test number \c{tc})
/// and returns the effective test result
TestResult logging_print_results(std::span<const ChildExitStatus> status, int *tc, const struct test *test)
TestResult logging_print_results(std::span<const ChildExitStatus> status, const struct test *test)
{
int n = ++*tc;
switch (current_output_format()) {
case SandstoneApplication::OutputFormat::key_value: {
KeyValuePairLogger l(test, status);
l.print(n);
l.print(sApp->current_test_count);
return l.testResult;
}

case SandstoneApplication::OutputFormat::tap: {
TapFormatLogger l(test, status);
l.print(n);
l.print(sApp->current_test_count);
return l.testResult;
}

Expand Down
7 changes: 1 addition & 6 deletions framework/meson.build
Expand Up @@ -14,7 +14,6 @@ framework_incdir = [
top_incdir,
include_directories([
'.',
'test_selectors',
sysdeps_dir,
])
]
Expand Down Expand Up @@ -86,13 +85,12 @@ framework_files = files(
'sandstone.cpp',
'sandstone_chrono.cpp',
'sandstone_data.cpp',
'sandstone_tests.cpp',
'sandstone_test_groups.cpp',
'sandstone_thread.cpp',
'sandstone_utils.cpp',
'static_vectors.c',
'test_knobs.cpp',
'test_selectors/SelectorFactory.cpp',
'test_selectors/WeightedSelectorBase.cpp',
'sandstone_context_dump.cpp',
'topology.cpp',
)
Expand Down Expand Up @@ -197,9 +195,6 @@ unittests_sources += files(
'sandstone_data.cpp',
'sandstone_utils.cpp',
'test_knobs.cpp',
'test_selectors/SelectorFactory.cpp',
'test_selectors/WeightedSelectorBase.cpp',
'unit-tests/WeightedTestSelector_tests.cpp',
'unit-tests/sandstone_data_tests.cpp',
'unit-tests/sandstone_test_utils_tests.cpp',
'unit-tests/sandstone_utils_tests.cpp',
Expand Down