Teuchos - Trilinos Tools Package Version of the Day
Loading...
Searching...
No Matches
Teuchos_TestingHelpers.cpp
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
11#include "Teuchos_toString.hpp"
12
13
14namespace {
15
16
17// Make sure this is initialized whenever needed before main starts!
18bool& showTestFailureLocationImpl()
19{
20 static bool showTFL = false;
21 return showTFL;
22}
23
24
25} // namespace
26
27
28const std::string
30 const std::string &file, const int lineNumber)
31{
32 std::string rtn = passfail(result);
34 rtn += " ==> "+file+":"+toString(lineNumber);
35 }
36 return rtn;
37}
38
39
44
45
Utilities to make writing tests easier.
Smart reference counting pointer class for automatic garbage collection.
TEUCHOSCORE_LIB_DLL_EXPORT const std::string passfail_with_location(const bool result, const std::string &file, const int lineNumber)
Helper function for TEUCHOS_PASS_FAIL(...).
bool showTestFailureLocation()
Return if TEUCHOS_PASS_FAIL(...) should print test failure location.
const std::string passfail(const bool result)
Return "passed" or "failed".
void showTestFailureLocation(bool)
Set if TEUCHOS_PASS_FAIL(...) should print test failure location.