Use a custom theme for CSS style tests
Use a custom, empty theme and stop importing reset-to-defaults.css. This avoids overwriting initial values, so our initial value filtering works better.
This commit is contained in:
0
testsuite/css/style/Empty.css
Normal file
0
testsuite/css/style/Empty.css
Normal file
@ -14,15 +14,19 @@ test_css_style_CFLAGS = \
|
|||||||
-I$(top_builddir)/gdk \
|
-I$(top_builddir)/gdk \
|
||||||
-I$(top_srcdir)/gdk \
|
-I$(top_srcdir)/gdk \
|
||||||
$(GTK_DEBUG_FLAGS) \
|
$(GTK_DEBUG_FLAGS) \
|
||||||
$(GTK_DEP_CFLAGS)
|
$(GTK_DEP_CFLAGS) \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
test_css_style_LDADD = \
|
test_css_style_LDADD = \
|
||||||
$(top_builddir)/gdk/libgdk-3.la \
|
$(top_builddir)/gdk/libgdk-3.la \
|
||||||
$(top_builddir)/gtk/libgtk-3.la \
|
$(top_builddir)/gtk/libgtk-3.la \
|
||||||
$(GTK_DEP_LIBS)
|
$(GTK_DEP_LIBS) \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
test_css_style_SOURCES = \
|
test_css_style_SOURCES = \
|
||||||
test-css-style.c
|
test-css-style.c \
|
||||||
|
resources.c \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
test_data = \
|
test_data = \
|
||||||
currentcolor.ui currentcolor.css currentcolor.nodes \
|
currentcolor.ui currentcolor.css currentcolor.nodes \
|
||||||
@ -31,7 +35,19 @@ test_data = \
|
|||||||
nth-child.ui nth-child.css nth-child.nodes \
|
nth-child.ui nth-child.css nth-child.nodes \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
EXTRA_DIST += $(test_in_files) $(test_data)
|
BUILT_SOURCES = resources.c
|
||||||
|
|
||||||
|
resource_files = $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(builddir)/test-css-style.gresource.xml)
|
||||||
|
|
||||||
|
resources.c: test-css-style.gresource.xml $(resource_files)
|
||||||
|
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-source $(srcdir)/test-css-style.gresource.xml
|
||||||
|
|
||||||
|
EXTRA_DIST += \
|
||||||
|
test-css-style.gresource.xml \
|
||||||
|
$(resource_files) \
|
||||||
|
$(test_in_files) \
|
||||||
|
$(test_data) \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
if BUILDOPT_INSTALL_TESTS
|
if BUILDOPT_INSTALL_TESTS
|
||||||
insttestdir=$(libexecdir)/installed-tests/$(PACKAGE)/css/style
|
insttestdir=$(libexecdir)/installed-tests/$(PACKAGE)/css/style
|
||||||
@ -48,7 +64,6 @@ $(test_files): %.test: %.test.in
|
|||||||
$(AM_V_GEN) sed $(substitutions) $< > $@.tmp && mv $@.tmp $@
|
$(AM_V_GEN) sed $(substitutions) $< > $@.tmp && mv $@.tmp $@
|
||||||
|
|
||||||
EXTRA_DIST += \
|
EXTRA_DIST += \
|
||||||
reset-to-defaults.css \
|
|
||||||
$(test_files) \
|
$(test_files) \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
@import "reset-to-defaults.css";
|
|
||||||
|
|
||||||
box {
|
box {
|
||||||
color: red;
|
color: red;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
@import "reset-to-defaults.css";
|
|
||||||
|
|
||||||
box {
|
box {
|
||||||
color: red;
|
color: red;
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
@import "reset-to-defaults.css";
|
|
||||||
|
|
||||||
box {
|
box {
|
||||||
font: "Comic Sans";
|
font: "Comic Sans";
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
@import "reset-to-defaults.css";
|
|
||||||
|
|
||||||
label:first-child {
|
label:first-child {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
}
|
}
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
* {
|
|
||||||
all: unset;
|
|
||||||
}
|
|
@ -245,6 +245,7 @@ main (int argc, char **argv)
|
|||||||
|
|
||||||
g_object_set (gtk_settings_get_default (),
|
g_object_set (gtk_settings_get_default (),
|
||||||
"gtk-font-name", "Sans",
|
"gtk-font-name", "Sans",
|
||||||
|
"gtk-theme-name", "Empty",
|
||||||
NULL);
|
NULL);
|
||||||
if (argc < 2)
|
if (argc < 2)
|
||||||
{
|
{
|
||||||
|
6
testsuite/css/style/test-css-style.gresource.xml
Normal file
6
testsuite/css/style/test-css-style.gresource.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<gresources>
|
||||||
|
<gresource prefix="/org/gtk/libgtk/theme">
|
||||||
|
<file>Empty.css</file>
|
||||||
|
</gresource>
|
||||||
|
</gresources>
|
Reference in New Issue
Block a user