Skip to content

Commit

Permalink
Calculate the app's dependant kazoo apps and compile-test them (2600h…
Browse files Browse the repository at this point in the history
…z#5885)

* Calculate the app's dependant kazoo apps and compile-test them

Rather than trying to make sure the relevant apps are also test
compiled when running an app's tests, calculate the apps involved
automagically and compile them for testing
  • Loading branch information
jamesaimonetti authored and lazedo committed Jul 3, 2019
1 parent 2034f1a commit e929274
Show file tree
Hide file tree
Showing 118 changed files with 537 additions and 418 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*.plt
*.app
.deps.mk
.test.deps
*.beam
*.so
*.o
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ clean-test-apps:
compile-test: ERLC_OPTS += +nowarn_missing_spec
compile-test: deps compile-test-core compile-test-apps
compile-test-core:
@$(MAKE) -j$(JOBS) -C core/ compile-test
@$(MAKE) -j$(JOBS) -C core/ compile-test-direct
compile-test-apps:
@$(MAKE) -j$(JOBS) -C applications/ compile-test
@$(MAKE) -j$(JOBS) -C applications/ compile-test-direct

eunit: eunit-core eunit-apps

Expand Down
5 changes: 4 additions & 1 deletion applications/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ROOT = ..

MAKEDIRS = $(sort $(wildcard */Makefile))

.PHONY: all compile compile-test clean clean-test eunit test $(MAKEDIRS)
.PHONY: all compile compile-test compile-test-direct clean clean-test eunit test $(MAKEDIRS)

all: compile

Expand All @@ -12,6 +12,9 @@ compile: $(MAKEDIRS)
compile-test: ACTION = compile-test
compile-test: $(MAKEDIRS)

compile-test-direct: ACTION = compile-test-direct
compile-test-direct: $(MAKEDIRS)

clean: ACTION = clean
clean: $(MAKEDIRS)

Expand Down
3 changes: 2 additions & 1 deletion applications/acdc/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = acdc

all: compile
Expand Down
3 changes: 2 additions & 1 deletion applications/ananke/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = ananke

all: compile
Expand Down
3 changes: 2 additions & 1 deletion applications/blackhole/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = blackhole

all: compile
Expand Down
3 changes: 2 additions & 1 deletion applications/braintree/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = braintree

SOURCES = $(wildcard src/*.erl) $(wildcard src/*/*.erl)
Expand Down
3 changes: 2 additions & 1 deletion applications/call_inspector/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = call_inspector

TEST_EBINS = $(wildcard $(ROOT)/deps/mochiweb-*/ebin)
Expand Down
10 changes: 2 additions & 8 deletions applications/callflow/Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = callflow

all: schemas compile

compile-test: compile-extra

compile-extra:
$(MAKE) compile-test -C $(ROOT)/core/kazoo_schemas/
$(MAKE) compile-test -C $(ROOT)/core/kazoo_apps/
$(MAKE) compile-test -C $(ROOT)/core/kazoo_call/

schemas:
@bash priv/scripts/check-schemas.bash

Expand Down
3 changes: 2 additions & 1 deletion applications/camper/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = camper

all: compile
Expand Down
3 changes: 2 additions & 1 deletion applications/cccp/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = cccp

all: compile
Expand Down
3 changes: 2 additions & 1 deletion applications/cdr/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = cdr

all: compile
Expand Down
3 changes: 2 additions & 1 deletion applications/conference/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = conference

all: compile
Expand Down
3 changes: 2 additions & 1 deletion applications/crossbar/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = crossbar

COMPILE_MOAR = priv/couchdb/schemas/port_requests.to_scheduled.json
Expand Down
3 changes: 2 additions & 1 deletion applications/doodle/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = doodle

all: compile
Expand Down
3 changes: 2 additions & 1 deletion applications/ecallmgr/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = ecallmgr

all: compile
Expand Down
3 changes: 2 additions & 1 deletion applications/edr/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = edr

all: compile
Expand Down
3 changes: 2 additions & 1 deletion applications/fax/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = fax

all: compile
Expand Down
3 changes: 2 additions & 1 deletion applications/frontier/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = frontier

all: compile
Expand Down
3 changes: 2 additions & 1 deletion applications/hangups/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = hangups

all: compile
Expand Down
3 changes: 2 additions & 1 deletion applications/hotornot/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = hotornot

all: compile
Expand Down
3 changes: 2 additions & 1 deletion applications/jonny5/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = jonny5

