You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by kx...@apache.org on 2015/10/19 21:01:08 UTC

[1/9] couchdb commit: updated refs/heads/master to c071df9

Repository: couchdb
Updated Branches:
  refs/heads/master d6f193710 -> c071df98e


Add targets to list possible tests candidates


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/d4ac4c42
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/d4ac4c42
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/d4ac4c42

Branch: refs/heads/master
Commit: d4ac4c42efcf225dfd6686954e9973d6f6072f30
Parents: de72658
Author: Alexander Shorin <kx...@apache.org>
Authored: Sat Oct 17 20:50:44 2015 +0300
Committer: Alexander Shorin <kx...@apache.org>
Committed: Sat Oct 17 20:50:44 2015 +0300

----------------------------------------------------------------------
 Makefile | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/d4ac4c42/Makefile
----------------------------------------------------------------------
diff --git a/Makefile b/Makefile
index bf24ed4..3387232 100644
--- a/Makefile
+++ b/Makefile
@@ -53,7 +53,7 @@ help:
 	@egrep "^# target: " Makefile \
 		| sed -e 's/^# target: //g' \
 		| sort \
-		| awk '{printf("    %-15s", $$1); $$1=$$2=""; print "-" $$0}'
+		| awk '{printf("    %-20s", $$1); $$1=$$2=""; print "-" $$0}'
 
 
 ################################################################################
@@ -106,6 +106,30 @@ javascript: all share/www/script/test
 	@dev/run -q --with-admin-party-please test/javascript/run $(suites)
 
 
+.PHONY: list-eunit-apps
+# target: list-eunit-apps - List EUnit target apps
+list-eunit-apps:
+	@find ./src/ -type f -name *_test.erl -o -name *_tests.erl \
+		| cut -d '/' -f 3 \
+		| sort -u
+
+
+.PHONY: list-eunit-suites
+# target: list-eunit-suites - List EUnit target test suites
+list-eunit-suites:
+	@find ./src/ -type f -name *_test.erl -o -name *_tests.erl -printf "%f\n" \
+		| cut -d '.' -f -1 \
+		| sort
+
+
+.PHONY: list-js-suites
+# target: list-js-suites - List JavaScript test suites
+list-js-suites:
+	@find ./test/javascript/tests/ -type f -name *.js -printf "%f\n" \
+		| cut -d '.' -f -1 \
+		| sort
+
+
 .PHONY: build-test
 # target: build-test - Test build script
 build-test:


[3/9] couchdb commit: updated refs/heads/master to c071df9

Posted by kx...@apache.org.
Simplify eunit target options

Now it mirrors rebar eunit options and you can preserve old habits
to specify app, suite or test to run test against:

  make eunit apps=couch suites=couch_btree

Supported options are: apps, skip_deps, suites, tests. If you need
something more specific you can use EUNIT_OPTS to specify rebar eunit
options as-is:

  make eunit EUNIT_OPTS="apps=couch suites=couch_btree"


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/af1c88b8
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/af1c88b8
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/af1c88b8

Branch: refs/heads/master
Commit: af1c88b84af1cbe28722e523dc99c43778b3ef06
Parents: e5a1c9b
Author: Alexander Shorin <kx...@apache.org>
Authored: Sat Oct 17 18:53:59 2015 +0300
Committer: Alexander Shorin <kx...@apache.org>
Committed: Mon Oct 19 13:47:39 2015 +0300

----------------------------------------------------------------------
 Makefile | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/af1c88b8/Makefile
