Kaynağa Gözat

Fixed makefiles inclusion flow to pass actual configuration variable values.
Test build system modified to be similar to uClibc one:
* test custom logic moved from Makefile to a new Makefile.in (to be included
by Makefile).
* Makefile same for all tests and just used for including all other needed
makefiles.

Signed-off-by: Salvatore Cro <salvatore.cro@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>

Carmelo Amoroso 15 yıl önce
ebeveyn
işleme
e72856950a
51 değiştirilmiş dosya ile 341 ekleme ve 222 silme
  1. 1 1
      test/Makefile
  2. 13 9
      test/README
  3. 0 3
      test/Test.mak
  4. 3 7
      test/args/Makefile
  5. 9 0
      test/args/Makefile.in
  6. 3 3
      test/assert/Makefile
  7. 5 0
      test/assert/Makefile.in
  8. 3 0
      test/build/Makefile
  9. 3 10
      test/crypt/Makefile
  10. 6 0
      test/crypt/Makefile.in
  11. 3 2
      test/ctype/Makefile
  12. 4 0
      test/ctype/Makefile.in
  13. 3 36
      test/dlopen/Makefile
  14. 38 0
      test/dlopen/Makefile.in
  15. 3 0
      test/inet/Makefile
  16. 3 25
      test/locale-mbwc/Makefile
  17. 27 0
      test/locale-mbwc/Makefile.in
  18. 3 27
      test/locale/Makefile
  19. 29 0
      test/locale/Makefile.in
  20. 3 2
      test/malloc/Makefile
  21. 4 0
      test/malloc/Makefile.in
  22. 3 26
      test/math/Makefile
  23. 27 0
      test/math/Makefile.in
  24. 3 10
      test/misc/Makefile
  25. 12 0
      test/misc/Makefile.in
  26. 3 0
      test/mmap/Makefile
  27. 3 4
      test/pthread/Makefile
  28. 7 0
      test/pthread/Makefile.in
  29. 3 6
      test/pwd_grp/Makefile
  30. 8 0
      test/pwd_grp/Makefile.in
  31. 3 0
      test/regex/Makefile
  32. 3 8
      test/rpc/Makefile
  33. 11 0
      test/rpc/Makefile.in
  34. 3 0
      test/setjmp/Makefile
  35. 3 4
      test/signal/Makefile
  36. 6 0
      test/signal/Makefile.in
  37. 3 3
      test/silly/Makefile
  38. 5 0
      test/silly/Makefile.in
  39. 3 8
      test/stat/Makefile
  40. 10 0
      test/stat/Makefile.in
  41. 4 3
      test/stdio/Makefile
  42. 4 0
      test/stdio/Makefile.in
  43. 3 5
      test/stdlib/Makefile
  44. 7 0
      test/stdlib/Makefile.in
  45. 3 2
      test/string/Makefile
  46. 4 0
      test/string/Makefile.in
  47. 3 0
      test/termios/Makefile
  48. 3 9
      test/time/Makefile
  49. 11 0
      test/time/Makefile.in
  50. 3 9
      test/unistd/Makefile
  51. 11 0
      test/unistd/Makefile.in

+ 1 - 1
test/Makefile

@@ -32,7 +32,7 @@ endif
 ifneq ($(UCLIBC_HAS_LOCALE),y)
 ifneq ($(UCLIBC_HAS_LOCALE),y)
 	DIRS := $(filter-out locale,$(DIRS))
 	DIRS := $(filter-out locale,$(DIRS))
 endif
 endif
-ifeq ($(UCLIBC_HAS_CRYPT_STUB),y)
+ifneq ($(UCLIBC_HAS_CRYPT),y)
 	DIRS := $(filter-out crypt,$(DIRS))
 	DIRS := $(filter-out crypt,$(DIRS))
 endif
 endif
 ifeq ($(HAS_NO_THREADS),y)
 ifeq ($(HAS_NO_THREADS),y)

+ 13 - 9
test/README

@@ -36,19 +36,23 @@ make check UCLIBC_ONLY=1
 ----------------
 ----------------
 
 
 The structure of this test system is:
 The structure of this test system is:
