File: run_tests_long_and_standalone.py

package info (click to toggle)
brian 2.9.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,872 kB
  • sloc: python: 51,820; cpp: 2,033; makefile: 108; sh: 72
file content (20 lines) | stat: -rw-r--r-- 658 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import sys

import brian2
import numpy as np

# Run tests for float32 and float64
success = [brian2.test(long_tests=True, test_standalone='cpp_standalone', float_dtype=np.float32),
           brian2.test(long_tests=True, test_standalone='cpp_standalone', float_dtype=np.float64)]

result = ['Tests for {} dtype: {}'.format(dtype,
                                         'passed' if status else 'FAILED')
          for status, dtype in zip(success, ['float32', 'float64'])]
print('\t--\t'.join(result))

if all(success):
    print('OK: All tests passed successfully')
else:
    print('FAILED: Not all tests passed successfully (see above)')
    sys.exit(1)