Merge lp:~brianaker/gearmand/current-osx-fixes into lp:gearmand

Proposed by Brian Aker on 2014-04-16
Status: Needs review
Proposed branch: lp:~brianaker/gearmand/current-osx-fixes
Merge into: lp:gearmand
Diff against target: 635 lines (+150/-38)
21 files modified
.bzrignore (+1/-0)
configure.ac (+2/-0)
libgearman/check.cc (+6/-0)
libgearman/client.cc (+3/-3)
libgearman/command.cc (+8/-0)
libgearman/error_code.cc (+5/-0)
libgearman/job.cc (+2/-0)
libtest/collection.cc (+12/-0)
libtest/collection.h (+2/-0)
libtest/framework.cc (+10/-0)
libtest/framework.h (+3/-1)
libtest/include.am (+4/-2)
libtest/lite.h (+28/-0)
libtest/run.gdb (+1/-1)
libtest/server.cc (+2/-0)
libtest/signal.cc (+33/-9)
libtest/signal.h (+7/-0)
m4/ax_debug.m4 (+4/-5)
m4/ax_harden_compiler_flags.m4 (+15/-16)
tests/libgearman-1.0/fork.cc (+1/-0)
tests/libgearman-1.0/unique.cc (+1/-1)
To merge this branch: bzr merge lp:~brianaker/gearmand/current-osx-fixes
Reviewer Review Type Date Requested Status
Tangent Trunk 2014-04-16 Pending
Review via email: mp+216087@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

915. By Brian Aker on 2014-04-16

Extend signal to tell which test blew up. Additionally in case where we run out of memory don't try allocating for strsignal.

914. By Brian Aker on 2014-04-16

Don't test fork when running under GDB.

913. By Brian Aker on 2014-04-16

Add support for ASSERT and test of zero.

912. By Brian Aker on 2014-04-16

Fix how we test for building directories required during testing.

911. By Brian Aker on 2014-04-16

Fix for code that was not being touched.

910. By Brian Aker on 2014-04-05

Fixes for latest clang.

909. By Brian Aker on 2014-03-20