all: compile
Expand Down
3 changes: 2 additions & 1 deletion applications/konami/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = konami

all: compile
Expand Down
3 changes: 2 additions & 1 deletion applications/media_mgr/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = media_mgr

all: compile
Expand Down
3 changes: 2 additions & 1 deletion applications/milliwatt/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = milliwatt

all: compile
Expand Down
3 changes: 2 additions & 1 deletion applications/notify/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = notify

all: compile
Expand Down
3 changes: 2 additions & 1 deletion applications/omnipresence/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = omnipresence

all: compile
Expand Down
3 changes: 2 additions & 1 deletion applications/pivot/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = pivot

all: compile
Expand Down
3 changes: 2 additions & 1 deletion applications/pusher/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = pusher

all: compile
Expand Down
3 changes: 2 additions & 1 deletion applications/registrar/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = registrar

all: compile
Expand Down
3 changes: 2 additions & 1 deletion applications/reorder/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = reorder

all: compile
Expand Down
3 changes: 2 additions & 1 deletion applications/skel/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = skel

all: compile
Expand Down
3 changes: 2 additions & 1 deletion applications/spyvsspy/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = spyvsspy

all: compile
Expand Down
3 changes: 2 additions & 1 deletion applications/stats/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = stats

all: compile
Expand Down
3 changes: 2 additions & 1 deletion applications/stepswitch/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = stepswitch

all: compile
Expand Down
3 changes: 2 additions & 1 deletion applications/sysconf/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = sysconf

all: compile
Expand Down
5 changes: 3 additions & 2 deletions applications/tasks/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = tasks

all: compile
Expand All @@ -19,6 +20,6 @@ clean-headers:
@rm -f src/modules/kt_rates.hrl
@rm -f src/task_modules.hrl

compile-test: headers
compile-test-direct: headers

include $(ROOT)/make/kz.mk
9 changes: 3 additions & 6 deletions applications/teletype/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = teletype

all: compile
Expand All @@ -15,10 +16,6 @@ clean: clean-default_modules
clean-default_modules:
rm -f src/teletype_default_modules.hrl

compile-test: default_modules compile-extra

compile-extra:
$(MAKE) compile-test -C $(ROOT)/core/kazoo_data
$(MAKE) compile-test -C $(ROOT)/core/kazoo_bindings
compile-test-direct: default_modules

include $(ROOT)/make/kz.mk
3 changes: 2 additions & 1 deletion applications/trunkstore/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = trunkstore

all: compile
Expand Down
3 changes: 2 additions & 1 deletion applications/webhooks/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = webhooks

all: compile
Expand Down
5 changes: 4 additions & 1 deletion core/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ROOT = ..

MAKEDIRS = $(sort $(wildcard */Makefile))

.PHONY: all compile compile-test clean clean-test eunit test first $(MAKEDIRS)
.PHONY: all compile compile-test compile-test-direct clean clean-test eunit test first $(MAKEDIRS)

all: compile

Expand All @@ -12,6 +12,9 @@ compile: $(MAKEDIRS)
compile-test: ACTION = compile-test
compile-test: $(MAKEDIRS)

compile-test-direct: ACTION = compile-test-direct
compile-test-direct: $(MAKEDIRS)

clean: ACTION = clean
clean: $(MAKEDIRS)

Expand Down
3 changes: 2 additions & 1 deletion core/amqp_cron/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = amqp_cron

TEST_EBINS = $(ROOT)/core/amqp_leader/ebin
Expand Down
3 changes: 2 additions & 1 deletion core/amqp_leader/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = amqp_leader

all: compile
Expand Down
3 changes: 2 additions & 1 deletion core/gcm/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = gcm

all: compile
Expand Down
10 changes: 2 additions & 8 deletions core/kazoo/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = kazoo

# Mimetypes module generator.
Expand All @@ -15,13 +16,6 @@ compile: $(GEN_ERL)

compile-test: $(GEN_ERL)

eunit: kz-test

test: kz-test

kz-test:
$(MAKE) compile-test -C $(ROOT)/core/kazoo_stdlib

include $(ROOT)/make/kz.mk

clean-generated:
Expand Down
3 changes: 2 additions & 1 deletion core/kazoo_amqp/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT = ../..
CWD = $(shell pwd -P)
ROOT = $(realpath $(CWD)/../..)
PROJECT = kazoo_amqp

SOURCES = src/gen_listener.erl $(wildcard src/*.erl) $(wildcard src/*/*.erl)
Expand Down
Loading

0 comments on commit e929274

Please sign in to comment.