Commit 1ab90782 authored by Peter Hutterer's avatar Peter Hutterer
Browse files

test: sub the builddir path for the helpers



When building with srcdir != builddir, the resulting file won't be in the
source directory.
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent 3627b194
......@@ -38,7 +38,9 @@ GTEST_CPPFLAGS=-I$(top_srcdir)/gtest/include -I$(top_srcdir)/gtest
AM_CPPFLAGS = $(GTEST_CPPFLAGS) $(BASE_CPPFLAGS)
AM_CXXFLAGS = $(BASE_CXXFLAGS) $(BASE_CPPFLAGS) \
-DTEST_ROOT_DIR=\"$(abs_top_srcdir)/test/\"
-DTEST_ROOT_DIR=\"$(abs_top_srcdir)/test/\" \
-DTEST_BUILD_DIR=\"$(abs_builddir)/\" \
$(NULL)
tests_libraries = \
libgtest.a \
......
......@@ -125,7 +125,7 @@ TEST(Process, TerminationFailure)
sigaddset(&sig_mask, SIGUSR1);
Process p;
p.Start(TEST_ROOT_DIR "process-test-helper", nullptr);
p.Start(TEST_BUILD_DIR "process-test-helper", nullptr);
/* don't check error here, the helper may have sent the signal before we
get here */
sigtimedwait(&sig_mask, nullptr, &sig_timeout);
......@@ -143,7 +143,7 @@ TEST(Process, KillExitStatus)
XORG_TESTCASE("a child process killed must have a state of\n"
"FINISHED_FAILURE");
Process p;
p.Start(TEST_ROOT_DIR "process-test-helper", nullptr);
p.Start(TEST_BUILD_DIR "process-test-helper", nullptr);
p.Kill(1000);
ASSERT_EQ(p.GetState(), Process::FINISHED_FAILURE);
}
......@@ -195,7 +195,7 @@ TEST(Process, DoubleStart)
/* job that must be killed, followed by job */
sigemptyset(&sig_mask);
sigaddset(&sig_mask, SIGUSR1);
p.Start(TEST_ROOT_DIR "process-test-helper", nullptr);
p.Start(TEST_BUILD_DIR "process-test-helper", nullptr);
sigtimedwait(&sig_mask, nullptr, &sig_timeout);
ASSERT_EQ(p.GetState(), Process::RUNNING);
p.Kill(100);
......@@ -215,7 +215,7 @@ TEST(Process, DoubleStart)
/* job that fails to terminate, starting another one must fail */
sigemptyset(&sig_mask);
sigaddset(&sig_mask, SIGUSR1);
p.Start(TEST_ROOT_DIR "process-test-helper", nullptr);
p.Start(TEST_BUILD_DIR "process-test-helper", nullptr);
sigtimedwait(&sig_mask, nullptr, &sig_timeout);
ASSERT_EQ(p.GetState(), Process::RUNNING);
ASSERT_FALSE(p.Terminate(100));
......@@ -338,7 +338,7 @@ TEST_P(ProcessValgrindArgsWrapper, ValgrindWrapperWithArgs)
/* now set the env and fire up valgrind */
setenv("XORG_GTEST_USE_VALGRIND", vargs.c_str(), 1);
Process p;
p.Start(TEST_ROOT_DIR "process-test-helper", nullptr);
p.Start(TEST_BUILD_DIR "process-test-helper", nullptr);
unsetenv("XORG_GTEST_USE_VALGRIND");
ASSERT_EQ(p.GetState(), Process::RUNNING);
......
......@@ -368,7 +368,7 @@ TEST(XServer, RemoveOption)
XServer server;
server.SetOption("-fail", "yes");
server.SetOption("-logfile", LOGFILE_DIR "/Xorg-remove-option.log");
server.Start(TEST_ROOT_DIR "/xserver-test-helper");
server.Start(TEST_BUILD_DIR "/xserver-test-helper");
while(i++ < 10 && server.GetState() == Process::RUNNING)
usleep(50000);
......@@ -376,7 +376,7 @@ TEST(XServer, RemoveOption)
ASSERT_EQ(server.GetState(), Process::FINISHED_FAILURE);
server.RemoveOption("-fail");
server.Start(TEST_ROOT_DIR "/xserver-test-helper");
server.Start(TEST_BUILD_DIR "/xserver-test-helper");
ASSERT_EQ(server.GetState(), Process::FINISHED_SUCCESS);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment