9#include "ns3/example-as-test.h"
32 const std::string program,
33 const std::string dataDir,
35 const std::string args =
"",
36 const bool shouldNotErr =
true);
65 const std::string program,
66 const std::string dataDir,
68 const std::string args ,
69 const bool shouldNotErr )
86 std::string command(
"| grep TEST | sort ");
104 const std::string program,
105 const std::string dataDir,
107 const std::string args =
"",
109 const bool shouldNotErr =
true)
120 "simple-distributed-mpi-comm",
124 "simple-distributed-mpi-comm",
129 "simple-distributed-mpi-comm",
134 "simple-distributed-empty-node",
138 "simple-distributed-empty-node",
142 "simple-distributed",
149 "simple-distributed",
154 "simple-distributed-empty-node",
159 "simple-distributed-empty-node",
This version of ns3::ExampleTestCase is specialized for MPI by accepting the number of ranks as a par...
std::string GetCommandTemplate() const override
Produce the --command-template argument which will invoke mpiexec with the requested number of ranks.
MpiTestCase(const std::string name, const std::string program, const std::string dataDir, const int ranks, const std::string args="", const bool shouldNotErr=true)
Constructor.
~MpiTestCase() override
Destructor.
std::string GetPostProcessingCommand() const override
Sort the output from parallel execution.
int m_ranks
The number of ranks.
MPI specialization of ns3::ExampleTestSuite.
MpiTestSuite(const std::string name, const std::string program, const std::string dataDir, const int ranks, const std::string args="", const Duration duration=Duration::QUICK, const bool shouldNotErr=true)
Constructor.
Execute an example program as a test, by comparing the output to a reference file.
std::string m_args
Any additional arguments to the program.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
Duration
How long the test takes to execute.
static constexpr auto EXAMPLE
static MpiTestSuite g_mpiSimple2("mpi-example-simple-2", "simple-distributed", NS_TEST_SOURCEDIR, 2)
static MpiTestSuite g_mpiNms2("mpi-example-nms-2", "nms-p2p-nix-distributed", NS_TEST_SOURCEDIR, 2)
static MpiTestSuite g_mpiComm2("mpi-example-comm-2", "simple-distributed-mpi-comm", NS_TEST_SOURCEDIR, 2)
static MpiTestSuite g_mpiEmpty2NullMsg("mpi-example-empty-2-nullmsg", "simple-distributed-empty-node", NS_TEST_SOURCEDIR, 2, "-nullmsg")
static MpiTestSuite g_mpiEmpty3NullMsg("mpi-example-empty-3-nullmsg", "simple-distributed-empty-node", NS_TEST_SOURCEDIR, 3, "-nullmsg")
static MpiTestSuite g_mpiComm3comm("mpi-example-comm-3-init", "simple-distributed-mpi-comm", NS_TEST_SOURCEDIR, 3, "--init")
static MpiTestSuite g_mpiComm2comm("mpi-example-comm-2-init", "simple-distributed-mpi-comm", NS_TEST_SOURCEDIR, 2, "--init")
static MpiTestSuite g_mpiEmpty3("mpi-example-empty-3", "simple-distributed-empty-node", NS_TEST_SOURCEDIR, 3)
static MpiTestSuite g_mpiEmpty2("mpi-example-empty-2", "simple-distributed-empty-node", NS_TEST_SOURCEDIR, 2)
static MpiTestSuite g_mpiSimple2NullMsg("mpi-example-simple-2-nullmsg", "simple-distributed", NS_TEST_SOURCEDIR, 2, "--nullmsg")
static MpiTestSuite g_mpiThird2("mpi-example-third-2", "third-distributed", NS_TEST_SOURCEDIR, 2)
Every class exported by the ns3 library is enclosed in the ns3 namespace.