You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ro...@apache.org on 2023/01/20 21:14:57 UTC
[couchdb] branch fix-win-makefile created (now 4292914d4)
This is an automated email from the ASF dual-hosted git repository.
ronny pushed a change to branch fix-win-makefile
in repository https://gitbox.apache.org/repos/asf/couchdb.git
at 4292914d4 Allow to run only specific EUnit tests on Windows
This branch includes the following new commits:
new 4292914d4 Allow to run only specific EUnit tests on Windows
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[couchdb] 01/01: Allow to run only specific EUnit tests on Windows
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ronny pushed a commit to branch fix-win-makefile
in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit 4292914d46b53316d6690540b757ad0bedf68929
Author: Ronny Berndt <ro...@apache.org>
AuthorDate: Fri Jan 20 22:11:22 2023 +0100
Allow to run only specific EUnit tests on Windows
- backport dynamic environment variables to Makefile.win
- return exit code 1 if EUnit test fail
- fixes some path issues
---
Makefile.win | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/Makefile.win b/Makefile.win
index 13b83f781..a6acaa161 100644
--- a/Makefile.win
+++ b/Makefile.win
@@ -82,9 +82,10 @@ skip_deps=folsom,meck,mochiweb,triq,proper,snappy,bcrypt,hyper,ibrowse,local
suites=
tests=
-# no sed on Windows, hard code since apps\suites\tests are empty
-EUNIT_OPTS=skip_deps=$(skip_deps)
-DIALYZE_OPTS=skip_deps=$(skip_deps)
+# no sed on Windows (per default), but powershell
+COMPILE_OPTS=$(shell powershell -command "('apps=${apps} ') -replace '[a-z_]+= ', ' '")
+EUNIT_OPTS=$(shell powershell -command "('skip_deps=${skip_deps} suites=${suites} tests=${tests} ') -replace '[a-z]+= ', ' '")
+DIALYZE_OPTS=$(shell powershell -command "('apps=${apps} skip_deps=${skip_deps} ') -replace '[a-z]+= ', ' '")
EXUNIT_OPTS=$(subst $(comma),$(space),$(tests))
@@ -133,9 +134,10 @@ fauxton: share\www
.PHONY: check
# target: check - Test everything
check: all
+ @$(MAKE) exunit
@$(MAKE) eunit
@$(MAKE) mango-test
- @$(MAKE) elixir
+ @$(MAKE) elixir-suite
ifdef apps
subdirs = $(apps)
@@ -146,30 +148,30 @@ endif
.PHONY: eunit
# target: eunit - Run EUnit tests, use EUNIT_OPTS to provide custom options
eunit: export BUILDDIR = $(shell echo %cd%)
-eunit: export ERL_AFLAGS = $(shell echo "-config rel/files/eunit.config")
+eunit: export ERL_AFLAGS = $(shell echo "-config %cd%/rel/files/eunit.config")
eunit: export COUCHDB_QUERY_SERVER_JAVASCRIPT = $(shell echo %cd%)/bin/couchjs $(shell echo %cd%)/share/server/main.js
eunit: export COUCHDB_TEST_ADMIN_PARTY_OVERRIDE=1
eunit: couch
@set COUCHDB_VERSION=$(COUCHDB_VERSION) && set COUCHDB_GIT_SHA=$(COUCHDB_GIT_SHA) && $(REBAR) setup_eunit 2> nul
- @cmd /c "FOR %d IN ($(subdirs)) DO set COUCHDB_VERSION=$(COUCHDB_VERSION) & set COUCHDB_GIT_SHA=$(COUCHDB_GIT_SHA) & $(REBAR) -r eunit $(EUNIT_OPTS) apps=%d"
+ @cmd /c "FOR %d IN ($(subdirs)) DO set COUCHDB_VERSION=$(COUCHDB_VERSION) & set COUCHDB_GIT_SHA=$(COUCHDB_GIT_SHA) & $(REBAR) -r eunit $(EUNIT_OPTS) apps=%d || exit /b 1"
.PHONY: exunit
# target: exunit - Run ExUnit tests
exunit: export BUILDDIR = $(shell echo %cd%)
exunit: export MIX_ENV=test
exunit: export ERL_LIBS = $(shell echo %cd%)\src
-exunit: export ERL_AFLAGS = $(shell echo "-config rel/files/eunit.config")
+exunit: export ERL_AFLAGS = $(shell echo "-config %cd%/rel/files/eunit.config")
exunit: export COUCHDB_QUERY_SERVER_JAVASCRIPT = $(shell echo %cd%)/bin/couchjs $(shell echo %cd%)/share/server/main.js
exunit: couch elixir-init setup-eunit elixir-check-formatted elixir-credo
@mix test --cover --trace $(EXUNIT_OPTS)
-setup-eunit: export BUILDDIR = $(shell pwd)
-setup-eunit: export ERL_AFLAGS = $(shell echo "-config rel/files/eunit.config")
+setup-eunit: export BUILDDIR = $(shell echo %cd%)
+setup-eunit: export ERL_AFLAGS = $(shell echo "-config %cd%/rel/files/eunit.config")
setup-eunit:
@$(REBAR) setup_eunit 2> nul
-just-eunit: export BUILDDIR = $(shell pwd)
-just-eunit: export ERL_AFLAGS = $(shell echo "-config rel/files/eunit.config")
+just-eunit: export BUILDDIR = $(shell echo %cd%)
+just-eunit: export ERL_AFLAGS = $(shell echo "-config %cd%/rel/files/eunit.config")
just-eunit:
@$(REBAR) -r eunit $(EUNIT_OPTS)
@@ -361,7 +363,7 @@ install: release
@echo .
@echo To install CouchDB into your system, copy the rel\couchdb
@echo to your desired installation location. For example:
- @echo xcopy /E rel\couchdb C:\CouchDB\
+ @echo xcopy /E rel\couchdb C:\CouchDB\
@echo .
################################################################################