]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blobdiff - Makefile
make tests pass with redesigned directory pages
[tahoe-lafs/tahoe-lafs.git] / Makefile
index ac08c2571d282f7ee30d4999fcdff53c7cb40740..a0e055830e8e672798b44c623f4f43fe9c94f16a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -10,15 +10,14 @@ export PYTHON
 # itself. It will also create it in the beginning of the 'develop' command.
 
 TAHOE=$(PYTHON) bin/tahoe
-SOURCES=src/allmydata src/buildtest static misc/build_helpers bin/tahoe-script.template twisted setup.py
+SOURCES=src/allmydata src/buildtest static misc bin/tahoe-script.template twisted setup.py
 
 .PHONY: make-version build
 
-# The 'darcsver' setup.py command comes in the 'darcsver' package:
-# http://pypi.python.org/pypi/darcsver It is necessary only if you want to
-# automatically produce a new _version.py file from the current darcs history.
+# This is necessary only if you want to automatically produce a new
+# _version.py file from the current git/darcs history (without doing a build).
 make-version:
-       $(PYTHON) ./setup.py darcsver --count-all-patches
+       $(PYTHON) ./setup.py update_version
 
 .built:
        $(MAKE) build
@@ -27,25 +26,11 @@ src/allmydata/_version.py:
        $(MAKE) make-version
 
 # It is unnecessary to have this depend on build or src/allmydata/_version.py,
-# since 'setup.py build' always updates the version using 'darcsver --count-all-patches'.
+# since 'setup.py build' always updates the version.
 build:
        $(PYTHON) setup.py build
        touch .built
 
-# 'make install' will do the following:
-#   build+install tahoe (probably to /usr/lib/pythonN.N/site-packages)
-# 'make install PREFIX=/usr/local/stow/tahoe-N.N' will do the same, but to
-# a different location
-
-install:
-ifdef PREFIX
-       mkdir -p $(PREFIX)
-       $(PYTHON) ./setup.py install --single-version-externally-managed \
-           --prefix=$(PREFIX) --record=./tahoe.files
-else
-       $(PYTHON) ./setup.py install --single-version-externally-managed
-endif
-
 
 # TESTING
 
@@ -73,16 +58,28 @@ test-coverage: build
        rm -f .coverage
        $(TAHOE) debug trial --reporter=bwverbose-coverage $(TEST)
 
-quicktest:
+quicktest: make-version
        $(TAHOE) debug trial $(TRIALARGS) $(TEST)
 
+# "make tmpfstest" may be a faster way of running tests on Linux. It works best when you have
+# at least 330 MiB of free physical memory (to run the whole test suite). Since it uses sudo
+# to mount/unmount the tmpfs filesystem, it might prompt for your password.
+tmpfstest:
+       time make _tmpfstest 'TMPDIR=$(shell mktemp -d --tmpdir=.)'
+
+_tmpfstest: make-version
+       sudo mount -t tmpfs -o size=400m tmpfs '$(TMPDIR)'
+       -$(TAHOE) debug trial --rterrors '--temp-directory=$(TMPDIR)/_trial_temp' $(TRIALARGS) $(TEST)
+       sudo umount '$(TMPDIR)'
+       rmdir '$(TMPDIR)'
+
 # code-coverage: install the "coverage" package from PyPI, do "make
 # quicktest-coverage" to do a unit test run with coverage-gathering enabled,
 # then use "make coverate-output-text" for a brief report, or "make
 # coverage-output" for a pretty HTML report. Also see "make .coverage.el" and
 # misc/coding_tools/coverage.el for emacs integration.
 
-quicktest-coverage:
+quicktest-coverage: make-version
        rm -f .coverage
        PYTHONPATH=. $(TAHOE) debug trial --reporter=bwverbose-coverage $(TEST)
 # on my laptop, "quicktest" takes 239s, "quicktest-coverage" takes 304s
@@ -121,7 +118,7 @@ upload-coverage:
        false
 endif
 
-code-checks: build version-and-path check-interfaces -find-trailing-spaces -check-umids pyflakes
+code-checks: build version-and-path check-interfaces check-miscaptures -find-trailing-spaces -check-umids pyflakes
 
 version-and-path:
        $(TAHOE) --version-and-path
@@ -130,25 +127,37 @@ check-interfaces:
        $(TAHOE) @misc/coding_tools/check-interfaces.py 2>&1 |tee violations.txt
        @echo
 
+check-miscaptures:
+       $(PYTHON) misc/coding_tools/check-miscaptures.py $(SOURCES) 2>&1 |tee miscaptures.txt
+       @echo
+
 pyflakes:
-       $(PYTHON) -OOu `which pyflakes` $(SOURCES) |sort |uniq
+       @$(PYTHON) -OOu `which pyflakes` $(SOURCES) |sort |uniq
        @echo
 
 check-umids:
-       $(PYTHON) misc/coding_tools/check-umids.py `find $(SOURCES) -name '*.py'`
+       $(PYTHON) misc/coding_tools/check-umids.py `find $(SOURCES) -name '*.py' -not -name 'old.py'`
        @echo
 
 -check-umids:
