A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
example-as-test.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2020 Lawrence Livermore National Laboratory
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Author: Peter D. Barnes, Jr. <pdbarnes@llnl.gov>
18
*/
19
20
#ifndef NS3_EXAMPLE_AS_TEST_SUITE_H
21
#define NS3_EXAMPLE_AS_TEST_SUITE_H
22
23
#include "ns3/test.h"
24
25
#include <string>
26
34
namespace
ns3
35
{
36
48
class
ExampleAsTestCase
:
public
TestCase
49
{
50
public
:
68
ExampleAsTestCase
(
const
std::string name,
69
const
std::string program,
70
const
std::string dataDir,
71
const
std::string
args
=
""
);
72
74
~ExampleAsTestCase
()
override
;
75
82
virtual
std::string
GetCommandTemplate
()
const
;
83
93
virtual
std::string
GetPostProcessingCommand
()
const
;
94
95
// Inherited
96
void
DoRun
()
override
;
97
98
protected
:
99
std::string
m_program
;
100
std::string
m_dataDir
;
101
std::string
m_args
;
103
};
// class ExampleAsTestCase
104
195
class
ExampleAsTestSuite
:
public
TestSuite
196
{
197
public
:
203
ExampleAsTestSuite
(
const
std::string name,
204
const
std::string program,
205
const
std::string dataDir,
206
const
std::string
args
=
""
,
207
const
TestDuration
duration =
QUICK
);
208
};
// class ExampleAsTestSuite
209
210
}
// namespace ns3
211
212
#endif
/* NS3_EXAMPLE_TEST_SUITE_H */
ns3::ExampleAsTestCase
Execute an example program as a test, by comparing the output to a reference file.
Definition:
example-as-test.h:49
ns3::ExampleAsTestCase::ExampleAsTestCase
ExampleAsTestCase(const std::string name, const std::string program, const std::string dataDir, const std::string args="")
Constructor.
ns3::ExampleAsTestCase::DoRun
void DoRun() override
Implementation to actually run this TestCase.
ns3::ExampleAsTestCase::GetPostProcessingCommand
virtual std::string GetPostProcessingCommand() const
Customization point for tests requiring post-processing of stdout.
ns3::ExampleAsTestCase::m_args
std::string m_args
Any additional arguments to the program.
Definition:
example-as-test.h:101
ns3::ExampleAsTestCase::m_dataDir
std::string m_dataDir
The source directory for the test.
Definition:
example-as-test.h:100
ns3::ExampleAsTestCase::GetCommandTemplate
virtual std::string GetCommandTemplate() const
Customization point for more complicated patterns to invoke the example program.
ns3::ExampleAsTestCase::m_program
std::string m_program
The program to run.
Definition:
example-as-test.h:99
ns3::ExampleAsTestCase::~ExampleAsTestCase
~ExampleAsTestCase() override
Destructor.
ns3::ExampleAsTestSuite
Execute an example program as a test suite.
Definition:
example-as-test.h:196
ns3::ExampleAsTestSuite::ExampleAsTestSuite
ExampleAsTestSuite(const std::string name, const std::string program, const std::string dataDir, const std::string args="", const TestDuration duration=QUICK)
Constructor.
ns3::TestCase
encapsulates test code
Definition:
test.h:1060
ns3::TestCase::TestDuration
TestDuration
How long the test takes to execute.
Definition:
test.h:1064
ns3::TestCase::QUICK
@ QUICK
Fast test.
Definition:
test.h:1065
ns3::TestSuite
A suite of tests to run.
Definition:
test.h:1256
check-style-clang-format.args
args
Definition:
check-style-clang-format.py:675
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
core
model
example-as-test.h
Generated on Tue Nov 1 2022 22:59:46 for ns-3 by
1.9.3