[ovs-dev] [PATCH 04/16] test-util: Changes for 'assert' test on Windows.
Gurucharan Shetty
shettyg at nicira.com
Fri May 30 19:06:12 UTC 2014
There is no 'kill -l' type functionality available on Windows.
So instead of looking for the string 'ABRT', check for the exit
code which when run on msys (unit test environment) is 9.
Also, after a call to abort(), on Windows, stderr does not get
flushed to any file. So, do not look for it.
Signed-off-by: Gurucharan Shetty <gshetty at nicira.com>
---
tests/library.at | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/tests/library.at b/tests/library.at
index 7fa7aaf..e3e8df2 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 $?],
+if test "$IS_WIN32" = "yes"; then
+ AT_CHECK([ovstest test-util -voff -vfile:info '-vPATTERN:file:%c|%p|%m' --log-file assert],
+ [9], [], [stderr])
+else
+ AT_CHECK([ovstest test-util -voff -vfile:info '-vPATTERN:file:%c|%p|%m' --log-file assert || kill -l $?],
[0], [ABRT
], [stderr])
+fi
AT_CHECK([sed 's/\(opened log file\) .*/\1/
s/|[[^|]]*: /|/' test-util.log], [0], [dnl
@@ -185,10 +190,11 @@ vlog|INFO|opened log file
util|EMER|assertion false failed in test_assert()
])
-AT_CHECK([sed 's/.*: //
-1q' stderr], [0],
- [assertion false failed in test_assert()
+if test "$IS_WIN32" != "yes"; then
+ AT_CHECK([sed 's/.*: //
+1q' stderr], [0], [assertion false failed in test_assert()
])
+fi
AT_CLEANUP
--
1.7.9.5
More information about the dev
mailing list