aboutsummaryrefslogtreecommitdiff
path: root/tests/Makefile.tests
blob: bd1c8efcefd69613455fc50f1959749c1d2d2b00 (plain)
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
LIB_TESTS_L = get_mem_rsv \
	root_node find_property subnode_offset path_offset \
	get_name getprop get_phandle \
	get_path supernode_atdepth_offset parent_offset \
	node_offset_by_prop_value node_offset_by_phandle \
	node_check_compatible node_offset_by_compatible \
	get_alias \
	char_literal \
	sized_cells \
	notfound \
	addr_size_cells \
	addr_size_cells2 \
	stringlist \
	setprop_inplace nop_property nop_node \
	sw_tree1 sw_states \
	move_and_save mangle-layout nopulate \
	open_pack rw_tree1 set_name setprop del_property del_node \
	appendprop1 appendprop2 propname_escapes \
	string_escapes references path-references phandle_format \
	boot-cpuid incbin \
	extra-terminating-null \
	dtbs_equal_ordered \
	dtb_reverse dtbs_equal_unordered \
	add_subnode_with_nops path_offset_aliases \
	utilfdt_test \
	integer-expressions \
	property_iterate \
	subnode_iterate \
	overlay overlay_bad_fixup \
	check_path check_header check_full \
	fs_tree1
LIB_TESTS = $(LIB_TESTS_L:%=$(TESTS_PREFIX)%)

LIBTREE_TESTS_L = truncated_property truncated_string truncated_memrsv
LIBTREE_TESTS = $(LIBTREE_TESTS_L:%=$(TESTS_PREFIX)%)

DL_LIB_TESTS_L = asm_tree_dump value-labels
DL_LIB_TESTS = $(DL_LIB_TESTS_L:%=$(TESTS_PREFIX)%)

TESTS = $(LIB_TESTS) $(LIBTREE_TESTS) $(DL_LIB_TESTS)

TESTS_TREES_L = test_tree1.dtb
TESTS_TREES = $(TESTS_TREES_L:%=$(TESTS_PREFIX)%)

TESTS_TARGETS = $(TESTS) $(TESTS_TREES)

TESTS_DEPFILES = $(TESTS:%=%.d) \
	$(addprefix $(TESTS_PREFIX),testutils.d trees.d dumptrees.d)

TESTS_CLEANFILES_L =  *.output vglog.* vgcore.* *.dtb *.test.dts *.dtsv1 tmp.*
TESTS_CLEANFILES_L += dumptrees
TESTS_CLEANFILES = $(TESTS) $(TESTS_CLEANFILES_L:%=$(TESTS_PREFIX)%)
TESTS_CLEANDIRS_L = fs
TESTS_CLEANDIRS = $(TESTS_CLEANDIRS_L:%=$(TESTS_PREFIX)%)

.PHONY: tests
tests:	$(TESTS) $(TESTS_TREES)

$(LIB_TESTS): %: $(TESTS_PREFIX)testutils.o util.o $(LIBFDT_archive)

# Not necessary on all platforms; allow -ldl to be excluded instead of forcing
# other platforms to patch it out.
LIBDL = -ldl
$(DL_LIB_TESTS): %: %.o $(TESTS_PREFIX)testutils.o util.o $(LIBFDT_archive)
	@$(VECHO) LD [libdl] $@
	$(LINK.c) -o $@ $^ $(LIBDL)

$(LIBTREE_TESTS): %: $(TESTS_PREFIX)testutils.o $(TESTS_PREFIX)trees.o \
		util.o $(LIBFDT_archive)

$(TESTS_PREFIX)dumptrees: $(TESTS_PREFIX)trees.o

$(TESTS_TREES): $(TESTS_PREFIX)dumptrees
	@$(VECHO) DUMPTREES
	cd $(TESTS_PREFIX); ./dumptrees >/dev/null

tests_clean:
	@$(VECHO) CLEAN "(tests)"
	rm -f $(STD_CLEANFILES:%=$(TESTS_PREFIX)%)
	rm -f $(TESTS_CLEANFILES)
	rm -rf $(TESTS_CLEANDIRS)

check:	tests ${TESTS_BIN} $(TESTS_PYLIBFDT)
	cd $(TESTS_PREFIX); ./run_tests.sh

ifeq ($(NO_VALGRIND),1)
checkm:
	@echo "make checkm requires valgrind, but NO_VALGRIND=1"
else
checkm: tests ${TESTS_BIN} $(TESTS_PYLIBFDT)
	cd $(TESTS_PREFIX); ./run_tests.sh -m 2>&1 | tee vglog.$$$$
endif

checkv:	tests ${TESTS_BIN} $(TESTS_PYLIBFDT)
	cd $(TESTS_PREFIX); ./run_tests.sh -v

ifneq ($(DEPTARGETS),)
-include $(TESTS_DEPFILES)
endif