-
Notifications
You must be signed in to change notification settings - Fork 15
/
setup.py
44 lines (40 loc) · 1.38 KB
/
setup.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
42
43
from distutils.core import setup
import distutils.cmd
import sys, os
class MyTests(distutils.cmd.Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
sys.path.insert(0, os.getcwd())
import unittest
result = unittest.TextTestResult(sys.stdout, True, True)
suite = unittest.defaultTestLoader.discover("./tests")
print ("Discovered %d test cases" % suite.countTestCases())
result.buffer = True
suite.run(result)
print ("")
if not result.wasSuccessful():
if len(result.errors):
print ("============ Errors disovered =================")
for res in result.errors:
print (res[0], ":", res[1])
if len(result.failures):
print ("============ Failures disovered =================")
for res in result.failures:
print (res[0], ":", res[1])
sys.exit(1)
else:
print ("All tests successful")
setup(
name="ctypescrypto",
version="0.5",
description="CTypes-based interface for some OpenSSL libcrypto features",
author="Victor Wagner",
author_email="[email protected]",
url="https://github.com/vbwagner/ctypescrypto",
packages=["ctypescrypto"],
cmdclass={"test":MyTests}
)