Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixes 'make distcheck' to run the test suite.

Quite a few changes to the build system to handle VPATH builds appropriately as well as make the test suite know about them.



git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@833951 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
commit e29a1924afe9e6051369f7bcbf44ccdf53de536a 1 parent c114565
@davisp davisp authored
Showing with 291 additions and 161 deletions.
  1. +4 −2 Makefile.am
  2. +1 −1  bin/Makefile.am
  3. +4 −0 configure.ac
  4. +8 −5 etc/couchdb/Makefile.am
  5. +1 −1  etc/couchdb/default.ini.tpl.in
  6. +6 −0 license.skip
  7. +1 −0  share/Makefile.am
  8. +8 −1 src/couchdb/priv/Makefile.am
  9. 0  src/couchdb/priv/{stat_descriptions.cfg → stat_descriptions.cfg.in}
  10. +8 −7 src/erlang-oauth/Makefile.am
  11. 0  src/erlang-oauth/{oauth.app → oauth.app.in}
  12. +5 −4 src/ibrowse/Makefile.am
  13. 0  src/ibrowse/{ibrowse.app → ibrowse.app.in}
  14. +6 −5 src/mochiweb/Makefile.am
  15. 0  src/mochiweb/{mochiweb.app → mochiweb.app.in}
  16. +1 −33 test/Makefile.am
  17. +1 −3 test/etap/001-load.t
  18. +1 −2  test/etap/002-erl-driver.t
  19. +2 −3 test/etap/010-file-basics.t
  20. +2 −3 test/etap/011-file-headers.t
  21. +2 −3 test/etap/020-btree-basics.t
  22. +1 −2  test/etap/021-btree-reductions.t
  23. +1 −2  test/etap/030-doc-from-json.t
  24. +1 −2  test/etap/031-doc-to-json.t
  25. +1 −2  test/etap/040-util.t
  26. +4 −5 test/etap/041-uuid-gen.t
  27. +1 −2  test/etap/050-stream.t
  28. +1 −2  test/etap/060-kt-merging.t
  29. +1 −2  test/etap/061-kt-missing-leaves.t
  30. +1 −2  test/etap/062-kt-remove-leaves.t
  31. +1 −2  test/etap/063-kt-get-leaves.t
  32. +1 −2  test/etap/064-kt-counting.t
  33. +1 −2  test/etap/065-kt-stemming.t
  34. +1 −3 test/etap/070-couch-db.t
  35. +2 −3 test/etap/080-config-get-set.t
  36. +5 −6 test/etap/081-config-override.t
  37. +2 −3 test/etap/082-config-register.t
  38. +2 −3 test/etap/083-config-no-files.t
  39. +1 −2  test/etap/090-task-status.t
  40. +1 −2  test/etap/100-ref-counter.t
  41. +8 −8 test/etap/110-replication-httpc.t
  42. +9 −8 test/etap/111-replication-changes-feed.t
  43. +8 −8 test/etap/112-replication-missing-revs.t
  44. +1 −2  test/etap/120-stats-collect.t
  45. +9 −4 test/etap/121-stats-aggregates.t
  46. +64 −0 test/etap/Makefile.am
  47. +27 −0 test/etap/run.tpl
  48. +35 −0 test/etap/test_util.erl.in
  49. +15 −0 test/javascript/Makefile.am
  50. 0  test/{ → javascript}/runner.sh
  51. 0  test/{ → javascript}/test.js
  52. +15 −0 test/view_server/Makefile.am
  53. 0  test/{ → view_server}/query_server_spec.rb
  54. 0  test/{ → view_server}/run_native_process.es
  55. +10 −9 utils/Makefile.am
