htmlgen: add html generation as last step of kokoro

Signed-off-by: Alessandro Comodi <acomodi@antmicro.com>
This commit is contained in:
Alessandro Comodi 2020-04-01 20:22:58 +02:00
parent 27a8e27381
commit 8bed17b40e
6 changed files with 21 additions and 11 deletions

View File

@ -167,6 +167,15 @@ if [[ $EXTRAS_PARTS_RET != 0 ]] ; then
exit $EXTRAS_PARTS_RET
fi
echo
echo "========================================"
echo " Testing HTML generation"
echo "----------------------------------------"
(
cd htmlgen
source htmlgen.sh $XRAY_SETTINGS
)
# If we get here, then all the fuzzers completed fine. Hence we are
# going to assume we don't want to keep all the build / logs / etc (as
# they are quite large). Thus do a clean to get rid of them.

View File

@ -32,6 +32,3 @@ jobs:
script:
- make format
- test $(git status --porcelain | wc -l) -eq 0 || { git diff; false; }
- name: "HTML generation"
script: make test-htmlgen

View File

@ -156,7 +156,7 @@ $(foreach DB,$(DATABASES),$(eval $(call database,$(DB))))
# Targets related to Project X-Ray parts
# --------------------------------------
ARTIX_PARTS=artix200t
ARTIX_PARTS=artix7_200t
ZYNQ_PARTS=zynq7010
KINTEX_PARTS=kintex70t

View File

@ -41,9 +41,8 @@ def db_open(fn, db_dir):
def out_open(fn, output):
out_dir = os.path.join(output, get_setting("XRAY_DATABASE"))
os.makedirs(out_dir, exist_ok=True)
fp = os.path.join(out_dir, fn)
os.makedirs(output, exist_ok=True)
fp = os.path.join(output, fn)
print("Writing %s" % fp)
return open(fp, "w")
@ -990,7 +989,7 @@ def main():
parser.add_argument('--verbose', action='store_true')
parser.add_argument(
'--output',
default=os.path.join(os.path.curdir, 'html'),
default=os.path.join(os.path.curdir, 'html', get_setting('XRAY_DATABASE')),
help='Put the generated files in this directory (default current dir).'
)
parser.add_argument(

View File

@ -1,14 +1,19 @@
#!/bin/bash
SETTINGS=../settings/*
DATABASE=$1
# If DATABASE is empty, checks htmlgen for all settings files
SETTINGS=../settings/$DATABASE*.sh
for setting in $SETTINGS
do
no_prefix_setting=${setting#../settings/}
clean_setting=${no_prefix_setting%.sh}
echo ""
echo "============================================="
echo "Generating HTML for ${setting%.sh}"
echo "Generating HTML for ${clean_setting}"
echo "============================================="
echo ""
source ../settings/$setting
./htmlgen.py
./htmlgen.py --output html/${clean_setting}
done