----------------------------------------------------------------------
diff --git a/Makefile b/Makefile
index ee202bf..3f41e20 100644
--- a/Makefile
+++ b/Makefile
@@ -19,6 +19,19 @@ COUCHDB_VERSION = $(vsn_major).$(vsn_minor).$(vsn_patch)$(COUCHDB_VERSION_SUFFIX
 
 DESTDIR=
 
+# Rebar options
+apps=
+skip_deps=folsom,lager,meck,mochiweb,proper,snappy
+suites=
+tests=
+
+EUNIT_OPTS=$(shell echo "\
+	apps=$(apps) \
+	skip_deps=$(skip_deps) \
+	suites=$(suites) \
+	tests=$(tests) \
+	" | sed -e 's/[a-z]\+= / /g')
+
 
 ################################################################################
 # Main commands
@@ -75,12 +88,12 @@ check:
 
 
 .PHONY: eunit
-# target: eunit - Run EUnit tests, use $(EUNIT_OPTS) for custom rebar eunit params
+# target: eunit - Run EUnit tests, use EUNIT_OPTS to provide custom options
 eunit: export BUILDDIR = $(shell pwd)
 eunit: export ERL_AFLAGS = -config $(shell pwd)/rel/files/eunit.config
 eunit: couch
 	@$(REBAR) setup_eunit 2> /dev/null
-	@$(REBAR) -r eunit skip_deps=meck,mochiweb,lager,snappy,folsom,proper $(EUNIT_OPTS)
+	@$(REBAR) -r eunit $(EUNIT_OPTS)
 
 
 .PHONY: javascript


[2/9] couchdb commit: updated refs/heads/master to c071df9

Posted by kx...@apache.org.
Improve testing instructions


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/c071df98
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/c071df98
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/c071df98

Branch: refs/heads/master
Commit: c071df98e64cd38ca1d4255f64b618906beb1e8e
Parents: d4ac4c4
Author: Alexander Shorin <kx...@apache.org>
Authored: Sun Oct 18 00:36:02 2015 +0300
Committer: Alexander Shorin <kx...@apache.org>
Committed: Sun Oct 18 00:36:02 2015 +0300

----------------------------------------------------------------------
 README-DEV.md | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 56 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/c071df98/README-DEV.md
----------------------------------------------------------------------
diff --git a/README-DEV.md b/README-DEV.md
index 81cfc4a..66e30c3 100644
--- a/README-DEV.md
+++ b/README-DEV.md
@@ -119,16 +119,69 @@ If you want to build it into different destination than `/usr/local`.
 
     ./configure --prefix=/<your directory path>
 
+If you don't want to build Fauxton or documentation specify `--disable-fauxton`
+and/or `--disable-docs` arguments for `configure` to ignore their build and
+avoid any issues with their dependencies.
+
+See `./configure --help` for more information.
+
 Testing
 -------
 
-Check the test suite by running:
+To run all the tests use run:
 
     make check
 
-Generate a coverage report by running:
+You can also run each test suite individually via `eunit` and `javascript`
+targets:
+
+    make eunit
+    make javascript
+
+If you need to run specific Erlang tests, you can pass special "options"
+to make targets:
+
+    # Run tests only for couch and chttpd apps
+    make eunit apps=couch,chttpd
+
+    # Run only tests from couch_btree_tests suite
+    make eunit suites=couch_btree_tests
+
+    # Run only only specific tests
+    make eunit tests=btree_open_test,reductions_test
+
+    # Ignore tests for specified apps
+    make eunit skip_deps=couch_log,couch_epi
+
+The `apps`, `suites`, `tests` and `skip_deps` could be combined in any way.
+These are mimics to `rebar eunit` arguments. If you're not satisfied by these,
+you can use EUNIT_OPT environment variable to specify exact `rebar eunit`
+options:
+
+    make eunit EUNIT_OPTS="apps=couch,chttpd"
+
+JavaScript tests accepts only `suites` option, but in the same way
+
+    # Run all JavaScript tests
+    make javascript
+
+    # Run only basic and design_options tests
+    make javascript suites="basic design_options"
+
+Note that tests are delimited here by whitespace, not by comma. You can get list
+of all possible test targets with the following command:
+
+    make list-js-suites
+
+Code analyzer could be run by:
+
+    make dialyze
+
+If you need to analyze only specific apps, you can specify them in familiar way:
+
+    make dialyze apps=couch,couch_epi
 
-    make cover
+See `make help` for more info and useful commands.
 
 Please report any problems to the developer's mailing list.
 


[6/9] couchdb commit: updated refs/heads/master to c071df9

Posted by kx...@apache.org.
Reorganize Makefile commands


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/9acb1740
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/9acb1740
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/9acb1740

Branch: refs/heads/master
Commit: 9acb174022dceec5dc0e6b906da8365dbe04ccc7
Parents: d6f1937
Author: Alexander Shorin <kx...@apache.org>
Authored: Sat Oct 17 00:51:27 2015 +0300
Committer: Alexander Shorin <kx...@apache.org>
Committed: Mon Oct 19 13:47:39 2015 +0300

----------------------------------------------------------------------
 Makefile | 190 ++++++++++++++++++++++++++++++++++++----------------------
 1 file changed, 117 insertions(+), 73 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/9acb1740/Makefile
----------------------------------------------------------------------
diff --git a/Makefile b/Makefile
index 178233b..11dd5e3 100644
--- a/Makefile
+++ b/Makefile
@@ -19,34 +19,85 @@ COUCHDB_VERSION = $(vsn_major).$(vsn_minor).$(vsn_patch)$(COUCHDB_VERSION_SUFFIX
 
 DESTDIR=
 
+
+################################################################################
+# Main commands
+################################################################################
+
+
 all: couch fauxton docs
 
-config.erl:
-	@echo "Apache CouchDB has not been configured."
-	@echo "Try \"./configure -h\" for help."
-	@echo
-	@false
+
+################################################################################
+# Building
+################################################################################
+
 
 couch: config.erl
-	@${REBAR} compile
+	@$(REBAR) compile
 	@cp src/couch/priv/couchjs bin/
 
-clean:
-	@${REBAR} -r clean
-	@rm -f bin/couchjs
-	@rm -rf src/*/ebin
-	@rm -rf src/*/.rebar
-	@rm -rf src/*/priv/*.so
-	@rm -rf src/couch/priv/{couchspawnkillable,couchjs}
-	@rm -rf share/server/main.js share/server/main-coffee.js
-	@rm -rf tmp dev/data dev/lib dev/logs
-	@rm -f src/couch/priv/couchspawnkillable
-	@rm -f src/couch/priv/couch_js/config.h
-	@rm -f dev/boot_node.beam dev/pbkdf2.pyc log/crash.log
+
+docs: src/docs/build
+
+
+fauxton: share/www
+
+
+################################################################################
+# Testing
+################################################################################
+
 
 check: javascript eunit build-test
 
-# creates a full erlang release
+
+eunit: export BUILDDIR = $(shell pwd)
+eunit: export ERL_AFLAGS = -config $(shell pwd)/rel/files/eunit.config
+eunit: couch
+	@$(REBAR) setup_eunit 2> /dev/null
+	@$(REBAR) -r eunit skip_deps=meck,mochiweb,lager,snappy,folsom,proper $(EUNIT_OPTS)
+
+
+javascript: all
+	# TODO: Fix tests to look for these files in their new path
+	@mkdir -p share/www/script/test
+	@cp test/javascript/tests/lorem*.txt share/www/script/test/
+	@dev/run -q --with-admin-party-please test/javascript/run
+	@rm -rf share/www/script
+
+
+build-test:
+	@test/build/test-configure.sh
+
+
+################################################################################
+# Developing
+################################################################################
+
+
+docker-image:
+	@docker build --rm -t couchdb/dev-cluster .
+
+
+docker-start:
+	@docker run -d -P -t couchdb/dev-cluster > .docker-id
+
+
+docker-stop:
+	@docker stop `cat .docker-id`
+
+
+introspect:
+	@$(REBAR) -r update-deps
+	@./introspect
+
+
+################################################################################
+# Distributing
+################################################################################
+
+
 dist: all
 	@./build-aux/couchdb-build-release.sh $(COUCHDB_VERSION)
 
@@ -61,30 +112,15 @@ dist: all
 	@mkdir -p apache-couchdb-$(COUCHDB_VERSION)/share/docs/info
 	@cp src/docs/build/texinfo/CouchDB.info apache-couchdb-$(COUCHDB_VERSION)/share/docs/info/
 
-# Tar!
 	@tar czf apache-couchdb-$(COUCHDB_VERSION).tar.gz apache-couchdb-$(COUCHDB_VERSION)
 	@echo "Done: apache-couchdb-$(COUCHDB_VERSION).tar.gz"
 
-distclean: clean
-	@rm -f install.mk
-	@rm -f config.erl
-	@rm -f rel/couchdb.config
-ifneq ($(IN_RELEASE), true)
-# when we are in a release, don’t delete the
-# copied sources, generated docs, or fauxton
-	@rm -rf rel/couchdb
-	@rm -rf share/www
-	@rm -rf src/docs
-endif
-
-devclean:
-	@rm -rf dev/lib/*/data
 
 -include install.mk
 install: all
 	@echo "Installing CouchDB into $(DESTDIR)/$(install_dir)..." | sed -e 's,///,/,'
 	@rm -rf rel/couchdb
-	@${REBAR} generate # make full erlang release
+	@$(REBAR) generate # make full erlang release
 
 	@mkdir -p $(DESTDIR)/$(install_dir)
 	@cp -R rel/couchdb/* $(DESTDIR)/$(install_dir)
@@ -125,6 +161,44 @@ install: all
 
 	@echo "...done"
 
+
+################################################################################
+# Cleaning
+################################################################################
+
+
+clean:
+	@$(REBAR) -r clean
+	@rm -f bin/couchjs
+	@rm -rf src/*/ebin
+	@rm -rf src/*/.rebar
+	@rm -rf src/*/priv/*.so
+	@rm -rf src/couch/priv/{couchspawnkillable,couchjs}
+	@rm -rf share/server/main.js share/server/main-coffee.js
+	@rm -rf tmp dev/data dev/lib dev/logs
+	@rm -f src/couch/priv/couchspawnkillable
+	@rm -f src/couch/priv/couch_js/config.h
+	@rm -f dev/boot_node.beam dev/pbkdf2.pyc log/crash.log
+
+
+
+distclean: clean
+	@rm -f install.mk
+	@rm -f config.erl
+	@rm -f rel/couchdb.config
+ifneq ($(IN_RELEASE), true)
+# when we are in a release, don’t delete the
+# copied sources, generated docs, or fauxton
+	@rm -rf rel/couchdb
+	@rm -rf share/www
+	@rm -rf src/docs
+endif
+
+
+devclean:
+	@rm -rf dev/lib/*/data
+
+
 uninstall:
 	@rm -rf $(DESTDIR)/$(install_dir)
 	@rm -f $(DESTDIR)/$(bin_dir)/couchdb
@@ -137,57 +211,27 @@ uninstall:
 	@rm -rf $(DESTDIR)/$(man_dir)
 	@rm -rf $(DESTDIR)/$(info_dir)
 
-install.mk:
-# ignore install.mk missing if we are running
-# `make clean` without having run ./configure first
-ifneq ($(MAKECMDGOALS), clean)
-	@echo "No install.mk found. Run ./configure"
-	@exit 1
-endif
-
-docker-image:
-	@docker build --rm -t couchdb/dev-cluster .
-
-docker-start:
-	@docker run -d -P -t couchdb/dev-cluster > .docker-id
 
-docker-stop:
-	@docker stop `cat .docker-id`
-
-eunit: export BUILDDIR = $(shell pwd)
-eunit: export ERL_AFLAGS = -config $(shell pwd)/rel/files/eunit.config
-eunit: couch
-	@${REBAR} setup_eunit 2> /dev/null
-	@${REBAR} -r eunit skip_deps=meck,mochiweb,lager,snappy,folsom,proper $(EUNIT_OPTS)
+################################################################################
+# Misc
+################################################################################
 
-javascript: all
-	# TODO: Fix tests to look for these files in their new path
-	@mkdir -p share/www/script/test
-	@cp test/javascript/tests/lorem*.txt share/www/script/test/
-	@dev/run -q --with-admin-party-please test/javascript/run
-	@rm -rf share/www/script
 
-build-test:
-	@test/build/test-configure.sh
+config.erl:
+	@echo "Apache CouchDB has not been configured."
+	@echo "Try \"./configure -h\" for help."
+	@echo
+	@false
 
-# build docs
-docs: src/docs/build
 
 src/docs/build:
 ifeq ($(with_docs), 1)
 	@cd src/docs; $(MAKE)
 endif
 
-# build fauxton
-fauxton: share/www
 
 share/www:
 ifeq ($(with_fauxton), 1)
 	@echo "Building Fauxton"
 	@cd src/fauxton && npm install && ./node_modules/grunt-cli/bin/grunt couchdb
 endif
-
-.PHONY: introspect
-introspect:
-	${REBAR} -r update-deps
-	./introspect


[4/9] couchdb commit: updated refs/heads/master to c071df9

Posted by kx...@apache.org.
Simplify exit on first test suite failure


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/e5a1c9b8
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/e5a1c9b8
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/e5a1c9b8

Branch: refs/heads/master
Commit: e5a1c9b8fa27e10216bb109ea8f2acf4611035f9
Parents: 366c856
Author: Alexander Shorin <kx...@apache.org>
Authored: Sat Oct 17 03:31:03 2015 +0300
Committer: Alexander Shorin <kx...@apache.org>
Committed: Mon Oct 19 13:47:39 2015 +0300

----------------------------------------------------------------------
 .travis.yml  | 2 +-
 Makefile     | 5 ++++-
 run-tests.sh | 4 ----
 3 files changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/e5a1c9b8/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 920a8ee..f0f7126 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,7 +5,7 @@ before_install:
    - sudo apt-get -y install shunit2
 before_script: ./configure -c --disable-docs --disable-fauxton
 script:
-   - ./run-tests.sh
+   - make check
 language: erlang
 otp_release:
    - 18.1

http://git-wip-us.apache.org/repos/asf/couchdb/blob/e5a1c9b8/Makefile
----------------------------------------------------------------------
diff --git a/Makefile b/Makefile
index f613c75..ee202bf 100644
--- a/Makefile
+++ b/Makefile
@@ -68,7 +68,10 @@ fauxton: share/www
 
 .PHONY: check
 # target: check - Test everything
-check: javascript eunit build-test
+check:
+	@$(MAKE) eunit
+	@$(MAKE) javascript
+	@$(MAKE) build-test
 
 
 .PHONY: eunit

http://git-wip-us.apache.org/repos/asf/couchdb/blob/e5a1c9b8/run-tests.sh
----------------------------------------------------------------------
diff --git a/run-tests.sh b/run-tests.sh
deleted file mode 100755
index f8ab486..0000000
--- a/run-tests.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh -ev
-
-# Eunit/Javascript tests
-make check


[7/9] couchdb commit: updated refs/heads/master to c071df9

Posted by kx...@apache.org.
Allow to run specific javascript test suite via make

Example for single test suite:

    make javascript suites=basics

Multiple suites:

    make javascript suites="basics design_options"


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/e767957a
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/e767957a
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/e767957a

Branch: refs/heads/master
Commit: e767957ac55227d2741a4988551fe7ff95cc220f
Parents: af1c88b
Author: Alexander Shorin <kx...@apache.org>
Authored: Sat Oct 17 19:13:21 2015 +0300
Committer: Alexander Shorin <kx...@apache.org>
Committed: Mon Oct 19 14:01:46 2015 +0300

----------------------------------------------------------------------
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/e767957a/Makefile
----------------------------------------------------------------------
diff --git a/Makefile b/Makefile
index 3f41e20..5d3716f 100644
--- a/Makefile
+++ b/Makefile
@@ -102,7 +102,7 @@ javascript: all
 	# TODO: Fix tests to look for these files in their new path
 	@mkdir -p share/www/script/test
 	@cp test/javascript/tests/lorem*.txt share/www/script/test/
-	@dev/run -q --with-admin-party-please test/javascript/run
+	@dev/run -q --with-admin-party-please test/javascript/run $(tests)
 	@rm -rf share/www/script
 
 


[8/9] couchdb commit: updated refs/heads/master to c071df9

Posted by kx...@apache.org.
Reorganize javascript target


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/9eabbc63
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/9eabbc63
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/9eabbc63

Branch: refs/heads/master
Commit: 9eabbc63620a0279cbc5ef06db814f38405e2cdc
Parents: e767957
Author: Alexander Shorin <kx...@apache.org>
Authored: Sat Oct 17 19:16:25 2015 +0300
Committer: Alexander Shorin <kx...@apache.org>
Committed: Mon Oct 19 14:02:14 2015 +0300

----------------------------------------------------------------------
 Makefile | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/9eabbc63/Makefile
----------------------------------------------------------------------
diff --git a/Makefile b/Makefile
index 5d3716f..bb0114c 100644
--- a/Makefile
+++ b/Makefile
@@ -97,13 +97,9 @@ eunit: couch
 
 
 .PHONY: javascript
-# target: javascript - Run JavaScript tests suite
-javascript: all
-	# TODO: Fix tests to look for these files in their new path
-	@mkdir -p share/www/script/test
-	@cp test/javascript/tests/lorem*.txt share/www/script/test/
-	@dev/run -q --with-admin-party-please test/javascript/run $(tests)
-	@rm -rf share/www/script
+# target: javascript - Run JavaScript test suites or specific ones defined by suites option
+javascript: all share/www/script/test
+	@dev/run -q --with-admin-party-please test/javascript/run $(suites)
 
 
 .PHONY: build-test
@@ -295,3 +291,9 @@ ifeq ($(with_fauxton), 1)
 	@echo "Building Fauxton"
 	@cd src/fauxton && npm install && ./node_modules/grunt-cli/bin/grunt couchdb
 endif
+
+
+share/www/script/test:
+	@# TODO: Fix tests to look for these files in their new path
+	@mkdir -p $@
+	@cp test/javascript/tests/lorem*.txt share/www/script/test/


[5/9] couchdb commit: updated refs/heads/master to c071df9

Posted by kx...@apache.org.
Make help


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/366c8562
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/366c8562
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/366c8562

Branch: refs/heads/master
Commit: 366c8562467864880c6be7b83e7d30bdb1827a7a
Parents: 9acb174
Author: Alexander Shorin <kx...@apache.org>
Authored: Sat Oct 17 00:52:37 2015 +0300
Committer: Alexander Shorin <kx...@apache.org>
Committed: Mon Oct 19 13:47:39 2015 +0300

----------------------------------------------------------------------
 Makefile | 46 +++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 45 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/366c8562/Makefile
----------------------------------------------------------------------
diff --git a/Makefile b/Makefile
index 11dd5e3..f613c75 100644
--- a/Makefile
+++ b/Makefile
@@ -25,22 +25,39 @@ DESTDIR=
 ################################################################################
 
 
+.PHONY: all
+# target: all - Build everything
 all: couch fauxton docs
 
 
+.PHONY: help
+# target: help - Print this help
+help:
+	@egrep "^# target: " Makefile \
+		| sed -e 's/^# target: //g' \
+		| sort \
+		| awk '{printf("    %-15s", $$1); $$1=$$2=""; print "-" $$0}'
+
+
 ################################################################################
 # Building
 ################################################################################
 
 
+.PHONY: couch
+# target: couch - Build CouchDB core
 couch: config.erl
 	@$(REBAR) compile
 	@cp src/couch/priv/couchjs bin/
 
 
+.PHONY: docs
+# target: docs - Build documentation
 docs: src/docs/build
 
 
+.PHONY: fauxton
+# target: fauxton - Build Fauxton web UI
 fauxton: share/www
 
 
@@ -49,9 +66,13 @@ fauxton: share/www
 ################################################################################
 
 
+.PHONY: check
+# target: check - Test everything
 check: javascript eunit build-test
 
 
+.PHONY: eunit
+# target: eunit - Run EUnit tests, use $(EUNIT_OPTS) for custom rebar eunit params
 eunit: export BUILDDIR = $(shell pwd)
 eunit: export ERL_AFLAGS = -config $(shell pwd)/rel/files/eunit.config
 eunit: couch
@@ -59,6 +80,8 @@ eunit: couch
 	@$(REBAR) -r eunit skip_deps=meck,mochiweb,lager,snappy,folsom,proper $(EUNIT_OPTS)
 
 
+.PHONY: javascript
+# target: javascript - Run JavaScript tests suite
 javascript: all
 	# TODO: Fix tests to look for these files in their new path
 	@mkdir -p share/www/script/test
@@ -67,6 +90,8 @@ javascript: all
 	@rm -rf share/www/script
 
 
+.PHONY: build-test
+# target: build-test - Test build script
 build-test:
 	@test/build/test-configure.sh
 
@@ -76,18 +101,26 @@ build-test:
 ################################################################################
 
 
+.PHONY: docker-image
+# target: docker-image - Build Docker image
 docker-image:
 	@docker build --rm -t couchdb/dev-cluster .
 
 
+.PHONY: docker-start
+# target: docker-start - Start CouchDB in Docker container
 docker-start:
 	@docker run -d -P -t couchdb/dev-cluster > .docker-id
 
 
+.PHONY: docker-stop
+# target: docker-stop - Stop Docker container
 docker-stop:
 	@docker stop `cat .docker-id`
 
 
+.PHONY: introspect
+# target: introspect - Check for commits difference between rebar.config and repository
 introspect:
 	@$(REBAR) -r update-deps
 	@./introspect
@@ -98,6 +131,8 @@ introspect:
 ################################################################################
 
 
+.PHONY: dist
+# target: dist - Make release tarball
 dist: all
 	@./build-aux/couchdb-build-release.sh $(COUCHDB_VERSION)
 
@@ -116,6 +151,8 @@ dist: all
 	@echo "Done: apache-couchdb-$(COUCHDB_VERSION).tar.gz"
 
 
+.PHONY: install
+# target: install - Install CouchDB :-)
 -include install.mk
 install: all
 	@echo "Installing CouchDB into $(DESTDIR)/$(install_dir)..." | sed -e 's,///,/,'
@@ -167,6 +204,8 @@ install: all
 ################################################################################
 
 
+.PHONY: clean
+# target: clean - Remove build artifacts
 clean:
 	@$(REBAR) -r clean
 	@rm -f bin/couchjs
@@ -181,7 +220,8 @@ clean:
 	@rm -f dev/boot_node.beam dev/pbkdf2.pyc log/crash.log
 
 
-
+.PHONY: distclean
+# target: distclean - Remove build and release artifacts
 distclean: clean
 	@rm -f install.mk
 	@rm -f config.erl
@@ -195,10 +235,14 @@ ifneq ($(IN_RELEASE), true)
 endif
 
 
+.PHONY: devclean
+# target: devclean - Remove dev cluster artifacts
 devclean:
 	@rm -rf dev/lib/*/data
 
 
+.PHONY: uninstall
+# target: uninstall - Uninstall CouchDB :-(
 uninstall:
 	@rm -rf $(DESTDIR)/$(install_dir)
 	@rm -f $(DESTDIR)/$(bin_dir)/couchdb


[9/9] couchdb commit: updated refs/heads/master to c071df9

Posted by kx...@apache.org.
Add targets for code analyze

Supports build-plt, check-plt and dialyze. You can run
them against some specific apps by using `apps` options,
and ignore apps with `skip_deps`:

    make dialyze apps=couch_epi,couch

If you eventually need more, use DIALYZE_OPTS to specify
own options set:

    make dialyze DIALYZE_OPTS="..."


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/de72658a
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/de72658a
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/de72658a

Branch: refs/heads/master
Commit: de72658a747c0b1704a969cdadb11b2c5ad78f19
Parents: 9eabbc6
Author: Alexander Shorin <kx...@apache.org>
Authored: Sat Oct 17 19:56:12 2015 +0300
Committer: Alexander Shorin <kx...@apache.org>
Committed: Mon Oct 19 14:02:14 2015 +0300

----------------------------------------------------------------------
 .gitignore          |  1 +
 Makefile            | 26 ++++++++++++++++++++++++++
 rebar.config.script |  7 +++++++
 3 files changed, 34 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/de72658a/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index b92f076..77ae520 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,5 +28,6 @@ src/couch/priv/couch_js/config.h
 src/couch/priv/couchjs
 src/couch/priv/couchspawnkillable
 
+.rebar
 bin/
 apache-couchdb-*/

http://git-wip-us.apache.org/repos/asf/couchdb/blob/de72658a/Makefile
----------------------------------------------------------------------
diff --git a/Makefile b/Makefile
index bb0114c..bf24ed4 100644
--- a/Makefile
+++ b/Makefile
@@ -31,6 +31,10 @@ EUNIT_OPTS=$(shell echo "\
 	suites=$(suites) \
 	tests=$(tests) \
 	" | sed -e 's/[a-z]\+= / /g')
+DIALYZE_OPTS=$(shell echo "\
+	apps=$(apps) \
+	skip_deps=$(skip_deps) \
+	" | sed -e 's/[a-z]\+= / /g')
 
 
 ################################################################################
@@ -113,6 +117,24 @@ build-test:
 ################################################################################
 
 
+.PHONY: build-plt
+# target: build-plt - Build project-specific PLT
+build-plt:
+	@$(REBAR) -r build-plt $(DIALYZE_OPTS)
+
+
+.PHONY: check-plt
+# target: check-plt - Check the PLT for consistency and rebuild it if it is not up-to-date
+check-plt:
+	@$(REBAR) -r check-plt $(DIALYZE_OPTS)
+
+
+.PHONY: dialyze
+# target: dialyze - Analyze the code for discrepancies
+dialyze: .rebar
+	@$(REBAR) -r dialyze $(DIALYZE_OPTS)
+
+
 .PHONY: docker-image
 # target: docker-image - Build Docker image
 docker-image:
@@ -220,6 +242,7 @@ install: all
 # target: clean - Remove build artifacts
 clean:
 	@$(REBAR) -r clean
+	@rm -rf .rebar/
 	@rm -f bin/couchjs
 	@rm -rf src/*/ebin
 	@rm -rf src/*/.rebar
@@ -273,6 +296,9 @@ uninstall:
 ################################################################################
 
 
+.rebar: build-plt
+
+
 config.erl:
 	@echo "Apache CouchDB has not been configured."
 	@echo "Try \"./configure -h\" for help."

http://git-wip-us.apache.org/repos/asf/couchdb/blob/de72658a/rebar.config.script
----------------------------------------------------------------------
diff --git a/rebar.config.script b/rebar.config.script
index 8e9dbbb..8f3b63a 100644
--- a/rebar.config.script
+++ b/rebar.config.script
@@ -85,6 +85,13 @@ AddConfig = [
     {erl_opts, [debug_info]},
     {eunit_opts, [verbose]},
     {plugins, [eunit_plugin]},
+    {dialyzer, [
+        {plt_location, local},
+        {plt_location, COUCHDB_ROOT},
+        {plt_extra_apps, [
+            asn1, compiler, crypto, inets, kernel, os_mon, runtime_tools,
+            sasl, ssl, stdlib, syntax_tools, xmerl]},
+        {warnings, [unmatched_returns, error_handling, race_conditions]}]},
     {post_hooks, [{compile, "escript support/build_js.escript"}]}
 ],