-       -$(PYTHON) misc/coding_tools/check-umids.py `find $(SOURCES) -name '*.py'`
+       -$(PYTHON) misc/coding_tools/check-umids.py `find $(SOURCES) -name '*.py' -not -name 'old.py'`
+       @echo
+
+doc-checks: check-rst
+
+check-rst:
+       @for x in `find *.rst docs -name "*.rst"`; do rst2html -v $${x} >/dev/null; done 2>&1 |grep -v 'Duplicate implicit target name:'
        @echo
 
 count-lines:
        @echo -n "files: "
-       @find src -name '*.py' |grep -v /build/ |wc --lines
+       @find src -name '*.py' |grep -v /build/ |wc -l
        @echo -n "lines: "
-       @cat `find src -name '*.py' |grep -v /build/` |wc --lines
+       @cat `find src -name '*.py' |grep -v /build/` |wc -l
        @echo -n "TODO: "
-       @grep TODO `find src -name '*.py' |grep -v /build/` | wc --lines
+       @grep TODO `find src -name '*.py' |grep -v /build/` | wc -l
+       @echo -n "XXX: "
+       @grep XXX `find src -name '*.py' |grep -v /build/` | wc -l
 
 check-memory: .built
        rm -rf _test_memory
@@ -194,6 +203,10 @@ check-grid: .built
 bench-dirnode: .built
        $(TAHOE) @src/allmydata/test/bench_dirnode.py
 
+# the provisioning tool runs as a stand-alone webapp server
+run-provisioning-tool: .built
+       $(TAHOE) @misc/operations_helpers/provisioning/run.py
+
 # 'make repl' is a simple-to-type command to get a Python interpreter loop
 # from which you can type 'import allmydata'
 repl:
@@ -203,6 +216,10 @@ test-darcs-boringfile:
        $(MAKE)
        $(PYTHON) misc/build_helpers/test-darcs-boringfile.py
 
+test-git-ignore:
+       $(MAKE)
+       $(PYTHON) misc/build_helpers/test-git-ignore.py
+
 test-clean:
        find . |grep -vEe "_darcs|allfiles.tmp|src/allmydata/_(version|appname).py" |sort >allfiles.tmp.old
        $(MAKE)
@@ -213,11 +230,11 @@ test-clean:
 # It would be nice if 'make clean' deleted any automatically-generated
 # _version.py too, so that 'make clean; make all' could be useable as a
 # "what the heck is going on, get me back to a clean state', but we need
-# 'make clean' to work on non-darcs trees without destroying useful information.
+# 'make clean' to work on non-checkout trees without destroying useful information.
+# Use 'make distclean' instead to delete all generated files.
 clean:
        rm -rf build _trial_temp _test_memory .built
        rm -f `find src *.egg -name '*.so' -or -name '*.pyc'`
-       rm -rf src/allmydata_tahoe.egg-info
        rm -rf support dist
        rm -rf `ls -d *.egg | grep -vEe"setuptools-|setuptools_darcs-|darcsver-"`
        rm -rf *.pyc
@@ -225,6 +242,11 @@ clean:
        rm -rf misc/dependencies/tahoe_deps.egg-info
        rm -f bin/tahoe bin/tahoe.pyscript
 
+distclean: clean
+       rm -rf src/allmydata_tahoe.egg-info
+       rm -f src/allmydata/_version.py
+       rm -f src/allmydata/_appname.py
+
 find-trailing-spaces:
        $(PYTHON) misc/coding_tools/find-trailing-spaces.py -r $(SOURCES)
        @echo
@@ -239,9 +261,9 @@ find-trailing-spaces:
 # support/lib/ directory is gone.
 
 fetch-and-unpack-deps:
-       test -f tahoe-deps.tar.gz || wget https://tahoe-lafs.org/source/tahoe/deps/tahoe-deps.tar.gz
+       test -f tahoe-deps.tar.gz || wget https://tahoe-lafs.org/source/tahoe-lafs/deps/tahoe-lafs-deps.tar.gz
        rm -rf tahoe-deps
-       tar xzf tahoe-deps.tar.gz
+       tar xzf tahoe-lafs-deps.tar.gz
 
 test-desert-island:
        $(MAKE) fetch-and-unpack-deps
@@ -257,4 +279,4 @@ tarballs:
        $(PYTHON) setup.py sdist --sumo --formats=bztar,gztar,zip
 
 upload-tarballs:
-       @if [ "X${BB_BRANCH}" = "Xtrunk" ] || [ "X${BB_BRANCH}" = "X" ]; then for f in dist/allmydata-tahoe-*; do flappclient --furlfile ~/.tahoe-tarball-upload.furl upload-file $$f; done ; else echo not uploading tarballs because this is not trunk but is branch \"${BB_BRANCH}\" ; fi
+       @if [ "X${BB_BRANCH}" = "Xmaster" ] || [ "X${BB_BRANCH}" = "X" ]; then for f in dist/allmydata-tahoe-*; do flappclient --furlfile ~/.tahoe-tarball-upload.furl upload-file $$f; done ; else echo not uploading tarballs because this is not trunk but is branch \"${BB_BRANCH}\" ; fi