diff options
Diffstat (limited to 'webrtc/test/testsupport')
-rw-r--r-- | webrtc/test/testsupport/fileutils_unittest.cc | 17 | ||||
-rw-r--r-- | webrtc/test/testsupport/gtest_disable.h | 57 |
2 files changed, 14 insertions, 60 deletions
diff --git a/webrtc/test/testsupport/fileutils_unittest.cc b/webrtc/test/testsupport/fileutils_unittest.cc index dff7f2249b..e205db3ecf 100644 --- a/webrtc/test/testsupport/fileutils_unittest.cc +++ b/webrtc/test/testsupport/fileutils_unittest.cc @@ -16,7 +16,6 @@ #include <string> #include "testing/gtest/include/gtest/gtest.h" -#include "webrtc/test/testsupport/gtest_disable.h" #ifdef WIN32 #define chdir _chdir @@ -66,7 +65,14 @@ TEST_F(FileUtilsTest, ProjectRootPath) { } // Similar to the above test, but for the output dir -TEST_F(FileUtilsTest, DISABLED_ON_ANDROID(OutputPathFromUnchangedWorkingDir)) { +#if defined(WEBRTC_ANDROID) +#define MAYBE_OutputPathFromUnchangedWorkingDir \ + DISABLED_OutputPathFromUnchangedWorkingDir +#else +#define MAYBE_OutputPathFromUnchangedWorkingDir \ + OutputPathFromUnchangedWorkingDir +#endif +TEST_F(FileUtilsTest, MAYBE_OutputPathFromUnchangedWorkingDir) { std::string path = webrtc::test::OutputPath(); std::string expected_end = "out"; expected_end = kPathDelimiter + expected_end + kPathDelimiter; @@ -75,7 +81,12 @@ TEST_F(FileUtilsTest, DISABLED_ON_ANDROID(OutputPathFromUnchangedWorkingDir)) { // Tests with current working directory set to a directory higher up in the // directory tree than the project root dir. -TEST_F(FileUtilsTest, DISABLED_ON_ANDROID(OutputPathFromRootWorkingDir)) { +#if defined(WEBRTC_ANDROID) +#define MAYBE_OutputPathFromRootWorkingDir DISABLED_OutputPathFromRootWorkingDir +#else +#define MAYBE_OutputPathFromRootWorkingDir OutputPathFromRootWorkingDir +#endif +TEST_F(FileUtilsTest, MAYBE_OutputPathFromRootWorkingDir) { ASSERT_EQ(0, chdir(kPathDelimiter)); ASSERT_EQ("./", webrtc::test::OutputPath()); } diff --git a/webrtc/test/testsupport/gtest_disable.h b/webrtc/test/testsupport/gtest_disable.h deleted file mode 100644 index fdc56acc05..0000000000 --- a/webrtc/test/testsupport/gtest_disable.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#ifndef TEST_TESTSUPPORT_INCLUDE_GTEST_DISABLE_H_ -#define TEST_TESTSUPPORT_INCLUDE_GTEST_DISABLE_H_ - -// Helper macros for platform disables. These can be chained. Example use: -// TEST_F(ViEStandardIntegrationTest, -// DISABLED_ON_LINUX(RunsBaseTestWithoutErrors)) { // ... -// -// Or, you can disable a whole test class by wrapping all mentions of the test -// class name inside one of these macros. -// -// The platform #defines we are looking at here are set by the build system. -#ifdef WEBRTC_LINUX -#define DISABLED_ON_LINUX(test) DISABLED_##test -#else -#define DISABLED_ON_LINUX(test) test -#endif - -#ifdef WEBRTC_MAC -#define DISABLED_ON_MAC(test) DISABLED_##test -#else -#define DISABLED_ON_MAC(test) test -#endif - -#ifdef _WIN32 -#define DISABLED_ON_WIN(test) DISABLED_##test -#else -#define DISABLED_ON_WIN(test) test -#endif - -// Using some extra magic here to be able to chain Android and iOS macros. -// http://stackoverflow.com/questions/8231966/why-do-i-need-double-layer-of-indirection-for-macros -#ifdef WEBRTC_ANDROID -#define DISABLED_ON_ANDROID_HIDDEN(test) DISABLED_##test -#define DISABLED_ON_ANDROID(test) DISABLED_ON_ANDROID_HIDDEN(test) -#else -#define DISABLED_ON_ANDROID_HIDDEN(test) test -#define DISABLED_ON_ANDROID(test) DISABLED_ON_ANDROID_HIDDEN(test) -#endif - -#ifdef WEBRTC_IOS -#define DISABLED_ON_IOS_HIDDEN(test) DISABLED_##test -#define DISABLED_ON_IOS(test) DISABLED_ON_IOS_HIDDEN(test) -#else -#define DISABLED_ON_IOS_HIDDEN(test) test -#define DISABLED_ON_IOS(test) DISABLED_ON_IOS_HIDDEN(test) -#endif - -#endif // TEST_TESTSUPPORT_INCLUDE_GTEST_DISABLE_H_ |