[PATCH 1/3] build: Move test support to librtemstest.a

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Mar 14 10:24:14 UTC 2019


One reason to move the test support into a dedicated library are the
standard output __wrap_*() functions.  They may conflict with
application level wrappers.

Update #3199.
---
 cpukit/Makefile.am                                      | 14 +++++++++-----
 cpukit/{libmisc/testsupport => libtest}/testbeginend.c  |  0
 cpukit/{libmisc/testsupport => libtest}/testbusy.c      |  0
 cpukit/{libmisc/testsupport => libtest}/testextension.c |  0
 cpukit/{libmisc/testsupport => libtest}/testparallel.c  |  0
 cpukit/{libmisc/testsupport => libtest}/testwrappers.c  |  0
 testsuites/ada/ada.am                                   |  2 +-
 testsuites/automake/compile.am                          |  1 +
 8 files changed, 11 insertions(+), 6 deletions(-)
 rename cpukit/{libmisc/testsupport => libtest}/testbeginend.c (100%)
 rename cpukit/{libmisc/testsupport => libtest}/testbusy.c (100%)
 rename cpukit/{libmisc/testsupport => libtest}/testextension.c (100%)
 rename cpukit/{libmisc/testsupport => libtest}/testparallel.c (100%)
 rename cpukit/{libmisc/testsupport => libtest}/testwrappers.c (100%)

diff --git a/cpukit/Makefile.am b/cpukit/Makefile.am
index 51ab18ca05..0081bb77cd 100644
--- a/cpukit/Makefile.am
+++ b/cpukit/Makefile.am
@@ -322,11 +322,6 @@ librtemscpu_a_SOURCES += libmisc/stringto/stringtounsignedchar.c
 librtemscpu_a_SOURCES += libmisc/stringto/stringtounsignedint.c
 librtemscpu_a_SOURCES += libmisc/stringto/stringtounsignedlong.c
 librtemscpu_a_SOURCES += libmisc/stringto/stringtounsignedlonglong.c
-librtemscpu_a_SOURCES += libmisc/testsupport/testbeginend.c
-librtemscpu_a_SOURCES += libmisc/testsupport/testbusy.c
-librtemscpu_a_SOURCES += libmisc/testsupport/testextension.c
-librtemscpu_a_SOURCES += libmisc/testsupport/testparallel.c
-librtemscpu_a_SOURCES += libmisc/testsupport/testwrappers.c
 librtemscpu_a_SOURCES += libmisc/untar/untar.c
 librtemscpu_a_SOURCES += libmisc/untar/untar_tgz.c
 librtemscpu_a_SOURCES += libmisc/untar/untar_txz.c
@@ -1834,6 +1829,15 @@ project_lib_LIBRARIES += librtemsdefaultconfig.a
 librtemsdefaultconfig_a_SOURCES =
 librtemsdefaultconfig_a_SOURCES += libmisc/dummy/default-configuration.c
 
+project_lib_LIBRARIES += librtemstest.a
+
+librtemstest_a_SOURCES =
+librtemstest_a_SOURCES += libtest/testbeginend.c
+librtemstest_a_SOURCES += libtest/testbusy.c
+librtemstest_a_SOURCES += libtest/testextension.c
+librtemstest_a_SOURCES += libtest/testparallel.c
+librtemstest_a_SOURCES += libtest/testwrappers.c
+
 project_lib_LIBRARIES += libftpd.a
 
 libftpd_a_SOURCES =
diff --git a/cpukit/libmisc/testsupport/testbeginend.c b/cpukit/libtest/testbeginend.c
similarity index 100%
rename from cpukit/libmisc/testsupport/testbeginend.c
rename to cpukit/libtest/testbeginend.c
diff --git a/cpukit/libmisc/testsupport/testbusy.c b/cpukit/libtest/testbusy.c
similarity index 100%
rename from cpukit/libmisc/testsupport/testbusy.c
rename to cpukit/libtest/testbusy.c
diff --git a/cpukit/libmisc/testsupport/testextension.c b/cpukit/libtest/testextension.c
similarity index 100%
rename from cpukit/libmisc/testsupport/testextension.c
rename to cpukit/libtest/testextension.c
diff --git a/cpukit/libmisc/testsupport/testparallel.c b/cpukit/libtest/testparallel.c
similarity index 100%
rename from cpukit/libmisc/testsupport/testparallel.c
rename to cpukit/libtest/testparallel.c
diff --git a/cpukit/libmisc/testsupport/testwrappers.c b/cpukit/libtest/testwrappers.c
similarity index 100%
rename from cpukit/libmisc/testsupport/testwrappers.c
rename to cpukit/libtest/testwrappers.c
diff --git a/testsuites/ada/ada.am b/testsuites/ada/ada.am
index 33d0c3ae2f..83260687c2 100644
--- a/testsuites/ada/ada.am
+++ b/testsuites/ada/ada.am
@@ -9,7 +9,7 @@ GNATCOMPILE = $(GNATMAKE) \
 -bargs -Mgnat_main \
 -margs $(AM_ADAFLAGS) $(ADAFLAGS) \
 -cargs $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) \
--largs $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) init.o
+-largs $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -lrtemstest init.o
 
 CLEANFILES += *.ali *.o b~*.adb b~*.ads
 
diff --git a/testsuites/automake/compile.am b/testsuites/automake/compile.am
index f7f0fb623f..83d4ab111c 100644
--- a/testsuites/automake/compile.am
+++ b/testsuites/automake/compile.am
@@ -24,5 +24,6 @@ AM_LDFLAGS += $(TEST_LD_FLAGS)
 LDADD =
 LDADD += $(RTEMS_ROOT)lib/libbsp/@RTEMS_CPU@/@RTEMS_BSP_FAMILY@/librtemsbsp.a
 LDADD += $(RTEMS_ROOT)cpukit/librtemscpu.a
+LDADD += $(RTEMS_ROOT)cpukit/librtemstest.a
 
 CLEANFILES = *.num *.nxe *.elf *.srec* *.bin *.bt *.ralf
-- 
2.16.4



More information about the devel mailing list