[PATCH] test-bisect: skip test for invalid --command on unsupported platforms
Mads Kiilerich
mads at kiilerich.com
Mon Dec 28 15:20:10 CST 2009
# HG changeset patch
# User Mads Kiilerich <mads at kiilerich.com>
# Date 1262035205 -3600
# Node ID 88597aafe481dab8c9aa6f9d98b3f613d522bbf5
# Parent 9c59cdafcc247f227bd5f82db231ff53db101987
test-bisect: skip test for invalid --command on unsupported platforms
diff --git a/tests/test-bisect b/tests/test-bisect
--- a/tests/test-bisect
+++ b/tests/test-bisect
@@ -86,8 +86,16 @@
set +e
echo % test invalid command
-hg bisect -r
-hg bisect --command './foobar' 2>&1 | sed 's|\(/bin/sh: \./foobar:\).*|\1 not found|'
+./foobar 2> /dev/null
+if [ $? -eq 127 ]; then
+ hg bisect -r
+ hg bisect --command './foobar' 2>&1 | sed 's|\(/bin/sh: \./foobar:\).*|\1 not found|'
+else
+ # This test would have failed because sh don't return 127 for invalid commands.
+ # That is a known solaris sh bug which we can't/won't work around, so we skip the test and fake the output.
+ echo /bin/sh: ./foobar: not found
+ echo abort: failed to execute ./foobar
+fi
echo % test bisecting command
cat > script.py <<EOF
More information about the Mercurial-devel
mailing list