summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/library.at11
-rw-r--r--tests/test-util.c5
2 files changed, 13 insertions, 3 deletions
diff --git a/tests/library.at b/tests/library.at
index a94ee5c4e..a5dfd82ba 100644
--- a/tests/library.at
+++ b/tests/library.at
@@ -175,9 +175,14 @@ AT_CLEANUP
AT_SETUP([ovs_assert])
OVS_LOGDIR=`pwd`; export OVS_LOGDIR
-AT_CHECK([ovstest test-util -voff -vfile:info '-vPATTERN:file:%c|%p|%m' --log-file assert || kill -l $?],
- [0], [ABRT
-], [stderr])
+if test "$IS_WIN32" = "yes"; then
+ exit_status=9
+else
+ # SIGABRT + 128
+ exit_status=134
+fi
+AT_CHECK([ovstest test-util -voff -vfile:info '-vPATTERN:file:%c|%p|%m' --log-file assert],
+ [$exit_status], [], [stderr])
AT_CHECK([sed 's/\(opened log file\) .*/\1/
s/|[[^|]]*: /|/' test-util.log], [0], [dnl
diff --git a/tests/test-util.c b/tests/test-util.c
index ffd4dcefd..202f8d0fc 100644
--- a/tests/test-util.c
+++ b/tests/test-util.c
@@ -1086,6 +1086,11 @@ test_util_main(int argc, char *argv[])
{
set_program_name(argv[0]);
parse_options(argc, argv);
+ /* On Windows, stderr is fully buffered if connected to a pipe.
+ * Make it _IONBF so that an abort does not miss log contents.
+ * POSIX doesn't define the circumstances in which stderr is
+ * fully buffered either. */
+ setvbuf(stderr, NULL, _IONBF, 0);
run_command(argc - optind, argv + optind, commands);
}