diff options
author | Marcin Cieślak <saper@saper.info> | 2015-09-24 22:32:51 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-09-29 10:04:14 +0200 |
commit | 5c95762ec6c8e43fe7bc5582fd43585076214ba4 (patch) | |
tree | 96da2a7d2d83b8644387beef656cecbd2cc9ac1d /src/test/test_bt_cl.c | |
parent | 4ce9b8f1ec352f1167ac23d2750795986fb2ba11 (diff) | |
download | tor-5c95762ec6c8e43fe7bc5582fd43585076214ba4.tar.gz tor-5c95762ec6c8e43fe7bc5582fd43585076214ba4.zip |
Skip tests if backtrace support not compiled-in
FreeBSD needs -lexecinfo to fully support
backtrace reporting.
Diffstat (limited to 'src/test/test_bt_cl.c')
-rw-r--r-- | src/test/test_bt_cl.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/test/test_bt_cl.c b/src/test/test_bt_cl.c index 01c621eb0e..dabaee6e0a 100644 --- a/src/test/test_bt_cl.c +++ b/src/test/test_bt_cl.c @@ -84,15 +84,24 @@ main(int argc, char **argv) if (argc < 2) { puts("I take an argument. It should be \"assert\" or \"crash\" or " - "\"none\""); + "\"backtraces\" or \"none\""); return 1; } + +#if !(defined(HAVE_EXECINFO_H) && defined(HAVE_BACKTRACE) && \ + defined(HAVE_BACKTRACE_SYMBOLS_FD) && defined(HAVE_SIGACTION)) + puts("Backtrace reporting is not supported on this platform"); + return 77; +#endif + if (!strcmp(argv[1], "assert")) { crashtype = 1; } else if (!strcmp(argv[1], "crash")) { crashtype = 0; } else if (!strcmp(argv[1], "none")) { crashtype = -1; + } else if (!strcmp(argv[1], "backtraces")) { + return 0; } else { puts("Argument should be \"assert\" or \"crash\" or \"none\""); return 1; |