Add a test that dumps settings

This is not much of a test, tbh. But it will give us a convenient
dump of all GTK+ settings in continuous, which helps with tracking
down test failures that might depend on settings.
This commit is contained in:
Matthias Clasen 2016-03-05 13:41:47 -05:00
parent 434b08fe24
commit b2e6ad640d
2 changed files with 27 additions and 3 deletions

View File

@ -16,24 +16,31 @@ test_simplify = \
EXTRA_DIST += \
$(test_simplify) \
test-simplify.in \
test-settings.in \
$(NULL)
TESTS_ENVIRONMENT = \
GTK_BUILDER_TOOL="$(top_builddir)/gtk/gtk-builder-tool"
GTK_BUILDER_TOOL="$(top_builddir)/gtk/gtk-builder-tool" \
GTK_QUERY_SETTINGS="$(top_builddir)/gtk/gtk-query-settings" \
$(NULL)
TEST_PROGS += \
test-simplify \
test-settings \
$(NULL)
test-simplify:test-simplify.in
$(AM_V_GEN) cp $< $@
test-settings:test-settings.in
$(AM_V_GEN) cp $< $@
if BUILDOPT_INSTALL_TESTS
insttestdir = $(libexecdir)/installed-tests/$(PACKAGE)
insttest_SCRIPTS = $(TEST_PROGS)
nobase_insttest_DATA = $(test_simplify)
test-simplify.test: test-simplify Makefile
%.test: % Makefile
$(AM_V_GEN) (echo '[Test]' > $@.tmp; \
echo 'Type=session' >> $@.tmp; \
echo 'Output=TAP' >> $@.tmp; \
@ -43,7 +50,7 @@ test-simplify.test: test-simplify Makefile
test_files = $(TEST_PROGS:=.test)
DISTCLEANFILES = \
test-simplify \
$(TEST_PROGS) \
$(test_files) \
$(NULL)

View File

@ -0,0 +1,17 @@
#! /bin/bash
GTK_QUERY_SETTINGS=${GTK_QUERY_SETTINGS:-gtk-query-settings}
TEST_RESULT_DIR=${TEST_RESULT_DIR:-/tmp}
shopt -s nullglob
echo "1..1"
name=gtk-query-settings
result=$TEST_RESULT_DIR/$name.out
$GTK_QUERY_SETTINGS 2>/dev/null >$result
if [ $(wc -l $result | cut -f1 -d' ') -eq 82 ]; then
echo "ok 1 $name"
else
echo "not ok 1 $name"
fi