forked from P1sec/pycrate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
42 lines (32 loc) · 818 Bytes
/
test.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
35
36
37
38
39
40
41
#!/usr/bin/env python3
import sys
import time
from test import test_pycrate
# core / asn1rt objects config
test_pycrate.Element._SAFE_STAT = True
test_pycrate.Element._SAFE_DYN = True
test_pycrate.ASN1Obj._SAFE_INIT = True
#
# testing the compilation of all ASN.1 modules
test_pycrate.TEST_ASN1C_ALL = False
def test_unit():
print('[+] running unit tests')
ut = test_pycrate.TestPycrate()
ut.test_core()
ut.test_media()
ut.test_ether()
ut.test_asn1c()
ut.test_asn1rt()
ut.test_csn1()
ut.test_mobile()
def test_perf():
print('[+] running perf test')
test_pycrate.test_perf_all()
def main():
TO = time.time()
test_unit()
test_perf()
print('[+] total time: %f sec' % (time.time() - TO, ))
return 0
if __name__ == '__main__':
sys.exit(main())