summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorILYA Khlopotov <iilyak@apache.org>2018-12-07 16:27:54 +0000
committerILYA Khlopotov <iilyak@apache.org>2018-12-07 22:45:03 +0000
commitbe38d66ef9fb8b97bf2d5d2f7c3bf4698eee5f93 (patch)
tree44bf3d880e1d1fd91d3abc8af661f2e75642268b
parent77eb982bd9cd078e45e4a424e7ffa46f7073bfa5 (diff)
downloadcouchdb-be38d66ef9fb8b97bf2d5d2f7c3bf4698eee5f93.tar.gz
Support specifying individual Elixir tests to run
Individual tests can be specified as: - make elixir tests=test/basics_test.exs - make elixir tests=test/basics_test.exs,test/config_test.exs - make elixir tests=test/basic_test.exs:17
-rw-r--r--Makefile8
-rw-r--r--Makefile.win9
-rwxr-xr-xtest/elixir/run2
-rw-r--r--test/elixir/run.cmd2
4 files changed, 17 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 5af99740d..04c40e7fe 100644
--- a/Makefile
+++ b/Makefile
@@ -59,6 +59,11 @@ COUCHDB_VERSION = $(RELTAG)$(DIRTY)
endif
endif
+# needed to do text substitutions
+comma:= ,
+empty:=
+space:= $(empty) $(empty)
+
DESTDIR=
# Rebar options
@@ -80,6 +85,7 @@ DIALYZE_OPTS=$(shell echo "\
apps=$(apps) \
skip_deps=$(skip_deps) \
" | sed -e 's/[a-z]\{1,\}= / /g')
+EXUNIT_OPTS=$(subst $(comma),$(space),$(tests))
#ignore javascript tests
ignore_js_suites=
@@ -195,7 +201,7 @@ python-black-update: .venv/bin/black
.PHONY: elixir
elixir: elixir-check-formatted elixir-credo devclean
- @dev/run -a adm:pass --no-eval test/elixir/run
+ @dev/run -a adm:pass --no-eval test/elixir/run $(EXUNIT_OPTS)
.PHONY: elixir-check-formatted
elixir-check-formatted:
diff --git a/Makefile.win b/Makefile.win
index a42ec7027..0ffbfa971 100644
--- a/Makefile.win
+++ b/Makefile.win
@@ -60,6 +60,11 @@ COUCHDB_VERSION = $(RELTAG)$(DIRTY)
endif
endif
+# needed to do text substitutions
+comma:= ,
+empty:=
+space:= $(empty) $(empty)
+
DESTDIR=
# Rebar options
@@ -72,6 +77,8 @@ tests=
EUNIT_OPTS=skip_deps=$(skip_deps)
DIALYZE_OPTS=skip_deps=$(skip_deps)
+EXUNIT_OPTS=$(subst $(comma),$(space),$(tests))
+
################################################################################
# Main commands
################################################################################
@@ -166,7 +173,7 @@ python-black-update: .venv/bin/black
.PHONY: elixir
elixir: elixir-check-formatted elixir-credo devclean
- @dev\run -a adm:pass --no-eval test\elixir\run.cmd
+ @dev\run -a adm:pass --no-eval test\elixir\run.cmd $(EXUNIT_OPTS)
.PHONY: elixir-check-formatted
elixir-check-formatted:
diff --git a/test/elixir/run b/test/elixir/run
index 2d8464c18..a9c2efa4d 100755
--- a/test/elixir/run
+++ b/test/elixir/run
@@ -3,4 +3,4 @@ cd "$(dirname "$0")"
mix local.hex --force
mix local.rebar --force
mix deps.get
-mix test --trace
+mix test --trace "$@"
diff --git a/test/elixir/run.cmd b/test/elixir/run.cmd
index a99df8c6c..f1789adce 100644
--- a/test/elixir/run.cmd
+++ b/test/elixir/run.cmd
@@ -4,4 +4,4 @@ cd %~dp0
call mix local.hex --force
call mix local.rebar --force
call mix deps.get
-call mix test --trace
+call mix test --trace %*