-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Foundation for testing for user errors (#200)
This adds a new dummy testing TriBITS package PkgWithUserErrors that will be used to test for user errors. In following commits, we will optionally break this various ways!
- Loading branch information
1 parent
d03fdde
commit cfb441b
Showing
10 changed files
with
116 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
test/core/ExamplesUnitTests/PkgWithUserErrors/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
TRIBITS_PACKAGE(PkgWithUserErrors) | ||
|
||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
||
TRIBITS_ADD_LIBRARY( | ||
pkgwithusererrors | ||
HEADERS PkgWithUserErrorsLib.hpp | ||
SOURCES PkgWithUserErrorsLib.cpp | ||
) | ||
|
||
TRIBITS_ADD_TEST_DIRECTORIES(test) | ||
|
||
TRIBITS_PACKAGE_POSTPROCESS() |
3 changes: 3 additions & 0 deletions
3
test/core/ExamplesUnitTests/PkgWithUserErrors/PackagesList.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
TRIBITS_REPOSITORY_DEFINE_PACKAGES( | ||
PkgWithUserErrors . PT | ||
) |
6 changes: 6 additions & 0 deletions
6
test/core/ExamplesUnitTests/PkgWithUserErrors/PkgWithUserErrorsLib.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include "PkgWithUserErrorsLib.hpp" | ||
|
||
std::string PkgWithUserErrors::theThing() | ||
{ | ||
return "PkgWithUserErrorsThing"; | ||
} |
12 changes: 12 additions & 0 deletions
12
test/core/ExamplesUnitTests/PkgWithUserErrors/PkgWithUserErrorsLib.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#ifndef PKGWITHUSSERERRORSLIB_HPP_ | ||
#define PKGWITHUSSERERRORSLIB_HPP_ | ||
|
||
#include <string> | ||
|
||
namespace PkgWithUserErrors { | ||
|
||
std::string theThing(); | ||
|
||
} | ||
|
||
#endif /* PKGWITHUSSERERRORSLIB_HPP_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
================ | ||
TargetDefinesPkg | ||
================ | ||
|
||
The purpose of this package is to demonstrate and test the usage of the | ||
TRIBITS_ADD_EXECUTABLE() TARGET_DEFINES argument and to show the bad behavior | ||
of the old DEFINES argument. | ||
|
||
See GitHub TriBITS Issue #90 for more details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
TRIBITS_REPOSITORY_DEFINE_TPLS() |
1 change: 1 addition & 0 deletions
1
test/core/ExamplesUnitTests/PkgWithUserErrors/cmake/Dependencies.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
TRIBITS_PACKAGE_DEFINE_DEPENDENCIES() |
6 changes: 6 additions & 0 deletions
6
test/core/ExamplesUnitTests/PkgWithUserErrors/test/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
TRIBITS_ADD_EXECUTABLE_AND_TEST( PkgWithUserErrorsTest | ||
SOURCES PkgWithUserErrorsTest.cpp | ||
NUM_MPI_PROCS 1 | ||
PASS_REGULAR_EXPRESSION | ||
"PkgWithUserErrorsLib returns PkgWithUserErrorsThing" | ||
) |
9 changes: 9 additions & 0 deletions
9
test/core/ExamplesUnitTests/PkgWithUserErrors/test/PkgWithUserErrorsTest.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#include <iostream> | ||
|
||
#include "PkgWithUserErrorsLib.hpp" | ||
|
||
int main() { | ||
std::cout << "PkgWithUserErrorsLib returns " | ||
<< PkgWithUserErrors::theThing() << "\n"; | ||
return 0; | ||
} |