[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:56:21 PST 2016


aizatsky updated this revision to Diff 46190.
aizatsky marked an inline comment as done.
aizatsky added a comment.

nit


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 = "/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.


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


More information about the llvm-commits mailing list