aboutsummaryrefslogtreecommitdiff
path: root/tests/gtest_globals.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/gtest_globals.cpp')
-rw-r--r--tests/gtest_globals.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/gtest_globals.cpp b/tests/gtest_globals.cpp
index 607544a65..5b5ede8d4 100644
--- a/tests/gtest_globals.cpp
+++ b/tests/gtest_globals.cpp
@@ -24,12 +24,13 @@
#include <string>
std::string GetTestlibRoot() {
- // Calculate ANDROID_DATA assuming the binary is in "$ANDROID_DATA/somedir/binary-dir/binary"
- std::string path = android::base::Dirname(android::base::GetExecutablePath()) + "/..";
+ // Typically the executable is /data/nativetest[64]/bionic-unit-tests/bionic-unit-tests, and the
+ // test libraries are in /data/nativetest[64]/bionic-loader-test-libs.
+ std::string path = android::base::GetExecutableDirectory() + "/..";
std::string out_path;
if (!android::base::Realpath(path.c_str(), &out_path)) {
- printf("Failed to get realpath for \"%s\"", path.c_str());
+ printf("Failed to get realpath for \"%s\"\n", path.c_str());
abort();
}
@@ -37,7 +38,7 @@ std::string GetTestlibRoot() {
std::string real_path;
if (!android::base::Realpath(out_path, &real_path)) {
- printf("\"%s\": does not exists", out_path.c_str());
+ printf("\"%s\": does not exists\n", out_path.c_str());
abort();
}