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
/* -*- 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
#ifndef NS3_EXAMPLE_AS_TEST_SUITE_H
22
#define NS3_EXAMPLE_AS_TEST_SUITE_H
23
24
#include "ns3/test.h"
25
26
#include <string>
27
35
namespace
ns3
{
36
37
49
class
ExampleAsTestCase
:
public
TestCase
50
{
51
public
:
69
ExampleAsTestCase
(
const
std::string name,
70
const
std::string program,
71
const
std::string dataDir,
72
const
std::string args =
""
);
73
75
virtual
~ExampleAsTestCase
(
void
);
76
83
virtual
std::string
GetCommandTemplate
(
void
)
const
;
84
94
virtual
std::string
GetPostProcessingCommand
(
void
)
const
;
95
96
// Inherited
97
virtual
void
DoRun
(
void
);
98
99
protected
:
100
std::string
m_program
;
101
std::string
m_dataDir
;
102
std::string
m_args
;
104
};
// class ExampleAsTestCase
105
196
class
ExampleAsTestSuite
:
public
TestSuite
197
{
198
public
:
204
ExampleAsTestSuite
(
const
std::string name,
205
const
std::string program,
206
const
std::string dataDir,
207
const
std::string args =
""
,
208
const
TestDuration
duration =
QUICK
);
209
};
// class ExampleAsTestSuite
210
211
212
}
// namespace ns3
213
214
#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:50
ns3::ExampleAsTestCase::ExampleAsTestCase
ExampleAsTestCase(const std::string name, const std::string program, const std::string dataDir, const std::string args="")
Constructor.
ns3::ExampleAsTestCase::GetCommandTemplate
virtual std::string GetCommandTemplate(void) const
Customization point for more complicated patterns to invoke the example program.
ns3::ExampleAsTestCase::GetPostProcessingCommand
virtual std::string GetPostProcessingCommand(void) 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:102
ns3::ExampleAsTestCase::m_dataDir
std::string m_dataDir
The source directory for the test.
Definition:
example-as-test.h:101
ns3::ExampleAsTestCase::~ExampleAsTestCase
virtual ~ExampleAsTestCase(void)
Destructor.
ns3::ExampleAsTestCase::DoRun
virtual void DoRun(void)
Implementation to actually run this TestCase.
ns3::ExampleAsTestCase::m_program
std::string m_program
The program to run.
Definition:
example-as-test.h:100
ns3::ExampleAsTestSuite
Execute an example program as a test suite.
Definition:
example-as-test.h:197
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:994
ns3::TestCase::TestDuration
TestDuration
How long the test takes to execute.
Definition:
test.h:998
ns3::TestCase::QUICK
@ QUICK
Fast test.
Definition:
test.h:999
ns3::TestSuite
A suite of tests to run.
Definition:
test.h:1188
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
core
model
example-as-test.h
Generated on Tue Feb 6 2024 19:21:16 for ns-3 by
1.9.1