List:Commits« Previous MessageNext Message »
From:Tor Didriksen Date:April 21 2010 8:39am
Subject:bzr commit into mysql-next-mr-bugfixing branch (tor.didriksen:3148) Bug#52385
View as plain text  
#At file:///export/home/didrik/mysqldev-next-mr/next-mr-bf-bug52385/ based on revid:jon.hauglid@stripped

 3148 Tor Didriksen	2010-04-21
      Bug#52385 mytap should not bail out on test failures
      
      In the mytap signal handler:
      print stack trace (if possible) and exit, rather than terminating all tests.
     @ CMakeLists.txt
        Add unittest/examples
     @ unittest/examples/CMakeLists.txt
        Simplify targets.
     @ unittest/examples/Makefile.am
        Add dependency on libmysys (for stack trace)
     @ unittest/examples/core-t.c
        Update comment.
     @ unittest/mytap/CMakeLists.txt
        Add dependency on libmysys (for stack trace)
     @ unittest/mytap/tap.c
        New signal handler.

    modified:
      CMakeLists.txt
      unittest/examples/CMakeLists.txt
      unittest/examples/Makefile.am
      unittest/examples/core-t.c
      unittest/mytap/CMakeLists.txt
      unittest/mytap/tap.c
=== modified file 'CMakeLists.txt'
--- a/CMakeLists.txt	2010-03-14 12:51:28 +0000
+++ b/CMakeLists.txt	2010-04-21 08:38:59 +0000
@@ -231,6 +231,7 @@ IF(WITH_UNIT_TESTS)
  ENABLE_TESTING()
 ENDIF()
 IF(WITH_UNIT_TESTS)
+  ADD_SUBDIRECTORY(unittest/examples)
   ADD_SUBDIRECTORY(unittest/mytap)
   ADD_SUBDIRECTORY(unittest/mysys)
 ENDIF()

=== modified file 'unittest/examples/CMakeLists.txt'
--- a/unittest/examples/CMakeLists.txt	2009-11-18 04:29:26 +0000
+++ b/unittest/examples/CMakeLists.txt	2010-04-21 08:38:59 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2007 MySQL AB
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. 
 # 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -19,20 +19,10 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/
                     ${CMAKE_SOURCE_DIR}/regex
                     ${CMAKE_SOURCE_DIR}/extra/yassl/include
                     ${CMAKE_SOURCE_DIR}/unittest/mytap)
-ADD_EXECUTABLE(simple-t simple-t.c)
-TARGET_LINK_LIBRARIES(simple-t mytap)
 
-ADD_EXECUTABLE(skip-t skip-t.c)
-TARGET_LINK_LIBRARIES(skip-t mytap)
-
-ADD_EXECUTABLE(todo-t todo-t.c)
-TARGET_LINK_LIBRARIES(todo-t mytap)
-
-ADD_EXECUTABLE(skip_all-t skip_all-t.c)
-TARGET_LINK_LIBRARIES(skip_all-t mytap)
-
-ADD_EXECUTABLE(no_plan-t no_plan-t.c)
-TARGET_LINK_LIBRARIES(no_plan-t mytap)
-
-ADD_EXECUTABLE(core-t core-t.c)
-TARGET_LINK_LIBRARIES(core-t mytap)
+SET(TESTS simple skip todo skip_all no_plan core)
+FOREACH(test ${TESTS})
+  ADD_EXECUTABLE(${test}-t ${test}-t.c)
+  TARGET_LINK_LIBRARIES(${test}-t mytap)
+  ADD_TEST(${test} ${test}-t)
+ENDFOREACH()

=== modified file 'unittest/examples/Makefile.am'
--- a/unittest/examples/Makefile.am	2007-05-28 20:18:51 +0000
+++ b/unittest/examples/Makefile.am	2010-04-21 08:38:59 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2006 MySQL AB
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. 
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -18,7 +18,7 @@ AM_CPPFLAGS        = -I$(srcdir) -I$(top
 
 AM_LDFLAGS         = -L$(top_builddir)/unittest/mytap
 
-LDADD              = -lmytap
+LDADD              = -lmytap $(top_builddir)/mysys/libmysys.a 
 
 noinst_PROGRAMS    = simple-t skip-t todo-t skip_all-t no_plan-t core-t
 

=== modified file 'unittest/examples/core-t.c'
--- a/unittest/examples/core-t.c	2009-11-18 04:29:26 +0000
+++ b/unittest/examples/core-t.c	2010-04-21 08:38:59 +0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 MySQL AB
+/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. 
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -21,8 +21,6 @@
 /*
   This is a simple test to demonstrate what happens if a signal that
   generates a core is raised.
-
-  Note that this test will stop all further testing!
  */
 
 int main() {

=== modified file 'unittest/mytap/CMakeLists.txt'
--- a/unittest/mytap/CMakeLists.txt	2009-11-09 11:32:48 +0000
+++ b/unittest/mytap/CMakeLists.txt	2010-04-21 08:38:59 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2007 MySQL AB, 2009 Sun Microsystems, Inc
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. 
 # 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -16,3 +16,4 @@
 
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
 ADD_LIBRARY(mytap tap.c)
+TARGET_LINK_LIBRARIES(mytap mysys)

=== modified file 'unittest/mytap/tap.c'
--- a/unittest/mytap/tap.c	2009-11-25 00:50:10 +0000
+++ b/unittest/mytap/tap.c	2010-04-21 08:38:59 +0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 MySQL AB
+/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. 
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -20,6 +20,7 @@
 #include "tap.h"
 
 #include "my_global.h"
+#include "my_stacktrace.h"
 
 #include <stdlib.h>
 #include <stdarg.h>
@@ -123,7 +124,14 @@ emit_endl()
 static void
 handle_core_signal(int signo)
 {
-  BAIL_OUT("Signal %d thrown", signo);
+  /* BAIL_OUT("Signal %d thrown", signo); */
+#ifdef HAVE_STACKTRACE
+  fprintf(stderr, "Signal %d thrown, attempting backtrace.\n", signo);
+  my_print_stacktrace(NULL, 0);
+#endif
+  signal(signo, SIG_DFL);
+  raise(signo);
+  _exit(EXIT_FAILURE);
 }
 
 void


Attachment: [text/bzr-bundle] bzr/tor.didriksen@sun.com-20100421083859-epy9404lt5rxehyd.bundle
Thread
bzr commit into mysql-next-mr-bugfixing branch (tor.didriksen:3148) Bug#52385Tor Didriksen21 Apr