diff options
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | Makefile | 36 | ||||
-rw-r--r-- | libfdt/.gitignore | 5 | ||||
-rw-r--r-- | libfdt/Makefile | 28 | ||||
-rw-r--r-- | libfdt/tests/.gitignore | 1 | ||||
-rw-r--r-- | libfdt/tests/Makefile | 62 | ||||
-rw-r--r-- | tests/Makefile | 61 | ||||
-rw-r--r-- | tests/del_node.c (renamed from libfdt/tests/del_node.c) | 0 | ||||
-rw-r--r-- | tests/del_property.c (renamed from libfdt/tests/del_property.c) | 0 | ||||
-rw-r--r-- | tests/dumptrees.c (renamed from libfdt/tests/dumptrees.c) | 0 | ||||
-rw-r--r-- | tests/find_property.c (renamed from libfdt/tests/find_property.c) | 0 | ||||
-rw-r--r-- | tests/getprop.c (renamed from libfdt/tests/getprop.c) | 0 | ||||
-rw-r--r-- | tests/move_and_save.c (renamed from libfdt/tests/move_and_save.c) | 0 | ||||
-rw-r--r-- | tests/nop_node.c (renamed from libfdt/tests/nop_node.c) | 0 | ||||
-rw-r--r-- | tests/nop_property.c (renamed from libfdt/tests/nop_property.c) | 0 | ||||
-rw-r--r-- | tests/notfound.c (renamed from libfdt/tests/notfound.c) | 0 | ||||
-rw-r--r-- | tests/open_pack.c (renamed from libfdt/tests/open_pack.c) | 0 | ||||
-rw-r--r-- | tests/path_offset.c (renamed from libfdt/tests/path_offset.c) | 0 | ||||
-rw-r--r-- | tests/root_node.c (renamed from libfdt/tests/root_node.c) | 0 | ||||
-rw-r--r-- | tests/run_all_tests.sh | 2 | ||||
-rwxr-xr-x | tests/run_tests.sh (renamed from libfdt/tests/run_tests.sh) | 0 | ||||
-rw-r--r-- | tests/rw_tree1.c (renamed from libfdt/tests/rw_tree1.c) | 0 | ||||
-rw-r--r-- | tests/setprop.c (renamed from libfdt/tests/setprop.c) | 0 | ||||
-rw-r--r-- | tests/setprop_inplace.c (renamed from libfdt/tests/setprop_inplace.c) | 0 | ||||
-rw-r--r-- | tests/subnode_offset.c (renamed from libfdt/tests/subnode_offset.c) | 0 | ||||
-rw-r--r-- | tests/sw_tree1.c (renamed from libfdt/tests/sw_tree1.c) | 0 | ||||
-rw-r--r-- | tests/testdata.h (renamed from libfdt/tests/testdata.h) | 0 | ||||
-rw-r--r-- | tests/tests.h (renamed from libfdt/tests/tests.h) | 0 | ||||
-rw-r--r-- | tests/testutils.c (renamed from libfdt/tests/testutils.c) | 0 | ||||
-rw-r--r-- | tests/trees.S (renamed from libfdt/tests/trees.S) | 0 | ||||
-rw-r--r-- | tests/truncated_property.c (renamed from libfdt/tests/truncated_property.c) | 0 |
31 files changed, 94 insertions, 104 deletions
@@ -1,5 +1,8 @@ *.o *.d +*.a +*.so +*~ *.tab.[ch] lex.yy.c dtc @@ -9,7 +9,9 @@ DTC_OBJS = dtc.o flattree.o fstree.o data.o livetree.o \ DEPFILES = $(DTC_OBJS:.o=.d) -all: $(TARGETS) +.PHONY: libfdt tests + +all: $(TARGETS) tests libfdt dtc: $(DTC_OBJS) $(LINK.c) -o $@ $^ @@ -17,6 +19,9 @@ dtc: $(DTC_OBJS) ftdump: ftdump.o $(LINK.c) -o $@ $^ +libfdt: + cd libfdt && $(MAKE) all + dtc-parser.tab.c dtc-parser.tab.h dtc-parser.output: dtc-parser.y $(BISON) -d $< @@ -25,17 +30,38 @@ lex.yy.c: dtc-lexer.l lex.yy.o: lex.yy.c dtc-parser.tab.h -check: all - cd tests && $(MAKE) check +tests: tests/all + +tests/%: libfdt + $(MAKE) -C tests $* + +check: all + cd tests; ./run_tests.sh + +checkv: all + cd tests; ./run_tests.sh -v + +func: all + cd tests; ./run_tests.sh -t func + +funcv: all + cd tests; ./run_tests.sh -t func -v + +stress: all + cd tests; ./run_tests.sh -t stress + +stressv: all + cd tests; ./run_tests.sh -t stress -v clean: rm -f *~ *.o a.out core $(TARGETS) rm -f *.tab.[ch] lex.yy.c rm -f *.i *.output vgcore.* rm -f *.d - cd tests && $(MAKE) clean + $(MAKE) -C libfdt clean + $(MAKE) -C tests clean %.d: %.c - $(CC) -MM -MG -MT "$*.o $@" $< > $@ + $(CC) $(CPPFLAGS) -MM -MG -MT "$*.o $@" $< > $@ -include $(DEPFILES) diff --git a/libfdt/.gitignore b/libfdt/.gitignore deleted file mode 100644 index 4b147f1..0000000 --- a/libfdt/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -*.d -*.o -*.a -*.so -*~ diff --git a/libfdt/Makefile b/libfdt/Makefile index c8240bb..3f68877 100644 --- a/libfdt/Makefile +++ b/libfdt/Makefile @@ -26,35 +26,12 @@ endif DEPFILES = $(LIBOBJS:%.o=%.d) -all: libs tests +all: libs -.PHONY: tests libs +.PHONY: libs libs: $(TARGETLIBS) -tests: tests/all - -tests/%: libs - $(MAKE) -C tests $* - -check: all - cd tests; ./run_tests.sh - -checkv: all - cd tests; ./run_tests.sh -v - -func: all - cd tests; ./run_tests.sh -t func - -funcv: all - cd tests; ./run_tests.sh -t func -v - -stress: all - cd tests; ./run_tests.sh -t stress - -stressv: all - cd tests; ./run_tests.sh -t stress -v - %.o: %.c @$(VECHO) CC $@ $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $< @@ -74,7 +51,6 @@ libfdt.a: $(LIBOBJS) clean: @$(VECHO) CLEAN rm -f *~ *.o *.so *.a *.d *.i *.s core a.out $(VERSION) - $(MAKE) -C tests clean %.d: %.c @$(CC) $(CPPFLAGS) -MM -MT "$*.o $@" $< > $@ diff --git a/libfdt/tests/.gitignore b/libfdt/tests/.gitignore deleted file mode 100644 index b60ed20..0000000 --- a/libfdt/tests/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.dtb diff --git a/libfdt/tests/Makefile b/libfdt/tests/Makefile deleted file mode 100644 index 533c98e..0000000 --- a/libfdt/tests/Makefile +++ /dev/null @@ -1,62 +0,0 @@ -PREFIX = /usr/local - -LIB_TESTS = root_node find_property subnode_offset path_offset getprop \ - notfound \ - setprop_inplace nop_property nop_node \ - sw_tree1 \ - move_and_save \ - open_pack rw_tree1 setprop del_property del_node -LIBTREE_TESTS = truncated_property -TESTS = $(LIB_TESTS) $(LIBTREE_TESTS) -UTILS = dumptrees - -TREES = test_tree1.dtb - -CFLAGS = -Wall -g -CPPFLAGS = -I.. -LDFLAGS = -L.. - -LIBFDT = ../libfdt.a - -ifdef V -VECHO = : -else -VECHO = echo " " -.SILENT: -endif - -DEPFILES = $(TESTS:%=%.d) testutils.d - -all: $(TESTS) $(TREES) - -%.o: %.c - @$(VECHO) CC $@ - $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $< - -%.o: %.S - @$(VECHO) AS $@ - $(CC) -D__ASSEMBLY__ $(CPPFLAGS) -o $@ -c $< - -%: %.o - @$(VECHO) LD $@ - $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS) - -$(LIB_TESTS): %: testutils.o $(LIBFDT) - -$(LIBTREE_TESTS): %: testutils.o trees.o $(LIBFDT) - -dumptrees: %: trees.o - -$(TREES): dumptrees - @$(VECHO) DUMPTREES - ./dumptrees >/dev/null - -clean: - @$(VECHO) CLEAN "(tests)" - rm -f *~ *.o *.so *.a *.d *.s core a.out - rm -f $(TESTS) $(UTILS) *.dtb - -%.d: %.c - @$(CC) $(CPPFLAGS) -MM -MT "$*.o $@" $< > $@ - --include $(DEPFILES) diff --git a/tests/Makefile b/tests/Makefile index 912f832..5273028 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,12 +1,67 @@ DTC = ../dtc VG_DTC = valgrind --tool=memcheck ../dtc +LIB_TESTS = root_node find_property subnode_offset path_offset getprop \ + notfound \ + setprop_inplace nop_property nop_node \ + sw_tree1 \ + move_and_save \ + open_pack rw_tree1 setprop del_property del_node +LIBTREE_TESTS = truncated_property +TESTS = $(LIB_TESTS) $(LIBTREE_TESTS) +UTILS = dumptrees + +TREES = test_tree1.dtb + +CFLAGS = -Wall -g +CPPFLAGS = -I../libfdt +LDFLAGS = -L../libfdt + +LIBFDT = ../libfdt/libfdt.a + +ifdef V +VECHO = : +else +VECHO = echo " " +.SILENT: +endif + +DEPFILES = $(TESTS:%=%.d) testutils.d + check: all - ./run_all_tests.sh + ./run_tests.sh + +all: $(TESTS) $(TREES) + +%.o: %.c + @$(VECHO) CC $@ + $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $< + +%.o: %.S + @$(VECHO) AS $@ + $(CC) -D__ASSEMBLY__ $(CPPFLAGS) -o $@ -c $< + +%: %.o + @$(VECHO) LD $@ + $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS) + +$(LIB_TESTS): %: testutils.o $(LIBFDT) + +$(LIBTREE_TESTS): %: testutils.o trees.o $(LIBFDT) + +dumptrees: %: trees.o -all: +$(TREES): dumptrees + @$(VECHO) DUMPTREES + ./dumptrees >/dev/null clean: - rm -f *~ + rm -f $(TESTS) + rm -f *.dtb dumptrees + rm -f *~ *.d *.o a.out core + rm -f *.i *.output vgcore.* +%.d: %.c + @$(CC) $(CPPFLAGS) -MM -MT "$*.o $@" $< > $@ +-include $(DEPFILES) diff --git a/libfdt/tests/del_node.c b/tests/del_node.c index 26bb061..26bb061 100644 --- a/libfdt/tests/del_node.c +++ b/tests/del_node.c diff --git a/libfdt/tests/del_property.c b/tests/del_property.c index 35dc932..35dc932 100644 --- a/libfdt/tests/del_property.c +++ b/tests/del_property.c diff --git a/libfdt/tests/dumptrees.c b/tests/dumptrees.c index 3db0e2b..3db0e2b 100644 --- a/libfdt/tests/dumptrees.c +++ b/tests/dumptrees.c diff --git a/libfdt/tests/find_property.c b/tests/find_property.c index ced14ae..ced14ae 100644 --- a/libfdt/tests/find_property.c +++ b/tests/find_property.c diff --git a/libfdt/tests/getprop.c b/tests/getprop.c index f124951..f124951 100644 --- a/libfdt/tests/getprop.c +++ b/tests/getprop.c diff --git a/libfdt/tests/move_and_save.c b/tests/move_and_save.c index da73157..da73157 100644 --- a/libfdt/tests/move_and_save.c +++ b/tests/move_and_save.c diff --git a/libfdt/tests/nop_node.c b/tests/nop_node.c index 80cf4d0..80cf4d0 100644 --- a/libfdt/tests/nop_node.c +++ b/tests/nop_node.c diff --git a/libfdt/tests/nop_property.c b/tests/nop_property.c index 56256c4..56256c4 100644 --- a/libfdt/tests/nop_property.c +++ b/tests/nop_property.c diff --git a/libfdt/tests/notfound.c b/tests/notfound.c index a93b605..a93b605 100644 --- a/libfdt/tests/notfound.c +++ b/tests/notfound.c diff --git a/libfdt/tests/open_pack.c b/tests/open_pack.c index d614024..d614024 100644 --- a/libfdt/tests/open_pack.c +++ b/tests/open_pack.c diff --git a/libfdt/tests/path_offset.c b/tests/path_offset.c index 05b0c32..05b0c32 100644 --- a/libfdt/tests/path_offset.c +++ b/tests/path_offset.c diff --git a/libfdt/tests/root_node.c b/tests/root_node.c index 6e2c391..6e2c391 100644 --- a/libfdt/tests/root_node.c +++ b/tests/root_node.c diff --git a/tests/run_all_tests.sh b/tests/run_all_tests.sh deleted file mode 100644 index a8b7c3e..0000000 --- a/tests/run_all_tests.sh +++ /dev/null @@ -1,2 +0,0 @@ -#! /bin/sh - diff --git a/libfdt/tests/run_tests.sh b/tests/run_tests.sh index f4a5a54..f4a5a54 100755 --- a/libfdt/tests/run_tests.sh +++ b/tests/run_tests.sh diff --git a/libfdt/tests/rw_tree1.c b/tests/rw_tree1.c index 3fb9307..3fb9307 100644 --- a/libfdt/tests/rw_tree1.c +++ b/tests/rw_tree1.c diff --git a/libfdt/tests/setprop.c b/tests/setprop.c index 7f9be3e..7f9be3e 100644 --- a/libfdt/tests/setprop.c +++ b/tests/setprop.c diff --git a/libfdt/tests/setprop_inplace.c b/tests/setprop_inplace.c index 59c1209..59c1209 100644 --- a/libfdt/tests/setprop_inplace.c +++ b/tests/setprop_inplace.c diff --git a/libfdt/tests/subnode_offset.c b/tests/subnode_offset.c index d4edfe4..d4edfe4 100644 --- a/libfdt/tests/subnode_offset.c +++ b/tests/subnode_offset.c diff --git a/libfdt/tests/sw_tree1.c b/tests/sw_tree1.c index 7b54359..7b54359 100644 --- a/libfdt/tests/sw_tree1.c +++ b/tests/sw_tree1.c diff --git a/libfdt/tests/testdata.h b/tests/testdata.h index 822c69a..822c69a 100644 --- a/libfdt/tests/testdata.h +++ b/tests/testdata.h diff --git a/libfdt/tests/tests.h b/tests/tests.h index ace7ba3..ace7ba3 100644 --- a/libfdt/tests/tests.h +++ b/tests/tests.h diff --git a/libfdt/tests/testutils.c b/tests/testutils.c index fcb1c88..fcb1c88 100644 --- a/libfdt/tests/testutils.c +++ b/tests/testutils.c diff --git a/libfdt/tests/trees.S b/tests/trees.S index 6057668..6057668 100644 --- a/libfdt/tests/trees.S +++ b/tests/trees.S diff --git a/libfdt/tests/truncated_property.c b/tests/truncated_property.c index 5642d8d..5642d8d 100644 --- a/libfdt/tests/truncated_property.c +++ b/tests/truncated_property.c |