From e312d69ab32cca3b9b78345ea65419a0f137547a Mon Sep 17 00:00:00 2001 From: Tommaso Pecorella Date: Mon, 23 Jan 2023 16:47:18 -0600 Subject: [PATCH] core: (fixes #578): test-runner exits if no TestSuite is specified --- CHANGES.md | 1 + RELEASE_NOTES.md | 1 + src/core/model/test.cc | 8 +++++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index edf0c6de1..1f79c657a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -32,6 +32,7 @@ Changes from ns-3.37 to ns-3.38 * (lr-wpan) Add file `src/lr-wpan/model/lr-wpan-constants.h` with common constants of the LR-WPAN module. * (lr-wpan) Remove the functions `LrWpanCsmaCa::GetUnitBackoffPeriod()` and `LrWpanCsmaCa::SetUnitBackoffPeriod()`, and move the constant `m_aUnitBackoffPeriod` to `src/lr-wpan/model/lr-wpan-constants.h`. * (lr-wpan) Adds beacon payload handle support (MLME-SET.request) in **LrWpanMac**. +* (core) Now test-runner exits if no TestSuite is specified. ### Changes to build system diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index ab93dbd1f..1f4ecef9c 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -25,6 +25,7 @@ Release 3-dev - (core) !1236 - Added some macros to silence compiler warnings. The new macros are in **warnings.h**, and their use is not suggested unless for very specific cases. - (internet-apps) - A new Ping model that works for both IPv4 and IPv6 has been added, to replace the address family specific v4Ping and Ping6. - (lr-wpan) !1268 - Adding beacon payload now its possible using MLME-SET.request primitive. +- (core) !1302 - Now test-runner exits if no TestSuite is specified. ### Bugs fixed diff --git a/src/core/model/test.cc b/src/core/model/test.cc index cb268ba64..c11094d71 100644 --- a/src/core/model/test.cc +++ b/src/core/model/test.cc @@ -1083,11 +1083,17 @@ TestRunnerImpl::Run(int argc, char* argv[]) // let's run our tests now. bool failed = false; - if (tests.size() == 0) + if (tests.empty()) { std::cerr << "Error: no tests match the requested string" << std::endl; return 1; } + else if (tests.size() > 1) + { + std::cerr << "Error: tests should be launched separately (one at a time)" << std::endl; + return 1; + } + for (std::list::const_iterator i = tests.begin(); i != tests.end(); ++i) { TestCase* test = *i;