Teuchos - Trilinos Tools Package Version of the Day
Loading...
Searching...
No Matches
Teuchos_UnitTestRepository.hpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// Teuchos: Common Tools Package
4//
5// Copyright 2004 NTESS and the Teuchos contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#ifndef TEUCHOS_UNIT_TEST_REPOSITORY_HPP
11#define TEUCHOS_UNIT_TEST_REPOSITORY_HPP
12
13
17
18
19#include "Teuchos_FancyOStream.hpp"
21#include "Teuchos_Ptr.hpp"
22
23
24namespace Teuchos {
25
26
27class UnitTestBase;
28
29
31
32
41class TEUCHOSCORE_LIB_DLL_EXPORT UnitTestRepository {
42public:
43
46
48 static void setGloballyReduceTestResult(const bool globallyReduceUnitTestResult);
49
51 static bool getGloballyReduceTestResult();
52
54 static bool runUnitTests(FancyOStream &out);
55
60 static int runUnitTestsFromMain(int argc, char* argv[]);
61
66 static void addUnitTest(UnitTestBase *unitTest, const std::string groupName,
67 const std::string testName);
68
76 static bool verboseUnitTests();
77
78private:
79
80 UnitTestRepository();
81
82 static void setUpCLP(const Ptr<CommandLineProcessor>& clp);
83
84 class InstanceData;
85
86 static InstanceData& getData();
87
88 static bool runUnitTestImpl(const UnitTestBase &unitTest, FancyOStream &out);
89
90};
91
92
93} // namespace Teuchos
94
95
96#endif // TEUCHOS_UNIT_TEST_REPOSITORY_HPP
Macro that adds <<std member comp>> members as attribute members for any class.
Class that helps parse command line input arguments from (argc,argv[]) and set options.
Simple wrapper class for raw pointers to single objects where no persisting relationship exists.
Unit test base class.
static bool verboseUnitTests()
Returns if unit tests are verbose or not.
static bool runUnitTests(FancyOStream &out)
Run the registered unit tests.
static bool getGloballyReduceTestResult()
Get if the unit tests should reduce across processes or not.
static CommandLineProcessor & getCLP()
Return the CLP to add options to.
static int runUnitTestsFromMain(int argc, char *argv[])
Run the unit tests from main() passing in (argc, argv).
static void addUnitTest(UnitTestBase *unitTest, const std::string groupName, const std::string testName)
Add an unit test (called indirectly through macros.
static void setGloballyReduceTestResult(const bool globallyReduceUnitTestResult)
Set if the unit tests should reduce pass/fail across processes.
basic_FancyOStream< char > FancyOStream
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...