rm -rf %{buildroot}%{_datadir}/doc
# build test binaries and copy test data
-%define relative_dbus_tests_base_dir %{_prefix}/lib/dbus-tests
+%define relative_dbus_tests_base_dir %{_libdir}/dbus-tests
%define dbus_tests_base_dir %{buildroot}%{relative_dbus_tests_base_dir}
+%define dbus_installed_tests_dir %{_libdir}/dbus/installed-tests/dbus
mkdir -p %{dbus_tests_base_dir}/test-suites/dbus-tests/
mkdir -p %{dbus_tests_base_dir}/runner/
-%__cc %{_builddir}/%{name}-%{version}/test-runner.c -o %{dbus_tests_base_dir}/runner/dbus-tests
-cp -fr %{buildroot}%{_libdir}/dbus/installed-tests/dbus/* %{dbus_tests_base_dir}/test-suites/dbus-tests/
-rm -fr %{buildroot}%{_libdir}/dbus/installed-tests/dbus
+%__cc %{_builddir}/%{name}-%{version}/test-runner.c -g -o %{dbus_tests_base_dir}/runner/dbus-tests
rm -fr %{buildroot}/usr/share/installed-tests/dbus
+# The tests are installed in standard directory for dbus tests.
+# However, we need to have the tests also available for dbus-integration-tests package.
+# Thus, we link selected tests to our dbus-integration-tests directory
+for f in manual-dir-iter manual-tcp test-corrupt test-dbus-daemon \
+ test-dbus-daemon-eavesdrop test-fdpass test-loopback test-marshal \
+ test-monitor test-printf test-refs test-relay test-sd-activation \
+ test-shell test-syntax test-syslog test-uid-permissions
+do ln -s %{dbus_installed_tests_dir}/$f %{dbus_tests_base_dir}/test-suites/dbus-tests/$f; done
%if %{with coverage}
%define relative_cov_lib_dir %{relative_dbus_tests_base_dir}/coverage-libs
%files tests
%manifest %{name}.manifest
%defattr(-,root,root)
-%{_prefix}/lib/dbus-tests/test-suites/dbus-tests
-%{_prefix}/lib/dbus-tests/runner/dbus-tests
+%{_libdir}/dbus-tests/test-suites/dbus-tests
+%{_libdir}/dbus-tests/runner/dbus-tests
+%{_libdir}/dbus/installed-tests
%if %{with coverage}
%files coverage
#define MAX_BUFFER (64*1024)
#define MAX_COMMENT 1024
+#define INSTALLED_TESTS_DIR "/usr/lib/dbus/installed-tests/dbus/data"
+
enum {
INIT_TEST,
NEW_STDOUT,
{
static char* args_dir[2];
args_dir[0] = (char*)b->name;
- args_dir[1] = "/usr/lib/dbus-tests/test-suites/dbus-tests/data";
+ args_dir[1] = INSTALLED_TESTS_DIR;
return args_dir;
}
int init_environment_vars()
{
- return !(putenv("DBUS_TEST_DATA=/usr/lib/dbus-tests/test-suites/dbus-tests/data"));
+ return !(putenv("DBUS_TEST_DATA="INSTALLED_TESTS_DIR));
}
void parse_binary_outputs(const struct binary* b, const char* test_name, char* buffer, int state_change, int state_option)