20 #include "ns3/example-as-test.h"
43 const std::string program,
44 const std::string dataDir,
46 const std::string
args =
"",
47 const bool shouldNotErr =
true);
60 std::string GetCommandTemplate()
const override;
68 std::string GetPostProcessingCommand()
const override;
76 const std::string program,
77 const std::string dataDir,
79 const std::string
args ,
80 const bool shouldNotErr )
97 std::string command(
"| grep TEST | sort ");
115 const std::string program,
116 const std::string dataDir,
118 const std::string
args =
"",
120 const bool shouldNotErr =
true)
131 "simple-distributed-mpi-comm",
135 "simple-distributed-mpi-comm",
140 "simple-distributed-mpi-comm",
145 "simple-distributed-empty-node",
149 "simple-distributed-empty-node",
153 "simple-distributed",
160 "simple-distributed",
165 "simple-distributed-empty-node",
170 "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 TestDuration 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.
TestDuration
How long the test takes to execute.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
@ EXAMPLE
This test suite implements an Example Test.
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.