summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2013-08-16 10:57:54 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2013-08-19 23:22:38 +0100
commitfa72540246499f71fc69172d7c5d7902bf666011 (patch)
treea351af73da79d9466cd464230ffdd7cd6a3b4e36
parentb50e1c3b628c0238da0d1ea89853b53ef06fa2ef (diff)
downloadclutter-fa72540246499f71fc69172d7c5d7902bf666011.tar.gz
build: Ensure tests are built only on make check
Tests should only be enabled when we want to run them, or when we are generating a tarball.
-rw-r--r--tests/Makefile.am11
-rw-r--r--tests/accessibility/Makefile.am8
-rw-r--r--tests/conform/Makefile.am101
-rw-r--r--tests/interactive/Makefile.am9
-rw-r--r--tests/micro-bench/Makefile.am2
-rw-r--r--tests/performance/Makefile.am2
6 files changed, 47 insertions, 86 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 48f253170..8526b39fe 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,14 +1,3 @@
SUBDIRS = accessibility data conform interactive micro-bench performance
EXTRA_DIST = README
-
-test conform:
- ( cd ./conform && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $$?
-
-test-report full-report:
- ( cd ./conform && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $$?
-
-.PHONY: test conform test-report full-report
-
-# run make test as part of make check
-check-local: test
diff --git a/tests/accessibility/Makefile.am b/tests/accessibility/Makefile.am
index 4c7a376d4..df713bd5d 100644
--- a/tests/accessibility/Makefile.am
+++ b/tests/accessibility/Makefile.am
@@ -7,18 +7,20 @@ common_sources = \
cally-examples-util.c \
cally-examples-util.h
-INCLUDES = \
+AM_CPPFLAGS = \
+ -DPREFIXDIR=\"$(libdir)\" \
+ -DCLUTTER_DISABLE_DEPRECATION_WARNINGS \
+ -DGLIB_DISABLE_DEPRECATION_WARNINGS \
-I$(top_srcdir) \
-I$(top_builddir) \
-I$(top_srcdir)/clutter \
-I$(top_builddir)/clutter \
-I$(top_srcdir)/tests/accessibility
-AM_CPPFLAGS = -DPREFIXDIR=\"$(libdir)\" -DCLUTTER_DISABLE_DEPRECATION_WARNINGS -DGLIB_DISABLE_DEPRECATION_WARNINGS
AM_CFLAGS = $(CLUTTER_CFLAGS) $(MAINTAINER_CFLAGS)
LDADD = $(common_ldadd) $(CLUTTER_LIBS)
-noinst_PROGRAMS = \
+check_PROGRAMS = \
cally-atkcomponent-example \
cally-atkeditabletext-example \
cally-atkevents-example \
diff --git a/tests/conform/Makefile.am b/tests/conform/Makefile.am
index 10e359b32..90f1f35b1 100644
--- a/tests/conform/Makefile.am
+++ b/tests/conform/Makefile.am
@@ -2,7 +2,16 @@ include $(top_srcdir)/build/autotools/Makefile.am.silent
NULL =
-noinst_PROGRAMS = test-conformance
+BUILT_SOURCES =
+
+TESTS =
+check_PROGRAMS =
+check_SCRIPTS =
+
+EXTRA_DIST =
+DISTCLEANFILES =
+
+TEST_PROGS =
# the common sources
common_sources = \
@@ -71,14 +80,15 @@ units_sources += \
events-touch.c \
$(NULL)
-test_conformance_SOURCES = $(common_sources) $(units_sources)
-
if OS_WIN32
SHEXT =
else
SHEXT = $(EXEEXT)
endif
+EXTRA_DIST += ADDING_NEW_TESTS test-launcher.sh.in run-tests.sh
+DISTCLEANFILES += test-launcher.sh .gitignore
+
# For convenience, this provides a way to easily run individual unit tests:
.PHONY: wrappers clean-wrappers
@@ -101,6 +111,7 @@ stamp-test-conformance: Makefile $(srcdir)/test-conform-main.c
echo "*.html" ; \
echo "*.test" ; \
echo ".gitignore" ; \
+ echo "test-suite.log" ; \
echo "unit-tests" ; \
echo "/wrappers/" ) > .gitignore
@for i in `cat unit-tests`; \
@@ -118,22 +129,20 @@ stamp-test-conformance: Makefile $(srcdir)/test-conform-main.c
&& echo timestamp > $(@F)
clean-wrappers:
- @for i in `cat unit-tests`; \
- do \
+ @if test -f "unit-tests"; then \
+ for i in `cat unit-tests`; \
+ do \
unit=`basename $$i | sed -e s/_/-/g`; \
echo " RM $$unit"; \
rm -f $$unit$(SHEXT) ; \
rm -f wrappers/$$unit$(SHEXT) ; \
- done \
- && rmdir wrappers \
+ done \
+ fi \
+ && rm -rf wrappers \
&& rm -f unit-tests \
&& rm -f $(top_builddir)/build/win32/*.bat \
&& rm -f stamp-test-conformance
-# NB: BUILT_SOURCES here a misnomer. We aren't building source, just inserting
-# a phony rule that will generate symlink scripts for running individual tests
-BUILT_SOURCES = wrappers
-
test_conformance_CPPFLAGS = \
-DG_DISABLE_SINGLE_INCLUDES \
-DCOGL_ENABLE_EXPERIMENTAL_API \
@@ -147,10 +156,17 @@ test_conformance_CPPFLAGS = \
-I$(top_builddir)/clutter
test_conformance_CFLAGS = -g $(CLUTTER_CFLAGS)
-
test_conformance_LDADD = $(top_builddir)/clutter/libclutter-@CLUTTER_API_VERSION@.la $(CLUTTER_LIBS) -lm
-
test_conformance_LDFLAGS = -export-dynamic
+test_conformance_SOURCES = $(common_sources) $(units_sources)
+
+if OS_WIN32
+TESTS += test-conformance
+endif
+
+TEST_PROGS += test-conformance
+check_PROGRAMS += test-conformance
+check_SCRIPTS += wrappers
test: wrappers
@export G_TEST_SRCDIR="$(abs_srcdir)" ; \
@@ -164,21 +180,18 @@ test-verbose: wrappers
$(top_srcdir)/tests/conform/run-tests.sh \
./test-conformance$(EXEEXT) -o test-report.xml --verbose
-GTESTER = gtester
-GTESTER_REPORT = gtester-report
-
-# XXX: we could prevent the conformance test suite from running
-# by simply defining this variable conditionally
-TEST_PROGS = test-conformance
-
.PHONY: test
.PHONY: test-report perf-report full-report
-.PHONY: test-report-npot perf-report-npot full-report-npot
+
+check-local: test
+
+GTESTER = gtester
+GTESTER_REPORT = gtester-report
# test-report: run tests and generate report
# perf-report: run tests with -m perf and generate report
# full-report: like test-report: with -m perf and -m slow
-test-report perf-report full-report: ${TEST_PROGS}
+test-report perf-report full-report: ${TEST_PROGS}
@test -z "${TEST_PROGS}" || { \
export GTESTER_LOGDIR=`mktemp -d "$(srcdir)/.testlogs-XXXXXX"` ; \
if test -d "$(top_srcdir)/.git"; then \
@@ -216,47 +229,6 @@ test-report perf-report full-report: ${TEST_PROGS}
rm -rf "$$GTESTER_LOGDIR" ; \
}
-# same as above, but with a wrapper that forcibly disables non-power of
-# two textures
-test-report-npot perf-report-npot full-report-npot: ${TEST_PROGS}
- @test -z "${TEST_PROGS}" || { \
- export COGL_DEBUG="$COGL_DEBUG,disable-npot-textures"; \
- 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 \
- test-report-npot) test_options="-k";; \
- perf-report-npot) test_options="-k -m=perf";; \
- full-report-npot) test_options="-k -m=perf -m=slow";; \
- esac ; \
- export G_TEST_SRCDIR="$(abs_srcdir)" ; \
- export G_TEST_BUILDDIR="$(abs_builddir)" ; \
- $(top_srcdir)/tests/conform/run-tests.sh \
- ./test-conformance$(EXEEXT) \
- --verbose \
- $$test_options \
- -o `mktemp "$$GTESTER_LOGDIR/log-XXXXXX"` ; \
- echo '<?xml version="1.0"?>' > $@.xml ; \
- echo '<report-collection>' >> $@.xml ; \
- echo '<info>' >> $@.xml ; \
- echo ' <package>$(PACKAGE)</package>' >> $@.xml ; \
- echo ' <version>$(VERSION)</version>' >> $@.xml ; \
- echo " <revision>$$REVISION</revision>" >> $@.xml ; \
- echo " <date>$$TIMESTAMP</date>" >> $@.xml ; \
- echo '</info>' >> $@.xml ; \
- for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \
- sed '1,1s/^<?xml\b[^>?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \
- done ; \
- echo >> $@.xml ; \
- echo '</report-collection>' >> $@.xml ; \
- ${GTESTER_REPORT} --version 2>/dev/null 1>&2 ; test "$$?" != 0 || ${GTESTER_REPORT} $@.xml >$@.html ; \
- rm -rf "$$GTESTER_LOGDIR" ; \
- }
-
XML_REPORTS = \
test-report.xml \
perf-report.xml \
@@ -273,9 +245,6 @@ HTML_REPORTS = \
perf-report-npot.html \
full-report-npot.html
-EXTRA_DIST = ADDING_NEW_TESTS test-launcher.sh.in run-tests.sh
-DISTCLEANFILES = test-launcher.sh .gitignore
-
dist-hook: $(top_builddir)/build/win32/vs9/test-conformance-clutter.vcproj $(top_builddir)/build/win32/vs10/test-conformance-clutter.vcxproj $(top_builddir)/build/win32/vs10/test-conformance-clutter.vcxproj.filters
$(top_builddir)/build/win32/vs9/test-conformance-clutter.vcproj: $(top_srcdir)/build/win32/vs9/test-conformance-clutter.vcprojin
diff --git a/tests/interactive/Makefile.am b/tests/interactive/Makefile.am
index 00bdae4da..753d9f47c 100644
--- a/tests/interactive/Makefile.am
+++ b/tests/interactive/Makefile.am
@@ -67,7 +67,7 @@ SHEXT = $(EXEEXT)
endif
# For convenience, this provides a way to easily run individual unit tests:
-wrappers: stamp-test-interactive $(top_builddir)/build/win32/test-interactive-clutter.bat
+wrappers: stamp-test-interactive
@true
stamp-test-interactive: Makefile
@@ -91,7 +91,7 @@ stamp-test-interactive: Makefile
done \
&& echo timestamp > $(@F)
-$(top_builddir)/build/win32/test-interactive-clutter.bat: Makefile test-interactive$(EXEEXT)
+$(top_builddir)/build/win32/test-interactive-clutter.bat: Makefile
@echo " GEN test-interactive-clutter.bat" ; \
for i in $(UNIT_TESTS); \
do \
@@ -138,7 +138,8 @@ clean-wrappers:
common_ldadd = $(top_builddir)/clutter/libclutter-@CLUTTER_API_VERSION@.la
-noinst_PROGRAMS = test-interactive
+check_PROGRAMS = test-interactive
+check_SCRIPTS = wrappers $(top_builddir)/build/win32/test-interactive-clutter.bat
test_interactive_SOURCES = test-main.c $(UNIT_TESTS)
nodist_test_interactive_SOURCES = test-unit-names.h
@@ -162,7 +163,7 @@ EXTRA_DIST = \
DISTCLEANFILES = wrapper.sh .gitignore test-unit-names.h
-BUILT_SOURCES = test-unit-names.h wrappers
+BUILT_SOURCES = test-unit-names.h
dist-hook: $(top_builddir)/build/win32/vs9/test-interactive-clutter.vcproj $(top_builddir)/build/win32/vs10/test-interactive-clutter.vcxproj $(top_builddir)/build/win32/vs10/test-interactive-clutter.vcxproj.filters
diff --git a/tests/micro-bench/Makefile.am b/tests/micro-bench/Makefile.am
index 802cbab8d..e4cb8f12f 100644
--- a/tests/micro-bench/Makefile.am
+++ b/tests/micro-bench/Makefile.am
@@ -2,7 +2,7 @@ include $(top_srcdir)/build/autotools/Makefile.am.silent
common_ldadd = $(top_builddir)/clutter/libclutter-@CLUTTER_API_VERSION@.la
-noinst_PROGRAMS = \
+check_PROGRAMS = \
test-text \
test-picking \
test-text-perf \
diff --git a/tests/performance/Makefile.am b/tests/performance/Makefile.am
index dfcba7570..ef7745ca6 100644
--- a/tests/performance/Makefile.am
+++ b/tests/performance/Makefile.am
@@ -1,6 +1,6 @@
include $(top_srcdir)/build/autotools/Makefile.am.silent
-noinst_PROGRAMS = \
+check_PROGRAMS = \
test-picking \
test-text-perf \
test-state \