core: (fixes #578): test-runner exits if no TestSuite is specified

This commit is contained in:
Tommaso Pecorella
2023-01-23 16:47:18 -06:00
committed by Tommaso Pecorella
parent 9664f53884
commit e312d69ab3
3 changed files with 9 additions and 1 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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<TestCase*>::const_iterator i = tests.begin(); i != tests.end(); ++i)
{
TestCase* test = *i;