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
2a9a130b
Commit
2a9a130b
authored
Nov 02, 2019
by
Miodrag Milanovic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use python script instead of shell script
parent
b4b4fdeb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
51 deletions
+24
-51
regression/Makefile
+4
-2
regression/generate.py
+20
-0
regression/run-test.sh
+0
-49
No files found.
regression/Makefile
View file @
2a9a130b
PYTHON_EXECUTABLE
:=
$(
shell
if
python3
-c
""
;
then
echo
"python3"
;
else
echo
"python"
;
fi
)
all
::
run-test.mk
@
touch .stamp
@
$(MAKE)
-f
run-test.mk
...
...
@@ -5,7 +7,7 @@ clean:: run-test.mk
@
rm
-f
.stamp
@
$(MAKE)
-f
run-test.mk clean
run-test.mk
:
run-test.sh
@
./run-test.sh
run-test.mk
:
generate.py
@
$(PYTHON_EXECUTABLE)
generate.py
>
run-test.mk
.PHONY
:
all clean
regression/generate.py
0 → 100644
View file @
2a9a130b
import
os
is_heavy_enabled
=
int
(
os
.
getenv
(
'ENABLE_HEAVY_TESTS'
,
'0'
))
==
1
for
root
,
dirs
,
files
in
sorted
(
os
.
walk
(
"."
)):
for
file
in
files
:
if
file
.
endswith
(
'.ys'
):
dir
=
os
.
path
.
basename
(
root
)
work
=
os
.
path
.
splitext
(
file
)[
0
]
heavy
=
os
.
path
.
exists
(
os
.
path
.
join
(
dir
,
"heavy_test"
))
print
(
"all:: {0}/work_{1}/.stamp
\n
"
"{0}/work_{1}/.stamp:"
.
format
(
dir
,
work
))
if
(
heavy
and
not
is_heavy_enabled
):
print
(
"
\t
@echo 'Skipping heavy test {0}..'"
.
format
(
dir
,
work
))
continue
print
(
"
\t
@echo 'Running {2}{1}..'
\n
"
"
\t
@./run.sh {0} {1}
\n
"
"clean::
\n
"
"
\t
@echo 'Cleaning {1}..'
\n
"
"
\t
@rm -rf {0}/work_{1}"
.
format
(
dir
,
work
,
"heavy "
if
heavy
else
""
))
print
(
".PHONY: all clean"
)
\ No newline at end of file
regression/run-test.sh
deleted
100755 → 0
View file @
b4b4fdeb
#!/usr/bin/env bash
set
-e
{
for
x
in
*
;
do
if
[
-d
"
$x
"
]
;
then
if
[
-f
"
$x
/
$x
.ys"
]
;
then
# Running test expected to pass
echo
"all::
$x
/work_
$x
/.stamp"
echo
"
$x
/work_
$x
/.stamp:"
if
[
-f
"
$x
/heavy_test"
]
;
then
if
[
-z
"
$ENABLE_HEAVY_TESTS
"
]
||
[
"
$ENABLE_HEAVY_TESTS
"
-ne
"1"
]
;
then
echo
" @echo 'Skipping heavy test
$x
..'"
continue
fi
echo
" @echo 'Running heavy test
$x
..'"
else
echo
" @echo 'Running
$x
..'"
fi
echo
" @./run.sh
$x
$x
"
echo
"clean::"
echo
" @echo 'Cleaning
$x
..'"
echo
" @rm -rf
$x
/work_
$x
"
elif
[
-f
"
$x
/
$x
""_fail.ys"
]
;
then
# Running test expected to fail
echo
"all::
$x
/work_
$x
""_fail/.stamp"
echo
"
$x
/work_
$x
""_fail/.stamp:"
if
[
-f
"
$x
/heavy_test"
]
;
then
if
[
-z
"
$ENABLE_HEAVY_TESTS
"
]
||
[
"
$ENABLE_HEAVY_TESTS
"
-ne
"1"
]
;
then
echo
" @echo 'Skipping heavy test
$x
..'"
continue
fi
echo
" @echo 'Running heavy test
$x
..'"
else
echo
" @echo 'Running
$x
..'"
fi
echo
" @./run.sh
$x
$x
""_fail"
echo
"clean::"
echo
" @echo 'Cleaning
$x
..'"
echo
" @rm -rf
$x
/work_
$x
""_fail"
else
# In case there is no script fail makefile
echo
"all:: run-
$x
"
echo
"run-
$x
:"
echo
"
\$
(error 'No scripts in
$x
..')"
fi
fi
done
echo
".PHONY: all clean"
}
>
run-test.mk
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