From 5d682ca7a1d2bb3ca7de2bbb469281e07ea85bde Mon Sep 17 00:00:00 2001 From: kthelgason Date: Tue, 10 Jan 2017 03:00:41 -0800 Subject: [PATCH] Disable some filesystem tests that don't make sense on iOS. BUG=webrtc:5571 NOTRY=true Review-Url: https://codereview.webrtc.org/2627583002 Cr-Commit-Position: refs/heads/master@{#15981} --- webrtc/build/ios/tests/common_tests.json | 3 +++ webrtc/test/testsupport/fileutils_unittest.cc | 13 ++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/webrtc/build/ios/tests/common_tests.json b/webrtc/build/ios/tests/common_tests.json index 3afb645517..30d557f953 100644 --- a/webrtc/build/ios/tests/common_tests.json +++ b/webrtc/build/ios/tests/common_tests.json @@ -18,6 +18,9 @@ { "app": "system_wrappers_unittests" }, + { + "app": "test_support_unittests" + }, { "app": "voice_engine_unittests" } diff --git a/webrtc/test/testsupport/fileutils_unittest.cc b/webrtc/test/testsupport/fileutils_unittest.cc index 5e36c35f77..f7ddb1539b 100644 --- a/webrtc/test/testsupport/fileutils_unittest.cc +++ b/webrtc/test/testsupport/fileutils_unittest.cc @@ -58,7 +58,7 @@ std::string FileUtilsTest::original_working_dir_ = ""; // directory that is automatically set when the test executable is launched. // The test is not fully testing the implementation, since we cannot be sure // of where the executable was launched from. -#if defined(WEBRTC_ANDROID) +#if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) #define MAYBE_OutputPathFromUnchangedWorkingDir \ DISABLED_OutputPathFromUnchangedWorkingDir #else @@ -74,7 +74,7 @@ TEST_F(FileUtilsTest, MAYBE_OutputPathFromUnchangedWorkingDir) { // Tests with current working directory set to a directory higher up in the // directory tree than the project root dir. -#if defined(WEBRTC_ANDROID) || defined(WIN32) +#if defined(WEBRTC_ANDROID) || defined(WIN32) || defined(WEBRTC_IOS) #define MAYBE_OutputPathFromRootWorkingDir DISABLED_OutputPathFromRootWorkingDir #else #define MAYBE_OutputPathFromRootWorkingDir OutputPathFromRootWorkingDir @@ -93,7 +93,12 @@ TEST_F(FileUtilsTest, TempFilename) { } // Only tests that the code executes -TEST_F(FileUtilsTest, CreateDir) { +#if defined(WEBRTC_IOS) +#define MAYBE_CreateDir DISABLED_CreateDir +#else +#define MAYBE_CreateDir CreateDir +#endif +TEST_F(FileUtilsTest, MAYBE_CreateDir) { std::string directory = "fileutils-unittest-empty-dir"; // Make sure it's removed if a previous test has failed: remove(directory.c_str()); @@ -121,7 +126,9 @@ TEST_F(FileUtilsTest, ResourcePathReturnsValue) { TEST_F(FileUtilsTest, ResourcePathFromRootWorkingDir) { ASSERT_EQ(0, chdir(kPathDelimiter)); std::string resource = webrtc::test::ResourcePath(kTestName, kExtension); +#if !defined(WEBRTC_IOS) ASSERT_NE(resource.find("resources"), std::string::npos); +#endif ASSERT_GT(resource.find(kTestName), 0u); ASSERT_GT(resource.find(kExtension), 0u); }