Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
0bccb735
Commit
0bccb735
authored
Aug 25, 2011
by
neverlord
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
catch exceptions of unit tests
parent
13a37636
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
4 deletions
+19
-4
unit_testing/main.cpp
unit_testing/main.cpp
+19
-4
No files found.
unit_testing/main.cpp
View file @
0bccb735
...
...
@@ -17,30 +17,45 @@
#include "cppa/tuple.hpp"
#include "cppa/config.hpp"
#include "cppa/detail/demangle.hpp"
#include "cppa/uniform_type_info.hpp"
#include "cppa/process_information.hpp"
#include "cppa/detail/mock_scheduler.hpp"
#include "cppa/detail/task_scheduler.hpp"
#include "cppa/detail/thread_pool_scheduler.hpp"
#define CPPA_TEST_CATCH_BLOCK() \
catch (std::exception& e) \
{ \
std::cerr << "test exited after throwing an instance of \"" \
<< ::cppa::detail::demangle(typeid(e).name()) \
<< "\"\n what(): " << e.what() << std::endl; \
errors += 1; \
} \
catch (...) \
{ \
std::cerr << "test exited because of an unknown exception" << std::endl; \
errors += 1; \
}
#define RUN_TEST(fun_name) \
std::cout << "run " << #fun_name << " ..." << std::endl; \
errors += fun_name ();
\
try { errors += fun_name (); } CPPA_TEST_CATCH_BLOCK()
\
std::cout << std::endl
#define RUN_TEST_A1(fun_name, arg1) \
std::cout << "run " << #fun_name << " ..." << std::endl; \
errors += fun_name ((arg1));
\
try { errors += fun_name ((arg1)); } CPPA_TEST_CATCH_BLOCK()
\
std::cout << std::endl
#define RUN_TEST_A2(fun_name, arg1, arg2) \
std::cout << "run " << #fun_name << " ..." << std::endl; \
errors += fun_name ((arg1), (arg2));
\
try { errors += fun_name ((arg1), (arg2)); } CPPA_TEST_CATCH_BLOCK()
\
std::cout << std::endl
#define RUN_TEST_A3(fun_name, arg1, arg2, arg3) \
std::cout << "run " << #fun_name << " ..." << std::endl; \
errors += fun_name ((arg1), (arg2), (arg3));
\
try { errors += fun_name ((arg1), (arg2), (arg3)); } CPPA_TEST_CATCH_BLOCK()
\
std::cout << std::endl
using
std
::
cout
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment