#249: add 'test-desert-island', to assert that a tahoe-deps.tar.gz -enabled build...
authorBrian Warner <warner@lothar.com>
Wed, 17 Sep 2008 01:37:02 +0000 (18:37 -0700)
committerBrian Warner <warner@lothar.com>
Wed, 17 Sep 2008 01:37:02 +0000 (18:37 -0700)
Makefile
misc/check-build.py [new file with mode: 0644]

index 8f605ed6692acf41f726db2c9f8fc26119c41081..d262b5e712861f966570a4ef6ce048c6e9b3806c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -245,6 +245,18 @@ clean:
 find-trailing-spaces:
        $(PYTHON) misc/find-trailing-spaces.py -r src
 
+# The test-desert-island target grabs the tahoe-deps tarball, unpacks it,
+# does a build, then asserts that the build did not try to download anything
+# as it ran. Invoke this on a new tree, or after a 'clean', to make sure the
+# support/lib/ directory is gone.
+
+test-desert-island:
+       wget http://allmydata.org/source/tahoe/tarballs/tahoe-deps.tar.gz
+       tar xf tahoe-deps.tar.gz
+       $(MAKE) 2>&1 | tee make.out
+       $(PYTHON) misc/check-build.py make.out no-downloads
+
+
 # TARBALL GENERATION
 .PHONY: tarballs upload-tarballs
 tarballs:
diff --git a/misc/check-build.py b/misc/check-build.py
new file mode 100644 (file)
index 0000000..1e6e9c5
--- /dev/null
@@ -0,0 +1,22 @@
+#! /usr/bin/env python
+
+# This helper script is used with the 'test-desert-island' Makefile target.
+
+import sys
+
+good = True
+build_out = sys.argv[1]
+mode = sys.argv[2]
+
+for line in open(build_out, "r"):
+    if mode == "no-downloads" and "downloading" in line.lower():
+        print line,
+        good = False
+if good:
+    if mode == "no-downloads":
+        print "Good: build did not try to download any files"
+    sys.exit(0)
+else:
+    if mode == "no-downloads":
+        print "Failed: build tried to download files"
+    sys.exit(1)