]> git.ozlabs.org Git - ccan/blobdiff - ccan_tools/test_all.sh
Include all the tools under ccan_tools dir, hacked to work for me.
[ccan] / ccan_tools / test_all.sh
diff --git a/ccan_tools/test_all.sh b/ccan_tools/test_all.sh
new file mode 100755 (executable)
index 0000000..3c65c21
--- /dev/null
@@ -0,0 +1,22 @@
+#! /bin/sh
+
+# First, test normal config.
+if ! make -s; then
+    echo Normal config failed.
+    exit 1
+fi
+
+# Now, remove one HAVE_ at a time.
+cp config.h original-config.h
+trap "mv original-config.h config.h && rm -f .newconfig" EXIT
+
+while grep -q '1$' config.h; do
+    tr '\012' @ < config.h | sed 's/1@/0@/' | tr @ '\012' > .newconfig
+    diff -u config.h .newconfig
+    mv .newconfig config.h
+    if ! make -s; then
+       echo Failed config:
+       cat config.h
+       exit 1
+    fi
+done