File: check-fragment.am

package info (click to toggle)
crossfire 1.71.0+dfsg1-2
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 28,076 kB
  • sloc: ansic: 85,126; sh: 11,978; perl: 2,659; lex: 2,044; makefile: 1,271
file content (116 lines) | stat: -rw-r--r-- 4,255 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
LOG_ROOT=$(top_builddir)/test/logs
LOGDIR=$(LOG_ROOT)/$(CHECK_FOLDER)
TEMPLATE_ROOT = $(top_srcdir)/test/templates
XSLTENGINE= @XSLTENGINE@
BUILT_SOURCES=$(LOGDIR)
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)/\"
$(LOGDIR):
	mkdir -p $(LOGDIR)
$(LOG_ROOT):
	mkdir -p $(LOG_ROOT)
automenu:
	@echo "Building menu entry..."
	@subdirs='$(SUBDIRS)';\
	list='$(TESTS)'; \
	dir='$(LOGDIR)'; \
	srcdir='$(top_srcdir)'; \
	output_menu="$${dir}/.automenu.xml"; \
	parentfoldername='$(CHECK_PARENT_NAME)'; \
	echo '<?xml version="1.0"?><menu>' > $$output_menu; \
	echo '<parentMenu>$(CHECK_PARENT_NAME)</parentMenu>' >> $$output_menu;\
	for tst in $$list; do \
	  tst="$${tst/check_/}" ; \
	  tst="$${tst/-/_}" ; \
	  xml="$(LOGDIR)/$${tst}.xml" ;\
	  if test -e "$$xml"; then \
	      successCount=`grep -c 'result="success"' $$xml`;\
	      errorCount=`grep -c 'result="error"' $$xml`;\
	      failureCount=`grep -c 'result="failure"' $$xml`;\
	      echo '<entry success="'$${successCount}'" error="'$${errorCount}'" failure="'$${failureCount}'">'$$tst'</entry>' >> $$output_menu; \
	  fi; \
	done; \
	for sub in $$subdirs; do \
	    if test -e "$${dir}/$${sub}/.automenu.xml"; then \
	       echo '<subDirectory name="'$${sub}'"/>' >> $$output_menu; \
	    fi; \
	done;\
	echo "</menu>" >> $$output_menu

logreport: automenu $(LOG_ROOT)/logresult.xsl
	@echo "processing logs to html..."
	@list='$(TESTS)'; \
	builddir='$(top_builddir)'; \
	xsl="$${builddir}/test/logs/logresult.xsl" ; \
	xsltproc='$(XSLTENGINE)';\
	xsltproc=$${xsltproc/\%2/$$xsl};\
	xml_siteuri='$(CHECK_ROOT)' ;\
	xml_check_folder='../logs/$(CHECK_FOLDER)' ;\
	runxml='.autorun.xml';\
	if test -n "$$list"; then \
	  for tst in $$list; do \
	    tst="$${tst/check_/}" ; \
	    tst="$${tst/-/_}" ; \
	    checkFile="$${tst}.xml" ;\
	    echo '<?xml version="1.0"?><config>' > $$runxml;\
	    echo "<baseSiteUri>$$xml_siteuri</baseSiteUri>" >> $$runxml;\
	    echo "<checkFile>$$checkFile</checkFile>" >> $$runxml;\
	    echo "<checkFolder>$$xml_check_folder</checkFolder></config>" >> $$runxml;\
	    html=$(LOGDIR)/$${tst}.html ;\
	    if test -e "$(LOGDIR)/$$xml"; then \
	        torun="$${xsltproc/\%1/$$runxml}";\
	        torun="$${torun/\%3/$$html}";\
	        echo "running $$torun";\
	        $$torun; \
	    fi; \
	  done; \
	else :; fi; \
	echo '<?xml version="1.0"?><config>' > $$runxml;\
	echo "<baseSiteUri>$$xml_siteuri</baseSiteUri>" >> $$runxml;\
	echo "<checkFolder>$$xml_check_folder</checkFolder></config>" >> $$runxml;\
	html='$(LOGDIR)/.index.html' ;\
	torun="$${xsltproc/\%1/$$runxml}";\
	torun="$${torun/\%3/$$html}";\
	echo "running $$torun";\
	$$torun;

$(LOG_ROOT)/logresult.xsl: $(LOG_ROOT) $(TEMPLATE_ROOT)/logresult.xsl
	cp "$(TEMPLATE_ROOT)/logresult.xsl" '$(LOG_ROOT)'/;

$(LOG_ROOT)/checkTextResult.xsl: $(LOG_ROOT) $(TEMPLATE_ROOT)/checkTextResult.xsl
	cp "$(TEMPLATE_ROOT)/checkTextResult.xsl" '$(LOG_ROOT)'/;

$(LOG_ROOT)/checkReport.css: $(LOG_ROOT) $(TEMPLATE_ROOT)/checkReport.css
	cp "$(TEMPLATE_ROOT)/checkReport.css" '$(LOG_ROOT)'/;

template-copy: $(LOGDIR)
	@echo copying template
	@if test -d "$(top_srcdir)/test/templates/$(CHECK_FOLDER)"; then \
	    cp "$(top_srcdir)/test/templates/$(CHECK_FOLDER)/"[^C]* '$(LOGDIR)'/;\
	fi
textlog: automenu $(LOG_ROOT)/checkTextResult.xsl
	@echo "processing logs to text..."
	@builddir='$(top_builddir)'; \
	xsl="$${builddir}/test/logs/checkTextResult.xsl" ; \
	xsltproc='$(XSLTENGINE)';\
	xsltproc="$${xsltproc/\%2/$$xsl}";\
	xml_siteuri='$(CHECK_ROOT)' ;\
	xml_check_folder='../logs/$(CHECK_FOLDER)' ;\
	runxml='.autorun.xml';\
	echo '<?xml version="1.0"?><config>' > $$runxml;\
	echo "<baseSiteUri>$$xml_siteuri</baseSiteUri>" >> $$runxml;\
	echo "<checkFolder>$$xml_check_folder</checkFolder></config>" >> $$runxml;\
	txt='$(LOGDIR)/testlog.txt' ;\
	torun="$${xsltproc/\%1/$$runxml}";\
	torun="$${torun/\%3/$$txt}";\
	echo "running $$torun";\
	$$torun;

if PROCESS_XSLT
CHECK_HTML = logreport template-copy
CHECK_TXT= textlog
endif
check-html: $(CHECK_HTML)
check-text: $(CHECK_TXT)
clean-unit:
	rm -f autorun.xml
noinst_PROGRAMS=$(TESTS)