A Discrete-Event Network Simulator
API
examples-as-tests-test-suite.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2020 Lawrence Livermore National Laboratory
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Peter D. Barnes, Jr. <pdbarnes@llnl.gov>
19  */
20 
21 #include "ns3/example-as-test.h"
22 #include "ns3/system-path.h"
23 
24 #include <vector>
25 
26 using namespace ns3;
27 
41 namespace ns3 {
42 
43 namespace tests {
49 {
50 public:
52 };
53 
54 
56  : TestSuite ("examples-as-tests-test-suite", UNIT)
57 {
58  AddTestCase (new ExampleAsTestCase ("core-example-simulator", "sample-simulator", NS_TEST_SOURCEDIR));
59 
60  AddTestCase (new ExampleAsTestCase ("core-example-sample-random-variable", "sample-random-variable", NS_TEST_SOURCEDIR));
61 
62  AddTestCase (new ExampleAsTestCase ("core-example-command-line", "command-line-example", NS_TEST_SOURCEDIR));
63 }
64 
71 
79 static ExampleAsTestSuite g_exampleCommandLineTest ("core-example-command-line", "command-line-example", NS_TEST_SOURCEDIR);
80 
81 } // namespace tests
82 
83 } // namespace ns3
84 
85 
86 
87 
88 
A suite of tests to run.
Definition: test.h:1343
static ExamplesAsTestsTestSuite g_examplesAsTestsTestSuite
ExampleAsTestsTestSuite instance variable.
Execute an example program as a test suite.
Run examples as tests, checking stdout for regressions.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Definition: test.cc:299
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Execute an example program as a test, by comparing the output to a reference file.
static ExampleAsTestSuite g_exampleCommandLineTest("core-example-command-line", "command-line-example", NS_TEST_SOURCEDIR)
ExampleTestSuite instance variables.