[PATCH] D16654: using /system/bin/sh on android in tests.

Mike Aizatsky via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 27 15:41:51 PST 2016


aizatsky updated this revision to Diff 46187.
aizatsky added a comment.

nits


http://reviews.llvm.org/D16654

Files:
  lib/sanitizer_common/tests/sanitizer_linux_test.cc

Index: lib/sanitizer_common/tests/sanitizer_linux_test.cc
===================================================================
--- lib/sanitizer_common/tests/sanitizer_linux_test.cc
+++ lib/sanitizer_common/tests/sanitizer_linux_test.cc
@@ -266,9 +266,14 @@
 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 = "/bin/sh";
+#else
+  const char *shell = "/system/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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16654.46187.patch
Type: text/x-patch
Size: 921 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160127/a7c3a5a8/attachment.bin>


More information about the llvm-commits mailing list