From 0781d0f5df9aee336e3b6b6de4143c2e2f83e6ad Mon Sep 17 00:00:00 2001 From: Nick White Date: Sun, 14 Nov 2010 22:57:42 +0000 Subject: Make clear that test is webkit specific --- Makefile | 6 ++++-- tests/runtest.sh | 26 -------------------------- tests/webkittest.sh | 26 ++++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 28 deletions(-) delete mode 100755 tests/runtest.sh create mode 100755 tests/webkittest.sh diff --git a/Makefile b/Makefile index 5bfc273..b5fc205 100644 --- a/Makefile +++ b/Makefile @@ -47,10 +47,12 @@ crx: simplyread.js chromium/icon.svg chromium/manifest.json chromium/background. gpg -b < $(NAME)-$(VERSION).crx > $(NAME)-$(VERSION).crx.sig echo $(NAME)-$(VERSION).crx $(NAME)-$(VERSION).crx.sig +# note that tests require a patched surf browser; see tests/runtest.sh test: for i in tests/html/*.html; do \ - sh tests/runtest.sh $$i $$i.simple 1>$$i.diff 2>/dev/null; \ - test $$? -eq 0 && echo $$i passed || echo "$$i failed (see $$i.diff)"; \ + sh tests/webkittest.sh $$i $$i.simple 1>$$i.diff 2>/dev/null; \ + test $$? -eq 0 && echo "$$i passed (webkit)" \ + || echo "$$i failed (webkit) (see $$i.diff)"; \ test ! -s $$i.diff && rm $$i.diff; \ done diff --git a/tests/runtest.sh b/tests/runtest.sh deleted file mode 100755 index d3e8887..0000000 --- a/tests/runtest.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh -# -# This test requires surf from http://surf.suckless.org, -# patched with surfuri_js.patch - -test $# -ne 2 && echo usage $0 testhtml expectedoutput && exit 1 - -testjs=tests/showsimple.js -htmlloadtime=2 -scriptloadtime=2 - -surf -x "file://./$1" > testxid 2>testoutput & -pid=$! -sleep $htmlloadtime -xid=`cat testxid` -xprop -id $xid -f _SURF_GO 8t -set _SURF_GO "javascript:`cat $testjs`" -sleep $scriptloadtime -kill $pid - -sed 's/^\*\* Message:[^<]*//g' < testoutput > testoutputbody - -diff "$2" testoutputbody -result=$? - -rm -f testxid testoutput testoutputbody -exit $result diff --git a/tests/webkittest.sh b/tests/webkittest.sh new file mode 100755 index 0000000..d3e8887 --- /dev/null +++ b/tests/webkittest.sh @@ -0,0 +1,26 @@ +#!/bin/sh +# +# This test requires surf from http://surf.suckless.org, +# patched with surfuri_js.patch + +test $# -ne 2 && echo usage $0 testhtml expectedoutput && exit 1 + +testjs=tests/showsimple.js +htmlloadtime=2 +scriptloadtime=2 + +surf -x "file://./$1" > testxid 2>testoutput & +pid=$! +sleep $htmlloadtime +xid=`cat testxid` +xprop -id $xid -f _SURF_GO 8t -set _SURF_GO "javascript:`cat $testjs`" +sleep $scriptloadtime +kill $pid + +sed 's/^\*\* Message:[^<]*//g' < testoutput > testoutputbody + +diff "$2" testoutputbody +result=$? + +rm -f testxid testoutput testoutputbody +exit $result -- cgit v1.2.3