| 1 |
LOG_ROOT=$(top_builddir)/test/logs |
| 2 |
LOGDIR=$(LOG_ROOT)/$(CHECK_FOLDER) |
| 3 |
TEMPLATE_ROOT = $(top_srcdir)/test/templates |
| 4 |
XSLTENGINE= @XSLTENGINE@ |
| 5 |
BUILT_SOURCES=$(LOGDIR) |
| 6 |
AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/test/include -DRESSOURCES=\"$(srcdir)/../../resources\" -DBUILD_ROOT=\"$(top_builddir)/\" -DLOGDIR=\"$(top_builddir)/test/logs\" -DSOURCE_ROOT=\"$(top_srcdir)/\" |
| 7 |
$(LOGDIR): |
| 8 |
mkdir -p $(LOGDIR) |
| 9 |
$(LOG_ROOT): |
| 10 |
mkdir -p $(LOG_ROOT) |
| 11 |
automenu: |
| 12 |
@echo "Building menu entry..." |
| 13 |
@subdirs='$(SUBDIRS)';\ |
| 14 |
list='$(TESTS)'; \ |
| 15 |
dir='$(LOGDIR)'; \ |
| 16 |
srcdir='$(top_srcdir)'; \ |
| 17 |
output_menu="$${dir}/.automenu.xml"; \ |
| 18 |
parentfoldername='$(CHECK_PARENT_NAME)'; \ |
| 19 |
echo '<?xml version="1.0"?><menu>' > $$output_menu; \ |
| 20 |
echo '<parentMenu>$(CHECK_PARENT_NAME)</parentMenu>' >> $$output_menu;\ |
| 21 |
for tst in $$list; do \ |
| 22 |
tst="$${tst/check_/}" ; \ |
| 23 |
tst="$${tst/-/_}" ; \ |
| 24 |
xml="$(LOGDIR)/$${tst}.xml" ;\ |
| 25 |
if test -e "$$xml"; then \ |
| 26 |
successCount=`grep -c 'result="success"' $$xml`;\ |
| 27 |
errorCount=`grep -c 'result="error"' $$xml`;\ |
| 28 |
failureCount=`grep -c 'result="failure"' $$xml`;\ |
| 29 |
echo '<entry success="'$${successCount}'" error="'$${errorCount}'" failure="'$${failureCount}'">'$$tst'</entry>' >> $$output_menu; \ |
| 30 |
fi; \ |
| 31 |
done; \ |
| 32 |
for sub in $$subdirs; do \ |
| 33 |
if test -e "$${dir}/$${sub}/.automenu.xml"; then \ |
| 34 |
echo '<subDirectory name="'$${sub}'"/>' >> $$output_menu; \ |
| 35 |
fi; \ |
| 36 |
done;\ |
| 37 |
echo "</menu>" >> $$output_menu |
| 38 |
|
| 39 |
logreport: automenu $(LOG_ROOT)/logresult.xsl |
| 40 |
@echo "processing logs to html..." |
| 41 |
@list='$(TESTS)'; \ |
| 42 |
builddir='$(top_builddir)'; \ |
| 43 |
xsl="$${builddir}/test/logs/logresult.xsl" ; \ |
| 44 |
xsltproc='$(XSLTENGINE)';\ |
| 45 |
xsltproc=$${xsltproc/\%2/$$xsl};\ |
| 46 |
xml_siteuri='$(CHECK_ROOT)' ;\ |
| 47 |
xml_check_folder='../logs/$(CHECK_FOLDER)' ;\ |
| 48 |
runxml='.autorun.xml';\ |
| 49 |
if test -n "$$list"; then \ |
| 50 |
for tst in $$list; do \ |
| 51 |
tst="$${tst/check_/}" ; \ |
| 52 |
tst="$${tst/-/_}" ; \ |
| 53 |
checkFile="$${tst}.xml" ;\ |
| 54 |
echo '<?xml version="1.0"?><config>' > $$runxml;\ |
| 55 |
echo "<baseSiteUri>$$xml_siteuri</baseSiteUri>" >> $$runxml;\ |
| 56 |
echo "<checkFile>$$checkFile</checkFile>" >> $$runxml;\ |
| 57 |
echo "<checkFolder>$$xml_check_folder</checkFolder></config>" >> $$runxml;\ |
| 58 |
html=$(LOGDIR)/$${tst}.html ;\ |
| 59 |
if test -e "$(LOGDIR)/$$xml"; then \ |
| 60 |
torun="$${xsltproc/\%1/$$runxml}";\ |
| 61 |
torun="$${torun/\%3/$$html}";\ |
| 62 |
echo "running $$torun";\ |
| 63 |
$$torun; \ |
| 64 |
fi; \ |
| 65 |
done; \ |
| 66 |
else :; fi; \ |
| 67 |
echo '<?xml version="1.0"?><config>' > $$runxml;\ |
| 68 |
echo "<baseSiteUri>$$xml_siteuri</baseSiteUri>" >> $$runxml;\ |
| 69 |
echo "<checkFolder>$$xml_check_folder</checkFolder></config>" >> $$runxml;\ |
| 70 |
html='$(LOGDIR)/.index.html' ;\ |
| 71 |
torun="$${xsltproc/\%1/$$runxml}";\ |
| 72 |
torun="$${torun/\%3/$$html}";\ |
| 73 |
echo "running $$torun";\ |
| 74 |
$$torun; |
| 75 |
|
| 76 |
$(LOG_ROOT)/logresult.xsl: $(LOG_ROOT) $(TEMPLATE_ROOT)/logresult.xsl |
| 77 |
cp "$(TEMPLATE_ROOT)/logresult.xsl" '$(LOG_ROOT)'/; |
| 78 |
|
| 79 |
$(LOG_ROOT)/checkTextResult.xsl: $(LOG_ROOT) $(TEMPLATE_ROOT)/checkTextResult.xsl |
| 80 |
cp "$(TEMPLATE_ROOT)/checkTextResult.xsl" '$(LOG_ROOT)'/; |
| 81 |
|
| 82 |
$(LOG_ROOT)/checkReport.css: $(LOG_ROOT) $(TEMPLATE_ROOT)/checkReport.css |
| 83 |
cp "$(TEMPLATE_ROOT)/checkReport.css" '$(LOG_ROOT)'/; |
| 84 |
|
| 85 |
template-copy: $(LOGDIR) |
| 86 |
@echo copying template |
| 87 |
@if test -d "$(top_srcdir)/test/templates/$(CHECK_FOLDER)"; then \ |
| 88 |
cp "$(top_srcdir)/test/templates/$(CHECK_FOLDER)/"[^C]* '$(LOGDIR)'/;\ |
| 89 |
fi |
| 90 |
textlog: automenu $(LOG_ROOT)/checkTextResult.xsl |
| 91 |
@echo "processing logs to text..." |
| 92 |
@builddir='$(top_builddir)'; \ |
| 93 |
xsl="$${builddir}/test/logs/checkTextResult.xsl" ; \ |
| 94 |
xsltproc='$(XSLTENGINE)';\ |
| 95 |
xsltproc="$${xsltproc/\%2/$$xsl}";\ |
| 96 |
xml_siteuri='$(CHECK_ROOT)' ;\ |
| 97 |
xml_check_folder='../logs/$(CHECK_FOLDER)' ;\ |
| 98 |
runxml='.autorun.xml';\ |
| 99 |
echo '<?xml version="1.0"?><config>' > $$runxml;\ |
| 100 |
echo "<baseSiteUri>$$xml_siteuri</baseSiteUri>" >> $$runxml;\ |
| 101 |
echo "<checkFolder>$$xml_check_folder</checkFolder></config>" >> $$runxml;\ |
| 102 |
txt='$(LOGDIR)/testlog.txt' ;\ |
| 103 |
torun="$${xsltproc/\%1/$$runxml}";\ |
| 104 |
torun="$${torun/\%3/$$txt}";\ |
| 105 |
echo "running $$torun";\ |
| 106 |
$$torun; |
| 107 |
|
| 108 |
if PROCESS_XSLT |
| 109 |
CHECK_HTML = logreport template-copy |
| 110 |
CHECK_TXT= textlog |
| 111 |
endif |
| 112 |
check-html: $(CHECK_HTML) |
| 113 |
check-text: $(CHECK_TXT) |
| 114 |
clean-unit: |
| 115 |
rm -f autorun.xml |
| 116 |
noinst_PROGRAMS=$(TESTS) |