David Gibson | d9d679f | 2007-06-26 12:45:51 +1000 | [diff] [blame^] | 1 | LIB_TESTS_L = root_node find_property subnode_offset path_offset getprop \ |
| 2 | notfound \ |
| 3 | setprop_inplace nop_property nop_node \ |
| 4 | sw_tree1 \ |
| 5 | move_and_save \ |
| 6 | open_pack rw_tree1 setprop del_property del_node |
| 7 | LIB_TESTS = $(LIB_TESTS_L:%=$(TESTS_PREFIX)%) |
| 8 | |
| 9 | LIBTREE_TESTS_L = truncated_property |
| 10 | LIBTREE_TESTS = $(LIBTREE_TESTS_L:%=$(TESTS_PREFIX)%) |
| 11 | |
| 12 | TESTS = $(LIB_TESTS) $(LIBTREE_TESTS) |
| 13 | |
| 14 | TESTS_TREES_L = test_tree1.dtb |
| 15 | TESTS_TREES = $(TESTS_TREES_L:%=$(TESTS_PREFIX)%) |
| 16 | |
| 17 | TESTS_TARGETS = $(TESTS) $(TESTS_TREES) |
| 18 | |
| 19 | TESTS_DEPFILES = $(TESTS:%=%.d) $(TESTS_PREFIX)testutils.d |
| 20 | |
| 21 | TESTS_CLEANFILES_L = *.output vgcore.* *.dtb |
| 22 | TESTS_CLEANFILES = $(TESTS_CLEANFILES_L:%=$(TESTS_PREFIX)%) |
| 23 | |
| 24 | BIN += $(TESTS) $(TESTS_PREFIX)dumptrees |
| 25 | |
| 26 | .PHONY: tests |
| 27 | tests: $(TESTS) $(TESTS_TREES) |
| 28 | |
| 29 | $(LIB_TESTS): %: $(TESTS_PREFIX)testutils.o $(LIBFDT_LIB) |
| 30 | |
| 31 | $(LIBTREE_TESTS): %: $(TESTS_PREFIX)testutils.o $(TESTS_PREFIX)trees.o $(LIBFDT_LIB) |
| 32 | |
| 33 | $(TESTS_PREFIX)dumptrees: $(TESTS_PREFIX)trees.o |
| 34 | |
| 35 | $(TESTS_TREES): $(TESTS_PREFIX)dumptrees |
| 36 | @$(VECHO) DUMPTREES |
| 37 | cd $(TESTS_PREFIX); ./dumptrees >/dev/null |
| 38 | |
| 39 | tests_clean: |
| 40 | @$(VECHO) CLEAN "(tests)" |
| 41 | rm -f $(STD_CLEANFILES:%=$(TESTS_PREFIX)%) |
| 42 | rm -f $(TESTS_CLEANFILES) |
| 43 | |
| 44 | check: tests |
| 45 | cd $(TESTS_PREFIX); ./run_tests.sh |
| 46 | |
| 47 | checkv: tests |
| 48 | cd $(TESTS_PREFIX); ./run_tests.sh -v |
| 49 | |
| 50 | func: tests |
| 51 | cd $(TESTS_PREFIX); ./run_tests.sh -t func |
| 52 | |
| 53 | funcv: tests |
| 54 | cd $(TESTS_PREFIX); ./run_tests.sh -t func -v |
| 55 | |
| 56 | stress: tests |
| 57 | cd $(TESTS_PREFIX); ./run_tests.sh -t stress |
| 58 | |
| 59 | stressv: tests |
| 60 | cd $(TESTS_PREFIX); ./run_tests.sh -t stress -v |
| 61 | |
| 62 | ifneq ($(DEPTARGETS),) |
| 63 | -include $(TESTS_DEPFILES) |
| 64 | endif |
| 65 | |