diff options
author | Mike Aizatsky <aizatsky@chromium.org> | 2016-01-27 23:58:23 +0000 |
---|---|---|
committer | Mike Aizatsky <aizatsky@chromium.org> | 2016-01-27 23:58:23 +0000 |
commit | 4bb20747fe25d4de653309d7022bc299b3e55c8a (patch) | |
tree | af205b60e77e9828445fc4a27d2982ed00f91453 /lib/sanitizer_common/tests | |
parent | 331b8d08ba07668ce06a15a8f310ba4fa9543296 (diff) |
using /system/bin/sh on android in tests.
Subscribers: tberghammer, danalbert, srhines
Differential Revision: http://reviews.llvm.org/D16654
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@259001 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/tests')
-rw-r--r-- | lib/sanitizer_common/tests/sanitizer_linux_test.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/sanitizer_common/tests/sanitizer_linux_test.cc b/lib/sanitizer_common/tests/sanitizer_linux_test.cc index 92d495e10..277d14ecf 100644 --- a/lib/sanitizer_common/tests/sanitizer_linux_test.cc +++ b/lib/sanitizer_common/tests/sanitizer_linux_test.cc @@ -266,9 +266,14 @@ TEST(SanitizerLinux, ThreadSelfTest) { TEST(SanitizerCommon, StartSubprocessTest) { int pipe_fds[2]; ASSERT_EQ(0, pipe(pipe_fds)); - const char *argv[] = {"/bin/sh", "-c", "echo -n 'hello'"}; - int pid = StartSubprocess("/bin/sh", const_cast<char **>(&argv[0]), - kInvalidFd /* stdin */, pipe_fds[1] /* stdout */); +#if SANITIZER_ANDROID + const char *shell = "/system/bin/sh"; +#else + const char *shell = "/bin/sh"; +#endif + const char *argv[] = {shell, "-c", "echo -n 'hello'"}; + int pid = StartSubprocess(shell, argv, + /* stdin */ kInvalidFd, /* stdout */ pipe_fds[1]); ASSERT_GT(pid, 0); // wait for process to finish. |