changeset 2728:e5db16acddac

Fix signal1.c so that it only tests real implementations of abort(), and both signal1.c and signal2.c to cope with configurations that do not include main()
author bartv
date Wed, 28 Jan 2009 16:55:35 +0000
parents a617eb45dda6
children 74dbf4c3f2e1
files packages/language/c/libc/signals/current/ChangeLog packages/language/c/libc/signals/current/tests/signal1.c packages/language/c/libc/signals/current/tests/signal2.c
diffstat 3 files changed, 24 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/packages/language/c/libc/signals/current/ChangeLog
+++ b/packages/language/c/libc/signals/current/ChangeLog
@@ -1,3 +1,11 @@
+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.
+
 2008-12-24  Andrew Lunn  <andrew.lunn@ascom.ch>
 
 	* include/signal.inl: (cyg_libc_signals_[un]lock): remove the
--- a/packages/language/c/libc/signals/current/tests/signal1.c
+++ b/packages/language/c/libc/signals/current/tests/signal1.c
@@ -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
--- a/packages/language/c/libc/signals/current/tests/signal2.c
+++ b/packages/language/c/libc/signals/current/tests/signal2.c
@@ -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;