summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2018-05-22 15:52:37 +0200
committerJonas Ådahl <jadahl@gmail.com>2018-11-06 17:17:36 +0100
commit8894ec462a6756b3de46280f62c4951b15a92cde (patch)
treedf4228d555debbd3ec8cf9f64c5919974aafcf4b
parent331e830cf6c0432fbcf9bacf3122b862f07b8bb9 (diff)
downloadmutter-8894ec462a6756b3de46280f62c4951b15a92cde.tar.gz
cogl: Pass unit-tests file to run-tests.sh
There are different unit-tests file generated containing lists of tests the test-runner.sh should run. Running run-tests.sh read the unit-tests in the current directory, which is inconvenient to do when using meson.
-rw-r--r--cogl/tests/conform/Makefile.am4
-rwxr-xr-xcogl/tests/run-tests.sh10
-rw-r--r--cogl/tests/unit/Makefile.am2
3 files changed, 12 insertions, 4 deletions
diff --git a/cogl/tests/conform/Makefile.am b/cogl/tests/conform/Makefile.am
index 2d284df53..c7ef1845e 100644
--- a/cogl/tests/conform/Makefile.am
+++ b/cogl/tests/conform/Makefile.am
@@ -135,7 +135,7 @@ test_conformance_LDADD += $(top_builddir)/cogl-path/libmutter-cogl-path-$(LIBMUT
test_conformance_LDFLAGS = -export-dynamic
test: wrappers
- @$(top_srcdir)/tests/run-tests.sh $(abs_builddir)/../config.env $(abs_builddir)/test-conformance$(EXEEXT)
+ @$(top_srcdir)/tests/run-tests.sh $(abs_builddir)/../config.env $(abs_builddir)/test-conformance$(EXEEXT) unit-tests
# XXX: we could prevent the conformance test suite from running
# by simply defining this variable conditionally
@@ -164,7 +164,7 @@ conform.test:
echo " GEN $@"; \
echo "[Test]" > $@.tmp; \
echo "Type=session" >> $@.tmp; \
- echo "Exec=sh -c \"cd $(libexecdir)/installed-tests/mutter-cogl/conform; ../run-tests.sh ../config.env ./test-conformance\"" >> $@.tmp; \
+ echo "Exec=sh -c \"cd $(libexecdir)/installed-tests/mutter-cogl/conform; ../run-tests.sh ../config.env ./test-conformance unit-tests\"" >> $@.tmp; \
mv $@.tmp $@
CLEANFILES = conform.test
diff --git a/cogl/tests/run-tests.sh b/cogl/tests/run-tests.sh
index 1e15fdd0c..2316c7b0d 100755
--- a/cogl/tests/run-tests.sh
+++ b/cogl/tests/run-tests.sh
@@ -14,6 +14,9 @@ shift
TEST_BINARY=$1
shift
+UNIT_TESTS_FILE=$1
+shift
+
. $ENVIRONMENT_CONFIG
set +m
@@ -98,7 +101,12 @@ fi
echo ""
echo ""
-for test in `cat unit-tests`
+if [ ! -f $UNIT_TESTS_FILE ]; then
+ echo Missing unit-tests file
+ exit 1
+fi
+
+for test in `cat $UNIT_TESTS_FILE`
do
export COGL_DEBUG=
diff --git a/cogl/tests/unit/Makefile.am b/cogl/tests/unit/Makefile.am
index f7833b7a5..62e1be412 100644
--- a/cogl/tests/unit/Makefile.am
+++ b/cogl/tests/unit/Makefile.am
@@ -68,7 +68,7 @@ test_unit_LDFLAGS = -export-dynamic
# XXX: uncomment when tests get fixed
#test: wrappers
-# @$(top_srcdir)/tests/run-tests.sh $(abs_builddir)/../config.env $(abs_builddir)/test-unit$(EXEEXT)
+# @$(top_srcdir)/tests/run-tests.sh $(abs_builddir)/../config.env $(abs_builddir)/test-unit$(EXEEXT) unit-tests
# XXX: we could prevent the unit test suite from running
# by simply defining this variable conditionally