mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-02-05 01:50:29 +01:00
Pass in DBUS_TEST_EXEC via environment, not hard-coded into binaries
This avoids "capturing" the build directory in the built binaries when built with embedded tests, which is good for reproducible builds. See <https://reproducible-builds.org/> for more information. Signed-off-by: Simon McVittie <smcv@debian.org> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=100692
This commit is contained in:
parent
53959c9924
commit
36fcd43005
5 changed files with 7 additions and 7 deletions
|
|
@ -31,7 +31,6 @@
|
|||
#define TEST_LISTEN "@TEST_LISTEN@"
|
||||
|
||||
// test binaries
|
||||
#define DBUS_TEST_EXEC "@DBUS_TEST_EXEC@"
|
||||
#define DBUS_EXEEXT "@EXEEXT@"
|
||||
|
||||
/* Some dbus features */
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ macro(add_test_executable _target _source)
|
|||
list(APPEND _env "DBUS_FATAL_WARNINGS=1")
|
||||
list(APPEND _env "DBUS_TEST_DATA=${PREFIX}${CMAKE_BINARY_DIR}/test/data")
|
||||
list(APPEND _env "DBUS_TEST_DBUS_LAUNCH=${PREFIX}${CMAKE_BINARY_DIR}/bin/dbus-launch${EXEEXT}")
|
||||
list(APPEND _env "DBUS_TEST_EXEC=${PREFIX}${DBUS_TEST_EXEC}")
|
||||
list(APPEND _env "DBUS_TEST_HOMEDIR=${PREFIX}${CMAKE_BINARY_DIR}/dbus")
|
||||
set_tests_properties(${_target} PROPERTIES ENVIRONMENT "${_env}")
|
||||
endmacro(add_test_executable)
|
||||
|
|
|
|||
|
|
@ -1742,8 +1742,6 @@ DBUS_TEST_DATA="$DBUS_PWD/test/data"
|
|||
AC_SUBST([DBUS_TEST_DATA])
|
||||
AC_SUBST([DBUS_TEST_EXEC])
|
||||
|
||||
AC_DEFINE_UNQUOTED([DBUS_TEST_EXEC], ["$DBUS_TEST_EXEC"],
|
||||
[Full path to the daemon in the builddir])
|
||||
AC_DEFINE_UNQUOTED([DBUS_EXEEXT], ["$EXEEXT"],
|
||||
[Extension for executables, typically empty or .exe])
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ get_test_exec (const char *exe,
|
|||
dbus_test_exec = _dbus_getenv ("DBUS_TEST_EXEC");
|
||||
|
||||
if (dbus_test_exec == NULL)
|
||||
dbus_test_exec = DBUS_TEST_EXEC;
|
||||
return NULL;
|
||||
|
||||
if (!_dbus_string_init (scratch_space))
|
||||
return NULL;
|
||||
|
|
@ -111,7 +111,7 @@ check_spawn_segfault (void *data)
|
|||
|
||||
if (argv[0] == NULL)
|
||||
{
|
||||
/* OOM was simulated, never mind */
|
||||
/* OOM was simulated or DBUS_TEST_EXEC was unset; either is OK */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
@ -166,7 +166,7 @@ check_spawn_exit (void *data)
|
|||
|
||||
if (argv[0] == NULL)
|
||||
{
|
||||
/* OOM was simulated, never mind */
|
||||
/* OOM was simulated or DBUS_TEST_EXEC was unset; either is OK */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
@ -217,7 +217,7 @@ check_spawn_and_kill (void *data)
|
|||
|
||||
if (argv[0] == NULL)
|
||||
{
|
||||
/* OOM was simulated, never mind */
|
||||
/* OOM was simulated or DBUS_TEST_EXEC was unset; either is OK */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -235,6 +235,7 @@ installcheck_environment = \
|
|||
export DBUS_TEST_DBUS_LAUNCH=$(DESTDIR)$(bindir)/dbus-launch$(EXEEXT); \
|
||||
export DBUS_TEST_DBUS_MONITOR=$(DESTDIR)$(bindir)/dbus-monitor$(EXEEXT); \
|
||||
export DBUS_TEST_DBUS_SEND=$(DESTDIR)$(bindir)/dbus-send$(EXEEXT); \
|
||||
export DBUS_TEST_EXEC=@abs_top_builddir@/test; \
|
||||
export DBUS_TEST_HOMEDIR=@abs_top_builddir@/dbus; \
|
||||
export DBUS_TEST_DATADIR=$(DESTDIR)$(datadir); \
|
||||
${NULL}
|
||||
|
|
@ -253,6 +254,7 @@ AM_TESTS_ENVIRONMENT = \
|
|||
export DBUS_TEST_DBUS_MONITOR=@abs_top_builddir@/tools/dbus-monitor$(EXEEXT); \
|
||||
export DBUS_TEST_DBUS_SEND=@abs_top_builddir@/tools/dbus-send$(EXEEXT); \
|
||||
export DBUS_TEST_DATA=@abs_top_builddir@/test/data; \
|
||||
export DBUS_TEST_EXEC=@abs_top_builddir@/test; \
|
||||
export DBUS_TEST_HOMEDIR=@abs_top_builddir@/dbus; \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue