summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2019-11-11 20:08:46 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2019-11-12 09:47:20 +0100
commit1a48cbfa16bf54a442f9394e4c4d9c2211e82865 (patch)
tree929eba7ba5e91ae9ae31f77547353dbb04ea5da4
parenttests: Simplify fatal error test support (diff)
downloadrtems-1a48cbfa16bf54a442f9394e4c4d9c2211e82865.tar.bz2
sptests: Avoid include path magic
Update #3818.
-rw-r--r--testsuites/libtests/Makefile.am6
-rw-r--r--testsuites/libtests/devnullfatal01/init.c (renamed from testsuites/libtests/devnullfatal01/testcase.h)10
-rwxr-xr-xtestsuites/psxtests/Makefile.am10
-rw-r--r--testsuites/psxtests/psxfatal01/init.c (renamed from testsuites/psxtests/psxfatal01/testcase.h)10
-rw-r--r--testsuites/psxtests/psxfatal02/init.c (renamed from testsuites/psxtests/psxfatal02/testcase.h)10
-rw-r--r--testsuites/psxtests/psxfatal_support/psxfatal.h14
-rw-r--r--testsuites/psxtests/psxfatal_support/psxfatalimpl.h (renamed from testsuites/psxtests/psxfatal_support/init.c)14
-rw-r--r--testsuites/sptests/Makefile.am95
-rw-r--r--testsuites/sptests/spfatal01/init.c (renamed from testsuites/sptests/spfatal01/testcase.h)10
-rw-r--r--testsuites/sptests/spfatal02/init.c (renamed from testsuites/sptests/spfatal02/testcase.h)10
-rw-r--r--testsuites/sptests/spfatal03/init.c (renamed from testsuites/sptests/spfatal03/testcase.h)10
-rw-r--r--testsuites/sptests/spfatal04/init.c (renamed from testsuites/sptests/spfatal04/testcase.h)10
-rw-r--r--testsuites/sptests/spfatal05/init.c (renamed from testsuites/sptests/spfatal05/testcase.h)10
-rw-r--r--testsuites/sptests/spfatal06/init.c (renamed from testsuites/sptests/spfatal06/testcase.h)10
-rw-r--r--testsuites/sptests/spfatal08/init.c (renamed from testsuites/sptests/spfatal08/testcase.h)10
-rw-r--r--testsuites/sptests/spfatal09/init.c (renamed from testsuites/sptests/spfatal09/testcase.h)10
-rw-r--r--testsuites/sptests/spfatal10/init.c (renamed from testsuites/sptests/spfatal10/testcase.h)10
-rw-r--r--testsuites/sptests/spfatal11/init.c (renamed from testsuites/sptests/spfatal11/testcase.h)10
-rw-r--r--testsuites/sptests/spfatal12/init.c (renamed from testsuites/sptests/spfatal12/testcase.h)10
-rw-r--r--testsuites/sptests/spfatal14/init.c (renamed from testsuites/sptests/spfatal14/testcase.h)10
-rw-r--r--testsuites/sptests/spfatal15/init.c (renamed from testsuites/sptests/spfatal15/testcase.h)10
-rw-r--r--testsuites/sptests/spfatal24/init.c (renamed from testsuites/sptests/spfatal24/testcase.h)10
-rw-r--r--testsuites/sptests/spfatal25/init.c (renamed from testsuites/sptests/spfatal25/testcase.h)10
-rw-r--r--testsuites/sptests/spfatal27/init.c (renamed from testsuites/sptests/spfatal27/testcase.h)10
-rw-r--r--testsuites/sptests/spfatal28/init.c (renamed from testsuites/sptests/spfatal28/testcase.h)10
-rw-r--r--testsuites/sptests/spfatal29/init.c (renamed from testsuites/sptests/spfatal29/testcase.h)10
-rw-r--r--testsuites/sptests/spfatal32/init.c (renamed from testsuites/sptests/spfatal32/testcase.h)10
-rw-r--r--testsuites/sptests/spfatal_support/spfatal.h14
-rw-r--r--testsuites/sptests/spfatal_support/spfatalimpl.h (renamed from testsuites/sptests/spfatal_support/init.c)8
29 files changed, 270 insertions, 111 deletions
diff --git a/testsuites/libtests/Makefile.am b/testsuites/libtests/Makefile.am
index a9af43e1c9..b7a102dc7f 100644
--- a/testsuites/libtests/Makefile.am
+++ b/testsuites/libtests/Makefile.am
@@ -313,11 +313,9 @@ if TEST_devnullfatal01
lib_tests += devnullfatal01
lib_screens += devnullfatal01/devnullfatal01.scn
lib_docs += devnullfatal01/devnullfatal01.doc
-devnullfatal01_SOURCES = ../sptests/spfatal_support/init.c \
- devnullfatal01/testcase.h
+devnullfatal01_SOURCES = devnullfatal01/init.c
devnullfatal01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_devnullfatal01) \
- $(support_includes) -I$(top_srcdir)/../../sptests/spfatal_support \
- -I$(top_srcdir)/devnullfatal01
+ $(support_includes)
endif
if DLTESTS
diff --git a/testsuites/libtests/devnullfatal01/testcase.h b/testsuites/libtests/devnullfatal01/init.c
index b97b7d0a58..ecf63cfe51 100644
--- a/testsuites/libtests/devnullfatal01/testcase.h
+++ b/testsuites/libtests/devnullfatal01/init.c
@@ -1,3 +1,9 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "../../sptests/spfatal_support/spfatal.h"
+
/*
* COPYRIGHT (c) 1989-2010, 2017.
* On-Line Applications Research Corporation (OAR).
@@ -15,7 +21,7 @@
#include <rtems/devnull.h>
#include "tmacros.h"
-void force_error()
+static void force_error(void)
{
int status;
@@ -27,3 +33,5 @@ void force_error()
/* A fatal error would be raised in previous call */
/* we will not run this far */
}
+
+#include "../../sptests/spfatal_support/spfatalimpl.h"
diff --git a/testsuites/psxtests/Makefile.am b/testsuites/psxtests/Makefile.am
index 0d213a4437..1f9e4233ec 100755
--- a/testsuites/psxtests/Makefile.am
+++ b/testsuites/psxtests/Makefile.am
@@ -391,19 +391,17 @@ endif
if TEST_psxfatal01
psx_tests += psxfatal01
psx_screens += psxfatal01/psxfatal01.scn
-psxfatal01_SOURCES = psxfatal_support/init.c \
- psxfatal01/testcase.h
+psxfatal01_SOURCES = psxfatal01/init.c
psxfatal01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_psxfatal01) \
- $(support_includes) -I$(top_srcdir)/psxfatal01
+ $(support_includes)
endif
if TEST_psxfatal02
psx_tests += psxfatal02
psx_screens += psxfatal02/psxfatal02.scn
-psxfatal02_SOURCES = psxfatal_support/init.c \
- psxfatal02/testcase.h
+psxfatal02_SOURCES = psxfatal02/init.c
psxfatal02_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_psxfatal02) \
- $(support_includes) -I$(top_srcdir)/psxfatal02
+ $(support_includes)
endif
if TEST_psxfchx01
diff --git a/testsuites/psxtests/psxfatal01/testcase.h b/testsuites/psxtests/psxfatal01/init.c
index e67f879ff6..fb0e2b24ed 100644
--- a/testsuites/psxtests/psxfatal01/testcase.h
+++ b/testsuites/psxtests/psxfatal01/init.c
@@ -1,3 +1,9 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "../psxfatal_support/psxfatal.h"
+
/*
* Classic API Init task create failure
*/
@@ -31,7 +37,9 @@ posix_initialization_threads_table POSIX_Initialization_threads[] = {
#define FATAL_ERROR_EXPECTED_ERROR \
INTERNAL_ERROR_POSIX_INIT_THREAD_CREATE_FAILED
-void force_error(void)
+static void force_error(void)
{
/* we will not run this far */
}
+
+#include "../psxfatal_support/psxfatalimpl.h"
diff --git a/testsuites/psxtests/psxfatal02/testcase.h b/testsuites/psxtests/psxfatal02/init.c
index 7f97a6769e..260c0aea0d 100644
--- a/testsuites/psxtests/psxfatal02/testcase.h
+++ b/testsuites/psxtests/psxfatal02/init.c
@@ -1,3 +1,9 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "../psxfatal_support/psxfatal.h"
+
/*
* Classic API Init task create failure
*/
@@ -35,7 +41,9 @@ posix_initialization_threads_table POSIX_Initialization_threads[] = {
#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_CORE
#define FATAL_ERROR_EXPECTED_ERROR INTERNAL_ERROR_POSIX_INIT_THREAD_CREATE_FAILED
-void force_error(void)
+static void force_error(void)
{
/* we will not run this far */
}
+
+#include "../psxfatal_support/psxfatalimpl.h"
diff --git a/testsuites/psxtests/psxfatal_support/psxfatal.h b/testsuites/psxtests/psxfatal_support/psxfatal.h
new file mode 100644
index 0000000000..253828bdbd
--- /dev/null
+++ b/testsuites/psxtests/psxfatal_support/psxfatal.h
@@ -0,0 +1,14 @@
+/*
+ * COPYRIGHT (c) 1989-2010.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#include <rtems/bspIo.h>
+
+#include <tmacros.h>
+
+void *POSIX_Init(void *argument);
diff --git a/testsuites/psxtests/psxfatal_support/init.c b/testsuites/psxtests/psxfatal_support/psxfatalimpl.h
index 2c305396d5..928b07f335 100644
--- a/testsuites/psxtests/psxfatal_support/init.c
+++ b/testsuites/psxtests/psxfatal_support/psxfatalimpl.h
@@ -7,20 +7,6 @@
* http://www.rtems.org/license/LICENSE.
*/
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/bspIo.h>
-
-#include <tmacros.h>
-
-void *POSIX_Init(void *argument);
-
-void force_error(void);
-
-#include "testcase.h"
-
const char rtems_test_name[] = "PSXFATAL " FATAL_ERROR_TEST_NAME;
static void print_test_begin_message(void)
diff --git a/testsuites/sptests/Makefile.am b/testsuites/sptests/Makefile.am
index 900a2f80d4..09751b6d58 100644
--- a/testsuites/sptests/Makefile.am
+++ b/testsuites/sptests/Makefile.am
@@ -890,150 +890,135 @@ if TEST_spfatal01
sp_tests += spfatal01
sp_screens += spfatal01/spfatal01.scn
sp_docs += spfatal01/spfatal01.doc
-spfatal01_SOURCES = spfatal_support/init.c \
- spfatal01/testcase.h
+spfatal01_SOURCES = spfatal01/init.c
spfatal01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spfatal01) \
- $(support_includes) -I$(top_srcdir)/spfatal01
+ $(support_includes)
endif
if TEST_spfatal02
sp_tests += spfatal02
sp_screens += spfatal02/spfatal02.scn
sp_docs += spfatal02/spfatal02.doc
-spfatal02_SOURCES = spfatal_support/init.c \
- spfatal02/testcase.h
+spfatal02_SOURCES = spfatal02/init.c
spfatal02_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spfatal02) \
- $(support_includes) -I$(top_srcdir)/spfatal02
+ $(support_includes)
endif
if TEST_spfatal03
sp_tests += spfatal03
sp_screens += spfatal03/spfatal03.scn
sp_docs += spfatal03/spfatal03.doc
-spfatal03_SOURCES = spfatal_support/init.c \
- spfatal03/testcase.h
+spfatal03_SOURCES = spfatal03/init.c
spfatal03_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spfatal03) \
- $(support_includes) -I$(top_srcdir)/spfatal03
+ $(support_includes)
endif
if TEST_spfatal04
sp_tests += spfatal04
sp_screens += spfatal04/spfatal04.scn
sp_docs += spfatal04/spfatal04.doc
-spfatal04_SOURCES = spfatal_support/init.c \
- spfatal04/testcase.h
+spfatal04_SOURCES = spfatal04/init.c
spfatal04_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spfatal04) \
- $(support_includes) -I$(top_srcdir)/spfatal04
+ $(support_includes)
endif
if TEST_spfatal05
sp_tests += spfatal05
sp_screens += spfatal05/spfatal05.scn
sp_docs += spfatal05/spfatal05.doc
-spfatal05_SOURCES = spfatal_support/init.c \
- spfatal05/testcase.h
+spfatal05_SOURCES = spfatal05/init.c
spfatal05_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spfatal05) \
- $(support_includes) -I$(top_srcdir)/spfatal05
+ $(support_includes)
endif
if TEST_spfatal06
sp_tests += spfatal06
sp_screens += spfatal06/spfatal06.scn
sp_docs += spfatal06/spfatal06.doc
-spfatal06_SOURCES = spfatal_support/init.c \
- spfatal06/testcase.h
+spfatal06_SOURCES = spfatal06/init.c
spfatal06_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spfatal06) \
- $(support_includes) -I$(top_srcdir)/spfatal06
+ $(support_includes)
endif
if TEST_spfatal08
sp_tests += spfatal08
sp_screens += spfatal08/spfatal08.scn
sp_docs += spfatal08/spfatal08.doc
-spfatal08_SOURCES = spfatal_support/init.c \
- spfatal08/testcase.h
+spfatal08_SOURCES = spfatal08/init.c
spfatal08_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spfatal08) \
- $(support_includes) -I$(top_srcdir)/spfatal08
+ $(support_includes)
endif
if TEST_spfatal09
sp_tests += spfatal09
sp_screens += spfatal09/spfatal09.scn
sp_docs += spfatal09/spfatal09.doc
-spfatal09_SOURCES = spfatal_support/init.c \
- spfatal09/testcase.h
+spfatal09_SOURCES = spfatal09/init.c
spfatal09_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spfatal09) \
- $(support_includes) -I$(top_srcdir)/spfatal09
+ $(support_includes)
endif
if TEST_spfatal10
sp_tests += spfatal10
sp_screens += spfatal10/spfatal10.scn
sp_docs += spfatal10/spfatal10.doc
-spfatal10_SOURCES = spfatal_support/init.c \
- spfatal10/testcase.h
+spfatal10_SOURCES = spfatal10/init.c
spfatal10_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spfatal10) \
- $(support_includes) -I$(top_srcdir)/spfatal10
+ $(support_includes)
endif
if TEST_spfatal11
sp_tests += spfatal11
sp_screens += spfatal11/spfatal11.scn
sp_docs += spfatal11/spfatal11.doc
-spfatal11_SOURCES = spfatal_support/init.c \
- spfatal11/testcase.h
+spfatal11_SOURCES = spfatal11/init.c
spfatal11_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spfatal11) \
- $(support_includes) -I$(top_srcdir)/spfatal11
+ $(support_includes)
endif
if TEST_spfatal12
sp_tests += spfatal12
sp_screens += spfatal12/spfatal12.scn
sp_docs += spfatal12/spfatal12.doc
-spfatal12_SOURCES = spfatal_support/init.c \
- spfatal12/testcase.h
+spfatal12_SOURCES = spfatal12/init.c
spfatal12_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spfatal12) \
- $(support_includes) -I$(top_srcdir)/spfatal12
+ $(support_includes)
endif
if TEST_spfatal14
sp_tests += spfatal14
sp_screens += spfatal14/spfatal14.scn
sp_docs += spfatal14/spfatal14.doc
-spfatal14_SOURCES = spfatal_support/init.c \
- spfatal14/testcase.h
+spfatal14_SOURCES = spfatal14/init.c
spfatal14_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spfatal14) \
- $(support_includes) -I$(top_srcdir)/spfatal14
+ $(support_includes)
endif
if TEST_spfatal15
sp_tests += spfatal15
sp_screens += spfatal15/spfatal15.scn
sp_docs += spfatal15/spfatal15.doc
-spfatal15_SOURCES = spfatal_support/init.c \
- spfatal15/testcase.h
+spfatal15_SOURCES = spfatal15/init.c
spfatal15_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spfatal15) \
- $(support_includes) -I$(top_srcdir)/spfatal15
+ $(support_includes)
endif
if TEST_spfatal24
sp_tests += spfatal24
sp_screens += spfatal24/spfatal24.scn
sp_docs += spfatal24/spfatal24.doc
-spfatal24_SOURCES = spfatal_support/init.c \
- spfatal24/testcase.h
+spfatal24_SOURCES = spfatal24/init.c
spfatal24_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spfatal24) \
- $(support_includes) -I$(top_srcdir)/spfatal24
+ $(support_includes)
endif
if TEST_spfatal25
sp_tests += spfatal25
sp_screens += spfatal25/spfatal25.scn
sp_docs += spfatal25/spfatal25.doc
-spfatal25_SOURCES = spfatal_support/init.c \
- spfatal25/testcase.h
+spfatal25_SOURCES = spfatal25/init.c
spfatal25_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spfatal25) \
- $(support_includes) -I$(top_srcdir)/spfatal25
+ $(support_includes)
endif
if TEST_spfatal26
@@ -1049,30 +1034,27 @@ if TEST_spfatal27
sp_tests += spfatal27
sp_screens += spfatal27/spfatal27.scn
sp_docs += spfatal27/spfatal27.doc
-spfatal27_SOURCES = spfatal_support/init.c \
- spfatal27/testcase.h
+spfatal27_SOURCES = spfatal27/init.c
spfatal27_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spfatal27) \
- $(support_includes) -I$(top_srcdir)/spfatal27
+ $(support_includes)
endif
if TEST_spfatal28
sp_tests += spfatal28
sp_screens += spfatal28/spfatal28.scn
sp_docs += spfatal28/spfatal28.doc
-spfatal28_SOURCES = spfatal_support/init.c \
- spfatal28/testcase.h
+spfatal28_SOURCES = spfatal28/init.c
spfatal28_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spfatal28) \
- $(support_includes) -I$(top_srcdir)/spfatal28
+ $(support_includes)
endif
if TEST_spfatal29
sp_tests += spfatal29
sp_screens += spfatal29/spfatal29.scn
sp_docs += spfatal29/spfatal29.doc
-spfatal29_SOURCES = spfatal_support/init.c \
- spfatal29/testcase.h
+spfatal29_SOURCES = spfatal29/init.c
spfatal29_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spfatal29) \
- $(support_includes) -I$(top_srcdir)/spfatal29
+ $(support_includes)
endif
if TEST_spfatal30
@@ -1097,10 +1079,9 @@ if TEST_spfatal32
sp_tests += spfatal32
sp_screens += spfatal32/spfatal32.scn
sp_docs += spfatal32/spfatal32.doc
-spfatal32_SOURCES = spfatal_support/init.c \
- spfatal32/testcase.h
+spfatal32_SOURCES = spfatal32/init.c
spfatal32_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spfatal32) \
- $(support_includes) -I$(top_srcdir)/spfatal32
+ $(support_includes)
endif
if TEST_spfifo01
diff --git a/testsuites/sptests/spfatal01/testcase.h b/testsuites/sptests/spfatal01/init.c
index 19cd16e72e..95067e74c6 100644
--- a/testsuites/sptests/spfatal01/testcase.h
+++ b/testsuites/sptests/spfatal01/init.c
@@ -1,3 +1,9 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "../spfatal_support/spfatal.h"
+
/*
* Classic API Init task create failure
*/
@@ -27,7 +33,7 @@ rtems_initialization_tasks_table Initialization_tasks[] = {
#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_CORE
#define FATAL_ERROR_EXPECTED_ERROR INTERNAL_ERROR_RTEMS_INIT_TASK_CREATE_FAILED
-void force_error()
+static void force_error(void)
{
/*
* Case 2: Null entry
@@ -38,3 +44,5 @@ void force_error()
/* we will not run this far */
}
+
+#include "../spfatal_support/spfatalimpl.h"
diff --git a/testsuites/sptests/spfatal02/testcase.h b/testsuites/sptests/spfatal02/init.c
index 8ed2f44284..e0f6a978fc 100644
--- a/testsuites/sptests/spfatal02/testcase.h
+++ b/testsuites/sptests/spfatal02/init.c
@@ -1,3 +1,9 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "../spfatal_support/spfatal.h"
+
/*
* Classic API Init task create failure
*/
@@ -28,7 +34,7 @@ rtems_initialization_tasks_table Initialization_tasks[] = {
#define FATAL_ERROR_EXPECTED_ERROR \
INTERNAL_ERROR_RTEMS_INIT_TASK_ENTRY_IS_NULL
-void force_error()
+static void force_error(void)
{
/*
* Case 2: Null entry
@@ -36,3 +42,5 @@ void force_error()
/* we will not run this far */
}
+
+#include "../spfatal_support/spfatalimpl.h"
diff --git a/testsuites/sptests/spfatal03/testcase.h b/testsuites/sptests/spfatal03/init.c
index b6935657ea..10a9f277e8 100644
--- a/testsuites/sptests/spfatal03/testcase.h
+++ b/testsuites/sptests/spfatal03/init.c
@@ -1,3 +1,9 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "../spfatal_support/spfatal.h"
+
/*
* Semaphore Obtain in Critical Section
*
@@ -19,7 +25,7 @@
#define FATAL_ERROR_EXPECTED_ERROR \
INTERNAL_ERROR_BAD_THREAD_DISPATCH_DISABLE_LEVEL
-void force_error(void)
+static void force_error(void)
{
rtems_status_code status;
@@ -44,3 +50,5 @@ void force_error(void)
rtems_test_assert( 0 );
/* we will not run this far */
}
+
+#include "../spfatal_support/spfatalimpl.h"
diff --git a/testsuites/sptests/spfatal04/testcase.h b/testsuites/sptests/spfatal04/init.c
index 323a77762c..cfbad5d409 100644
--- a/testsuites/sptests/spfatal04/testcase.h
+++ b/testsuites/sptests/spfatal04/init.c
@@ -1,3 +1,9 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "../spfatal_support/spfatal.h"
+
/*
* Classic API Init task create failure
*/
@@ -28,8 +34,10 @@ rtems_initialization_tasks_table Initialization_tasks[] = {
#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_RTEMS_API
#define FATAL_ERROR_EXPECTED_ERROR 0xdead
-void force_error()
+static void force_error(void)
{
rtems_fatal_error_occurred( 0xdead );
/* we will not run this far */
}
+
+#include "../spfatal_support/spfatalimpl.h"
diff --git a/testsuites/sptests/spfatal05/testcase.h b/testsuites/sptests/spfatal05/init.c
index 933b7a5d45..b0411162f2 100644
--- a/testsuites/sptests/spfatal05/testcase.h
+++ b/testsuites/sptests/spfatal05/init.c
@@ -1,3 +1,9 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "../spfatal_support/spfatal.h"
+
/*
* Classic API Init task create failure
*
@@ -44,7 +50,7 @@ rtems_task EmptyTask(
{
}
-void force_error()
+static void force_error(void)
{
rtems_id id;
rtems_status_code status;
@@ -67,3 +73,5 @@ void force_error()
/* we will not run this far */
}
+
+#include "../spfatal_support/spfatalimpl.h"
diff --git a/testsuites/sptests/spfatal06/testcase.h b/testsuites/sptests/spfatal06/init.c
index 8ec16271fe..842931a336 100644
--- a/testsuites/sptests/spfatal06/testcase.h
+++ b/testsuites/sptests/spfatal06/init.c
@@ -1,3 +1,9 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "../spfatal_support/spfatal.h"
+
/*
* Classic API Init task create failure
*
@@ -46,7 +52,9 @@ void *New_stack_allocate_hook(size_t unused)
return NULL;
}
-void force_error()
+static void force_error(void)
{
/* we will not run this far */
}
+
+#include "../spfatal_support/spfatalimpl.h"
diff --git a/testsuites/sptests/spfatal08/testcase.h b/testsuites/sptests/spfatal08/init.c
index 03e7ca5305..568bdf7dcb 100644
--- a/testsuites/sptests/spfatal08/testcase.h
+++ b/testsuites/sptests/spfatal08/init.c
@@ -1,3 +1,9 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "../spfatal_support/spfatal.h"
+
/*
* Classic API Init task create failure
*
@@ -16,8 +22,10 @@
#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_CORE
#define FATAL_ERROR_EXPECTED_ERROR INTERNAL_ERROR_WORKSPACE_ALLOCATION
-void force_error()
+static void force_error(void)
{
_Workspace_Allocate_or_fatal_error( SIZE_MAX );
/* we will not run this far */
}
+
+#include "../spfatal_support/spfatalimpl.h"
diff --git a/testsuites/sptests/spfatal09/testcase.h b/testsuites/sptests/spfatal09/init.c
index 07b03af206..5aca7a9ea0 100644
--- a/testsuites/sptests/spfatal09/testcase.h
+++ b/testsuites/sptests/spfatal09/init.c
@@ -1,3 +1,9 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "../spfatal_support/spfatal.h"
+
/*
* Malloc Initialization Error
*
@@ -17,8 +23,10 @@
#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_CORE
#define FATAL_ERROR_EXPECTED_ERROR INTERNAL_ERROR_NO_MEMORY_FOR_HEAP
-void force_error()
+static void force_error(void)
{
RTEMS_Malloc_Initialize( NULL, 0, NULL );
/* we will not run this far */
}
+
+#include "../spfatal_support/spfatalimpl.h"
diff --git a/testsuites/sptests/spfatal10/testcase.h b/testsuites/sptests/spfatal10/init.c
index df4125e7da..221f117f3a 100644
--- a/testsuites/sptests/spfatal10/testcase.h
+++ b/testsuites/sptests/spfatal10/init.c
@@ -1,3 +1,9 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "../spfatal_support/spfatal.h"
+
/* Test __assert_func with NULL function name
*
* COPYRIGHT (c) 1989-2009.
@@ -32,9 +38,11 @@ static inline bool spfatal10_is_expected_error( rtems_fatal_code error )
&& strcmp( assert_context->failed_expression, ASSERT_FEXP ) == 0;
}
-void force_error()
+static void force_error(void)
{
__assert_func( ASSERT_FILE, ASSERT_LINE, ASSERT_FUNC, ASSERT_FEXP );
/* we will not run this far */
}
+
+#include "../spfatal_support/spfatalimpl.h"
diff --git a/testsuites/sptests/spfatal11/testcase.h b/testsuites/sptests/spfatal11/init.c
index ddd37a66fe..af1596d1b6 100644
--- a/testsuites/sptests/spfatal11/testcase.h
+++ b/testsuites/sptests/spfatal11/init.c
@@ -1,3 +1,9 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "../spfatal_support/spfatal.h"
+
/* Test __assert_func with NULL function name
*
* COPYRIGHT (c) 1989-2009.
@@ -32,9 +38,11 @@ static inline bool spfatal11_is_expected_error( rtems_fatal_code error )
&& strcmp( assert_context->failed_expression, ASSERT_FEXP ) == 0;
}
-void force_error()
+static void force_error(void)
{
__assert_func( ASSERT_FILE, ASSERT_LINE, ASSERT_FUNC, ASSERT_FEXP );
/* we will not run this far */
}
+
+#include "../spfatal_support/spfatalimpl.h"
diff --git a/testsuites/sptests/spfatal12/testcase.h b/testsuites/sptests/spfatal12/init.c
index 8b3d40926c..c3c1afdd78 100644
--- a/testsuites/sptests/spfatal12/testcase.h
+++ b/testsuites/sptests/spfatal12/init.c
@@ -1,3 +1,9 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "../spfatal_support/spfatal.h"
+
/* Test __assert_func with NULL function name
*
* COPYRIGHT (c) 1989-2009.
@@ -16,10 +22,12 @@
#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_CORE
#define FATAL_ERROR_EXPECTED_ERROR INTERNAL_ERROR_TOO_LITTLE_WORKSPACE
-void force_error()
+static void force_error(void)
{
Heap_Area area = { .begin = NULL, .size = 0 };
_Workspace_Handler_initialization( &area, 1, NULL );
/* we will not run this far */
}
+
+#include "../spfatal_support/spfatalimpl.h"
diff --git a/testsuites/sptests/spfatal14/testcase.h b/testsuites/sptests/spfatal14/init.c
index d280a17750..ffb1c491b6 100644
--- a/testsuites/sptests/spfatal14/testcase.h
+++ b/testsuites/sptests/spfatal14/init.c
@@ -1,3 +1,9 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "../spfatal_support/spfatal.h"
+
/*
* COPYRIGHT (c) 1989-2010.
* On-Line Applications Research Corporation (OAR).
@@ -16,7 +22,9 @@
#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 1
-void force_error()
+static void force_error(void)
{
/* we will not run this far */
}
+
+#include "../spfatal_support/spfatalimpl.h"
diff --git a/testsuites/sptests/spfatal15/testcase.h b/testsuites/sptests/spfatal15/init.c
index fc3d25f2db..fb8645849f 100644
--- a/testsuites/sptests/spfatal15/testcase.h
+++ b/testsuites/sptests/spfatal15/init.c
@@ -1,3 +1,9 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "../spfatal_support/spfatal.h"
+
/*
* COPYRIGHT (c) 1989-2010.
* On-Line Applications Research Corporation (OAR).
@@ -15,7 +21,9 @@
#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 2
-void force_error()
+static void force_error(void)
{
/* we will not run this far */
}
+
+#include "../spfatal_support/spfatalimpl.h"
diff --git a/testsuites/sptests/spfatal24/testcase.h b/testsuites/sptests/spfatal24/init.c
index 19a7547304..6522ef7be2 100644
--- a/testsuites/sptests/spfatal24/testcase.h
+++ b/testsuites/sptests/spfatal24/init.c
@@ -1,3 +1,9 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "../spfatal_support/spfatal.h"
+
/*
* COPYRIGHT (c) 1989-2010.
* On-Line Applications Research Corporation (OAR).
@@ -15,9 +21,11 @@
#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_CORE
#define FATAL_ERROR_EXPECTED_ERROR INTERNAL_ERROR_GXX_KEY_ADD_FAILED
-void force_error()
+static void force_error(void)
{
pthread_key_t key = -1;
rtems_gxx_setspecific( &key, NULL );
}
+
+#include "../spfatal_support/spfatalimpl.h"
diff --git a/testsuites/sptests/spfatal25/testcase.h b/testsuites/sptests/spfatal25/init.c
index c2c97e4744..83042557e5 100644
--- a/testsuites/sptests/spfatal25/testcase.h
+++ b/testsuites/sptests/spfatal25/init.c
@@ -1,3 +1,9 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "../spfatal_support/spfatal.h"
+
/*
* COPYRIGHT (c) 1989-2010.
* On-Line Applications Research Corporation (OAR).
@@ -14,7 +20,7 @@
#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_CORE
#define FATAL_ERROR_EXPECTED_ERROR INTERNAL_ERROR_GXX_MUTEX_INIT_FAILED
-void force_error()
+static void force_error(void)
{
__gthread_mutex_t mutex;
@@ -23,3 +29,5 @@ void force_error()
rtems_test_assert( mutex != 0 );
}
}
+
+#include "../spfatal_support/spfatalimpl.h"
diff --git a/testsuites/sptests/spfatal27/testcase.h b/testsuites/sptests/spfatal27/init.c
index 9845959dcb..7f2cf8668f 100644
--- a/testsuites/sptests/spfatal27/testcase.h
+++ b/testsuites/sptests/spfatal27/init.c
@@ -1,3 +1,9 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "../spfatal_support/spfatal.h"
+
/*
* Copyright (c) 2014 embedded brains GmbH. All rights reserved.
*
@@ -20,7 +26,9 @@
#define CONFIGURE_MAXIMUM_POSIX_KEYS (-1)
#define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS (0)
-void force_error()
+static void force_error(void)
{
/* we should not reach this */
}
+
+#include "../spfatal_support/spfatalimpl.h"
diff --git a/testsuites/sptests/spfatal28/testcase.h b/testsuites/sptests/spfatal28/init.c
index 8797ae0fe9..c827b297c3 100644
--- a/testsuites/sptests/spfatal28/testcase.h
+++ b/testsuites/sptests/spfatal28/init.c
@@ -1,3 +1,9 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "../spfatal_support/spfatal.h"
+
/*
* Copyright (c) 2014 embedded brains GmbH. All rights reserved.
*
@@ -19,7 +25,7 @@
#define CONFIGURE_MAXIMUM_SEMAPHORES 1
-void force_error()
+static void force_error(void)
{
#if defined(RTEMS_SCORE_THREAD_ENABLE_RESOURCE_COUNT)
rtems_status_code sc;
@@ -39,3 +45,5 @@ void force_error()
_Terminate( INTERNAL_ERROR_CORE, INTERNAL_ERROR_RESOURCE_IN_USE );
#endif
}
+
+#include "../spfatal_support/spfatalimpl.h"
diff --git a/testsuites/sptests/spfatal29/testcase.h b/testsuites/sptests/spfatal29/init.c
index 69bbc80925..439eeef7ac 100644
--- a/testsuites/sptests/spfatal29/testcase.h
+++ b/testsuites/sptests/spfatal29/init.c
@@ -1,3 +1,9 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "../spfatal_support/spfatal.h"
+
/*
* Copyright (c) 2016 embedded brains GmbH. All rights reserved.
*
@@ -26,7 +32,7 @@ static void timer(rtems_id id, void *arg)
rtems_task_wake_after(RTEMS_YIELD_PROCESSOR);
}
-void force_error()
+static void force_error(void)
{
rtems_status_code sc;
rtems_id id;
@@ -42,3 +48,5 @@ void force_error()
rtems_task_exit();
}
+
+#include "../spfatal_support/spfatalimpl.h"
diff --git a/testsuites/sptests/spfatal32/testcase.h b/testsuites/sptests/spfatal32/init.c
index 8e77062f94..c4851cbd6f 100644
--- a/testsuites/sptests/spfatal32/testcase.h
+++ b/testsuites/sptests/spfatal32/init.c
@@ -1,3 +1,9 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "../spfatal_support/spfatal.h"
+
/*
* Copyright (c) 2018 embedded brains GmbH. All rights reserved.
*
@@ -20,8 +26,10 @@
#define FATAL_ERROR_EXPECTED_SOURCE RTEMS_FATAL_SOURCE_INVALID_HEAP_FREE
#define FATAL_ERROR_EXPECTED_ERROR 1
-void force_error()
+static void force_error(void)
{
uintptr_t invalid = 1;
free((void *) invalid);
}
+
+#include "../spfatal_support/spfatalimpl.h"
diff --git a/testsuites/sptests/spfatal_support/spfatal.h b/testsuites/sptests/spfatal_support/spfatal.h
new file mode 100644
index 0000000000..2a49ca2e54
--- /dev/null
+++ b/testsuites/sptests/spfatal_support/spfatal.h
@@ -0,0 +1,14 @@
+/*
+ * COPYRIGHT (c) 1989-2011.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#include <rtems/bspIo.h>
+
+#include <tmacros.h>
+
+rtems_task Init( rtems_task_argument argument );
diff --git a/testsuites/sptests/spfatal_support/init.c b/testsuites/sptests/spfatal_support/spfatalimpl.h
index e5aae95027..83f0d25ab7 100644
--- a/testsuites/sptests/spfatal_support/init.c
+++ b/testsuites/sptests/spfatal_support/spfatalimpl.h
@@ -7,20 +7,12 @@
* http://www.rtems.org/license/LICENSE.
*/
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
#include <rtems/bspIo.h>
#include <tmacros.h>
rtems_task Init( rtems_task_argument argument );
-void force_error( void );
-
-#include "testcase.h"
-
const char rtems_test_name[] = "SPFATAL " FATAL_ERROR_TEST_NAME;
static void print_test_begin_message(void)