Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
flatbuffers
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
flatbuffers
Commits
dd85c3b7
Commit
dd85c3b7
authored
Apr 08, 2019
by
Vladimir Glavnyy
Committed by
Wouter van Oortmerssen
Apr 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable MSVC assert report box [Abort|Retry|Ignore] if a debugger is present (#5279)
parent
94cb1ff9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
test_assert.cpp
tests/test_assert.cpp
+9
-4
No files found.
tests/test_assert.cpp
View file @
dd85c3b7
...
...
@@ -4,6 +4,7 @@
#ifdef _MSC_VER
# include <crtdbg.h>
# include <windows.h>
#endif
int
testing_fails
=
0
;
...
...
@@ -43,15 +44,19 @@ void InitTestEngine(TestFailEventListener listener) {
// clang-format off
#ifdef _MSC_VER
// Send all reports to STDOUT.
// By default, send all reports to STDOUT to prevent CI hangs.
// Enable assert report box [Abort|Retry|Ignore] if a debugger is present.
const
int
dbg_mode
=
(
_CRTDBG_MODE_FILE
|
_CRTDBG_MODE_DEBUG
)
|
(
IsDebuggerPresent
()
?
_CRTDBG_MODE_WNDW
:
0
);
(
void
)
dbg_mode
;
// release mode fix
// CrtDebug reports to _CRT_WARN channel.
_CrtSetReportMode
(
_CRT_WARN
,
_CRTDBG_MODE_FILE
|
_CRTDBG_MODE_DEBUG
);
_CrtSetReportMode
(
_CRT_WARN
,
dbg_mode
);
_CrtSetReportFile
(
_CRT_WARN
,
_CRTDBG_FILE_STDOUT
);
// The assert from <assert.h> reports to _CRT_ERROR channel
_CrtSetReportMode
(
_CRT_ERROR
,
_CRTDBG_MODE_FILE
|
_CRTDBG_MODE_DEBUG
);
_CrtSetReportMode
(
_CRT_ERROR
,
dbg_mode
);
_CrtSetReportFile
(
_CRT_ERROR
,
_CRTDBG_FILE_STDOUT
);
// Internal CRT assert channel?
_CrtSetReportMode
(
_CRT_ASSERT
,
_CRTDBG_MODE_FILE
|
_CRTDBG_MODE_DEBUG
);
_CrtSetReportMode
(
_CRT_ASSERT
,
dbg_mode
);
_CrtSetReportFile
(
_CRT_ASSERT
,
_CRTDBG_FILE_STDOUT
);
#endif
...
...
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