forked from bootcampdevops/bcdo-training
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
73 lines (56 loc) · 1.64 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# makefile for running tests
# can be called from jenkins
# todo: may need to set PATH appropriately
default: tests
TOP_TARGETS :=shell-tests python-tests
BUILDROOT :=$(shell /bin/pwd -P)
ACT_BASE ?=$(BUILDROOT)/acts
ACT_DIRS :=$(shell ls -d $(ACT_BASE)/*)
TEST_REP_DIR :=$(BUILDROOT)/test-reports
BIN :=$(BUILDROOT)/bin
RESULTS_DIR :=$(BUILDROOT)/test-results
HDR:= =====
.PHONY: clean
.PHONY: tests ruby-tests shell-tests python-tests
.PHONY: unittests ruby-unittests shell-unittests shiot-tests python-unittests
tests: clean $(TEST_REP_DIR)
@$(MAKE) selftest > $(TEST_REP_DIR)/selftest.out 2>&1
@$(MAKE) -k $(TOP_TARGETS)
# make -k doesn't exit on first error
unittests:
@$(MAKE) -k shell-unittests python-unittests
shell-tests:
@$(MAKE) shiot-tests shunit2-tests
python-tests:
@$(MAKE) -k python-unittests
ruby-tests:
@$(MAKE) -k ruby-unittests
clean:
/bin/rm -rf $(TEST_REP_DIR)
selftest: clean $(TEST_REP_DIR)
@$(MAKE) ST_SUF=_st ACT_BASE=$(BUILDROOT)/testacts $(TOP_TARGETS)
$(RESULTS_DIR):
mkdir -p $@
$(TEST_REP_DIR):
mkdir -p $@
python-unittests: $(TEST_REP_DIR)
@echo $(HDR) running $@
cd $(ACT_BASE) \
&& nosetests --with-xunit \
--xunit-file=$(TEST_REP_DIR)/nosetests$(ST_SUF).xml
@echo $(HDR)
ruby-unittests: $(TEST_REP_DIR)
@echo $(HDR) running $@
cd $(ACT_BASE) \
&& $(BIN)/rspec-xunit -v -o $(TEST_REP_DIR)/rspec$(ST_SUF).xml
@echo $(HDR)
shunit2-tests:
@echo $(HDR) running $@
cd $(ACT_BASE) \
&& $(BIN)/shunit2-xunit -v -o $(TEST_REP_DIR)/shunit2$(ST_SUF).xml
@echo $(HDR)
shiot-tests: $(TEST_REP_DIR)
@echo $(HDR) running $@
cd $(ACT_BASE) \
&& $(BIN)/shiot-xunit -v -o $(TEST_REP_DIR)/shiot$(ST_SUF).xml
@echo $(HDR)