1LIB_TESTS_L = get_mem_rsv \
2	root_node find_property subnode_offset path_offset \
3	get_name getprop get_phandle \
4	get_path supernode_atdepth_offset parent_offset \
5	node_offset_by_prop_value node_offset_by_phandle \
6	node_check_compatible node_offset_by_compatible \
7	get_alias \
8	char_literal \
9	sized_cells \
10	notfound \
11	addr_size_cells \
12	stringlist \
13	setprop_inplace nop_property nop_node \
14	sw_tree1 \
15	move_and_save mangle-layout nopulate \
16	open_pack rw_tree1 set_name setprop del_property del_node \
17	appendprop1 appendprop2 propname_escapes \
18	string_escapes references path-references phandle_format \
19	boot-cpuid incbin \
20	extra-terminating-null \
21	dtbs_equal_ordered \
22	dtb_reverse dtbs_equal_unordered \
23	add_subnode_with_nops path_offset_aliases \
24	utilfdt_test \
25	integer-expressions \
26	property_iterate \
27	subnode_iterate \
28	overlay overlay_bad_fixup \
29	check_path
30LIB_TESTS = $(LIB_TESTS_L:%=$(TESTS_PREFIX)%)
31
32LIBTREE_TESTS_L = truncated_property
33LIBTREE_TESTS = $(LIBTREE_TESTS_L:%=$(TESTS_PREFIX)%)
34
35DL_LIB_TESTS_L = asm_tree_dump value-labels
36DL_LIB_TESTS = $(DL_LIB_TESTS_L:%=$(TESTS_PREFIX)%)
37
38TESTS = $(LIB_TESTS) $(LIBTREE_TESTS) $(DL_LIB_TESTS)
39
40TESTS_TREES_L = test_tree1.dtb
41TESTS_TREES = $(TESTS_TREES_L:%=$(TESTS_PREFIX)%)
42
43TESTS_TARGETS = $(TESTS) $(TESTS_TREES)
44
45TESTS_DEPFILES = $(TESTS:%=%.d) \
46	$(addprefix $(TESTS_PREFIX),testutils.d trees.d dumptrees.d)
47
48TESTS_CLEANFILES_L =  *.output vglog.* vgcore.* *.dtb *.test.dts *.dtsv1 tmp.*
49TESTS_CLEANFILES_L += dumptrees
50TESTS_CLEANFILES = $(TESTS) $(TESTS_CLEANFILES_L:%=$(TESTS_PREFIX)%)
51
52.PHONY: tests
53tests:	$(TESTS) $(TESTS_TREES)
54
55$(LIB_TESTS): %: $(TESTS_PREFIX)testutils.o util.o $(LIBFDT_archive)
56
57$(DL_LIB_TESTS): %: %.o $(TESTS_PREFIX)testutils.o util.o $(LIBFDT_archive)
58	@$(VECHO) LD [libdl] $@
59	$(LINK.c) -o $@ $^ -ldl
60
61$(LIBTREE_TESTS): %: $(TESTS_PREFIX)testutils.o $(TESTS_PREFIX)trees.o \
62		util.o $(LIBFDT_archive)
63
64$(TESTS_PREFIX)dumptrees: $(TESTS_PREFIX)trees.o
65
66$(TESTS_TREES): $(TESTS_PREFIX)dumptrees
67	@$(VECHO) DUMPTREES
68	cd $(TESTS_PREFIX); ./dumptrees >/dev/null
69
70tests_clean:
71	@$(VECHO) CLEAN "(tests)"
72	rm -f $(STD_CLEANFILES:%=$(TESTS_PREFIX)%)
73	rm -f $(TESTS_CLEANFILES)
74
75check:	tests ${TESTS_BIN} $(TESTS_PYLIBFDT)
76	cd $(TESTS_PREFIX); ./run_tests.sh
77
78checkm: tests ${TESTS_BIN} $(TESTS_PYLIBFDT)
79	cd $(TESTS_PREFIX); ./run_tests.sh -m 2>&1 | tee vglog.$$$$
80
81checkv:	tests ${TESTS_BIN} $(TESTS_PYLIBFDT)
82	cd $(TESTS_PREFIX); ./run_tests.sh -v
83
84ifneq ($(DEPTARGETS),)
85-include $(TESTS_DEPFILES)
86endif
87
88