conform: Save the revision and date inside the test report

Even if gtester-report doesn't use that information (yet), we should
store the revision of Clutter that generated the report, and the date in
which the test suite was ran.
This commit is contained in:
Emmanuele Bassi 2010-10-12 15:43:42 +01:00
parent e6418a9dec
commit 2a23bab819

View File

@ -100,6 +100,7 @@ stamp-test-conformance: Makefile $(srcdir)/test-conform-main.c
echo "/test-launcher.sh" ; \ echo "/test-launcher.sh" ; \
echo "*.o" ; \ echo "*.o" ; \
echo "*.xml" ; \ echo "*.xml" ; \
echo "*.html" ; \
echo ".gitignore" ; \ echo ".gitignore" ; \
echo "unit-tests" ; \ echo "unit-tests" ; \
echo "/wrappers/" ) > .gitignore echo "/wrappers/" ) > .gitignore
@ -175,6 +176,12 @@ TEST_PROGS = test-conformance
test-report perf-report full-report: ${TEST_PROGS} test-report perf-report full-report: ${TEST_PROGS}
@test -z "${TEST_PROGS}" || { \ @test -z "${TEST_PROGS}" || { \
export GTESTER_LOGDIR=`mktemp -d "$(srcdir)/.testlogs-XXXXXX"` ; \ export GTESTER_LOGDIR=`mktemp -d "$(srcdir)/.testlogs-XXXXXX"` ; \
if test -d "$(top_srcdir)/.git"; then \
export REVISION="`git describe`" ; \
else \
export REVISION="$(VERSION) $(CLUTTER_RELEASE_STATUS)" ; \
fi ; \
export TIMESTAMP=`date +%Y-%m-%dT%H:%M:%S%z` ; \
case $@ in \ case $@ in \
test-report) test_options="-k";; \ test-report) test_options="-k";; \
perf-report) test_options="-k -m=perf";; \ perf-report) test_options="-k -m=perf";; \
@ -185,12 +192,14 @@ test-report perf-report full-report: ${TEST_PROGS}
--verbose \ --verbose \
$$test_options \ $$test_options \
-o `mktemp "$$GTESTER_LOGDIR/log-XXXXXX"` ; \ -o `mktemp "$$GTESTER_LOGDIR/log-XXXXXX"` ; \
echo '<?xml version="1.0"?>' > $@.xml ; \ echo '<?xml version="1.0"?>' > $@.xml ; \
echo '<report-collection>' >> $@.xml ; \ echo '<report-collection>' >> $@.xml ; \
echo '<info>' >> $@.xml ; \ echo '<info>' >> $@.xml ; \
echo ' <package>$(PACKAGE)</package>' >> $@.xml ; \ echo ' <package>$(PACKAGE)</package>' >> $@.xml ; \
echo ' <version>$(VERSION)</version>' >> $@.xml ; \ echo ' <version>$(VERSION)</version>' >> $@.xml ; \
echo '</info>' >> $@.xml ; \ echo " <revision>$$REVISION</revision>" >> $@.xml ; \
echo " <date>$$TIMESTAMP</date>" >> $@.xml ; \
echo '</info>' >> $@.xml ; \
for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \ for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \
sed '1,1s/^<?xml\b[^>?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \ sed '1,1s/^<?xml\b[^>?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \
done ; \ done ; \
@ -206,6 +215,12 @@ test-report-npot perf-report-npot full-report-npot: ${TEST_PROGS}
@test -z "${TEST_PROGS}" || { \ @test -z "${TEST_PROGS}" || { \
$(top_srcdir)/tests/tools/disable-npots.sh ; \ $(top_srcdir)/tests/tools/disable-npots.sh ; \
export GTESTER_LOGDIR=`mktemp -d "$(srcdir)/.testlogs-XXXXXX"` ; \ export GTESTER_LOGDIR=`mktemp -d "$(srcdir)/.testlogs-XXXXXX"` ; \
if test -d "$(top_srcdir)/.git"; then \
export REVISION="`git describe`" ; \
else \
export REVISION="$(VERSION) $(CLUTTER_RELEASE_STATUS)" ; \
fi ; \
export TIMESTAMP=`date +%Y-%m-%dT%H:%M:%S%z` ; \
case $@ in \ case $@ in \
test-report-npot) test_options="-k";; \ test-report-npot) test_options="-k";; \
perf-report-npot) test_options="-k -m=perf";; \ perf-report-npot) test_options="-k -m=perf";; \
@ -216,12 +231,14 @@ test-report-npot perf-report-npot full-report-npot: ${TEST_PROGS}
--verbose \ --verbose \
$$test_options \ $$test_options \
-o `mktemp "$$GTESTER_LOGDIR/log-XXXXXX"` ; \ -o `mktemp "$$GTESTER_LOGDIR/log-XXXXXX"` ; \
echo '<?xml version="1.0"?>' > $@.xml ; \ echo '<?xml version="1.0"?>' > $@.xml ; \
echo '<report-collection>' >> $@.xml ; \ echo '<report-collection>' >> $@.xml ; \
echo '<info>' >> $@.xml ; \ echo '<info>' >> $@.xml ; \
echo ' <package>$(PACKAGE)</package>' >> $@.xml ; \ echo ' <package>$(PACKAGE)</package>' >> $@.xml ; \
echo ' <version>$(VERSION)</version>' >> $@.xml ; \ echo ' <version>$(VERSION)</version>' >> $@.xml ; \
echo '</info>' >> $@.xml ; \ echo " <revision>$$REVISION</revision>" >> $@.xml ; \
echo " <date>$$TIMESTAMP</date>" >> $@.xml ; \
echo '</info>' >> $@.xml ; \
for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \ for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \
sed '1,1s/^<?xml\b[^>?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \ sed '1,1s/^<?xml\b[^>?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \
done ; \ done ; \