Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
modelgen
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
modelgen
Commits
44d57774
Commit
44d57774
authored
Jul 07, 2012
by
Taddeüs Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added basic testing framework files.
parents
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
0 deletions
+34
-0
.gitignore
.gitignore
+3
-0
Makefile
Makefile
+9
-0
test.py
test.py
+22
-0
No files found.
.gitignore
0 → 100644
View file @
44d57774
*.pyc
*.swp
*~
Makefile
0 → 100644
View file @
44d57774
TEST
:=
test.py
test
:
@
pyrg
$(TEST)
clean
:
rm
`
find
-name
\*
.pyc
`
.PHONY
:
test clean
test.py
0 → 100755
View file @
44d57774
#!/usr/bin/env python
import
os
import
re
import
sys
import
unittest
TESTS_DIR
=
'tests'
matches
=
[
re
.
match
(
'^(test_(
\
w+)).
\
py$'
,
f
)
for
f
in
os
.
listdir
(
TESTS_DIR
)]
suite
=
unittest
.
TestSuite
()
loader
=
unittest
.
TestLoader
()
for
match
in
filter
(
None
,
matches
):
modulename
,
testname
=
match
.
groups
()
classname
=
re
.
sub
(
'(?:^|_)([a-z])'
,
lambda
m
:
m
.
group
(
1
).
upper
(),
testname
)
+
'Test'
mod
=
__import__
(
TESTS_DIR
+
'.'
+
modulename
,
globals
(),
locals
(),
classname
)
suite
.
addTests
(
loader
.
loadTestsFromTestCase
(
getattr
(
mod
,
classname
)))
unittest
.
TextTestRunner
().
run
(
suite
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment