forked from Tinkerforge/generators
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_all.py
34 lines (25 loc) · 806 Bytes
/
test_all.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
path = os.getcwd()
bindings = []
for d in os.listdir(path):
if os.path.isdir(d):
if not d in ('configs', '.git', '__pycache__'):
bindings.append(d)
bindings = sorted(bindings)
for binding in bindings:
if binding in ('tcpip', 'modbus'):
continue
path_binding = '{0}/{1}'.format(path, binding)
sys.path.append(path_binding)
module = __import__('test_{0}_bindings'.format(binding))
print("### testing {0} bindings:".format(binding))
success = module.run(path_binding)
if type(success) != bool:
raise Exception('test_{0}_bindings.py returns wrong type from its run() function'.format(binding))
if not success:
sys.exit(1)
print('')
print('>>> Done <<<')