You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2013/03/13 11:41:02 UTC

svn commit: r1455873 - /subversion/trunk/subversion/tests/svn_test_main.c

Author: rhuijben
Date: Wed Mar 13 10:41:01 2013
New Revision: 1455873

URL: http://svn.apache.org/r1455873
Log:
* subversion/tests/svn_test_main.c
  (includes): Add crtdbg.h on Windows.
  (main): Make the CRT report errors via stderr instead of dialogs
    on Windows to avoid locking up buildbots.

Modified:
    subversion/trunk/subversion/tests/svn_test_main.c

Modified: subversion/trunk/subversion/tests/svn_test_main.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/svn_test_main.c?rev=1455873&r1=1455872&r2=1455873&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/svn_test_main.c (original)
+++ subversion/trunk/subversion/tests/svn_test_main.c Wed Mar 13 10:41:01 2013
@@ -27,6 +27,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <setjmp.h>
+#ifdef WIN32
+#include <crtdbg.h>
+#endif
 
 #include <apr_pools.h>
 #include <apr_general.h>
@@ -395,6 +398,27 @@ main(int argc, const char *argv[])
         prog_name = argv[0];
     }
 
+#ifdef WIN32
+#if _MSC_VER >= 1400
+  /* ### This should work for VC++ 2002 (=1300) and later */
+  /* Show the abort message on STDERR instead of a dialog to allow
+     scripts (e.g. our testsuite) to continue after an abort without
+     user intervention. Allow overriding for easier debugging. */
+  if (!getenv("SVN_CMDLINE_USE_DIALOG_FOR_ABORT"))
+    {
+      /* In release mode: Redirect abort() errors to stderr */
+      _set_error_mode(_OUT_TO_STDERR);
+
+      /* In _DEBUG mode: Redirect all debug output (E.g. assert() to stderr.
+         (Ignored in releas builds) */
+      _CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDERR);
+      _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
+      _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
+      _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
+    }
+#endif /* _MSC_VER >= 1400 */
+#endif
+
   if (err)
     return svn_cmdline_handle_exit_error(err, pool, prog_name);
   while (1)