View
6 Makefile.am
@@ -37,7 +37,7 @@ THANKS.gz: $(top_srcdir)/THANKS
-gzip -9 < $< > $@
check: dev
- prove test/etap/*.t
+ $(top_builddir)/test/etap/run
cover: dev
rm -f cover/*.coverdata
@@ -57,6 +57,9 @@ dev: all
mkdir -p $(top_builddir)/tmp/log
mkdir -p $(top_builddir)/tmp/run
+distclean-local:
+ rm -fr $(top_builddir)/tmp
+
.PHONY: local-clean
local-clean: maintainer-clean
@echo "This command is intended for maintainers to use;"
@@ -69,7 +72,6 @@ local-clean: maintainer-clean
rm -f $(top_srcdir)/test/etap/temp.*
rm -f $(top_srcdir)/*.tar.gz
rm -f $(top_srcdir)/*.tar.gz.*
- rm -fr $(top_srcdir)/tmp
find $(top_srcdir) -name Makefile.in -exec rm {} \;
distcheck-hook:
View
2  bin/Makefile.am
@@ -60,7 +60,7 @@ couchjs: couchjs.tpl
chmod +x $@
couchjs_dev: couchjs.tpl
- sed -e "s|%locallibbindir%|$(abs_top_srcdir)/src/couchdb|g" \
+ sed -e "s|%locallibbindir%|$(abs_top_builddir)/src/couchdb|g" \
-e "s|%bug_uri%|@bug_uri@|g" \
-e "s|%package_author_address%|@package_author_address@|g" \
-e "s|%package_author_name%|@package_author_name@|g" \
View
4 configure.ac
@@ -403,6 +403,10 @@ AC_CONFIG_FILES([src/etap/Makefile])
AC_CONFIG_FILES([src/ibrowse/Makefile])
AC_CONFIG_FILES([src/mochiweb/Makefile])
AC_CONFIG_FILES([test/Makefile])
+AC_CONFIG_FILES([test/etap/Makefile])
+AC_CONFIG_FILES([test/etap/test_util.erl])
+AC_CONFIG_FILES([test/javascript/Makefile])
+AC_CONFIG_FILES([test/view_server/Makefile])
AC_CONFIG_FILES([utils/Makefile])
AC_CONFIG_FILES([var/Makefile])
View
13 etc/couchdb/Makefile.am
@@ -11,7 +11,7 @@
## the License.
couchprivlibdir = $(localerlanglibdir)/couch-$(version)/priv/lib
-devcouchprivlibdir = $(abs_top_srcdir)/src/couchdb/.libs
+devcouchprivlibdir = $(abs_top_builddir)/src/couchdb/.libs
localconf_DATA = default.ini
noinst_DATA = default_dev.ini local_dev.ini
@@ -29,6 +29,7 @@ default.ini: default.ini.tpl
sed -e "s|%bindir%|.|g" \
-e "s|%localconfdir%|$(localconfdir)|g" \
-e "s|%localdatadir%|../share/couchdb|g" \
+ -e "s|%localbuilddatadir%|../share/couchdb|g" \
-e "s|%localstatelibdir%|../var/lib/couchdb|g" \
-e "s|%localstatelogdir%|../var/log/couchdb|g" \
-e "s|%couchprivlibdir%|../lib/couch-$(version)/priv/lib|g" \
@@ -39,6 +40,7 @@ default.ini: default.ini.tpl
sed -e "s|%bindir%|$(bindir)|g" \
-e "s|%localconfdir%|$(localconfdir)|g" \
-e "s|%localdatadir%|$(localdatadir)|g" \
+ -e "s|%localbuilddatadir%|$(localdatadir)|g" \
-e "s|%localstatelibdir%|$(localstatelibdir)|g" \
-e "s|%localstatelogdir%|$(localstatelogdir)|g" \
-e "s|%couchprivlibdir%|$(couchprivlibdir)|g" \
@@ -47,11 +49,12 @@ default.ini: default.ini.tpl
endif
default_dev.ini: default.ini.tpl
- sed -e "s|%bindir%|$(abs_top_srcdir)/bin|g" \
- -e "s|%localconfdir%|$(abs_top_srcdir)/etc/couchdb|g" \
+ sed -e "s|%bindir%|$(abs_top_builddir)/bin|g" \
+ -e "s|%localconfdir%|$(abs_top_builddir)/etc/couchdb|g" \
-e "s|%localdatadir%|$(abs_top_srcdir)/share|g" \
- -e "s|%localstatelibdir%|$(abs_top_srcdir)/tmp/lib|g" \
- -e "s|%localstatelogdir%|$(abs_top_srcdir)/tmp/log|g" \
+ -e "s|%localbuilddatadir%|$(abs_top_builddir)/share|g" \
+ -e "s|%localstatelibdir%|$(abs_top_builddir)/tmp/lib|g" \
+ -e "s|%localstatelogdir%|$(abs_top_builddir)/tmp/log|g" \
-e "s|%couchprivlibdir%|$(devcouchprivlibdir)|g" \
-e "s|%couchjs_command_name%|$(couchjs_dev_command_name)|g" \
< $< > $@
View
2  etc/couchdb/default.ini.tpl.in
@@ -31,7 +31,7 @@ secret = replace this with a real secret in your local.ini file
require_valid_user = false
[query_servers]
-javascript = %bindir%/%couchjs_command_name% %localdatadir%/server/main.js
+javascript = %bindir%/%couchjs_command_name% %localbuilddatadir%/server/main.js
; Changing reduce_limit to false will disable reduce_limit.
; If you think you're hitting reduce_limit with a "good" reduce function,
View
6 license.skip
@@ -74,6 +74,12 @@
^test/local.ini
^test/Makefile
^test/Makefile.in
+^test/etap/Makefile
+^test/etap/Makefile.in
+^test/javascript/Makefile
+^test/javascript/Makefile.in
+^test/view_server/Makefile
+^test/view_server/Makefile.in
^tmp/*
^THANKS
^utils/Makefile
View
1  share/Makefile.am
@@ -24,6 +24,7 @@ JS_FILE_COMPONENTS = \
JS_FILE_COMPONENTS_LAST = server/loop.js
$(JS_FILE): $(JS_FILE_COMPONENTS) $(JS_FILE_COMPONENTS_LAST)
+ mkdir -p `dirname $(JS_FILE)`
echo "// DO NOT EDIT THIS FILE BY HAND" > $@
echo >> $@
cat $^ >> $@
View
9 src/couchdb/priv/Makefile.am
@@ -13,11 +13,18 @@
couchlibdir = $(localerlanglibdir)/couch-$(version)
couchprivdir = $(couchlibdir)/priv
-EXTRA_DIST = couchspawnkillable.sh stat_descriptions.cfg
+EXTRA_DIST = \
+ couchspawnkillable.sh \
+ stat_descriptions.cfg.in
+
+CLEANFILES = stat_descriptions.cfg
couchpriv_DATA = stat_descriptions.cfg
couchpriv_PROGRAMS = couchspawnkillable
+%.cfg: %.cfg.in
+ cp $< $@
+
if WINDOWS
couchspawnkillable_SOURCES = couchspawnkillable_win.c
endif
View
0  src/couchdb/priv/stat_descriptions.cfg → src/couchdb/priv/stat_descriptions.cfg.in
File renamed without changes
View
15 src/erlang-oauth/Makefile.am
@@ -16,6 +16,7 @@ oauthebindir = $(localerlanglibdir)/erlang-oauth/ebin
# we add a ./configure option to enable it.
oauth_file_collection = \
+ oauth.app.in \
oauth.erl \
oauth_hmac_sha1.erl \
oauth_http.erl \
@@ -23,9 +24,8 @@ oauth_file_collection = \
oauth_unix.erl \
oauth_uri.erl
-oauthebin_static_file = oauth.app
-
oauthebin_make_generated_file_list = \
+ oauth.app \
oauth.beam \
oauth_hmac_sha1.beam \
oauth_http.beam \
@@ -34,15 +34,16 @@ oauthebin_make_generated_file_list = \
oauth_uri.beam
oauthebin_DATA = \
- $(oauthebin_static_file) \
- $(oauthebin_make_generated_file_list)
+ $(oauthebin_make_generated_file_list)
-EXTRA_DIST = \
- $(oauth_file_collection) \
- $(oauthebin_static_file)
+EXTRA_DIST = \
+ $(oauth_file_collection)
CLEANFILES = \
$(oauthebin_make_generated_file_list)
+%.app: %.app.in
+ cp $< $@
+
%.beam: %.erl
$(ERLC) $(ERLC_FLAGS) $<
View
0  src/erlang-oauth/oauth.app → src/erlang-oauth/oauth.app.in
File renamed without changes
View
9 src/ibrowse/Makefile.am
@@ -13,6 +13,7 @@
ibrowseebindir = $(localerlanglibdir)/ibrowse-1.5.2/ebin
ibrowse_file_collection = \
+ ibrowse.app.in \
ibrowse.erl \
ibrowse_app.erl \
ibrowse_http_client.erl \
@@ -21,9 +22,8 @@ ibrowse_file_collection = \
ibrowse_sup.erl \
ibrowse_test.erl
-ibrowseebin_static_file = ibrowse.app
-
ibrowseebin_make_generated_file_list = \
+ ibrowse.app \
ibrowse.beam \
ibrowse_app.beam \
ibrowse_http_client.beam \
@@ -33,16 +33,17 @@ ibrowseebin_make_generated_file_list = \
ibrowse_test.beam
ibrowseebin_DATA = \
- $(ibrowseebin_static_file) \
$(ibrowseebin_make_generated_file_list)
EXTRA_DIST = \
$(ibrowse_file_collection) \
- $(ibrowseebin_static_file) \
ibrowse.hrl
CLEANFILES = \
$(ibrowseebin_make_generated_file_list)
+%.app: %.app.in
+ cp $< $@
+
%.beam: %.erl
$(ERLC) $(ERLC_FLAGS) $<
View
0  src/ibrowse/ibrowse.app → src/ibrowse/ibrowse.app.in
File renamed without changes
View
11 src/mochiweb/Makefile.am
@@ -20,6 +20,7 @@ mochiweb_file_collection = \
mochijson.erl \
mochijson2.erl \
mochinum.erl \
+ mochiweb.app.in \
mochiweb.erl \
mochiweb_app.erl \
mochiweb_charref.erl \
@@ -37,8 +38,6 @@ mochiweb_file_collection = \
mochiweb_util.erl \
reloader.erl
-mochiwebebin_static_file = mochiweb.app
-
mochiwebebin_make_generated_file_list = \
mochifmt.beam \
mochifmt_records.beam \
@@ -47,6 +46,7 @@ mochiwebebin_make_generated_file_list = \
mochijson.beam \
mochijson2.beam \
mochinum.beam \
+ mochiweb.app \
mochiweb.beam \
mochiweb_app.beam \
mochiweb_charref.beam \
@@ -65,15 +65,16 @@ mochiwebebin_make_generated_file_list = \
reloader.beam
mochiwebebin_DATA = \
- $(mochiwebebin_static_file) \
$(mochiwebebin_make_generated_file_list)
EXTRA_DIST = \
- $(mochiweb_file_collection) \
- $(mochiwebebin_static_file)
+ $(mochiweb_file_collection)
CLEANFILES = \
$(mochiwebebin_make_generated_file_list)
+%.app: %.app.in
+ cp $< $@
+
%.beam: %.erl
$(ERLC) $(ERLC_FLAGS) $<
View
0  src/mochiweb/mochiweb.app → src/mochiweb/mochiweb.app.in
File renamed without changes
View
34 test/Makefile.am
@@ -10,37 +10,5 @@
## License for the specific language governing permissions and limitations under
## the License.
-dist_TESTS = runner.sh
+SUBDIRS = etap javascript view_server
-EXTRA_DIST = \
- etap/030-doc-from-json.t \
- etap/080-config-get-set.t \
- etap/064-kt-counting.t \
- etap/081-config-override.1.ini \
- etap/100-ref-counter.t \
- etap/083-config-no-files.t \
- etap/070-couch-db.t \
- etap/010-file-basics.t \
- etap/060-kt-merging.t \
- etap/040-util.t \
- etap/110-replication-httpc.t \
- etap/062-kt-remove-leaves.t \
- etap/001-load.t \
- etap/111-replication-changes-feed.t \
- etap/063-kt-get-leaves.t \
- etap/090-task-status.t \
- etap/021-btree-reductions.t \
- etap/081-config-override.2.ini \
- etap/065-kt-stemming.t \
- etap/020-btree-basics.t \
- etap/081-config-override.t \
- etap/082-config-register.t \
- etap/112-replication-missing-revs.t \
- etap/011-file-headers.t \
- etap/061-kt-missing-leaves.t \
- etap/050-stream.t \
- etap/031-doc-to-json.t \
- query_server_spec.rb \
- run_native_process.es \
- runner.sh \
- test.js
View
4 test/etap/001-load.t
@@ -1,6 +1,5 @@
#!/usr/bin/env escript
%% -*- erlang -*-
-%%! -pa src/couchdb -sasl errlog_type error -boot start_sasl -noshell
% Licensed under the Apache License, Version 2.0 (the "License"); you may not
% use this file except in compliance with the License. You may obtain a copy of
@@ -17,8 +16,7 @@
% Test that we can load each module.
main(_) ->
- code:add_patha("src/etap"),
- code:add_pathz("src/couchdb"),
+ test_util:init_code_path(),
etap:plan(37),
Modules = [
couch_btree,
View
3  test/etap/002-erl-driver.t
@@ -13,8 +13,7 @@
main(_) ->
- code:add_patha("src/etap"),
- code:add_pathz("src/couchdb"),
+ test_util:init_code_path(),
etap:plan(3),
etap:is(
couch_util:start_driver("src/couchdb/.libs"),
View
5 test/etap/010-file-basics.t
@@ -12,11 +12,10 @@
% License for the specific language governing permissions and limitations under
% the License.
-filename() -> "./test/etap/temp.010".
+filename() -> test_util:build_file("test/etap/temp.010").
main(_) ->
- code:add_patha("src/etap"),
- code:add_pathz("src/couchdb"),
+ test_util:init_code_path(),
etap:plan(16),
case (catch test()) of
ok ->
View
5 test/etap/011-file-headers.t
@@ -14,12 +14,11 @@
% License for the specific language governing permissions and limitations under
% the License.
-filename() -> "./test/etap/temp.011".
+filename() -> test_util:build_file("test/etap/temp.011").
sizeblock() -> 4096. % Need to keep this in sync with couch_file.erl
main(_) ->
- code:add_patha("src/etap"),
- code:add_pathz("src/couchdb"),
+ test_util:init_code_path(),
{S1, S2, S3} = now(),
random:seed(S1, S2, S3),
View
5 test/etap/020-btree-basics.t
@@ -14,14 +14,13 @@
% License for the specific language governing permissions and limitations under
% the License.
-filename() -> "./test/etap/temp.020".
+filename() -> test_util:build_file("test/etap/temp.020").
rows() -> 250.
-record(btree, {fd, root, extract_kv, assemble_kv, less, reduce}).
main(_) ->
- code:add_patha("src/etap"),
- code:add_pathz("src/couchdb"),
+ test_util:init_code_path(),
etap:plan(48),
case (catch test()) of
ok ->
View
3  test/etap/021-btree-reductions.t
@@ -18,8 +18,7 @@ filename() -> "./test/etap/temp.021".
rows() -> 1000.
main(_) ->
- code:add_patha("src/etap"),
- code:add_pathz("src/couchdb"),
+ test_util:init_code_path(),
etap:plan(8),
case (catch test()) of
ok ->
View
3  test/etap/030-doc-from-json.t
@@ -20,8 +20,7 @@
-record(att, {name, type, len, md5= <<>>, revpos=0, data}).
main(_) ->
- code:add_patha("src/etap"),
- code:add_pathz("src/couchdb"),
+ test_util:init_code_path(),
etap:plan(26),
case (catch test()) of
ok ->
View
3  test/etap/031-doc-to-json.t
@@ -20,8 +20,7 @@
-record(att, {name, type, len, md5= <<>>, revpos=0, data}).
main(_) ->
- code:add_patha("src/etap"),
- code:add_pathz("src/couchdb"),
+ test_util:init_code_path(),
etap:plan(12),
case (catch test()) of
ok ->
View
3  test/etap/040-util.t
@@ -14,8 +14,7 @@
% the License.
main(_) ->
- code:add_patha("src/etap"),
- code:add_pathz("src/couchdb"),
+ test_util:init_code_path(),
application:start(crypto),
etap:plan(11),
View
9 test/etap/041-uuid-gen.t
@@ -14,13 +14,13 @@
% the License.
default_config() ->
- "etc/couchdb/default_dev.ini".
+ test_util:build_file("etc/couchdb/default_dev.ini").
seq_alg_config() ->
- "test/etap/041-uuid-gen-seq.ini".
+ test_util:source_file("test/etap/041-uuid-gen-seq.ini").
utc_alg_config() ->
- "test/etap/041-uuid-gen-utc.ini".
+ test_util:source_file("test/etap/041-uuid-gen-utc.ini").
% Run tests and wait for the gen_servers to shutdown
run_test(IniFiles, Test) ->
@@ -38,8 +38,7 @@ run_test(IniFiles, Test) ->
end.
main(_) ->
- code:add_patha("src/etap"),
- code:add_pathz("src/couchdb"),
+ test_util:init_code_path(),
application:start(crypto),
etap:plan(6),
View
3  test/etap/050-stream.t
@@ -14,8 +14,7 @@
% the License.
main(_) ->
- code:add_patha("src/etap"),
- code:add_pathz("src/couchdb"),
+ test_util:init_code_path(),
etap:plan(13),
case (catch test()) of
ok ->
View
3  test/etap/060-kt-merging.t
@@ -14,8 +14,7 @@
% the License.
main(_) ->
- code:add_patha("src/etap"),
- code:add_pathz("src/couchdb"),
+ test_util:init_code_path(),
etap:plan(16),
case (catch test()) of
ok ->
View
3  test/etap/061-kt-missing-leaves.t
@@ -14,8 +14,7 @@
% the License.
main(_) ->
- code:add_patha("src/etap"),
- code:add_pathz("src/couchdb"),
+ test_util:init_code_path(),
etap:plan(4),
case (catch test()) of
ok ->
View
3  test/etap/062-kt-remove-leaves.t
@@ -14,8 +14,7 @@
% the License.
main(_) ->
- code:add_patha("src/etap"),
- code:add_pathz("src/couchdb"),
+ test_util:init_code_path(),
etap:plan(6),
case (catch test()) of
ok ->
View
3  test/etap/063-kt-get-leaves.t
@@ -14,8 +14,7 @@
% the License.
main(_) ->
- code:add_patha("src/etap"),
- code:add_pathz("src/couchdb"),
+ test_util:init_code_path(),
etap:plan(11),
case (catch test()) of
ok ->
View
3  test/etap/064-kt-counting.t
@@ -14,8 +14,7 @@
% the License.
main(_) ->
- code:add_patha("src/etap"),
- code:add_pathz("src/couchdb"),
+ test_util:init_code_path(),
etap:plan(4),
case (catch test()) of
ok ->
View
3  test/etap/065-kt-stemming.t
@@ -14,8 +14,7 @@
% the License.
main(_) ->
- code:add_patha("src/etap"),
- code:add_pathz("src/couchdb"),
+ test_util:init_code_path(),
etap:plan(3),
case (catch test()) of
ok ->
View
4 test/etap/070-couch-db.t
@@ -14,9 +14,7 @@
% the License.
main(_) ->
- code:add_patha("src/etap"),
- code:add_pathz("src/couchdb"),
- code:add_pathz("src/mochiweb"),
+ test_util:init_code_path(),
etap:plan(4),
case (catch test()) of
View
5 test/etap/080-config-get-set.t
@@ -14,11 +14,10 @@
% the License.
default_config() ->
- "etc/couchdb/default_dev.ini".
+ test_util:build_file("etc/couchdb/default_dev.ini").
main(_) ->
- code:add_patha("src/etap"),
- code:add_pathz("src/couchdb"),
+ test_util:init_code_path(),
etap:plan(12),
case (catch test()) of
ok ->
View
11 test/etap/081-config-override.t
@@ -14,16 +14,16 @@
% the License.
default_config() ->
- "etc/couchdb/default_dev.ini".
+ test_util:build_file("etc/couchdb/default_dev.ini").
local_config_1() ->
- "test/etap/081-config-override.1.ini".
+ test_util:source_file("test/etap/081-config-override.1.ini").
local_config_2() ->
- "test/etap/081-config-override.2.ini".
+ test_util:source_file("test/etap/081-config-override.2.ini").
local_config_write() ->
- "test/etap/temp.081".
+ test_util:build_file("test/etap/temp.081").
% Run tests and wait for the config gen_server to shutdown.
run_tests(IniFiles, Tests) ->
@@ -39,8 +39,7 @@ run_tests(IniFiles, Tests) ->
end.
main(_) ->
- code:add_patha("src/etap"),
- code:add_pathz("src/couchdb"),
+ test_util:init_code_path(),
etap:plan(17),
case (catch test()) of
View
5 test/etap/082-config-register.t
@@ -14,11 +14,10 @@
% the License.
default_config() ->
- "etc/couchdb/default_dev.ini".
+ test_util:build_file("etc/couchdb/default_dev.ini").
main(_) ->
- code:add_patha("src/etap"),
- code:add_pathz("src/couchdb"),
+ test_util:init_code_path(),
etap:plan(5),
case (catch test()) of
ok ->
View
5 test/etap/083-config-no-files.t
@@ -14,11 +14,10 @@
% the License.
default_config() ->
- "etc/couchdb/default_dev.ini".
+ test_util:build_file("etc/couchdb/default_dev.ini").
main(_) ->
- code:add_patha("src/etap"),
- code:add_pathz("src/couchdb"),
+ test_util:init_code_path(),
etap:plan(3),
case (catch test()) of
ok ->
View
3  test/etap/090-task-status.t
@@ -14,8 +14,7 @@
% the License.
main(_) ->
- code:add_patha("src/etap"),
- code:add_pathz("src/couchdb"),
+ test_util:init_code_path(),
etap:plan(16),
case (catch test()) of
ok ->
View
3  test/etap/100-ref-counter.t
@@ -14,8 +14,7 @@
% the License.
main(_) ->
- code:add_patha("src/etap"),
- code:add_pathz("src/couchdb"),
+ test_util:init_code_path(),
etap:plan(8),
case (catch test()) of
ok ->
View
16 test/etap/110-replication-httpc.t
@@ -38,12 +38,14 @@
server() -> "http://127.0.0.1:5984/".
dbname() -> "etap-test-db".
+config_files() ->
+ lists:map(fun test_util:build_file/1, [
+ "etc/couchdb/default_dev.ini",
+ "etc/couchdb/local_dev.ini"
+ ]).
+
main(_) ->
- code:add_patha("src/etap"),
- code:add_pathz("src/couchdb"),
- code:add_pathz("src/ibrowse"),
- code:add_pathz("src/mochiweb"),
- code:add_pathz("src/erlang-oauth"),
+ test_util:init_code_path(),
etap:plan(6),
case (catch test()) of
@@ -56,9 +58,7 @@ main(_) ->
ok.
test() ->
- couch_server_sup:start_link(
- ["etc/couchdb/default_dev.ini", "etc/couchdb/local_dev.ini"]
- ),
+ couch_server_sup:start_link(config_files()),
ibrowse:start(),
crypto:start(),
View
17 test/etap/111-replication-changes-feed.t
@@ -37,12 +37,15 @@
pause = 1,
conn = nil
}).
+
+config_files() ->
+ lists:map(fun test_util:build_file/1, [
+ "etc/couchdb/default_dev.ini",
+ "etc/couchdb/local_dev.ini"
+ ]).
+
main(_) ->
- code:add_patha("src/etap"),
- code:add_pathz("src/couchdb"),
- code:add_pathz("src/ibrowse"),
- code:add_pathz("src/mochiweb"),
- code:add_pathz("src/erlang-oauth"),
+ test_util:init_code_path(),
etap:plan(13),
case (catch test()) of
@@ -55,9 +58,7 @@ main(_) ->
ok.
test() ->
- couch_server_sup:start_link(
- ["etc/couchdb/default_dev.ini", "etc/couchdb/local_dev.ini"]
- ),
+ couch_server_sup:start_link(config_files()),
ibrowse:start(),
crypto:start(),
View
16 test/etap/112-replication-missing-revs.t
@@ -39,12 +39,14 @@
conn = nil
}).
+config_files() ->
+ lists:map(fun test_util:build_file/1, [
+ "etc/couchdb/default_dev.ini",
+ "etc/couchdb/local_dev.ini"
+ ]).
+
main(_) ->
- code:add_patha("src/etap"),
- code:add_pathz("src/couchdb"),
- code:add_pathz("src/ibrowse"),
- code:add_pathz("src/mochiweb"),
- code:add_pathz("src/erlang-oauth"),
+ test_util:init_code_path(),
etap:plan(12),
case (catch test()) of
@@ -57,9 +59,7 @@ main(_) ->
ok.
test() ->
- couch_server_sup:start_link(
- ["etc/couchdb/default_dev.ini", "etc/couchdb/local_dev.ini"]
- ),
+ couch_server_sup:start_link(config_files()),
ibrowse:start(),
crypto:start(),
View
3  test/etap/120-stats-collect.t
@@ -14,8 +14,7 @@
% the License.
main(_) ->
- code:add_patha("src/etap"),
- code:add_pathz("src/couchdb"),
+ test_util:init_code_path(),
etap:plan(11),
case (catch test()) of
ok ->
View
13 test/etap/121-stats-aggregates.t
@@ -13,9 +13,14 @@
% License for the specific language governing permissions and limitations under
% the License.
+ini_file() ->
+ test_util:source_file("test/etap/121-stats-aggregates.ini").
+
+cfg_file() ->
+ test_util:source_file("test/etap/121-stats-aggregates.cfg").
+
main(_) ->
- code:add_patha("src/etap"),
- code:add_pathz("src/couchdb"),
+ test_util:init_code_path(),
etap:plan(17),
case (catch test()) of
ok ->
@@ -27,9 +32,9 @@ main(_) ->
ok.
test() ->
- couch_config:start_link(["test/etap/121-stats-aggregates.ini"]),
+ couch_config:start_link([ini_file()]),
couch_stats_collector:start(),
- couch_stats_aggregator:start("test/etap/121-stats-aggregates.cfg"),
+ couch_stats_aggregator:start(cfg_file()),
ok = test_all_empty(),
ok = test_get_empty(),
ok = test_count_stats(),
View
64 test/etap/Makefile.am
@@ -0,0 +1,64 @@
+## Licensed under the Apache License, Version 2.0 (the "License"); you may not
+## use this file except in compliance with the License. You may obtain a copy of
+## the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+## WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+## License for the specific language governing permissions and limitations under
+## the License.
+
+check_SCRIPTS = run
+noinst_DATA = test_util.beam
+
+%.beam: %.erl
+ erlc $<
+
+run: run.tpl
+ sed -e "s|%abs_top_srcdir%|@abs_top_srcdir@|g" \
+ -e "s|%abs_top_builddir%|@abs_top_builddir@|g" > \
+ $@ < $<
+ chmod +x $@
+
+CLEANFILES = run *.beam
+DISTCLEANFILES = temp.*
+
+EXTRA_DIST = \
+ run.tpl \
+ 001-load.t \
+ 002-erl-driver.t \
+ 010-file-basics.t \
+ 011-file-headers.t \
+ 020-btree-basics.t \
+ 021-btree-reductions.t \
+ 030-doc-from-json.t \
+ 031-doc-to-json.t \
+ 040-util.t \
+ 041-uuid-gen-seq.ini \
+ 041-uuid-gen-utc.ini \
+ 041-uuid-gen.t \
+ 050-stream.t \
+ 060-kt-merging.t \
+ 061-kt-missing-leaves.t \
+ 062-kt-remove-leaves.t \
+ 063-kt-get-leaves.t \
+ 064-kt-counting.t \
+ 065-kt-stemming.t \
+ 070-couch-db.t \
+ 080-config-get-set.t \
+ 081-config-override.1.ini \
+ 081-config-override.2.ini \
+ 081-config-override.t \
+ 082-config-register.t \
+ 083-config-no-files.t \
+ 090-task-status.t \
+ 100-ref-counter.t \
+ 110-replication-httpc.t \
+ 111-replication-changes-feed.t \
+ 112-replication-missing-revs.t \
+ 120-stats-collect.t \
+ 121-stats-aggregates.cfg \
+ 121-stats-aggregates.ini \
+ 121-stats-aggregates.t
View
27 test/etap/run.tpl
@@ -0,0 +1,27 @@
+#!/bin/sh -e
+
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+SRCDIR="%abs_top_srcdir%"
+BUILDIR="%abs_top_builddir%"
+
+export ERL_FLAGS="$ERL_FLAGS -pa $BUILDIR/test/etap/"
+
+if test $# -gt 0; then
+ while [ $# -gt 0 ]; do
+ $1
+ shift
+ done
+else
+ prove $SRCDIR/test/etap/*.t
+fi
View
35 test/etap/test_util.erl.in
@@ -0,0 +1,35 @@
+% Licensed under the Apache License, Version 2.0 (the "License"); you may not
+% use this file except in compliance with the License. You may obtain a copy of
+% the License at
+%
+% http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+% License for the specific language governing permissions and limitations under
+% the License.
+
+-module(test_util).
+
+-export([init_code_path/0]).
+-export([source_file/1, build_file/1]).
+
+srcdir() ->
+ "@abs_top_srcdir@".
+
+builddir() ->
+ "@abs_top_builddir@".
+
+init_code_path() ->
+ Paths = ["etap", "couchdb", "erlang-oauth", "ibrowse", "mochiweb"],
+ lists:foreach(fun(Name) ->
+ code:add_pathz(filename:join([builddir(), "src", Name]))
+ end, Paths).
+
+source_file(Name) ->
+ filename:join([srcdir(), Name]).
+
+build_file(Name) ->
+ filename:join([builddir(), Name]).
+
View
15 test/javascript/Makefile.am
@@ -0,0 +1,15 @@
+## Licensed under the Apache License, Version 2.0 (the "License"); you may not
+## use this file except in compliance with the License. You may obtain a copy of
+## the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+## WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+## License for the specific language governing permissions and limitations under
+## the License.
+
+EXTRA_DIST = \
+ runner.sh \
+ test.js
View
0  test/runner.sh → test/javascript/runner.sh
File renamed without changes
View
0  test/test.js → test/javascript/test.js
File renamed without changes
View
15 test/view_server/Makefile.am
@@ -0,0 +1,15 @@
+## Licensed under the Apache License, Version 2.0 (the "License"); you may not
+## use this file except in compliance with the License. You may obtain a copy of
+## the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+## WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+## License for the specific language governing permissions and limitations under
+## the License.
+
+EXTRA_DIST = \
+ query_server_spec.rb \
+ run_native_process.es
View
0  test/query_server_spec.rb → test/view_server/query_server_spec.rb
File renamed without changes
View
0  test/run_native_process.es → test/view_server/run_native_process.es
File renamed without changes
View
19 utils/Makefile.am
@@ -20,17 +20,18 @@ couchdb_command_name = `echo couchdb | sed '$(transform)'`
run: ../bin/couchdb.tpl
sed -e "s|%ERL%|$(ERL)|g" \
-e "s|%ICU_CONFIG%|$(ICU_CONFIG)|g" \
- -e "s|%bindir%|$(abs_top_srcdir)/bin|g" \
+ -e "s|%bindir%|$(abs_top_builddir)/bin|g" \
-e "s|%defaultini%|default_dev.ini|g" \
-e "s|%localini%|local_dev.ini|g" \
- -e "s|%localerlanglibdir%|foo -pa $(abs_top_srcdir)\/src\/couchdb \
- -pa $(abs_top_srcdir)\/src\/erlang-oauth \
- -pa $(abs_top_srcdir)\/src\/ibrowse \
- -pa $(abs_top_srcdir)\/src\/mochiweb|g" \
- -e "s|%localconfdir%|$(abs_top_srcdir)/etc/couchdb|g" \
- -e "s|%localstatelogdir%|$(abs_top_srcdir)/tmp/log|g" \
- -e "s|%localstatelibdir%|$(abs_top_srcdir)/tmp/lib|g" \
- -e "s|%localstatedir%|$(abs_top_srcdir)/tmp|g" \
+ -e "s|%localerlanglibdir%|foo \
+ -pa $(abs_top_builddir)\/src\/couchdb \
+ -pa $(abs_top_builddir)\/src\/erlang-oauth \
+ -pa $(abs_top_builddir)\/src\/ibrowse \
+ -pa $(abs_top_builddir)\/src\/mochiweb|g" \
+ -e "s|%localconfdir%|$(abs_top_builddir)/etc/couchdb|g" \
+ -e "s|%localstatelogdir%|$(abs_top_builddir)/tmp/log|g" \
+ -e "s|%localstatelibdir%|$(abs_top_builddir)/tmp/lib|g" \
+ -e "s|%localstatedir%|$(abs_top_builddir)/tmp|g" \
-e "s|%bug_uri%|@bug_uri@|g" \
-e "s|%package_author_address%|@package_author_address@|g" \
-e "s|%package_author_name%|@package_author_name@|g" \
Please sign in to comment.
Something went wrong with that request. Please try again.