9 Commits

Author SHA1 Message Date
Zsolt Parragi
7cbf4c25e9 Windows (Clang9, MSVC2017) implementation
Remaining issues:
* some warinings
2019-11-29 12:33:22 +01:00
Zsolt Parragi
ec14c48e3e Making tests less platform dependent.
Tests executables made several assumptions that are only valid on
some system/compiler:

* That the main function is found even in a shared library (not true
  on windows). To fix this, test_main is now an ojbect library
* That the extern test_registry in test.cpp will be initialized
  before any actual test uses it. This was either a lucky coincidence
  on linux, or being related to the variable being initialized in a
  shared library. The variable is now initialized by a function,
  guarantaaing initialization order.
* That test.hpp is only inluded once per binary, which was only true
  because it was once part of a DLL, once the executable, hiding ODR
  violations. As now it's linked twice within the same binary, some
  functions had to be made inline.
* not is not a valid C++ operator, replaced all occurences with !
2019-11-29 12:16:13 +01:00
François-Xavier Bourlet
9fb93a08aa clang-format 2019-09-05 13:41:10 -07:00
John Salmon
80af93580f Improve portability to non-glibc Linux systems
Linux is not synonymous with glibc.  Alpine linux (among others) uses
libmusl as the standard C library.  Alpine/libmusl doesn't have
backtrace, dladdr1, execinfo.h or error.h.  It does have libunwind
and program_invocation_name and libdwarf and libelf are available as
packages.

This patch makes backward-cpp work on Alpine linux (and hopefully
others that rely on libmusl).

This patch makes dladdr1 dependent on the __GLIBC__ pp-symbol
(rather than __ANDROID__).

It uses __has_include (protected by a defined()) rather than __APPLE__
to decide whether to include <error.h> in _test_main.cpp.
2019-08-25 20:34:28 -04:00
Stephan Zuercher
44ae9609e8 functional mac port (#70)
* functional mac port

* combine common parts of Linux and Darwin implementations

* add unwind support for apple

* insure BACKWARD_HAS_BACKTRACE_SYMBOL is set for BACKWARD_SYSTEM_DARWIN

* fix indentation

* use pthread_self and pthread_main_np
2018-02-06 22:43:16 -08:00
François-Xavier Bourlet
e8b6cb2475 Tests are all passing now. 2013-11-17 22:16:13 -08:00
François-Xavier Bourlet
6bb925fd70 Better test checking
- fork every test
 - capture signals
 - more assertion tools
 - test can be expected to fail
2013-11-17 21:07:04 -08:00
François-Xavier Bourlet
2104840c1d Attribute Copyright to Google Inc. 2013-03-17 15:59:09 -07:00
François-Xavier Bourlet
1ae978ab77 Initial import. 2013-03-14 23:10:06 -07:00