[PATCH xts 1/3] Default to using the tetexec.cfg from the build directory.

Eric Anholt eric at anholt.net
Wed Aug 31 23:45:54 UTC 2016


One less environment variable the user needs to set to prevent
spurious failures.
---
 src/tet3/apilib/Makefile.am | 3 ++-
 src/tet3/apilib/dconfig.c   | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/tet3/apilib/Makefile.am b/src/tet3/apilib/Makefile.am
index 70391ed910df..e55afb3e6617 100644
--- a/src/tet3/apilib/Makefile.am
+++ b/src/tet3/apilib/Makefile.am
@@ -1,4 +1,5 @@
-AM_CPPFLAGS = -I$(srcdir)/../inc -I$(top_srcdir)/include
+AM_CPPFLAGS = -I$(srcdir)/../inc -I$(top_srcdir)/include \
+	-DTET_DEFAULT_CONFIG=\"$(abs_top_builddir)/tetexec.cfg\"
 
 # libapi_s is the shared portion of the library
 xtslibdir = $(libexecdir)/xts5
diff --git a/src/tet3/apilib/dconfig.c b/src/tet3/apilib/dconfig.c
index 129557909dd1..ac4444ad188e 100644
--- a/src/tet3/apilib/dconfig.c
+++ b/src/tet3/apilib/dconfig.c
@@ -144,7 +144,7 @@ TET_IMPORT void tet_config()
 	/* determine the config file name from the environment */
 	file = getenv("TET_CONFIG");
 	if (file == NULL || *file == '\0')
-		return;
+		file = TET_DEFAULT_CONFIG;
 
 	/* open the file */
 	if ((fp = fopen(file, "r")) == (FILE *) 0) {
-- 
2.9.3



More information about the xorg-devel mailing list