1 | # | |
---|
2 | # o---------------------------------------------------------------------o |
---|
3 | # | |
---|
4 | # | MAD makefile - tester rules |
---|
5 | # | |
---|
6 | # o---------------------------------------------------------------------o |
---|
7 | # | |
---|
8 | # | Methodical Accelerator Design |
---|
9 | # | |
---|
10 | # | Copyright (c) 2011+ CERN, mad@cern.ch |
---|
11 | # | |
---|
12 | # | For more information, see http://cern.ch/mad |
---|
13 | # | |
---|
14 | # o---------------------------------------------------------------------o |
---|
15 | # | |
---|
16 | # | $Id$ |
---|
17 | # | |
---|
18 | |
---|
19 | .PHONY: tests tests-all init-test fini-test check-tests-dirs check-tests-lists $(tests-all) $(TESTS) |
---|
20 | |
---|
21 | # |
---|
22 | # all tests |
---|
23 | # |
---|
24 | tests-all: init-test $(if $(TESTS),$(TESTS),$(tests-all)) fini-test |
---|
25 | |
---|
26 | # |
---|
27 | # fast tests only |
---|
28 | # |
---|
29 | tests: init-test $(if $(TESTS),$(TESTS),$(filter-out $(tests-long),$(tests-all))) fini-test |
---|
30 | |
---|
31 | # |
---|
32 | # rule for one test |
---|
33 | # |
---|
34 | $(sort $(TESTS) $(tests-all)): |
---|
35 | $(run-test) |
---|
36 | |
---|
37 | # |
---|
38 | # rule for init test |
---|
39 | # |
---|
40 | init-test: check-tests-dirs check-tests-lists |
---|
41 | $(init-test) |
---|
42 | |
---|
43 | # |
---|
44 | # rule for fini test |
---|
45 | # |
---|
46 | fini-test: |
---|
47 | $(fini-test) |
---|
48 | |
---|
49 | # |
---|
50 | # check for directory existence |
---|
51 | # |
---|
52 | check-tests-dirs: |
---|
53 | $(foreach dir,$(if $(TESTS),$(TESTS),$(tests-all)),\ |
---|
54 | $(call exists,tests/$(dir),invalid test directory tests/$(dir))) |
---|
55 | |
---|
56 | # |
---|
57 | # check for lists consistency |
---|
58 | # |
---|
59 | check-tests-lists: |
---|
60 | ifneq ($(filter-out $(tests-all),$(tests-long)),) |
---|
61 | $E "warning: Inconsistency detected between tests-long and tests-all (includes tests-long)" |
---|
62 | $E "warning: Missing files: $(filter-out $(tests-all),$(tests-long))" |
---|
63 | endif |
---|
64 | |
---|
65 | # end of makefile |
---|