Skip to content

Commit 240b0e3

Browse files
committed
add Maefile + test runner
1 parent 8d2a2b4 commit 240b0e3

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

Makefile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
PYTHON=python
2+
TSCRIPT=fs/tests/runner.py
3+
4+
all: test
5+
6+
clean:
7+
rm -f `find . -type f -name \*.py[co]`
8+
rm -f `find . -type f -name \*.so`
9+
rm -f `find . -type f -name \*.~`
10+
rm -f `find . -type f -name \*.orig`
11+
rm -f `find . -type f -name \*.bak`
12+
rm -f `find . -type f -name \*.rej`
13+
rm -rf `find . -type d -name __pycache__`
14+
rm -rf *.egg-info
15+
rm -rf build
16+
rm -rf dist
17+
18+
install:
19+
$(PYTHON) setup.py build
20+
$(PYTHON) setup.py develop
21+
22+
test: install
23+
$(PYTHON) $(TSCRIPT)

fs/tests/runner.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import os
2+
import sys
3+
import unittest
4+
5+
VERBOSITY = 2
6+
7+
HERE = os.path.abspath(os.path.dirname(__file__))
8+
testmodules = [os.path.splitext(x)[0] for x in os.listdir(HERE)
9+
if x.endswith('.py') and x.startswith('test_')]
10+
suite = unittest.TestSuite()
11+
for tm in testmodules:
12+
suite.addTest(unittest.defaultTestLoader.loadTestsFromName(tm))
13+
result = unittest.TextTestRunner(verbosity=VERBOSITY).run(suite)
14+
success = result.wasSuccessful()
15+
sys.exit(0 if success else 1)

0 commit comments

Comments
 (0)