Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 26 additions & 31 deletions Makefile.win
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ REBAR?=$(CURDIR)/bin/rebar.cmd
PYTHON=python.exe
ERLFMT?=$(CURDIR)/bin/erlfmt.cmd
MAKE=make -f Makefile.win
GRADLE?=$(CURDIR)/nouveau/gradlew.bat
GRADLE?=$(CURDIR)/extra/nouveau/gradlew.bat
# REBAR?=$(shell where rebar.cmd)

# Handle the following scenarios:
Expand Down Expand Up @@ -104,7 +104,7 @@ endif

.PHONY: all
# target: all - Build everything
all: couch fauxton docs nouveau
all: couch-core fauxton docs extra/nouveau


.PHONY: help
Expand All @@ -118,9 +118,9 @@ help:
################################################################################


.PHONY: couch
# target: couch - Build CouchDB core, use ERL_COMPILER_OPTIONS to provide custom compiler's options
couch: config.erl
.PHONY: couch-core
# target: couch-core - Build CouchDB core, use ERL_COMPILER_OPTIONS to provide custom compiler's options
couch-core: config.erl
@set COUCHDB_VERSION=$(COUCHDB_VERSION) && set COUCHDB_GIT_SHA=$(COUCHDB_GIT_SHA) && $(REBAR) compile $(COMPILE_OPTS)
ifeq ($(with_spidermonkey), true)
@copy src\couch\priv\couchjs.exe bin
Expand Down Expand Up @@ -155,30 +155,27 @@ check: all
@$(MAKE) nouveau-test

ifdef apps
subdirs=$(apps)
EUNIT_SUBDIRS = $(strip $(subst $(comma),$(space),$(apps)))
else
subdirs=$(shell dir /b src)
EUNIT_SUBDIRS = $(filter-out fauxton docs, $(shell dir /b src))
endif

.PHONY: eunit
# target: eunit - Run EUnit tests, use EUNIT_OPTS to provide custom options
eunit: export BUILDDIR = $(CURDIR)
.PHONY: eunit $(EUNIT_SUBDIRS)
eunit: export ERL_AFLAGS = -config $(CURDIR)/rel/files/eunit.config
eunit: export COUCHDB_QUERY_SERVER_JAVASCRIPT = $(CURDIR)/bin/couchjs $(CURDIR)/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 || exit /b 1"
eunit: $(EUNIT_SUBDIRS)

setup-eunit: export BUILDDIR = $(CURDIR)
setup-eunit: export ERL_AFLAGS = -config $(CURDIR)/rel/files/eunit.config
setup-eunit:
@$(REBAR) setup_eunit 2> nul
$(EUNIT_SUBDIRS):
-@rmdir /s /q tmp\$@
@$(REBAR) setup_eunit app=$@
@set BUILDDIR=$(CURDIR)/tmp/$@ && set COUCHDB_VERSION=$(COUCHDB_VERSION) && set COUCHDB_GIT_SHA=$(COUCHDB_GIT_SHA) && $(REBAR) -r eunit $(EUNIT_OPTS) apps=$@ && @rmdir /s/q tmp\$@

just-eunit: export BUILDDIR = $(CURDIR)
just-eunit: export ERL_AFLAGS = -config $(CURDIR)/rel/files/eunit.config
just-eunit:
@$(REBAR) -r eunit $(EUNIT_OPTS)
# cat together couch_log files after running eunit test
.PHONY: catlogs
catlogs:
@type tmp/*/couch.log > tmp/couch.log || true

# target: erlfmt-check - Check Erlang source code formatting
erlfmt-check: export ERLFMT_PATH = $(ERLFMT)
Expand Down Expand Up @@ -241,7 +238,6 @@ elixir-cluster-with-quorum: elixir-init devclean
.PHONY: elixir
# target: elixir - Run Elixir-based integration tests
elixir: export MIX_ENV=integration
elixir: export COUCHDB_TEST_ADMIN_PARTY_OVERRIDE=1
elixir: elixir-init devclean
@dev\run "$(TEST_OPTS)" -n 1 -q -a adm:pass \
--enable-erlang-views \
Expand Down Expand Up @@ -284,6 +280,7 @@ build-report:
@$(PYTHON) build-aux/show-test-results.py --suites=10 --tests=10 > test-results.log || true
cat .\dev\logs\node1.log || true
cat .\dev\logs\nouveau.log || true
$(MAKE) catlogs || true
cat .\tmp\couch.log || true
cat test-results.log || true

Expand All @@ -305,7 +302,6 @@ list-eunit-suites:

.PHONY: mango-test
# target: mango-test - Run Mango tests
mango-test: export COUCHDB_TEST_ADMIN_PARTY_OVERRIDE=1
mango-test: devclean all
@$(PYTHON) -m venv src\mango\.venv && \
src\mango\.venv\Scripts\pip.exe install -r src\mango\requirements.txt
Expand Down Expand Up @@ -491,8 +487,8 @@ config.erl:


src\docs\build:
@echo 'Building docs...'
ifeq ($(with_docs), true)
@echo 'Building docs...'
@cd src\docs && setup.bat && make.bat html && make.bat man
endif

Expand All @@ -519,29 +515,28 @@ derived:
# Nouveau
################################################################################

.PHONY: nouveau
.PHONY: extra/nouveau
# target: nouveau - Build nouveau
nouveau:
extra/nouveau:
ifeq ($(with_nouveau), true)
@cd nouveau && $(GRADLE) spotlessApply
@cd nouveau && $(GRADLE) build -x test
@cd extra/nouveau && $(GRADLE) spotlessApply
@cd extra/nouveau && $(GRADLE) build -x test
endif

.PHONY: nouveau-test
# target: nouveau-test - Run nouveau tests
nouveau-test: nouveau-test-gradle nouveau-test-elixir

.PHONY: nouveau-test-gradle
nouveau-test-gradle: couch nouveau
nouveau-test-gradle: couch-core extra/nouveau
ifeq ($(with_nouveau), true)
@cd nouveau && $(GRADLE) test --info --rerun

@cd extra/nouveau && $(GRADLE) test --info --rerun
endif

.PHONY: nouveau-test-elixir
nouveau-test-elixir: export MIX_ENV=integration
nouveau-test-elixir: elixir-init devclean
nouveau-test-elixir: couch nouveau
nouveau-test-elixir: couch-core extra/nouveau
ifeq ($(with_nouveau), true)
@dev\run "$(TEST_OPTS)" -n 1 -q -a adm:pass --with-nouveau \
--locald-config test/elixir/test/config/test-config.ini \
Expand Down
2 changes: 1 addition & 1 deletion src/couch/include/couch_eunit.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
false ->
throw("BUILDDIR environment variable must be set");
Dir ->
Dir
string:strip(Dir)
end
end).
-define(CONFIG_DEFAULT,
Expand Down