From cdbb632c6a69eeacf0cb384f1365e35b8e7a1a8f Mon Sep 17 00:00:00 2001 From: Gabriel Ferreira Date: Mon, 30 Jun 2025 16:24:30 +0200 Subject: [PATCH] core, test: Print example-as-test as example-as-test, instead of examples Avoids confusion regarding manually passing a test as a test-suite name (-s) or an actual example names (-e) --- src/core/model/test.cc | 12 ++++++------ test.py | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/core/model/test.cc b/src/core/model/test.cc index 93193a9e8..ab6615c61 100644 --- a/src/core/model/test.cc +++ b/src/core/model/test.cc @@ -790,11 +790,11 @@ TestRunnerImpl::PrintTestNameList(std::list::const_iterator begin, NS_LOG_FUNCTION(this << &begin << &end << printTestType); std::map label; - label[TestSuite::Type::ALL] = "all "; - label[TestSuite::Type::UNIT] = "unit "; - label[TestSuite::Type::SYSTEM] = "system "; - label[TestSuite::Type::EXAMPLE] = "example "; - label[TestSuite::Type::PERFORMANCE] = "performance "; + label[TestSuite::Type::ALL] = "all "; + label[TestSuite::Type::UNIT] = "unit "; + label[TestSuite::Type::SYSTEM] = "system "; + label[TestSuite::Type::EXAMPLE] = "example-as-test "; + label[TestSuite::Type::PERFORMANCE] = "performance "; for (auto i = begin; i != end; ++i) { @@ -813,7 +813,7 @@ TestRunnerImpl::PrintTestTypeList() const { NS_LOG_FUNCTION(this); std::cout << " core: Run all TestSuite-based tests (exclude examples)" << std::endl; - std::cout << " example: Examples (to see if example programs run successfully)" + std::cout << " example-as-test: Examples (to see if example programs run successfully)" << std::endl; std::cout << " performance: Performance Tests (check to see if the system is as fast as expected)" diff --git a/test.py b/test.py index 8f271f206..50a988062 100755 --- a/test.py +++ b/test.py @@ -1408,8 +1408,8 @@ def run_tests(): standard_out = standard_out.decode() list_items = standard_out.split("\n") list_items.sort() - print("Test Type Test Name") - print("--------- ---------") + print("Test Type Test Name") + print("--------------- ---------") for item in list_items: if len(item.strip()): print(item) @@ -1425,7 +1425,7 @@ def run_tests(): python_examples_sorted.sort() examples_sorted.extend(python_examples_sorted) for item in examples_sorted: - print("example ", item) + print("example ", item) print() if args.kinds or args.list: