Skip to content

Commit

Permalink
Merge pull request #39 from JCash/dev
Browse files Browse the repository at this point in the history
Added JCT_IS_DEBUGGER_ATTACHED for easier platform override
  • Loading branch information
JCash authored May 28, 2023
2 parents 8209ec3 + 0f750b8 commit 230daa6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/jc_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -1592,6 +1592,11 @@ void jc_test_exit() {
}
#endif

#ifndef JCT_IS_DEBUGGER_ATTACHED
#define JCT_IS_DEBUGGER_ATTACHED() jct_is_debugger_attached()
#endif


static void jc_test_dbg_break()
{
if (!jc_test_get_state()->break_on_failure)
Expand Down Expand Up @@ -1981,7 +1986,7 @@ static int jct_get_tty_color_support() {

void jc_test_init(int* argc, char** argv) {
jc_test_get_state()->use_colors = (uint32_t)jct_get_tty_color_support();
jc_test_get_state()->break_on_failure = (uint32_t)jct_is_debugger_attached();
jc_test_get_state()->break_on_failure = (uint32_t)JCT_IS_DEBUGGER_ATTACHED();

if (jc_test_parse_commandline(argc, argv)) {
jc_test_usage();
Expand Down Expand Up @@ -2047,6 +2052,7 @@ INSTANTIATE_TEST_CASE_P(EvenValues, MyParamTest, jc_test_values(2,4,6,8,10));
* * Added --test-break-on-fail for breaking into the debugger.
* Can be configured with JC_TEST_DBG_BREAK define.
* * Added automatic check for an attached debugger
* 2023-05-27 * Added JCT_IS_DEBUGGER_ATTACHED for easier overrides
* 0.9 2022-12-22 Fixed proper printout for pointer values
* Minimum version is now C++11 due to usage of <type_traits>
* Removed doctest support
Expand Down

0 comments on commit 230daa6

Please sign in to comment.