- test/                 toplevel dir containing common test code
- test/Rules.mak        Common build code
- test/Test.mak         Runtime test make code
- test/subdir/          code specific to a subsystem is stored in a subdir
- test/subdir/Makefile  describe the tests to run
- test/subdir/*.c       the tests
+ test/                    toplevel dir containing common test code
+ test/Rules.mak           Common build code
+ test/Test.mak            Runtime test make code
+ test/subdir/             code specific to a subsystem is stored in a subdir
+ test/subdir/Makefile.in  describe the tests to run
+ test/subdir/Makefile     test entry point, includes needed upper-level
+                          makefiles plus Makefile.in
+ test/subdir/*.c          the tests
 
 
-Each subdir Makefile must include the toplevel Test.mak file.  Before doing so,
-you may define the TESTS and TESTS_DISABLED variables.  If you do not, TESTS
+Each subdir has a Makefile (same for any subdir) that must include in strict order :
+  - the upper-level Rules.mak file.
+  - the Makefile.in .
+  - the upper-level Test.mak file.
+Makefile.in may be used to define the TESTS and TESTS_DISABLED variables.  If you do not, TESTS
 is built automatically based upon all the .c files in the subdir.
 is built automatically based upon all the .c files in the subdir.
 TESTS := foo
 TESTS := foo
 TESTS_DISABLED := bar
 TESTS_DISABLED := bar
-include ../Test.mak
 Each test must use a similar .c name; so the "foo" test needs a "foo.c".
 Each test must use a similar .c name; so the "foo" test needs a "foo.c".
 
 
 Additionally, the following options further control specific test behavior:
 Additionally, the following options further control specific test behavior:

+ 0 - 3
test/Test.mak

@@ -18,9 +18,6 @@ ifneq ($(filter-out test,$(TESTS)),$(TESTS))
 $(error Sanity check: cannot have a test named "test.c")
 $(error Sanity check: cannot have a test named "test.c")
 endif
 endif
 
 
-top_builddir = ../../
-include ../Rules.mak
-
 U_TARGETS := $(TESTS)
 U_TARGETS := $(TESTS)
 G_TARGETS := $(patsubst %,%_glibc,$(U_TARGETS))
 G_TARGETS := $(patsubst %,%_glibc,$(U_TARGETS))
 
 

+ 3 - 7
test/args/Makefile

@@ -1,11 +1,7 @@
 # uClibc args tests
 # uClibc args tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
 
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
 include ../Test.mak
-
-OPTS_arg_test = a b c d e f g h
-WRAPPER_arg_test = \
-	env -i \
-	ENVVAR=123 \
-	SOMETHING=sldajfasdf \
-	BLAHBLAH=" hi hi "

+ 9 - 0
test/args/Makefile.in

@@ -0,0 +1,9 @@
+# uClibc args tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+OPTS_arg_test = a b c d e f g h
+WRAPPER_arg_test = \
+	env -i \
+	ENVVAR=123 \
+	SOMETHING=sldajfasdf \
+	BLAHBLAH=" hi hi "

+ 3 - 3
test/assert/Makefile

@@ -1,7 +1,7 @@
 # uClibc assert tests
 # uClibc assert tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
 
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
 include ../Test.mak
-
-RET_assert     := 134
-WRAPPER_assert := trap ":" ABRT ;

+ 5 - 0
test/assert/Makefile.in

@@ -0,0 +1,5 @@
+# uClibc assert tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+RET_assert     := 134
+WRAPPER_assert := trap ":" ABRT ;

+ 3 - 0
test/build/Makefile

@@ -1,4 +1,7 @@
 # uClibc build tests
 # uClibc build tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
 
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
 include ../Test.mak

+ 3 - 10
test/crypt/Makefile

@@ -1,14 +1,7 @@
 # uClibc crypt tests
 # uClibc crypt tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
 
-include ../../.config
-
-ifneq ($(UCLIBC_HAS_CRYPT),y)
-TESTS_DISABLED := $(patsubst %.c,%,$(wildcard *.c))
-endif
-
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
 include ../Test.mak
-
-EXTRA_LDFLAGS := -lcrypt
-
-OPTS_crypt = < crypt.input

+ 6 - 0
test/crypt/Makefile.in

@@ -0,0 +1,6 @@
+# uClibc crypt tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+EXTRA_LDFLAGS := -lcrypt
+
+OPTS_crypt = < crypt.input

+ 3 - 2
test/ctype/Makefile

@@ -1,6 +1,7 @@
 # uClibc ctype tests
 # uClibc ctype tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
 
-TESTS := ctype
-
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
 include ../Test.mak

+ 4 - 0
test/ctype/Makefile.in

@@ -0,0 +1,4 @@
+# uClibc ctype tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+TESTS := ctype

+ 3 - 36
test/dlopen/Makefile

@@ -1,40 +1,7 @@
 # uClibc dlopen tests
 # uClibc dlopen tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
 
-# rules need a little love to work with glibc ...
-export UCLIBC_ONLY := 1
-
-TESTS := dltest dltest2 dlstatic test1 test2 test3 dlundef dlafk dladdr
-
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
 include ../Test.mak
-
-CFLAGS_dltest    := -DLIBNAME="\"./libtest.so\""
-CFLAGS_dltest2   := -DLIBNAME="\"./libtest3.so\""
-
-LDFLAGS_dlstatic := -ldl
-LDFLAGS_dltest   := -ldl -lpthread
-LDFLAGS_dltest2  := -ldl -lpthread
-LDFLAGS_dlundef  := -ldl
-LDFLAGS_dlafk    := -ldl ./libafk.so -Wl,-rpath,.
-LDFLAGS_test1    := -ldl
-LDFLAGS_test2    := -ldl
-LDFLAGS_test3    := -ldl ./libtest1.so ./libtest2.so -Wl,-rpath,.
-LDFLAGS_dladdr   := -ldl
-
-DEBUG_LIBS := X
-WRAPPER := env $(DEBUG_LIBS)=all LD_LIBRARY_PATH="$$PWD:.:$(LD_LIBRARY_PATH)"
-
-dltest: libtest.so
-dltest2: libtest3.so
-dlstatic: libstatic.so
-dlundef: libundef.so
-dlafk: libafk.so
-libafk.so: libafk-temp.so
-LDFLAGS_libafk.so := ./libafk-temp.so -Wl,-rpath,.
-test1: libtest1.so
-test2: libtest1.so libtest2.so
-test3: libtest1.so libtest2.so
-libtest1.so: libtest2.so
-LDFLAGS_libtest1.so := ./libtest2.so -Wl,-rpath,.
-LDFLAGS_libtest2.so := -Wl,-rpath,.
-LDFLAGS_libtest3.so := -lpthread -Wl,-rpath,.

+ 38 - 0
test/dlopen/Makefile.in

@@ -0,0 +1,38 @@
+# uClibc dlopen tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+# rules need a little love to work with glibc ...
+export UCLIBC_ONLY := 1
+
+TESTS := dltest dltest2 dlstatic test1 test2 test3 dlundef dlafk dladdr
+
+CFLAGS_dltest    := -DLIBNAME="\"./libtest.so\""
+CFLAGS_dltest2   := -DLIBNAME="\"./libtest3.so\""
+
+LDFLAGS_dlstatic := -ldl
+LDFLAGS_dltest   := -ldl -lpthread
+LDFLAGS_dltest2  := -ldl -lpthread
+LDFLAGS_dlundef  := -ldl
+LDFLAGS_dlafk    := -ldl ./libafk.so -Wl,-rpath,.
+LDFLAGS_test1    := -ldl
+LDFLAGS_test2    := -ldl
+LDFLAGS_test3    := -ldl ./libtest1.so ./libtest2.so -Wl,-rpath,.
+LDFLAGS_dladdr   := -ldl
+
+DEBUG_LIBS := X
+WRAPPER := env $(DEBUG_LIBS)=all LD_LIBRARY_PATH="$$PWD:.:$(LD_LIBRARY_PATH)"
+
+dltest: libtest.so
+dltest2: libtest3.so
+dlstatic: libstatic.so
+dlundef: libundef.so
+dlafk: libafk.so
+libafk.so: libafk-temp.so
+LDFLAGS_libafk.so := ./libafk-temp.so -Wl,-rpath,.
+test1: libtest1.so
+test2: libtest1.so libtest2.so
+test3: libtest1.so libtest2.so
+libtest1.so: libtest2.so
+LDFLAGS_libtest1.so := ./libtest2.so -Wl,-rpath,.
+LDFLAGS_libtest2.so := -Wl,-rpath,.
+LDFLAGS_libtest3.so := -lpthread -Wl,-rpath,.

+ 3 - 0
test/inet/Makefile

@@ -1,4 +1,7 @@
 # uClibc inet tests
 # uClibc inet tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
 
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
 include ../Test.mak

+ 3 - 25
test/locale-mbwc/Makefile

@@ -1,29 +1,7 @@
 # uClibc locale tests
 # uClibc locale tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
-#	 tst_mbtowc tst_strcoll tst_strfmon tst_strxfrm    \
-
-TESTS := tst_iswalnum tst_iswalpha tst_iswcntrl          \
-	 tst_iswctype tst_iswdigit tst_iswgraph          \
-	 tst_iswlower tst_iswprint tst_iswpunct          \
-	 tst_iswspace tst_iswupper tst_iswxdigit         \
-	 tst_mblen tst_mbrlen tst_mbrtowc tst_mbsrtowcs  \
-	 tst_mbstowcs tst_mbtowc tst_strcoll tst_strxfrm \
-	 tst_swscanf tst_towctrans tst_towlower          \
-	 tst_towupper tst_wcrtomb tst_wcscat tst_wcschr  \
-	 tst_wcscmp tst_wcscoll tst_wcscpy tst_wcscspn   \
-	 tst_wcslen tst_wcsncat tst_wcsncmp tst_wcsncpy  \
-	 tst_wcspbrk tst_wcsrtombs tst_wcsspn tst_wcsstr \
-	 tst_wcstod tst_wcstok tst_wcstombs tst_wcswidth \
-	 tst_wcsxfrm tst_wctob tst_wctomb tst_wctrans    \
-	 tst_wctype tst_wcwidth tst_strfmon
-
-
-# NOTE: For now disabled tst_strfmon to avoid build failure.
-TESTS_DISABLED := tst_strfmon
 
 
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
 include ../Test.mak
-
-DODIFF_rint     := 1
-
-EXTRA_CFLAGS    := -D__USE_GNU -fno-builtin
-

+ 27 - 0
test/locale-mbwc/Makefile.in

@@ -0,0 +1,27 @@
+# uClibc locale tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+#	 tst_mbtowc tst_strcoll tst_strfmon tst_strxfrm    \
+
+TESTS := tst_iswalnum tst_iswalpha tst_iswcntrl          \
+	 tst_iswctype tst_iswdigit tst_iswgraph          \
+	 tst_iswlower tst_iswprint tst_iswpunct          \
+	 tst_iswspace tst_iswupper tst_iswxdigit         \
+	 tst_mblen tst_mbrlen tst_mbrtowc tst_mbsrtowcs  \
+	 tst_mbstowcs tst_mbtowc tst_strcoll tst_strxfrm \
+	 tst_swscanf tst_towctrans tst_towlower          \
+	 tst_towupper tst_wcrtomb tst_wcscat tst_wcschr  \
+	 tst_wcscmp tst_wcscoll tst_wcscpy tst_wcscspn   \
+	 tst_wcslen tst_wcsncat tst_wcsncmp tst_wcsncpy  \
+	 tst_wcspbrk tst_wcsrtombs tst_wcsspn tst_wcsstr \
+	 tst_wcstod tst_wcstok tst_wcstombs tst_wcswidth \
+	 tst_wcsxfrm tst_wctob tst_wctomb tst_wctrans    \
+	 tst_wctype tst_wcwidth tst_strfmon
+
+
+# NOTE: For now disabled tst_strfmon to avoid build failure.
+TESTS_DISABLED := tst_strfmon
+
+DODIFF_rint     := 1
+
+EXTRA_CFLAGS    := -D__USE_GNU -fno-builtin
+

+ 3 - 27
test/locale/Makefile

@@ -1,31 +1,7 @@
 # uClibc locale tests
 # uClibc locale tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
-#	 tst_mbtowc tst_strcoll tst_strfmon tst_strxfrm    \
-
-TESTS := bug-iconv-trans bug-usesetlocale collate-test dump-ctype \
-	 gen-unicode-ctype show-ucs-data tst-ctype \
-	 tst-digits tst-fmon tst-langinfo tst-leaks tst-mbswcs1 \
-	 tst-mbswcs2 tst-mbswcs3 tst-mbswcs4 tst-mbswcs5 tst-mbswcs6 \
-	 tst_nl_langinfo tst-numeric tst-rpmatch tst-setlocale \
-	 tst-sscanf tst-strfmon1 tst-trans tst-wctype tst-xlocale1 \
-	 tst-xlocale2 xfrm-test
-
-
-# NOTE: For now disabled some tests that are known not build
-TESTS_DISABLED := tst-ctype tst-fmon tst-leaks tst-rpmatch tst-strfmon1
-
-ifneq ($(UCLIBC_HAS_XLOCALE),y)
-TESTS_DISABLED += bug-usesetlocale tst-xlocale1 tst-xlocale2 xfrm-test tst-C-locale
-endif
 
 
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
 include ../Test.mak
-
-DODIFF_rint     := 1
-
-EXTRA_CFLAGS    := -D__USE_GNU -fno-builtin
-
-OPTS_dump-ctype = C
-OPTS_tst-ctype = < tst-ctype-de_DE.ISO-8859-1.in
-OPTS_tst-langinfo = < tst-langinfo.input
-
-EXTRA_DIRS := C

+ 29 - 0
test/locale/Makefile.in

@@ -0,0 +1,29 @@
+# uClibc locale tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+#	 tst_mbtowc tst_strcoll tst_strfmon tst_strxfrm    \
+
+TESTS := bug-iconv-trans bug-usesetlocale collate-test dump-ctype \
+	 gen-unicode-ctype show-ucs-data tst-ctype \
+	 tst-digits tst-fmon tst-langinfo tst-leaks tst-mbswcs1 \
+	 tst-mbswcs2 tst-mbswcs3 tst-mbswcs4 tst-mbswcs5 tst-mbswcs6 \
+	 tst_nl_langinfo tst-numeric tst-rpmatch tst-setlocale \
+	 tst-sscanf tst-strfmon1 tst-trans tst-wctype tst-xlocale1 \
+	 tst-xlocale2 xfrm-test
+
+
+# NOTE: For now disabled some tests that are known not build
+TESTS_DISABLED := tst-ctype tst-fmon tst-leaks tst-rpmatch tst-strfmon1
+
+ifneq ($(UCLIBC_HAS_XLOCALE),y)
+TESTS_DISABLED += bug-usesetlocale tst-xlocale1 tst-xlocale2 xfrm-test tst-C-locale
+endif
+
+DODIFF_rint     := 1
+
+EXTRA_CFLAGS    := -D__USE_GNU -fno-builtin
+
+OPTS_dump-ctype = C
+OPTS_tst-ctype = < tst-ctype-de_DE.ISO-8859-1.in
+OPTS_tst-langinfo = < tst-langinfo.input
+
+EXTRA_DIRS := C

+ 3 - 2
test/malloc/Makefile

@@ -1,6 +1,7 @@
 # uClibc malloc tests
 # uClibc malloc tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
 
-TESTS_DISABLED := time_malloc
-
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
 include ../Test.mak

+ 4 - 0
test/malloc/Makefile.in

@@ -0,0 +1,4 @@
+# uClibc malloc tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+TESTS_DISABLED := time_malloc

+ 3 - 26
test/math/Makefile

@@ -1,30 +1,7 @@
 # uClibc math tests
 # uClibc math tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
 
-include ../../.config
-
-TESTS := basic-test rint tst-definitions test-fpucw test-float test-ifloat test-double test-idouble
-ifeq ($(UCLIBC_HAS_LONG_DOUBLE_MATH),y)
-TESTS += test-ldouble test-ildoubl compile_test
-else
-CFLAGS_basic-test := -DNO_LONG_DOUBLE
-endif
-
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
 include ../Test.mak
-
-DODIFF_rint     := 1
-
-# NOTE: For basic-test we must disable the floating point optimization.
-#       Only for sh architecture because in the other architecture are disabled.
-ifeq ($(TARGET_ARCH),sh)
-CFLAGS_basic-test += -mieee
-endif
-EXTRA_CFLAGS    := -fno-builtin
-EXTRA_LDFLAGS   := -lm
-
-PERL := /usr/bin/perl
-ulps-file := $(firstword $(wildcard $(config-sysdirs:%=$(..)%/libm-test-ulps)))
-libm-test.c: $(ulps-file) libm-test.inc gen-libm-test.pl
-	$(Q)$(PERL) ./gen-libm-test.pl -u $< ./libm-test.inc -o "." 2>&1 > /dev/null
-EXTRA_CLEAN := libm-test.c libm-test-ulps.h
-$(TARGETS): libm-test.c

+ 27 - 0
test/math/Makefile.in

@@ -0,0 +1,27 @@
+# uClibc math tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+TESTS := basic-test rint tst-definitions test-fpucw test-float test-ifloat test-double test-idouble
+ifeq ($(UCLIBC_HAS_LONG_DOUBLE_MATH),y)
+TESTS += test-ldouble test-ildoubl compile_test
+else
+CFLAGS_basic-test := -DNO_LONG_DOUBLE
+endif
+
+DODIFF_rint     := 1
+
+# NOTE: For basic-test we must disable the floating point optimization.
+#       Only for sh architecture because in the other architecture are disabled.
+ifeq ($(TARGET_ARCH),sh)
+CFLAGS_basic-test += -mieee
+endif
+EXTRA_CFLAGS    := -fno-builtin
+EXTRA_LDFLAGS   := -lm
+
+PERL := /usr/bin/perl
+ulps-file := $(firstword $(wildcard $(config-sysdirs:%=$(..)%/libm-test-ulps)))
+libm-test.c: $(ulps-file) libm-test.inc gen-libm-test.pl
+	$(Q)$(PERL) ./gen-libm-test.pl -u $< ./libm-test.inc -o "." 2>&1 > /dev/null
+EXTRA_CLEAN := libm-test.c libm-test-ulps.h
+TARGETS=libm-test.c
+

+ 3 - 10
test/misc/Makefile

@@ -1,14 +1,7 @@
 # uClibc misc tests
 # uClibc misc tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
 
-TESTS_DISABLED := outb tst-fnmatch bug-glob1 tst-gnuglob
-
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
 include ../Test.mak
-
-CFLAGS_dirent64 := -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-
-DODIFF_dirent    := 1
-DODIFF_dirent64  := 1
-
-OPTS_bug-glob1   := $(PWD)
-OPTS_tst-fnmatch := < tst-fnmatch.input

+ 12 - 0
test/misc/Makefile.in

@@ -0,0 +1,12 @@
+# uClibc misc tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+TESTS_DISABLED := outb tst-fnmatch bug-glob1 tst-gnuglob
+
+CFLAGS_dirent64 := -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
+
+DODIFF_dirent    := 1
+DODIFF_dirent64  := 1
+
+OPTS_bug-glob1   := $(PWD)
+OPTS_tst-fnmatch := < tst-fnmatch.input

+ 3 - 0
test/mmap/Makefile

@@ -1,4 +1,7 @@
 # uClibc mmap tests
 # uClibc mmap tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
 
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
 include ../Test.mak

+ 3 - 4
test/pthread/Makefile

@@ -1,8 +1,7 @@
 # uClibc pthread tests
 # uClibc pthread tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
 
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
 include ../Test.mak
-
-EXTRA_LDFLAGS := -lpthread
-
-LDFLAGS_cancellation-points := -lrt

+ 7 - 0
test/pthread/Makefile.in

@@ -0,0 +1,7 @@
+# uClibc pthread tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+
+EXTRA_LDFLAGS := -lpthread
+
+LDFLAGS_cancellation-points := -lrt

+ 3 - 6
test/pwd_grp/Makefile

@@ -1,10 +1,7 @@
 # uClibc pwd_grp tests
 # uClibc pwd_grp tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
 
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
 include ../Test.mak
-
-DODIFF_test_pwd  := 1
-DODIFF_test_grp  := 1
-DODIFF_pwcat     := 1
-DODIFF_grcat     := 1
-DODIFF_getgroups := 1

+ 8 - 0
test/pwd_grp/Makefile.in

@@ -0,0 +1,8 @@
+# uClibc pwd_grp tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+DODIFF_test_pwd  := 1
+DODIFF_test_grp  := 1
+DODIFF_pwcat     := 1
+DODIFF_grcat     := 1
+DODIFF_getgroups := 1

+ 3 - 0
test/regex/Makefile

@@ -1,4 +1,7 @@
 # uClibc regex tests
 # uClibc regex tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
 
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
 include ../Test.mak

+ 3 - 8
test/rpc/Makefile

@@ -1,12 +1,7 @@
 # uClibc rpc tests
 # uClibc rpc tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
 
-TESTS := getrpcent
-
-ifeq ($(UCLIBC_HAS_REENTRANT_RPC),y)
-TESTS += getrpcent_r
-endif
-
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
 include ../Test.mak
-
-DODIFF_getrpcent := 1

+ 11 - 0
test/rpc/Makefile.in

@@ -0,0 +1,11 @@
+# uClibc rpc tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+TESTS := getrpcent
+
+ifeq ($(UCLIBC_HAS_REENTRANT_RPC),y)
+TESTS += getrpcent_r
+endif
+
+DODIFF_getrpcent := 1
+

+ 3 - 0
test/setjmp/Makefile

@@ -1,4 +1,7 @@
 # uClibc setjmp tests
 # uClibc setjmp tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
 
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
 include ../Test.mak

+ 3 - 4
test/signal/Makefile

@@ -1,8 +1,7 @@
 # uClibc signal tests
 # uClibc signal tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
 
-ifeq ($(UCLIBC_HAS_OBSOLETE_BSD_SIGNAL),)
-TESTS_DISABLED := tst-sigsimple
-endif
-
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
 include ../Test.mak

+ 6 - 0
test/signal/Makefile.in

@@ -0,0 +1,6 @@
+# uClibc signal tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+ifeq ($(UCLIBC_HAS_OBSOLETE_BSD_SIGNAL),)
+TESTS_DISABLED := tst-sigsimple
+endif

+ 3 - 3
test/silly/Makefile

@@ -1,7 +1,7 @@
 # uClibc silly tests
 # uClibc silly tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
 
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
 include ../Test.mak
-
-RET_hello := 42
-RET_tiny  := 42

+ 5 - 0
test/silly/Makefile.in

@@ -0,0 +1,5 @@
+# uClibc silly tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+RET_hello := 42
+RET_tiny  := 42

+ 3 - 8
test/stat/Makefile

@@ -1,12 +1,7 @@
 # uClibc stat tests
 # uClibc stat tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
 
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
 include ../Test.mak
-
-CFLAGS_stat64 := -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-
-DODIFF_stat   := 1
-DODIFF_stat64 := 1
-
-OPTS_stat   := Makefile
-OPTS_stat64 := Makefile

+ 10 - 0
test/stat/Makefile.in

@@ -0,0 +1,10 @@
+# uClibc stat tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+CFLAGS_stat64 := -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
+
+DODIFF_stat   := 1
+DODIFF_stat64 := 1
+
+OPTS_stat   := Makefile
+OPTS_stat64 := Makefile

+ 4 - 3
test/stdio/Makefile

@@ -1,6 +1,7 @@
-# uClibc assert tests
+# uClibc stdio tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
 
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
 include ../Test.mak
-
-DODIFF_64bit := 1

+ 4 - 0
test/stdio/Makefile.in

@@ -0,0 +1,4 @@
+# uClibc stdio tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+DODIFF_64bit := 1

+ 3 - 5
test/stdlib/Makefile

@@ -1,9 +1,7 @@
 # uClibc stdlib tests
 # uClibc stdlib tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
 
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
 include ../Test.mak
-
-DODIFF_qsort       := 1
-DODIFF_testatexit  := 1
-DODIFF_teston_exit := 1
-DODIFF_teststrtol  := 1

+ 7 - 0
test/stdlib/Makefile.in

@@ -0,0 +1,7 @@
+# uClibc stdlib tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+DODIFF_qsort       := 1
+DODIFF_testatexit  := 1
+DODIFF_teston_exit := 1
+DODIFF_teststrtol  := 1

+ 3 - 2
test/string/Makefile

@@ -1,6 +1,7 @@
 # uClibc string tests
 # uClibc string tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
 
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
 include ../Test.mak
-
-EXTRA_CFLAGS := -fno-builtin

+ 4 - 0
test/string/Makefile.in

@@ -0,0 +1,4 @@
+# uClibc string tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+EXTRA_CFLAGS := -fno-builtin

+ 3 - 0
test/termios/Makefile

@@ -1,4 +1,7 @@
 # uClibc termios tests
 # uClibc termios tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
 
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
 include ../Test.mak

+ 3 - 9
test/time/Makefile

@@ -1,13 +1,7 @@
 # uClibc time tests
 # uClibc time tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
 
-TESTS_DISABLED := bug-asctime bug-asctime_r time tst-mktime2 tst-posixtz \
-	tst-strftime tst-strptime tst-timezone
-
-ifneq ($(UCLIBC_HAS_XLOCALE),y)
-TESTS_DISABLED += tst-ftime_l
-endif
-
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
 include ../Test.mak
-
-CFLAGS_tst-strptime2 := -std=c99

+ 11 - 0
test/time/Makefile.in

@@ -0,0 +1,11 @@
+# uClibc time tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+TESTS_DISABLED := bug-asctime bug-asctime_r time tst-mktime2 tst-posixtz \
+	tst-strftime tst-strptime tst-timezone
+
+ifneq ($(UCLIBC_HAS_XLOCALE),y)
+TESTS_DISABLED += tst-ftime_l
+endif
+
+CFLAGS_tst-strptime2 := -std=c99

+ 3 - 9
test/unistd/Makefile

@@ -1,13 +1,7 @@
 # uClibc unistd tests
 # uClibc unistd tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
 
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
 include ../Test.mak
-
-OPTS_getopt      := -abcXXX -9
-OPTS_getopt_long := --add XXX --delete YYY --verbose
-ifeq ($(UCLIBC_HAS_GNU_GETOPT),y)
-OPTS_tstgetopt   := -a -b -cfoobar --required foobar --optional=bazbug --none random --col --color --colour
-else
-# reordering is not supported, behaves as if POSIXLY_CORRECT would be set
-OPTS_tstgetopt   := -a -b -cfoobar --required foobar --optional=bazbug --none --colou --color --colour random
-endif

+ 11 - 0
test/unistd/Makefile.in

@@ -0,0 +1,11 @@
+# uClibc unistd tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+OPTS_getopt      := -abcXXX -9
+OPTS_getopt_long := --add XXX --delete YYY --verbose
+ifeq ($(UCLIBC_HAS_GNU_GETOPT),y)
+OPTS_tstgetopt   := -a -b -cfoobar --required foobar --optional=bazbug --none random --col --color --colour
+else
+# reordering is not supported, behaves as if POSIXLY_CORRECT would be set
+OPTS_tstgetopt   := -a -b -cfoobar --required foobar --optional=bazbug --none --colou --color --colour random
+endif