1 # Copyright 2013-2019, The Tor Project, Inc
2 # See LICENSE for licensing information
7 This file tests the output from test-bt-cl to make sure it's as expected.
11 $ ./src/test/test-bt-cl crash | ./src/test/bt_test.py
13 $ ./src/test/test-bt-cl assert | ./src/test/bt_test.py
18 # Future imports for Python 2.7, mandatory in 3.0
19 from __future__
import division
20 from __future__
import print_function
21 from __future__
import unicode_literals
26 def matches(lines
, funcs
):
27 if len(lines
) < len(funcs
):
30 for l
, f
in zip(lines
, funcs
):
37 FUNCNAMES
= "crash oh_what a_tangled_web we_weave main".split()
39 LINES
= sys
.stdin
.readlines()
41 for I
in range(len(LINES
)):
42 if matches(LINES
[I
:], FUNCNAMES
):
49 print("{}".format(l
), end
="")
51 if (sys
.platform
.startswith('freebsd') or sys
.platform
.startswith('netbsd') or
52 sys
.platform
.startswith('openbsd') or sys
.platform
.startswith('darwin')):
53 # See bug #17808 if you know how to fix backtraces on BSD-derived systems
54 print("Test failed; but {} is known to have backtrace problems."
55 .format(sys
.platform
))
56 print("Treating as 'SKIP'.")