From 5ca76f3cd285f04bc35de4998bd308493fd5ea1d Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Thu, 20 Dec 2018 12:38:01 -0800 Subject: [PATCH] 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 --- .../fs.op.funcs/fs.op.permissions/permissions.pass.cpp | 2 +- .../fs.op.funcs/fs.op.proximate/proximate.pass.cpp | 4 ++++ .../fs.op.temp_dir_path/temp_directory_path.pass.cpp | 8 ++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/test/std/input.output/filesystems/fs.op.funcs/fs.op.permissions/permissions.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.permissions/permissions.pass.cpp index cbe2b2d09..9030b93a3 100644 --- a/test/std/input.output/filesystems/fs.op.funcs/fs.op.permissions/permissions.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.permissions/permissions.pass.cpp @@ -159,7 +159,7 @@ TEST_CASE(test_no_resolve_symlink_on_symlink) {perms::owner_all, perms::group_all, perm_options::remove}, }; 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 // error code and the expected permissions. const auto expected_link_perms = TC.expected; diff --git a/test/std/input.output/filesystems/fs.op.funcs/fs.op.proximate/proximate.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.proximate/proximate.pass.cpp index 5f7b30dd6..ace8b7d69 100644 --- a/test/std/input.output/filesystems/fs.op.funcs/fs.op.proximate/proximate.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.proximate/proximate.pass.cpp @@ -72,7 +72,11 @@ TEST_CASE(basic_test) { {cwd, "a", ".."}, {parent_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"}, +#endif {"/", "a", dot_dot_to_root / ".."}, {"/", "a/b", dot_dot_to_root / "../.."}, {"/", "a/b/", dot_dot_to_root / "../../.."}, diff --git a/test/std/input.output/filesystems/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp b/test/std/input.output/filesystems/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp index 523e429cf..4f83e0f22 100644 --- a/test/std/input.output/filesystems/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp +++ b/test/std/input.output/filesystems/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp @@ -112,9 +112,17 @@ TEST_CASE(basic_tests) { std::error_code ec = GetTestEC(); 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(ret == "/tmp"); TEST_CHECK(is_directory(ret)); +#endif } }