public inbox for ecos-patches@sourceware.org
 help / color / mirror / Atom feed
* fix signals tests
@ 2009-01-28 16:55 Bart Veer
  0 siblings, 0 replies; only message in thread
From: Bart Veer @ 2009-01-28 16:55 UTC (permalink / raw)
  To: ecos-patches

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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-01-28 16:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-28 16:55 fix signals tests Bart Veer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).