mirror of
https://github.com/dgibson/dtc.git
synced 2026-07-10 13:29:48 -04:00
Switch the build system to use treegen instead of trees.S + dumptrees for generating the test DTB files. treegen produces byte-identical output without requiring a GNU assembler. Remove the old tree.S, dumptrees.c and associated pieces. This also removes the need for the ASM_CONST_LL macro and separated values for the high and low halves of 64-bit values: those only existed so the same constants could be embedded in both C and assembly. Remove those from testdata.h, and the copies in pylibfdt_tests.py. Assisted-by: Claude:claude-opus-4-6 Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
99 lines
2.9 KiB
Text
99 lines
2.9 KiB
Text
LIB_TESTS_L = get_mem_rsv \
|
|
root_node find_property subnode_offset path_offset \
|
|
get_name getprop get_prop_offset 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 get_next_tag_invalid_prop_len \
|
|
char_literal \
|
|
sized_cells \
|
|
notfound \
|
|
addr_size_cells \
|
|
addr_size_cells2 \
|
|
appendprop_addrrange \
|
|
stringlist \
|
|
setprop_inplace nop_property nop_node \
|
|
sw_tree1 sw_states \
|
|
move_and_save mangle-layout nopulate \
|
|
open_pack rw_tree1 rw_oom set_name setprop del_property del_node \
|
|
appendprop1 appendprop2 propname_escapes \
|
|
string_escapes references path-references phandle_format \
|
|
boot-cpuid incbin relref_merge \
|
|
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 \
|
|
truncated_property truncated_string \
|
|
truncated_memrsv unterminated_memrsv
|
|
LIB_TESTS = $(LIB_TESTS_L:%=$(TESTS_PREFIX)%)
|
|
|
|
ifneq ($(STATIC_BUILD),1)
|
|
DL_LIB_TESTS_L = asm_tree_dump value-labels
|
|
DL_LIB_TESTS = $(DL_LIB_TESTS_L:%=$(TESTS_PREFIX)%)
|
|
endif
|
|
|
|
TESTS = $(LIB_TESTS) $(DL_LIB_TESTS)
|
|
|
|
TESTS_TREES_L = test_tree1.dtb bad_node_char.dtb bad_node_format.dtb \
|
|
bad_prop_char.dtb ovf_size_strings.dtb truncated_property.dtb \
|
|
truncated_string.dtb truncated_memrsv.dtb unterminated_memrsv.dtb \
|
|
two_roots.dtb named_root.dtb
|
|
TESTS_TREES = $(TESTS_TREES_L:%=$(TESTS_PREFIX)%)
|
|
|
|
TESTS_TARGETS = $(TESTS) $(TESTS_TREES)
|
|
|
|
TESTS_DEPFILES = $(TESTS:%=%.d) \
|
|
$(addprefix $(TESTS_PREFIX),testutils.d)
|
|
|
|
TESTS_CLEANFILES_L = $(STD_CLEANFILES) \
|
|
*.dtb *.test.dts *.test.dt.yaml *.dtsv1 tmp.* *.bak \
|
|
treegen
|
|
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_dep)
|
|
|
|
# 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_dep)
|
|
@$(VECHO) LD [libdl] $@
|
|
$(LINK.c) -o $@ $^ $(LIBDL)
|
|
|
|
$(TESTS_TREES): $(TESTS_PREFIX)treegen
|
|
@$(VECHO) TREEGEN
|
|
cd $(TESTS_PREFIX); ./treegen . >/dev/null
|
|
|
|
tests_clean:
|
|
@$(VECHO) CLEAN "(tests)"
|
|
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
|
|
endif
|
|
|
|
checkv: tests ${TESTS_BIN} $(TESTS_PYLIBFDT)
|
|
cd $(TESTS_PREFIX); ./run_tests.sh -v
|
|
|
|
ifneq ($(DEPTARGETS),)
|
|
-include $(TESTS_DEPFILES)
|
|
endif
|