Fix tests for Android.
Test: ./run_tests.py --bitness 32 Test: ./run_tests.py --bitness 64 Test: ./run_tests.py --bitness 64 --host Bug: None Change-Id: I8746cdf3e5dd57603a2487b7d9b082b3cd8f8474
This commit is contained in:
@@ -159,7 +159,7 @@ TEST_CASE(test_no_resolve_symlink_on_symlink)
|
|||||||
{perms::owner_all, perms::group_all, perm_options::remove},
|
{perms::owner_all, perms::group_all, perm_options::remove},
|
||||||
};
|
};
|
||||||
for (auto const& TC : cases) {
|
for (auto const& TC : cases) {
|
||||||
#if defined(__APPLE__) || defined(__FreeBSD__)
|
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__ANDROID__)
|
||||||
// On OS X symlink permissions are supported. We should get an empty
|
// On OS X symlink permissions are supported. We should get an empty
|
||||||
// error code and the expected permissions.
|
// error code and the expected permissions.
|
||||||
const auto expected_link_perms = TC.expected;
|
const auto expected_link_perms = TC.expected;
|
||||||
|
|||||||
@@ -72,7 +72,11 @@ TEST_CASE(basic_test) {
|
|||||||
{cwd, "a", ".."},
|
{cwd, "a", ".."},
|
||||||
{parent_cwd, "a", "../.."},
|
{parent_cwd, "a", "../.."},
|
||||||
{"a", cwd, "a"},
|
{"a", cwd, "a"},
|
||||||
|
#if !defined(__ANDROID__)
|
||||||
|
// Android tests are run via a RemoteExecutor, where the parent directory
|
||||||
|
// is a temporary directory with no fixed name.
|
||||||
{"a", parent_cwd, "fs.op.proximate/a"},
|
{"a", parent_cwd, "fs.op.proximate/a"},
|
||||||
|
#endif
|
||||||
{"/", "a", dot_dot_to_root / ".."},
|
{"/", "a", dot_dot_to_root / ".."},
|
||||||
{"/", "a/b", dot_dot_to_root / "../.."},
|
{"/", "a/b", dot_dot_to_root / "../.."},
|
||||||
{"/", "a/b/", dot_dot_to_root / "../../.."},
|
{"/", "a/b/", dot_dot_to_root / "../../.."},
|
||||||
|
|||||||
@@ -112,9 +112,17 @@ TEST_CASE(basic_tests)
|
|||||||
{
|
{
|
||||||
std::error_code ec = GetTestEC();
|
std::error_code ec = GetTestEC();
|
||||||
path ret = temp_directory_path(ec);
|
path ret = temp_directory_path(ec);
|
||||||
|
#if defined(__ANDROID__)
|
||||||
|
// Android has no globally writable storage and thus this API does not
|
||||||
|
// work without environment configuration.
|
||||||
|
TEST_CHECK(ec != GetTestEC());
|
||||||
|
TEST_CHECK(ec);
|
||||||
|
TEST_CHECK(ret == "");
|
||||||
|
#else
|
||||||
TEST_CHECK(!ec);
|
TEST_CHECK(!ec);
|
||||||
TEST_CHECK(ret == "/tmp");
|
TEST_CHECK(ret == "/tmp");
|
||||||
TEST_CHECK(is_directory(ret));
|
TEST_CHECK(is_directory(ret));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user