diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-05-25 15:00:11 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-05-25 15:00:11 -0700 |
commit | d3efb7dcb71f0d9d6df09fee687fa1dbd0bde9bf (patch) | |
tree | 19be204e6a786b13d7a1136302e457deca36404e /tests/runner.py | |
parent | e1b8b28863ee7fea3117d0d10d7ab0a679dfb8ca (diff) |
allow 2 and 3 in SAFE_HEAP and CHECK_* options. 2 is only these, 3 is all but these
Diffstat (limited to 'tests/runner.py')
-rw-r--r-- | tests/runner.py | 46 |
1 files changed, 44 insertions, 2 deletions
diff --git a/tests/runner.py b/tests/runner.py index af1d283b..d24b2920 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -1879,7 +1879,7 @@ if 'benchmark' not in sys.argv: if SAFE_HEAP: # Ignore bitfield warnings - SAFE_HEAP = 2 + SAFE_HEAP = 3 SAFE_HEAP_LINES = ['btVoronoiSimplexSolver.h:40', 'btVoronoiSimplexSolver.h:41', 'btVoronoiSimplexSolver.h:42', 'btVoronoiSimplexSolver.h:43'] COMPILER_TEST_OPTS = ['-g'] @@ -2200,7 +2200,7 @@ if 'benchmark' not in sys.argv: global COMPILER_TEST_OPTS; COMPILER_TEST_OPTS = ['-g'] - SAFE_HEAP = 2 + SAFE_HEAP = 3 SAFE_HEAP_LINES = ["src.cpp:7"] self.do_test(src, '*ok*') @@ -2215,6 +2215,21 @@ if 'benchmark' not in sys.argv: # This test *should* fail, by throwing this exception assert 'Assertion failed: Load-store consistency assumption failure!' in str(e), str(e) + # And reverse the checks with = 2 + + SAFE_HEAP = 2 + SAFE_HEAP_LINES = ["src.cpp:99"] + + self.do_test(src, '*ok*') + + SAFE_HEAP_LINES = ["src.cpp:7"] + + try: + self.do_test(src, '*nothingatall*') + except Exception, e: + # This test *should* fail, by throwing this exception + assert 'Assertion failed: Load-store consistency assumption failure!' in str(e), str(e) + def test_check_overflow(self): global CHECK_OVERFLOWS; CHECK_OVERFLOWS = 1 global CORRECT_OVERFLOWS; CORRECT_OVERFLOWS = 0 @@ -2302,6 +2317,14 @@ if 'benchmark' not in sys.argv: CORRECT_SIGNS_LINES = ["src.cpp:3"] self.do_test(src, '*1*') + # And reverse the checks with = 2 + CORRECT_SIGNS = 3 + CORRECT_SIGNS_LINES = ["src.cpp:3"] + self.do_test(src, '*0*') + CORRECT_SIGNS = 3 + CORRECT_SIGNS_LINES = ["src.cpp:9"] + self.do_test(src, '*1*') + src = ''' #include<stdio.h> int main() { @@ -2343,6 +2366,19 @@ if 'benchmark' not in sys.argv: assert 'UNEXPECTED' not in str(e), str(e) assert 'Expected to find' in str(e), str(e) + # And reverse the checks with = 2 + CORRECT_OVERFLOWS = 3 + CORRECT_OVERFLOWS_LINES = ["src.cpp:3"] + self.do_test(src, correct) + CORRECT_OVERFLOWS = 3 + CORRECT_OVERFLOWS_LINES = ["src.cpp:6"] + try: + self.do_test(src, correct) + raise Exception('UNEXPECTED-PASS') + except Exception, e: + assert 'UNEXPECTED' not in str(e), str(e) + assert 'Expected to find' in str(e), str(e) + # Roundings src = ''' @@ -2380,6 +2416,12 @@ if 'benchmark' not in sys.argv: self.do_test(src.replace('TYPE', 'long long'), '*-3**2**-5**5*') self.do_test(src.replace('TYPE', 'int'), '*-2**2**-5**5*') # Here we are lucky and also get the first one right + # And reverse the check with = 2 + CORRECT_ROUNDINGS = 3 + CORRECT_ROUNDINGS_LINES = ["src.cpp:999"] + self.do_test(src.replace('TYPE', 'long long'), '*-2**2**-5**5*') + self.do_test(src.replace('TYPE', 'int'), '*-2**2**-5**5*') + # Generate tests for all our compilers def make_test(name, compiler, llvm_opts, embetter, quantum_size): |