This is the mail archive of the
ecos-patches@sourceware.org
mailing list for the eCos project.
fix signals tests
- From: Bart Veer <bartv at ecoscentric dot com>
- To: ecos-patches at sourceware dot org
- Date: Wed, 28 Jan 2009 16:55:01 GMT
- Subject: fix signals tests
This patches signal1.c to only test abort() if there is a real
implementation of that function, and patches both tests to cope with
configurations that don't use main().
Bart
2009-01-28 Bart Veer <bartv@ecoscentric.com>
* tests/signal1.c: skip the abort() test if there is no proper
implementation.
* tests/signal1.c, tests/signal2.c: allow to run if
CYGPKG_LIBC_STARTUP is absent.
Index: tests/signal1.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/language/c/libc/signals/current/tests/signal1.c,v
retrieving revision 1.4
diff -u -p -r1.4 signal1.c
--- tests/signal1.c 23 May 2002 23:07:10 -0000 1.4
+++ tests/signal1.c 28 Jan 2009 16:53:26 -0000
@@ -58,6 +58,10 @@
// INCLUDES
+#include <pkgconf/system.h>
+#ifdef CYGPKG_ISOINFRA
+# include <pkgconf/isoinfra.h>
+#endif
#include <cyg/infra/cyg_type.h> // Common type definitions and support
#include <cyg/infra/testcase.h> // Test infrastructure
#include <signal.h> // Signal functions
@@ -86,8 +90,12 @@ myhandler2(int signal)
longjmp(jbuf, 1);
} // myhandler2()
+#ifndef CYGPKG_LIBC_STARTUP
+void cyg_user_start(void)
+#else
int
main( int argc, char *argv[] )
+#endif
{
__sighandler_t handler1;
int rc;
@@ -184,6 +192,7 @@ main( int argc, char *argv[] )
CYG_TEST_PASS_FAIL(6==state, "SIGTERM handler returned correctly");
+#if defined(CYGINT_ISO_ENVIRON) && (CYGINT_ISO_ENVIRON > 0)
// Test 6
CYG_TEST_INFO("Test 6");
@@ -200,11 +209,13 @@ main( int argc, char *argv[] )
}
CYG_TEST_PASS_FAIL(7==state, "SIGABRT handler returned correctly");
+#else
+ CYG_TEST_INFO("skipping abort() test, function not implemented");
+#endif
CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C "
"library signal functions");
- return 0;
} // main()
// EOF signal1.c
Index: tests/signal2.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/language/c/libc/signals/current/tests/signal2.c,v
retrieving revision 1.6
diff -u -p -r1.6 signal2.c
--- tests/signal2.c 23 May 2002 23:07:10 -0000 1.6
+++ tests/signal2.c 28 Jan 2009 16:54:30 -0000
@@ -152,8 +152,12 @@ volatile int tmp;
#endif
+#ifndef CYGPKG_LIBC_STARTUP
+void cyg_user_start(void)
+#else
int
main( int argc, char *argv[] )
+#endif
{
#ifdef CYGSEM_LIBC_SIGNALS_HWEXCEPTIONS
__sighandler_t handler1;