diff options
author | cypherpunks <cypherpunks@torproject.org> | 2015-03-05 11:05:17 +0100 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-04-23 09:56:25 -0400 |
commit | 0e89abfa73ee8494f1e654823ab68282858038b0 (patch) | |
tree | 9773c70269a61b06fd198d52f1a71e64b2880b66 | |
parent | c535494238cee580acaa6debe2eb942bb90ea59d (diff) | |
download | tor-0e89abfa73ee8494f1e654823ab68282858038b0.tar.gz tor-0e89abfa73ee8494f1e654823ab68282858038b0.zip |
Integrate backtrace test into the automake test suite.
For this to work bt_test.py now returns an exit code indicating success or
failure. Additionally, check-local and its specific dependencies are now
obsolete so they are removed.
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | configure.ac | 1 | ||||
-rwxr-xr-x | src/test/bt_test.py | 4 | ||||
-rw-r--r-- | src/test/include.am | 16 | ||||
-rw-r--r-- | src/test/test_bt.sh.in | 9 |
5 files changed, 14 insertions, 17 deletions
diff --git a/.gitignore b/.gitignore index da5fc478b0..613920167d 100644 --- a/.gitignore +++ b/.gitignore @@ -176,6 +176,7 @@ cscope.* /src/test/test_workqueue.exe /src/test/test_zero_length_keys.sh /src/test/test_ntor.sh +/src/test/test_bt.sh # /src/tools/ /src/tools/tor-checkkey diff --git a/configure.ac b/configure.ac index 184211b558..098a15ca93 100644 --- a/configure.ac +++ b/configure.ac @@ -1664,6 +1664,7 @@ AC_CONFIG_FILES([ scripts/maint/updateVersions.pl src/test/test_zero_length_keys.sh src/test/test_ntor.sh + src/test/test_bt.sh ]) if test x$asciidoc = xtrue && test "$ASCIIDOC" = "none" ; then diff --git a/src/test/bt_test.py b/src/test/bt_test.py index 0afe797a6d..e694361703 100755 --- a/src/test/bt_test.py +++ b/src/test/bt_test.py @@ -36,7 +36,7 @@ LINES = sys.stdin.readlines() for I in range(len(LINES)): if matches(LINES[I:], FUNCNAMES): print("OK") - break + sys.exit(0) else: print("BAD") - + sys.exit(1) diff --git a/src/test/include.am b/src/test/include.am index 0ed3cb336f..3c9eed886f 100644 --- a/src/test/include.am +++ b/src/test/include.am @@ -2,7 +2,7 @@ TESTS += src/test/test src/test/test-slow src/test/test-memwipe \ src/test/test_zero_length_keys.sh if USEPYTHON -TESTS += src/test/test_ntor.sh +TESTS += src/test/test_ntor.sh src/test/test_bt.sh endif TEST_EXTENSIONS = .sh @@ -154,13 +154,6 @@ src_test_test_ntor_cl_LDADD = src/or/libtor.a src/common/libor.a \ @TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ src_test_test_ntor_cl_AM_CPPFLAGS = \ -I"$(top_srcdir)/src/or" -NTOR_TEST_DEPS=src/test/test-ntor-cl - -if COVERAGE_ENABLED -CMDLINE_TEST_TOR = $(top_builddir)/src/or/tor-cov -else -CMDLINE_TEST_TOR = $(top_builddir)/src/or/tor -endif noinst_PROGRAMS += src/test/test-bt-cl src_test_test_bt_cl_SOURCES = src/test/test_bt_cl.c @@ -170,13 +163,6 @@ src_test_test_bt_cl_LDADD = src/common/libor-testing.a \ src_test_test_bt_cl_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS) src_test_test_bt_cl_CPPFLAGS= $(src_test_AM_CPPFLAGS) $(TEST_CPPFLAGS) - -check-local: $(NTOR_TEST_DEPS) $(CMDLINE_TEST_TOR) -if USEPYTHON - $(top_builddir)/src/test/test-bt-cl assert | $(PYTHON) $(top_srcdir)/src/test/bt_test.py - $(top_builddir)/src/test/test-bt-cl crash | $(PYTHON) $(top_srcdir)/src/test/bt_test.py -endif - EXTRA_DIST += \ src/test/bt_test.py \ src/test/ntor_ref.py \ diff --git a/src/test/test_bt.sh.in b/src/test/test_bt.sh.in new file mode 100644 index 0000000000..d2498751cb --- /dev/null +++ b/src/test/test_bt.sh.in @@ -0,0 +1,9 @@ +#!/bin/sh +# Test backtrace functionality. + +exitcode=0 + +@builddir@/src/test/test-bt-cl assert | @PYTHON@ @abs_top_srcdir@/src/test/bt_test.py || exitcode=1 +@builddir@/src/test/test-bt-cl crash | @PYTHON@ @abs_top_srcdir@/src/test/bt_test.py || exitcode=1 + +exit ${exitcode} |