]> arthur.barton.de Git - bup.git/blobdiff - test/ext/test-web
Teach pytest to handle WVSKIP and use it where we can
[bup.git] / test / ext / test-web
index eab092c1caa802826a3c704a00862724882bd048..7349890b9a235891a91d8d3c027023e1697a9cf9 100755 (executable)
@@ -27,21 +27,20 @@ wait-for-server-start()
 
 WVPASS cd "$tmpdir"
 
-# FIXME: add WVSKIP
 if test -z "$(type -p curl)"; then
-    WVSTART 'curl does not appear to be installed; skipping  test'
+    WVSKIP 'curl does not appear to be installed; skipping test'
     exit 0
 fi
     
 WVPASS bup-cfg-py -c "import socket as s; s.socket(s.AF_UNIX).bind('socket')"
 curl -s --unix-socket ./socket http://localhost/foo
 if test $? -ne 7; then
-    WVSTART 'curl does not appear to support --unix-socket; skipping test'
+    WVSKIP 'curl does not appear to support --unix-socket; skipping test'
     exit 0
 fi
 
 if ! bup-python -c 'import tornado' 2> /dev/null; then
-    WVSTART 'unable to import tornado; skipping test'
+    WVSKIP 'unable to import tornado; skipping test'
     exit 0
 fi
 
@@ -53,8 +52,10 @@ WVPASS echo -e 'whee \x80\x90\xff' > "$(echo -ne 'src/whee \x80\x90\xff')"
 WVPASS bup index src
 WVPASS bup save -n '¡excitement!' --strip src
 
-"$TOP/bup" web unix://socket &
+"$TOP/bup" web unix://socket </dev/null >bup-web.log 2>&1 &
 web_pid=$!
+# output the log if something fails
+trap 'cat bup-web.log' EXIT
 wait-for-server-start
 
 WVPASS curl --unix-socket ./socket \
@@ -69,4 +70,5 @@ WVPASS cmp "$(echo -ne 'src/whee \x80\x90\xff')" result2
 WVPASS kill -s TERM "$web_pid"
 WVPASS wait "$web_pid"
 
+trap - EXIT
 WVPASS rm -r "$tmpdir"