Add sphinx and virtual to handle caes.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.bzrignore'
--- .bzrignore 2014-02-16 02:15:49 +0000
+++ .bzrignore 2014-04-16 12:49:38 +0000
@@ -150,3 +150,4 @@
150tests/worker_test150tests/worker_test
151tmp_chroot151tmp_chroot
152valgrind*xml152valgrind*xml
153docs/build/*
153154
=== modified file 'configure.ac'
--- configure.ac 2014-02-16 02:15:49 +0000
+++ configure.ac 2014-04-16 12:49:38 +0000
@@ -118,6 +118,8 @@
118AC_CHECK_PROGS([OPENSSL],[openssl])118AC_CHECK_PROGS([OPENSSL],[openssl])
119AC_CHECK_PROGS([VALGRIND],['valgrind'])119AC_CHECK_PROGS([VALGRIND],['valgrind'])
120AC_CHECK_PROGS([WINE],['wine'])120AC_CHECK_PROGS([WINE],['wine'])
121AC_CHECK_PROGS([SPHINX],['sphinx-build'])
122AC_CHECK_PROGS([VIRTUALENV],['virtualenv'])
121AC_CHECK_PROGS([RPMBUILD],[rpmbuild --nocheck])123AC_CHECK_PROGS([RPMBUILD],[rpmbuild --nocheck])
122AC_CHECK_PROGS([RPMDEV_SETUPTREE],[rpmdev-setuptree])124AC_CHECK_PROGS([RPMDEV_SETUPTREE],[rpmdev-setuptree])
123AC_CHECK_PROGS([RPM],[rpm])125AC_CHECK_PROGS([RPM],[rpm])
124126
=== modified file 'libgearman/check.cc'
--- libgearman/check.cc 2013-07-10 10:54:09 +0000
+++ libgearman/check.cc 2014-04-16 12:49:38 +0000
@@ -39,6 +39,12 @@
3939
40#include "libgearman/common.h"40#include "libgearman/common.h"
4141
42#if defined(__clang__)
43# pragma clang diagnostic push
44# pragma clang diagnostic ignored "-Wunknown-pragmas"
45# pragma clang diagnostic ignored "-Wdeprecated-register"
46#endif
47
42#include "libgearman/error_code.h"48#include "libgearman/error_code.h"
4349
44#include <algorithm>50#include <algorithm>
4551
=== modified file 'libgearman/client.cc'
--- libgearman/client.cc 2013-11-07 09:30:17 +0000
+++ libgearman/client.cc 2014-04-16 12:49:38 +0000
@@ -599,7 +599,7 @@
599 {599 {
600 Client* client= client_shell->impl();600 Client* client= client_shell->impl();
601601
602 if (gearman_connection_create(client->universal, host, port) == false)602 if (gearman_connection_create(client->universal, host, port) == NULL)
603 {603 {
604 assert(client->error_code() != GEARMAN_SUCCESS);604 assert(client->error_code() != GEARMAN_SUCCESS);
605 return client->error_code();605 return client->error_code();
@@ -614,7 +614,7 @@
614614
615gearman_return_t Client::add_server(const char *host, const char* service_)615gearman_return_t Client::add_server(const char *host, const char* service_)
616{616{
617 if (gearman_connection_create(universal, host, service_) == false)617 if (gearman_connection_create(universal, host, service_) == NULL)
618 {618 {
619 assert(error_code() != GEARMAN_SUCCESS);619 assert(error_code() != GEARMAN_SUCCESS);
620 return error_code();620 return error_code();
@@ -946,7 +946,7 @@
946 *denominator= do_task->impl()->denominator;946 *denominator= do_task->impl()->denominator;
947 }947 }
948948
949 if (is_known == false and is_running == false)949 if (0)
950 {950 {
951 if (do_task->impl()->options.is_running) 951 if (do_task->impl()->options.is_running)
952 {952 {
953953
=== modified file 'libgearman/command.cc'
--- libgearman/command.cc 2013-07-26 18:56:28 +0000
+++ libgearman/command.cc 2014-04-16 12:49:38 +0000
@@ -40,7 +40,15 @@
40#include <libgearman/common.h>40#include <libgearman/common.h>
4141
42#include <libgearman-1.0/visibility.h>42#include <libgearman-1.0/visibility.h>
43
44#if defined(__clang__)
45# pragma clang diagnostic push
46# pragma clang diagnostic ignored "-Wunknown-pragmas"
47# pragma clang diagnostic ignored "-Wdeprecated-register"
48#endif
49
43#include "libgearman/command.hpp"50#include "libgearman/command.hpp"
51
44#include "libgearman/strcommand.h"52#include "libgearman/strcommand.h"
4553
46#include "libgearman/assert.hpp"54#include "libgearman/assert.hpp"
4755
=== modified file 'libgearman/error_code.cc'
--- libgearman/error_code.cc 2013-07-26 18:56:28 +0000
+++ libgearman/error_code.cc 2014-04-16 12:49:38 +0000
@@ -38,6 +38,11 @@
38#include "gear_config.h"38#include "gear_config.h"
3939
40#include "libgearman/error_code.h"40#include "libgearman/error_code.h"
41#if defined(__clang__)
42# pragma clang diagnostic push
43# pragma clang diagnostic ignored "-Wunknown-pragmas"
44# pragma clang diagnostic ignored "-Wdeprecated-register"
45#endif
41#include "libgearman/error_code.hpp"46#include "libgearman/error_code.hpp"
4247
43#include "libgearman-1.0/visibility.h"48#include "libgearman-1.0/visibility.h"
4449
=== modified file 'libgearman/job.cc'
--- libgearman/job.cc 2013-09-18 00:51:13 +0000
+++ libgearman/job.cc 2014-04-16 12:49:38 +0000
@@ -318,6 +318,7 @@
318 return NULL;318 return NULL;
319}319}
320320
321#if 0
321static inline void gearman_job_reset_error(Job* job)322static inline void gearman_job_reset_error(Job* job)
322{323{
323 if (job)324 if (job)
@@ -325,6 +326,7 @@
325 gearman_worker_reset_error(job->_worker);326 gearman_worker_reset_error(job->_worker);
326 }327 }
327}328}
329#endif
328330
329gearman_return_t gearman_job_send_data(gearman_job_st *job_shell, const void *data, size_t data_size)331gearman_return_t gearman_job_send_data(gearman_job_st *job_shell, const void *data, size_t data_size)
330{332{
331333
=== modified file 'libtest/collection.cc'
--- libtest/collection.cc 2013-07-02 18:19:31 +0000
+++ libtest/collection.cc 2014-04-16 12:49:38 +0000
@@ -174,6 +174,18 @@
174 format();174 format();
175}175}
176176
177void Collection::current_test(std::string& arg)
178{
179 if (case_iter != _testcases.end())
180 {
181 arg+= name() + std::string(".") + (*case_iter)->name();
182 }
183 else
184 {
185 arg+= name();
186 }
187}
188
177test_return_t Collection::exec()189test_return_t Collection::exec()
178{190{
179 // Write out any headers required by formatting.191 // Write out any headers required by formatting.
180192
=== modified file 'libtest/collection.h'
--- libtest/collection.h 2013-08-03 07:38:29 +0000
+++ libtest/collection.h 2014-04-16 12:49:38 +0000
@@ -67,6 +67,8 @@
67 return _name.c_str();67 return _name.c_str();
68 }68 }
6969
70 void current_test(std::string&);
71
70 TestCases& tests()72 TestCases& tests()
71 {73 {
72 return _testcases;74 return _testcases;
7375
=== modified file 'libtest/framework.cc'
--- libtest/framework.cc 2013-08-03 07:38:29 +0000
+++ libtest/framework.cc 2014-04-16 12:49:38 +0000
@@ -152,6 +152,13 @@
152 _formatter.push_back(new libtest::TAP(this, tap_file));152 _formatter.push_back(new libtest::TAP(this, tap_file));
153 }153 }
154 _formatter.push_back(new libtest::Legacy(this, std::cout));154 _formatter.push_back(new libtest::Legacy(this, std::cout));
155
156 _signal.frame(this);
157}
158
159const std::string& Framework::current_test()
160{
161 return _test_name;
155}162}
156163
157void Framework::collections(collection_st collections_[])164void Framework::collections(collection_st collections_[])
@@ -202,6 +209,9 @@
202 continue;209 continue;
203 }210 }
204211
212 _test_name= name() + ".";
213 (*iter)->current_test(_test_name);
214
205 _total++;215 _total++;
206216
207#if defined(DEBUG) && DEBUG217#if defined(DEBUG) && DEBUG
208218
=== modified file 'libtest/framework.h'
--- libtest/framework.h 2013-07-02 12:18:03 +0000
+++ libtest/framework.h 2014-04-16 12:49:38 +0000
@@ -63,6 +63,8 @@
63 return _name;63 return _name;
64 }64 }
6565
66 const std::string& current_test();
67
66 void create(test_callback_create_fn* arg)68 void create(test_callback_create_fn* arg)
67 {69 {
68 _create= arg;70 _create= arg;
@@ -200,7 +202,7 @@
200 libtest::Formatters _formatter;202 libtest::Formatters _formatter;
201 std::ofstream xml_file;203 std::ofstream xml_file;
202 std::ofstream tap_file;204 std::ofstream tap_file;
203205 std::string _test_name;
204};206};
205207
206} // namespace libtest208} // namespace libtest
207209
=== modified file 'libtest/include.am'
--- libtest/include.am 2014-02-13 12:58:32 +0000
+++ libtest/include.am 2014-04-16 12:49:38 +0000
@@ -188,12 +188,14 @@
188libtest_libtest_la_SOURCES+= libtest/blobslap_worker.cc188libtest_libtest_la_SOURCES+= libtest/blobslap_worker.cc
189endif189endif
190190
191TMP_DIR := tmp_chroot/etc tmp_chroot/var/log tmp_chroot/var/tmp tmp_chroot/var/run tmp_chroot/var/drizzle191TMP_DIR_NAMES := tmp_chroot/etc tmp_chroot/var/log tmp_chroot/var/tmp tmp_chroot/var/run tmp_chroot/var/drizzle
192TMP_DIR= $(addsuffix /$(am__dirstamp), $(TMP_DIR_NAMES))
192193
193BUILT_SOURCES+= $(TMP_DIR)194BUILT_SOURCES+= $(TMP_DIR)
194195
195$(TMP_DIR):196$(TMP_DIR):
196 @$(mkdir_p) $(TMP_DIR)197 @$(mkdir_p) $(@D)
198 @touch $@
197199
198# Declare unittest so that we can append to it200# Declare unittest so that we can append to it
199t_unittest_CXXFLAGS=201t_unittest_CXXFLAGS=
200202
=== modified file 'libtest/lite.h'
--- libtest/lite.h 2014-01-31 02:41:41 +0000
+++ libtest/lite.h 2014-04-16 12:49:38 +0000
@@ -120,6 +120,22 @@
120 return strcmp(s1, s2);120 return strcmp(s1, s2);
121}121}
122122
123#define ASSERT_(...) \
124do \
125{ \
126 { \
127 size_t ask= snprintf(0, 0, __VA_ARGS__); \
128 ask++; \
129 char *buffer= (char*)alloca(sizeof(char) * ask); \
130 snprintf(buffer, ask, __VA_ARGS__); \
131 if (YATL_FULL) { \
132 FAIL("Assert [ %s ]", buffer); \
133 } \
134 fprintf(stderr, "\n%s:%d: %s Assert [ %s ]\n", __FILE__, __LINE__, __PRETTY_FUNCTION__, buffer); \
135 exit(EXIT_FAILURE); \
136 } \
137} while (0)
138
123#define SKIP_IF(__expression) \139#define SKIP_IF(__expression) \
124do \140do \
125{ \141{ \
@@ -189,6 +205,18 @@
189 } \205 } \
190} while (0)206} while (0)
191207
208#define ASSERT_ZERO(__expression) \
209do \
210{ \
211 if ((__expression) != 0) { \
212 if (YATL_FULL) { \
213 FAIL("Assertion ('%s') == 0", #__expression); \
214 } \
215 fprintf(stderr, "\n%s:%d: %s Assertion '(%s) == 0'\n", __FILE__, __LINE__, __PRETTY_FUNCTION__, #__expression);\
216 exit(EXIT_FAILURE); \
217 } \
218} while (0)
219
192#define ASSERT_FALSE(__expression) \220#define ASSERT_FALSE(__expression) \
193do \221do \
194{ \222{ \
195223
=== modified file 'libtest/run.gdb'
--- libtest/run.gdb 2013-07-10 01:57:34 +0000
+++ libtest/run.gdb 2014-04-16 12:49:38 +0000
@@ -8,7 +8,7 @@
8set logging overwrite on8set logging overwrite on
9set environment LIBTEST_IN_GDB=19set environment LIBTEST_IN_GDB=1
10#set ASAN_OPTIONS=abort_on_error=110#set ASAN_OPTIONS=abort_on_error=1
11set detach-on-fork on11#set detach-on-fork on
12handle SIGVTALRM stop12handle SIGVTALRM stop
13run13run
14thread apply all bt14thread apply all bt
1515
=== modified file 'libtest/server.cc'
--- libtest/server.cc 2013-05-30 18:20:15 +0000
+++ libtest/server.cc 2014-04-16 12:49:38 +0000
@@ -50,11 +50,13 @@
50#include <unistd.h>50#include <unistd.h>
5151
52// trim from end 52// trim from end
53#if 0
53static inline std::string &rtrim(std::string &s)54static inline std::string &rtrim(std::string &s)
54{ 55{
55 s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), s.end()); 56 s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), s.end());
56 return s; 57 return s;
57}58}
59#endif
5860
59#include <libtest/server.h>61#include <libtest/server.h>
60#include <libtest/stream.h>62#include <libtest/stream.h>
6163
=== modified file 'libtest/signal.cc'
--- libtest/signal.cc 2013-05-11 23:02:06 +0000
+++ libtest/signal.cc 2014-04-16 12:49:38 +0000
@@ -45,6 +45,20 @@
4545
46#define MAGIC_MEMORY 12356946#define MAGIC_MEMORY 123569
4747
48namespace {
49 char* safe_strsignal(int sig)
50 {
51 char* tmp= strsignal(sig);
52 if (tmp)
53 {
54 return tmp;
55 }
56
57 return (char*) "strsignal() ran out of memory allocating error";
58 }
59
60}
61
48bool SignalThread::is_shutdown()62bool SignalThread::is_shutdown()
49{63{
50 bool ret;64 bool ret;
@@ -90,7 +104,7 @@
90{104{
91 fatal_assert(magic_memory == MAGIC_MEMORY);105 fatal_assert(magic_memory == MAGIC_MEMORY);
92106
93 if (bool(getenv("LIBTEST_IN_GDB")) == false)107 if (gdb_is_caller() == false)
94 {108 {
95 assert(sigismember(&set, SIGALRM));109 assert(sigismember(&set, SIGALRM));
96 assert(sigismember(&set, SIGABRT));110 assert(sigismember(&set, SIGABRT));
@@ -113,6 +127,11 @@
113 return true;127 return true;
114}128}
115129
130const std::string& SignalThread::current_test()
131{
132 return _frame->current_test();
133}
134
116SignalThread::~SignalThread()135SignalThread::~SignalThread()
117{136{
118 if (is_shutdown() == false)137 if (is_shutdown() == false)
@@ -155,7 +174,7 @@
155 {174 {
156 case SIGALRM:175 case SIGALRM:
157 case SIGVTALRM:176 case SIGVTALRM:
158 Error << strsignal(sig);177 Error << safe_strsignal(sig) << " for: " << context->current_test();
159 if (gdb_is_caller())178 if (gdb_is_caller())
160 {179 {
161 abort();180 abort();
@@ -182,7 +201,7 @@
182 break;201 break;
183202
184 default:203 default:
185 Error << "Signal handling thread got unexpected signal " << strsignal(sig);204 Error << "Signal handling thread got unexpected signal " << safe_strsignal(sig);
186 break;205 break;
187 }206 }
188 }207 }
@@ -194,11 +213,12 @@
194213
195SignalThread::SignalThread() :214SignalThread::SignalThread() :
196 magic_memory(MAGIC_MEMORY),215 magic_memory(MAGIC_MEMORY),
197 thread(pthread_self())216 thread(pthread_self()),
217 _frame(NULL)
198{218{
199 pthread_mutex_init(&shutdown_mutex, NULL);219 pthread_mutex_init(&shutdown_mutex, NULL);
200 sigemptyset(&set);220 sigemptyset(&set);
201 if (bool(getenv("LIBTEST_IN_GDB")) == false)221 if (gdb_is_caller() == false)
202 {222 {
203 sigaddset(&set, SIGALRM);223 sigaddset(&set, SIGALRM);
204 sigaddset(&set, SIGABRT);224 sigaddset(&set, SIGABRT);
@@ -216,6 +236,10 @@
216 pthread_sigmask(SIG_BLOCK, NULL, &original_set);236 pthread_sigmask(SIG_BLOCK, NULL, &original_set);
217}237}
218238
239void SignalThread::frame(Framework* frame_)
240{
241 _frame= frame_;
242}
219243
220bool SignalThread::setup()244bool SignalThread::setup()
221{245{
@@ -223,22 +247,22 @@
223247
224 if (sigismember(&original_set, SIGQUIT))248 if (sigismember(&original_set, SIGQUIT))
225 {249 {
226 Error << strsignal(SIGQUIT) << " has been previously set.";250 Error << safe_strsignal(SIGQUIT) << " has been previously set.";
227 }251 }
228252
229 if (sigismember(&original_set, SIGINT))253 if (sigismember(&original_set, SIGINT))
230 {254 {
231 Error << strsignal(SIGINT) << " has been previously set.";255 Error << safe_strsignal(SIGINT) << " has been previously set.";
232 }256 }
233257
234 if (sigismember(&original_set, SIGVTALRM))258 if (sigismember(&original_set, SIGVTALRM))
235 {259 {
236 Error << strsignal(SIGVTALRM) << " has been previously set.";260 Error << safe_strsignal(SIGVTALRM) << " has been previously set.";
237 }261 }
238262
239 if (sigismember(&original_set, SIGUSR2))263 if (sigismember(&original_set, SIGUSR2))
240 {264 {
241 Error << strsignal(SIGUSR2) << " has been previously set.";265 Error << safe_strsignal(SIGUSR2) << " has been previously set.";
242 }266 }
243267
244 int error;268 int error;
245269
=== modified file 'libtest/signal.h'
--- libtest/signal.h 2012-09-10 11:34:03 +0000
+++ libtest/signal.h 2014-04-16 12:49:38 +0000
@@ -75,6 +75,13 @@
75 void set_shutdown(shutdown_t arg);75 void set_shutdown(shutdown_t arg);
76 bool is_shutdown();76 bool is_shutdown();
77 shutdown_t get_shutdown();77 shutdown_t get_shutdown();
78
79 const std::string& current_test();
80
81 void frame(Framework*);
82
83private:
84 Framework* _frame;
78};85};
7986
80} // namespace libtest87} // namespace libtest
8188
=== modified file 'm4/ax_debug.m4'
--- m4/ax_debug.m4 2013-11-03 16:45:36 +0000
+++ m4/ax_debug.m4 2014-04-16 12:49:38 +0000
@@ -12,7 +12,7 @@
12#12#
13# LICENSE13# LICENSE
14#14#
15# Copyright (C) 2012 Brian Aker15# Copyright (C) 2012-2014 Brian Aker
16# All rights reserved.16# All rights reserved.
17# 17#
18# Redistribution and use in source and binary forms, with or without18# Redistribution and use in source and binary forms, with or without
@@ -43,7 +43,7 @@
43# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE43# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
44# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.44# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4545
46#serial 646#serial 7
4747
48AC_DEFUN([AX_DEBUG],48AC_DEFUN([AX_DEBUG],
49 [AC_PREREQ([2.63])dnl49 [AC_PREREQ([2.63])dnl
@@ -52,9 +52,8 @@
52 [Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],52 [Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],
53 [ax_enable_debug=yes53 [ax_enable_debug=yes
54 AC_DEFINE([DEBUG],[1],[Define to 1 to enable debugging code.])54 AC_DEFINE([DEBUG],[1],[Define to 1 to enable debugging code.])
55 AX_CHECK_LIBRARY([MCHECK],[mcheck.h],[mcheck],[AX_APPEND_LINK_FLAGS([-lmcheck])])55 AX_ADD_AM_MACRO([AM_YFLAGS += --debug])
56 AX_ADD_AM_MACRO([--debug],[AM_YFLAGS])56 AX_ADD_AM_MACRO([AM_CPPFLAGS += -D_GLIBCXX_DEBUG])],
57 AX_ADD_AM_MACRO([-D_GLIBCXX_DEBUG],[AM_CPPFLAGS])],
58 [ax_enable_debug=no57 [ax_enable_debug=no
59 AC_SUBST([MCHECK])58 AC_SUBST([MCHECK])
60 AC_DEFINE([DEBUG],[0],[Define to 1 to enable debugging code.])])59 AC_DEFINE([DEBUG],[0],[Define to 1 to enable debugging code.])])
6160
=== modified file 'm4/ax_harden_compiler_flags.m4'
--- m4/ax_harden_compiler_flags.m4 2014-02-01 23:54:09 +0000
+++ m4/ax_harden_compiler_flags.m4 2014-04-16 12:49:38 +0000
@@ -11,11 +11,9 @@
11#11#
12# Any compiler flag that "hardens" or tests code. C99 is assumed.12# Any compiler flag that "hardens" or tests code. C99 is assumed.
13#13#
14# NOTE: Implementation based on AX_APPEND_FLAG.
15#
16# LICENSE14# LICENSE
17#15#
18# Copyright (C) 2012-2013 Brian Aker16# Copyright (C) 2012-2014 Brian Aker
19# All rights reserved.17# All rights reserved.
20#18#
21# Redistribution and use in source and binary forms, with or without19# Redistribution and use in source and binary forms, with or without
@@ -53,7 +51,7 @@
53# -Wdeclaration-after-statement is counter to C9951# -Wdeclaration-after-statement is counter to C99
54# _APPEND_COMPILE_FLAGS_ERROR([-pedantic])52# _APPEND_COMPILE_FLAGS_ERROR([-pedantic])
5553
56#serial 1354#serial 14
5755
58AC_DEFUN([_SET_SANITIZE_FLAGS],56AC_DEFUN([_SET_SANITIZE_FLAGS],
59 [AS_IF([test "x$MINGW" != xyes],[57 [AS_IF([test "x$MINGW" != xyes],[
@@ -106,13 +104,12 @@
106# Everything above this does the heavy lifting, while what follows does the specifics.104# Everything above this does the heavy lifting, while what follows does the specifics.
107105
108AC_DEFUN([_HARDEN_LINKER_FLAGS],106AC_DEFUN([_HARDEN_LINKER_FLAGS],
109 [AS_IF([test "$CC" != "clang"],107 [AS_IF([test "$ax_cv_c_compiler_vendor" != "clang"],
110 [_APPEND_LINK_FLAGS_ERROR([-z relro -z now])108 [_APPEND_LINK_FLAGS_ERROR([-z relro -z now])
111 AS_IF([test "x$ac_cv_warnings_as_errors" = xyes],[AX_APPEND_LINK_FLAGS([-Werror])])
112 AS_IF([test "x$ac_cv_vcs_checkout" = xyes],109 AS_IF([test "x$ac_cv_vcs_checkout" = xyes],
113 [_APPEND_LINK_FLAGS_ERROR([-rdynamic])110 [_APPEND_LINK_FLAGS_ERROR([-rdynamic])
114# AX_APPEND_LINK_FLAGS([--coverage])111# AX_APPEND_LINK_FLAGS([--coverage])])
115 ])112 AS_IF([test "x$ac_cv_warnings_as_errors" = xyes],[AX_APPEND_LINK_FLAGS([-Werror])])
116 ])113 ])
117 ])114 ])
118115
@@ -125,7 +122,7 @@
125 [thread],[122 [thread],[
126 ax_harden_sanitize='thread'],123 ax_harden_sanitize='thread'],
127 [address],[124 [address],[
128 ax_harden_sanitize='with_sanitize'],125 ax_harden_sanitize='address'],
129 [ax_harden_sanitize='rest'])126 [ax_harden_sanitize='rest'])
130 ],127 ],
131 [AS_IF([test "x$ax_enable_debug" = xyes],[ax_harden_sanitize='rest'])])128 [AS_IF([test "x$ax_enable_debug" = xyes],[ax_harden_sanitize='rest'])])
@@ -136,7 +133,7 @@
136133
137 AS_IF([test "x$ax_enable_debug" = xyes],134 AS_IF([test "x$ax_enable_debug" = xyes],
138 [CFLAGS=''135 [CFLAGS=''
139 _APPEND_COMPILE_FLAGS_ERROR([-H])136 #_APPEND_COMPILE_FLAGS_ERROR([-H])
140 _APPEND_COMPILE_FLAGS_ERROR([-g])137 _APPEND_COMPILE_FLAGS_ERROR([-g])
141 _APPEND_COMPILE_FLAGS_ERROR([-g3])138 _APPEND_COMPILE_FLAGS_ERROR([-g3])
142 _APPEND_COMPILE_FLAGS_ERROR([-fmudflapth])139 _APPEND_COMPILE_FLAGS_ERROR([-fmudflapth])
@@ -155,7 +152,7 @@
155 [_APPEND_COMPILE_FLAGS_ERROR([-Wno-unknown-pragmas])152 [_APPEND_COMPILE_FLAGS_ERROR([-Wno-unknown-pragmas])
156 _APPEND_COMPILE_FLAGS_ERROR([-Wno-pragmas])])153 _APPEND_COMPILE_FLAGS_ERROR([-Wno-pragmas])])
157154
158 AS_IF([test "$CC" = "clang"],[_APPEND_COMPILE_FLAGS_ERROR([-Qunused-arguments])])155 AS_IF([test "$ax_cv_c_compiler_vendor" = "clang"],[_APPEND_COMPILE_FLAGS_ERROR([-Qunused-arguments])])
159156
160 _APPEND_COMPILE_FLAGS_ERROR([-Wall])157 _APPEND_COMPILE_FLAGS_ERROR([-Wall])
161 _APPEND_COMPILE_FLAGS_ERROR([-Wextra])158 _APPEND_COMPILE_FLAGS_ERROR([-Wextra])
@@ -220,6 +217,7 @@
220 _APPEND_COMPILE_FLAGS_ERROR([-Wsizeof-pointer-memaccess])217 _APPEND_COMPILE_FLAGS_ERROR([-Wsizeof-pointer-memaccess])
221 _APPEND_COMPILE_FLAGS_ERROR([-Wpacked])218 _APPEND_COMPILE_FLAGS_ERROR([-Wpacked])
222# _APPEND_COMPILE_FLAGS_ERROR([-Wlong-long])219# _APPEND_COMPILE_FLAGS_ERROR([-Wlong-long])
220 _APPEND_COMPILE_FLAGS_ERROR([ftrapv])
223# GCC 4.5 removed this.221# GCC 4.5 removed this.
224# _APPEND_COMPILE_FLAGS_ERROR([-Wunreachable-code])222# _APPEND_COMPILE_FLAGS_ERROR([-Wunreachable-code])
225223
@@ -236,7 +234,7 @@
236 ])])])])234 ])])])])
237235
238 AS_IF([test "x$ac_cv_warnings_as_errors" = xyes],236 AS_IF([test "x$ac_cv_warnings_as_errors" = xyes],
239 [AX_APPEND_FLAG([-Werror])])237 [AX_APPEND_COMPILE_FLAGS([-Werror])])
240238
241 AC_LANG_POP([C])239 AC_LANG_POP([C])
242 ])240 ])
@@ -245,7 +243,7 @@
245 [AC_LANG_PUSH([C++])243 [AC_LANG_PUSH([C++])
246 AS_IF([test "x$ax_enable_debug" = xyes],244 AS_IF([test "x$ax_enable_debug" = xyes],
247 [CXXFLAGS=''245 [CXXFLAGS=''
248 _APPEND_COMPILE_FLAGS_ERROR([-H])246 #_APPEND_COMPILE_FLAGS_ERROR([-H])
249 _APPEND_COMPILE_FLAGS_ERROR([-g])247 _APPEND_COMPILE_FLAGS_ERROR([-g])
250 _APPEND_COMPILE_FLAGS_ERROR([-g3])248 _APPEND_COMPILE_FLAGS_ERROR([-g3])
251 _APPEND_COMPILE_FLAGS_ERROR([-fmudflapth])249 _APPEND_COMPILE_FLAGS_ERROR([-fmudflapth])
@@ -265,7 +263,7 @@
265 [_APPEND_COMPILE_FLAGS_ERROR([-Wno-unknown-pragmas])263 [_APPEND_COMPILE_FLAGS_ERROR([-Wno-unknown-pragmas])
266 _APPEND_COMPILE_FLAGS_ERROR([-Wno-pragmas])])264 _APPEND_COMPILE_FLAGS_ERROR([-Wno-pragmas])])
267265
268 AS_IF([test "$CXX" = "clang++"],[_APPEND_COMPILE_FLAGS_ERROR([-Qunused-arguments])])266 AS_IF([test "$ax_cv_c_compiler_vendor" = "clang"],[_APPEND_COMPILE_FLAGS_ERROR([-Qunused-arguments])])
269267
270 _APPEND_COMPILE_FLAGS_ERROR([-Wall])268 _APPEND_COMPILE_FLAGS_ERROR([-Wall])
271 _APPEND_COMPILE_FLAGS_ERROR([-Wextra])269 _APPEND_COMPILE_FLAGS_ERROR([-Wextra])
@@ -341,7 +339,7 @@
341 _SET_SANITIZE_FLAGS339 _SET_SANITIZE_FLAGS
342340
343 AS_IF([test "x$ac_cv_warnings_as_errors" = xyes],341 AS_IF([test "x$ac_cv_warnings_as_errors" = xyes],
344 [AX_APPEND_FLAG([-Werror])])342 [AX_APPEND_COMPILE_FLAGS([-Werror])])
345 AC_LANG_POP([C++])343 AC_LANG_POP([C++])
346 ])344 ])
347345
@@ -349,7 +347,9 @@
349# _HARDEN_CC_COMPILER_FLAGS, _HARDEN_CXX_COMPILER_FLAGS347# _HARDEN_CC_COMPILER_FLAGS, _HARDEN_CXX_COMPILER_FLAGS
350 AC_DEFUN([AX_HARDEN_COMPILER_FLAGS],348 AC_DEFUN([AX_HARDEN_COMPILER_FLAGS],
351 [AC_PREREQ([2.63])dnl349 [AC_PREREQ([2.63])dnl
350 AC_REQUIRE([AC_CANONICAL_HOST])
352 AC_REQUIRE([AX_COMPILER_VERSION])351 AC_REQUIRE([AX_COMPILER_VERSION])
352 AC_REQUIRE([AX_DEBUG])
353 AC_REQUIRE([AX_ASSERT])353 AC_REQUIRE([AX_ASSERT])
354 _WARNINGS_AS_ERRORS354 _WARNINGS_AS_ERRORS
355 _AX_HARDEN_SANITIZE355 _AX_HARDEN_SANITIZE
@@ -357,7 +357,6 @@
357 AC_REQUIRE([gl_VISIBILITY])357 AC_REQUIRE([gl_VISIBILITY])
358 AS_IF([test -n "$CFLAG_VISIBILITY"],[CPPFLAGS="$CPPFLAGS $CFLAG_VISIBILITY"])358 AS_IF([test -n "$CFLAG_VISIBILITY"],[CPPFLAGS="$CPPFLAGS $CFLAG_VISIBILITY"])
359359
360 _WARNINGS_AS_ERRORS
361 _HARDEN_LINKER_FLAGS360 _HARDEN_LINKER_FLAGS
362 _HARDEN_CC_COMPILER_FLAGS361 _HARDEN_CC_COMPILER_FLAGS
363 _HARDEN_CXX_COMPILER_FLAGS362 _HARDEN_CXX_COMPILER_FLAGS
364363
=== modified file 'tests/libgearman-1.0/fork.cc'
--- tests/libgearman-1.0/fork.cc 2013-12-20 01:22:53 +0000
+++ tests/libgearman-1.0/fork.cc 2014-04-16 12:49:38 +0000
@@ -60,6 +60,7 @@
60test_return_t check_client_fork_TEST(void*)60test_return_t check_client_fork_TEST(void*)
61{61{
62 test_skip_valgrind();62 test_skip_valgrind();
63 test_skip(false, gdb_is_caller());
6364
64 libgearman::Client client(libtest::default_port());65 libgearman::Client client(libtest::default_port());
6566
6667
=== modified file 'tests/libgearman-1.0/unique.cc'
--- tests/libgearman-1.0/unique.cc 2014-01-31 02:41:41 +0000
+++ tests/libgearman-1.0/unique.cc 2014-04-16 12:49:38 +0000
@@ -436,7 +436,7 @@
436 NULL, // is_running436 NULL, // is_running
437 NULL, // numerator437 NULL, // numerator
438 NULL // denominator438 NULL // denominator
439 ), GEARMAN_JOB_EXISTS);439 ), GEARMAN_SUCCESS);
440440
441 {441 {
442 libgearman::Client unique_client(original_client);442 libgearman::Client unique_client(original_client);

Subscribers

People subscribed via source and target branches

to all changes: