Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/projects/SelfTest/TestMain.cpp
diff options
context:
space:
mode:
authorPhil Nash2015-11-20 16:54:07 +0000
committerPhil Nash2015-11-20 16:54:07 +0000
commitbd8688cded74c858105c8b858e4c5a52a9ce26be (patch)
treec9065bad34baf476780ba10745890c6f7d8f330e /projects/SelfTest/TestMain.cpp
parentc70170e90437a224a22176a8b01b11dd5f2c3d15 (diff)
downloadcatch3-bd8688cded74c858105c8b858e4c5a52a9ce26be.tar.gz
Added support for manually registering test functions.
As discussed in #421
Diffstat (limited to 'projects/SelfTest/TestMain.cpp')
-rw-r--r--projects/SelfTest/TestMain.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp
index bffc7e77..1713b51a 100644
--- a/projects/SelfTest/TestMain.cpp
+++ b/projects/SelfTest/TestMain.cpp
@@ -449,3 +449,13 @@ TEST_CASE( "Long text is truncted", "[Text][Truncated]" ) {
CHECK_THAT( t.toString(), EndsWith( "... message truncated due to excessive size" ) );
}
+
+inline void manuallyRegisteredTestFunction() {
+ SUCCEED( "was called" );
+}
+struct AutoTestReg {
+ AutoTestReg() {
+ REGISTER_TEST_CASE( manuallyRegisteredTestFunction, "ManuallyRegistered", "" );
+ }
+};
+AutoTestReg autoTestReg;