Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit core collection
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
30
Issues
30
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit core collection
Commits
28fd3d67
Commit
28fd3d67
authored
Jan 26, 2017
by
Adam Wujek
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testbench: Generate test_results.xml for CI
Signed-off-by:
Adam Wujek
<
adam.wujek@cern.ch
>
parent
7d17ce87
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
80 additions
and
5 deletions
+80
-5
.gitignore
testbench/.gitignore
+1
-0
Makefile
testbench/Makefile
+79
-5
No files found.
testbench/.gitignore
0 → 100644
View file @
28fd3d67
test_results.xml
testbench/Makefile
View file @
28fd3d67
...
...
@@ -4,12 +4,13 @@
TB_DIRS
=
wr_minic
TB_DIRS
+=
wrc_core/main_tb
test_results_xml
=
test_results.xml
.PHONY
:
$(TB_DIRS)
all
:
$(TB_DIRS)
all
:
$(TB_DIRS)
summary summary_total summary_xml
$(TB_DIRS)
:
echo
$@
@
echo
$@
@
echo
"Run HDL-MAKE"
cd
"
$@
"
;
\
source
$(ISE_PATH)
/settings64.sh
;
\
...
...
@@ -20,13 +21,86 @@ $(TB_DIRS):
$(MAKE)
-C
$@
$(TARGET)
@echo
"Run vsim"
cd
"$@"
;
\
vsim
-c
-do
"run_ci.do"
cd
"$@"
;\
vsim
-c
-do
"run_ci.do"
;\
echo
"vsim returned $$?"
clean
:
summary
:
$(TB_DIRS)
@
echo
"-------------------------------------------------------------------"
@
echo
"Summary:"
@
for
d
in
$(TB_DIRS)
;
do
\
if
[
-f
$$
d/transcript
]
;
then
\
echo
"Warnings for
$$
d:"
;
\
cat
$$
d/transcript |
grep
Warning
;
\
if
[
$$
?
-eq
1
]
;
then
echo
"None"
;
fi
;
\
echo
"Errors for
$$
d:"
;
\
cat
$$
d/transcript |
grep
Error
;
\
if
[
$$
?
-eq
1
]
;
then
echo
"None"
;
fi
;
\
else
\
echo
"No transcript file for
$$
d"
;
\
fi
\
done
# Run tasks all before summary_total, because if there is a failure summary_total breaks the make execution
summary_total
:
summary summary_xml
@
echo
"-------------------------------------------------------------------"
@
echo
""
@
echo
"Summary total:"
@
echo
"+-------------------------------+----------+----------+"
@
echo
"| Test bench | Warnings | Errors |"
@
echo
"+-------------------------------+----------+----------+"
@
is_error
=
0
;
\
for
d
in
$(TB_DIRS)
;
do
\
if
[
-f
$$
d/transcript
]
;
then
\
printf
"| %-30s"
$$
d
;
\
printf
"| %8d "
`
cat
$$
d/transcript |
grep
Warning |
wc
-l
`
;
\
error_n
=
`
cat
$$
d/transcript |
grep
Error |
wc
-l
`
;
\
printf
"| %8d |
\n
"
$$
error_n
;
\
if
[
$$
error_n
-gt
0
]
;
then
is_error
=
1
;
fi
;
\
else
\
printf
"| %-30s"
$$
d
;
\
echo
"| No transcript file! |"
;
is_error
=
1
;
\
fi
\
done
;
\
echo
"+-------------------------------+----------+----------+"
;
\
if
[
$$
is_error
-gt
0
]
;
then
exit
1
;
fi
;
summary_xml
:
summary
@
echo
'<?xml version="1.0" encoding="UTF-8"?>'
>
$(test_results_xml)
@
echo
'<testsuites tests="0" failures="0" disabled="0" errors="0" time="0" name="AllTests">'
>>
$(test_results_xml)
@
for
d
in
$(TB_DIRS)
;
do
\
is_test_error
=
0
;
\
echo
-n
" <testsuite name=
\"
"
$$
d
"
\"
tests=
\"
1
\"
failures=
\"
"
>>
$(test_results_xml)
;
\
if
[
-f
$$
d/transcript
]
;
then
\
error_n
=
`
cat
$$
d/transcript |
grep
Error |
wc
-l
`
;
\
if
[
$$
error_n
-gt
0
]
;
then
is_test_error
=
1
;
fi
;
\
echo
-n
$$
is_test_error
>>
$(test_results_xml)
;
\
else
\
is_test_error
=
2
;
\
echo
-n
"1"
>>
$(test_results_xml)
;
\
fi
;
\
echo
"
\"
disabled=
\"
0
\"
errors=
\"
0
\"
time=
\"
0
\"
>"
>>
$(test_results_xml)
;
\
echo
" <testcase name=
\"
"
$$
d
"
\"
status=
\"
run
\"
time=
\"
0
\"
classname=
\"
"
Testbench
"
\"
>"
>>
$(test_results_xml)
;
\
if
[
$$
is_test_error
-eq
1
]
;
then
\
echo
" <failure message=
\"
Errors
\"
type=
\"\"
><![CDATA["
>>
$(test_results_xml)
;
\
cat
$$
d/transcript |
grep
Error
>>
$(test_results_xml)
;
\
echo
" ]]></failure>"
>>
$(test_results_xml)
;
\
fi
;
\
if
[
$$
is_test_error
-eq
2
]
;
then
\
echo
" <failure message=
\"
Output file not found
\"
type=
\"\"
>"
>>
$(test_results_xml)
;
\
echo
"<![CDATA[Output file not found. Testbench didnt run.]]>"
>>
$(test_results_xml)
;
\
echo
" </failure>"
>>
$(test_results_xml)
;
\
fi
;
\
echo
" </testcase>"
>>
$(test_results_xml)
;
\
echo
" </testsuite>"
>>
$(test_results_xml)
;
\
done
;
\
echo
"</testsuites>"
>>
$(test_results_xml)
clean
:
@
for
d
in
$(TB_DIRS)
;
do
\
if
[
-f
$$
d/Makefile
]
;
then
\
$(MAKE)
-C
$$
d
$@
;
\
rm
-f
$$
d/Makefile
;
\
fi
\
done
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