Fix minidump_writer_unittest on Android
Android doesn't have /bin/cp, so instead do the copy manually with CopyFile() Review URL: https://breakpad.appspot.com/442002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1022 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
parent
0efce7d2a8
commit
02f664dbf4
1 changed files with 3 additions and 4 deletions
|
@ -46,6 +46,7 @@
|
||||||
#include "common/linux/ignore_ret.h"
|
#include "common/linux/ignore_ret.h"
|
||||||
#include "common/linux/safe_readlink.h"
|
#include "common/linux/safe_readlink.h"
|
||||||
#include "common/tests/auto_tempdir.h"
|
#include "common/tests/auto_tempdir.h"
|
||||||
|
#include "common/tests/file_utils.h"
|
||||||
#include "common/using_std_string.h"
|
#include "common/using_std_string.h"
|
||||||
#include "google_breakpad/processor/minidump.h"
|
#include "google_breakpad/processor/minidump.h"
|
||||||
#include "processor/scoped_ptr.h"
|
#include "processor/scoped_ptr.h"
|
||||||
|
@ -328,10 +329,8 @@ TEST(MinidumpWriterTest, DeletedBinary) {
|
||||||
// Copy binary to a temp file.
|
// Copy binary to a temp file.
|
||||||
AutoTempDir temp_dir;
|
AutoTempDir temp_dir;
|
||||||
string binpath = temp_dir.path() + "/linux-dumper-unittest-helper";
|
string binpath = temp_dir.path() + "/linux-dumper-unittest-helper";
|
||||||
char cmdline[2 * PATH_MAX];
|
ASSERT_EQ(true, CopyFile(helper_path.c_str(), binpath.c_str())) \
|
||||||
sprintf(cmdline, "/bin/cp \"%s\" \"%s\"", helper_path.c_str(),
|
<< "Failed to copy " << helper_path << " to " << binpath;
|
||||||
binpath.c_str());
|
|
||||||
ASSERT_EQ(0, system(cmdline)) << "Failed to execute: " << cmdline;
|
|
||||||
ASSERT_EQ(0, chmod(binpath.c_str(), 0755));
|
ASSERT_EQ(0, chmod(binpath.c_str(), 0755));
|
||||||
|
|
||||||
int fds[2];
|
int fds[2];
|
||||||
|
|
Loading…
Reference in a new issue