Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yosys-tests
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
yosys-tests
Commits
331cad0e
Commit
331cad0e
authored
Feb 10, 2020
by
Miodrag Milanovic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test runner
parent
ea8a42ef
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
+39
-0
run-test
+39
-0
No files found.
run-test
0 → 100755
View file @
331cad0e
#!/usr/bin/env python3
import
argparse
,
sys
,
os
from
shutil
import
rmtree
def
run_test
(
argv
):
parser
=
argparse
.
ArgumentParser
(
prog
=
"run_test"
,
usage
=
"
%(prog)
s [options] <test_name>"
)
parser
.
add_argument
(
"test_name"
,
metavar
=
"<test_name>"
,
nargs
=
"?"
,
help
=
"Test name"
)
args
=
parser
.
parse_args
(
argv
[
1
:])
test_name
=
args
.
test_name
if
test_name
is
None
:
parser
.
print_help
()
sys
.
exit
()
test_path
=
test_name
.
split
(
'.'
)
if
not
len
(
test_path
)
==
3
:
print
(
"Test name have to be in proper format <suite>.<group>.<test>"
)
sys
.
exit
()
if
not
os
.
path
.
isdir
(
test_path
[
0
]):
print
(
"Test suite {} does not exist..."
.
format
(
test_path
[
0
]))
sys
.
exit
()
if
not
os
.
path
.
isdir
(
os
.
path
.
join
(
test_path
[
0
],
test_path
[
1
])):
print
(
"Test group {} does not exist..."
.
format
(
test_path
[
1
]))
sys
.
exit
()
test_case
=
test_path
[
2
][
len
(
test_path
[
1
])
+
1
:]
work_dir
=
os
.
path
.
join
(
test_path
[
0
],
test_path
[
1
],
'work_'
+
test_case
)
if
os
.
path
.
isdir
(
work_dir
):
rmtree
(
work_dir
)
make_target
=
os
.
path
.
join
(
test_path
[
1
],
'work_'
+
test_case
,
".stamp"
)
os
.
system
(
"make -C {} {}"
.
format
(
test_path
[
0
],
make_target
))
if
__name__
==
'__main__'
:
run_test
(
sys
.
argv
)
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