Remove DISABLED_ON_ macros.

Macro incorrectly displays DISABLED_ON_ANDROID in test names for
parameterized tests under --gtest_list_tests, causing tests to be
disabled on all platforms since they contain the DISABLED_ prefix rather
than their expanded variants.

This expands the macro variants to inline if they're disabled or not,
and removes building some tests under configurations where they should
fail, instead of building them but disabling them by default.

The change also removes gtest_disable.h as an unused include from many
other files.

BUG=webrtc:5387, webrtc:5400
R=kjellander@webrtc.org, phoglund@webrtc.org
TBR=henrik.lundin@webrtc.org

Review URL: https://codereview.webrtc.org/1547343002 .

Cr-Commit-Position: refs/heads/master@{#11150}
This commit is contained in:
Peter Boström
2016-01-04 22:44:05 +01:00
parent 13f61dfea5
commit e2976c87f7
54 changed files with 524 additions and 271 deletions

View File

@ -14,7 +14,6 @@ extern "C" {
}
#include "webrtc/modules/audio_processing/aec/echo_cancellation_internal.h"
#include "webrtc/modules/audio_processing/aec/echo_cancellation.h"
#include "webrtc/test/testsupport/gtest_disable.h"
#include "webrtc/typedefs.h"
namespace {

View File

@ -14,7 +14,6 @@ extern "C" {
#include "webrtc/modules/audio_processing/aec/aec_core.h"
}
#include "webrtc/modules/audio_processing/include/audio_processing.h"
#include "webrtc/test/testsupport/gtest_disable.h"
namespace webrtc {

View File

@ -28,7 +28,6 @@
#include "webrtc/system_wrappers/include/event_wrapper.h"
#include "webrtc/system_wrappers/include/trace.h"
#include "webrtc/test/testsupport/fileutils.h"
#include "webrtc/test/testsupport/gtest_disable.h"
#ifdef WEBRTC_ANDROID_PLATFORM_BUILD
#include "gtest/gtest.h"
#include "external/webrtc/webrtc/modules/audio_processing/test/unittest.pb.h"

View File

@ -17,7 +17,6 @@
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/system_wrappers/include/file_wrapper.h"
#include "webrtc/test/testsupport/fileutils.h"
#include "webrtc/test/testsupport/gtest_disable.h"
#include "webrtc/typedefs.h"
namespace webrtc {
@ -59,7 +58,12 @@ class TransientFileUtilsTest: public ::testing::Test {
const std::string kTestFileNamef;
};
TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(ConvertByteArrayToFloat)) {
#if defined(WEBRTC_IOS)
#define MAYBE_ConvertByteArrayToFloat DISABLED_ConvertByteArrayToFloat
#else
#define MAYBE_ConvertByteArrayToFloat ConvertByteArrayToFloat
#endif
TEST_F(TransientFileUtilsTest, MAYBE_ConvertByteArrayToFloat) {
float value = 0.0;
EXPECT_EQ(0, ConvertByteArrayToFloat(kPiBytesf, &value));
@ -72,7 +76,12 @@ TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(ConvertByteArrayToFloat)) {
EXPECT_FLOAT_EQ(kAvogadro, value);
}
TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(ConvertByteArrayToDouble)) {
#if defined(WEBRTC_IOS)
#define MAYBE_ConvertByteArrayToDouble DISABLED_ConvertByteArrayToDouble
#else
#define MAYBE_ConvertByteArrayToDouble ConvertByteArrayToDouble
#endif
TEST_F(TransientFileUtilsTest, MAYBE_ConvertByteArrayToDouble) {
double value = 0.0;
EXPECT_EQ(0, ConvertByteArrayToDouble(kPiBytes, &value));
@ -85,7 +94,12 @@ TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(ConvertByteArrayToDouble)) {
EXPECT_DOUBLE_EQ(kAvogadro, value);
}
TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(ConvertFloatToByteArray)) {
#if defined(WEBRTC_IOS)
#define MAYBE_ConvertFloatToByteArray DISABLED_ConvertFloatToByteArray
#else
#define MAYBE_ConvertFloatToByteArray ConvertFloatToByteArray
#endif
TEST_F(TransientFileUtilsTest, MAYBE_ConvertFloatToByteArray) {
rtc::scoped_ptr<uint8_t[]> bytes(new uint8_t[4]);
EXPECT_EQ(0, ConvertFloatToByteArray(kPi, bytes.get()));
@ -98,7 +112,12 @@ TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(ConvertFloatToByteArray)) {
EXPECT_EQ(0, memcmp(bytes.get(), kAvogadroBytesf, 4));
}
TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(ConvertDoubleToByteArray)) {
#if defined(WEBRTC_IOS)
#define MAYBE_ConvertDoubleToByteArray DISABLED_ConvertDoubleToByteArray
#else
#define MAYBE_ConvertDoubleToByteArray ConvertDoubleToByteArray
#endif
TEST_F(TransientFileUtilsTest, MAYBE_ConvertDoubleToByteArray) {
rtc::scoped_ptr<uint8_t[]> bytes(new uint8_t[8]);
EXPECT_EQ(0, ConvertDoubleToByteArray(kPi, bytes.get()));
@ -111,7 +130,12 @@ TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(ConvertDoubleToByteArray)) {
EXPECT_EQ(0, memcmp(bytes.get(), kAvogadroBytes, 8));
}
TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(ReadInt16BufferFromFile)) {
#if defined(WEBRTC_IOS)
#define MAYBE_ReadInt16BufferFromFile DISABLED_ReadInt16BufferFromFile
#else
#define MAYBE_ReadInt16BufferFromFile ReadInt16BufferFromFile
#endif
TEST_F(TransientFileUtilsTest, MAYBE_ReadInt16BufferFromFile) {
std::string test_filename = kTestFileName;
rtc::scoped_ptr<FileWrapper> file(FileWrapper::Create());
@ -149,8 +173,13 @@ TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(ReadInt16BufferFromFile)) {
EXPECT_EQ(17631, buffer[kBufferLength - 1]);
}
TEST_F(TransientFileUtilsTest,
DISABLED_ON_IOS(ReadInt16FromFileToFloatBuffer)) {
#if defined(WEBRTC_IOS)
#define MAYBE_ReadInt16FromFileToFloatBuffer \
DISABLED_ReadInt16FromFileToFloatBuffer
#else
#define MAYBE_ReadInt16FromFileToFloatBuffer ReadInt16FromFileToFloatBuffer
#endif
TEST_F(TransientFileUtilsTest, MAYBE_ReadInt16FromFileToFloatBuffer) {
std::string test_filename = kTestFileName;
rtc::scoped_ptr<FileWrapper> file(FileWrapper::Create());
@ -191,8 +220,13 @@ TEST_F(TransientFileUtilsTest,
EXPECT_DOUBLE_EQ(17631, buffer[kBufferLength - 1]);
}
TEST_F(TransientFileUtilsTest,
DISABLED_ON_IOS(ReadInt16FromFileToDoubleBuffer)) {
#if defined(WEBRTC_IOS)
#define MAYBE_ReadInt16FromFileToDoubleBuffer \
DISABLED_ReadInt16FromFileToDoubleBuffer
#else
#define MAYBE_ReadInt16FromFileToDoubleBuffer ReadInt16FromFileToDoubleBuffer
#endif
TEST_F(TransientFileUtilsTest, MAYBE_ReadInt16FromFileToDoubleBuffer) {
std::string test_filename = kTestFileName;
rtc::scoped_ptr<FileWrapper> file(FileWrapper::Create());
@ -232,7 +266,12 @@ TEST_F(TransientFileUtilsTest,
EXPECT_DOUBLE_EQ(17631, buffer[kBufferLength - 1]);
}
TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(ReadFloatBufferFromFile)) {
#if defined(WEBRTC_IOS)
#define MAYBE_ReadFloatBufferFromFile DISABLED_ReadFloatBufferFromFile
#else
#define MAYBE_ReadFloatBufferFromFile ReadFloatBufferFromFile
#endif
TEST_F(TransientFileUtilsTest, MAYBE_ReadFloatBufferFromFile) {
std::string test_filename = kTestFileNamef;
rtc::scoped_ptr<FileWrapper> file(FileWrapper::Create());
@ -269,7 +308,12 @@ TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(ReadFloatBufferFromFile)) {
EXPECT_FLOAT_EQ(kAvogadro, buffer[2]);
}
TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(ReadDoubleBufferFromFile)) {
#if defined(WEBRTC_IOS)
#define MAYBE_ReadDoubleBufferFromFile DISABLED_ReadDoubleBufferFromFile
#else
#define MAYBE_ReadDoubleBufferFromFile ReadDoubleBufferFromFile
#endif
TEST_F(TransientFileUtilsTest, MAYBE_ReadDoubleBufferFromFile) {
std::string test_filename = kTestFileName;
rtc::scoped_ptr<FileWrapper> file(FileWrapper::Create());
@ -306,7 +350,12 @@ TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(ReadDoubleBufferFromFile)) {
EXPECT_DOUBLE_EQ(kAvogadro, buffer[2]);
}
TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(WriteInt16BufferToFile)) {
#if defined(WEBRTC_IOS)
#define MAYBE_WriteInt16BufferToFile DISABLED_WriteInt16BufferToFile
#else
#define MAYBE_WriteInt16BufferToFile WriteInt16BufferToFile
#endif
TEST_F(TransientFileUtilsTest, MAYBE_WriteInt16BufferToFile) {
rtc::scoped_ptr<FileWrapper> file(FileWrapper::Create());
std::string kOutFileName = test::TempFilename(test::OutputPath(),
@ -348,7 +397,12 @@ TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(WriteInt16BufferToFile)) {
kBufferLength * sizeof(written_buffer[0])));
}
TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(WriteFloatBufferToFile)) {
#if defined(WEBRTC_IOS)
#define MAYBE_WriteFloatBufferToFile DISABLED_WriteFloatBufferToFile
#else
#define MAYBE_WriteFloatBufferToFile WriteFloatBufferToFile
#endif
TEST_F(TransientFileUtilsTest, MAYBE_WriteFloatBufferToFile) {
rtc::scoped_ptr<FileWrapper> file(FileWrapper::Create());
std::string kOutFileName = test::TempFilename(test::OutputPath(),
@ -390,7 +444,12 @@ TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(WriteFloatBufferToFile)) {
kBufferLength * sizeof(written_buffer[0])));
}
TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(WriteDoubleBufferToFile)) {
#if defined(WEBRTC_IOS)
#define MAYBE_WriteDoubleBufferToFile DISABLED_WriteDoubleBufferToFile
#else
#define MAYBE_WriteDoubleBufferToFile WriteDoubleBufferToFile
#endif
TEST_F(TransientFileUtilsTest, MAYBE_WriteDoubleBufferToFile) {
rtc::scoped_ptr<FileWrapper> file(FileWrapper::Create());
std::string kOutFileName = test::TempFilename(test::OutputPath(),
@ -432,7 +491,12 @@ TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(WriteDoubleBufferToFile)) {
kBufferLength * sizeof(written_buffer[0])));
}
TEST_F(TransientFileUtilsTest, DISABLED_ON_IOS(ExpectedErrorReturnValues)) {
#if defined(WEBRTC_IOS)
#define MAYBE_ExpectedErrorReturnValues DISABLED_ExpectedErrorReturnValues
#else
#define MAYBE_ExpectedErrorReturnValues ExpectedErrorReturnValues
#endif
TEST_F(TransientFileUtilsTest, MAYBE_ExpectedErrorReturnValues) {
std::string test_filename = kTestFileName;
double value;

View File

@ -19,8 +19,7 @@
#include "webrtc/modules/audio_processing/transient/file_utils.h"
#include "webrtc/system_wrappers/include/file_wrapper.h"
#include "webrtc/test/testsupport/fileutils.h"
#include "webrtc/test/testsupport/gtest_disable.h"
#include "webrtc/typedefs.h"
#include "webrtc/typedefs.h"
namespace webrtc {
@ -37,7 +36,11 @@ static const size_t kNumberOfSampleRates =
// The files contain all the results in double precision (Little endian).
// The audio files used with different sample rates are stored in the same
// directory.
TEST(TransientDetectorTest, DISABLED_ON_IOS(CorrectnessBasedOnFiles)) {
#if defined(WEBRTC_IOS)
TEST(TransientDetectorTest, DISABLED_CorrectnessBasedOnFiles) {
#else
TEST(TransientDetectorTest, CorrectnessBasedOnFiles) {
#endif
for (size_t i = 0; i < kNumberOfSampleRates; ++i) {
int sample_rate_hz = kSampleRatesHz[i];

View File

@ -19,7 +19,6 @@
#include "webrtc/modules/audio_processing/transient/file_utils.h"
#include "webrtc/system_wrappers/include/file_wrapper.h"
#include "webrtc/test/testsupport/fileutils.h"
#include "webrtc/test/testsupport/gtest_disable.h"
namespace webrtc {
@ -69,7 +68,11 @@ TEST(WPDTreeTest, Construction) {
// It also writes the results in its own set of files in the out directory.
// Matlab and output files contain all the results in double precision (Little
// endian) appended.
TEST(WPDTreeTest, DISABLED_ON_IOS(CorrectnessBasedOnMatlabFiles)) {
#if defined(WEBRTC_IOS)
TEST(WPDTreeTest, DISABLED_CorrectnessBasedOnMatlabFiles) {
#else
TEST(WPDTreeTest, CorrectnessBasedOnMatlabFiles) {
#endif
// 10 ms at 16000 Hz.
const size_t kTestBufferSize = 160;
const int kLevels = 3;

View File

@ -16,7 +16,6 @@
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/modules/include/module_common_types.h"
#include "webrtc/test/testsupport/fileutils.h"
#include "webrtc/test/testsupport/gtest_disable.h"
namespace webrtc {
@ -55,7 +54,11 @@ TEST(StandaloneVadTest, Api) {
EXPECT_EQ(kMode, vad->mode());
}
TEST(StandaloneVadTest, DISABLED_ON_IOS(ActivityDetection)) {
#if defined(WEBRTC_IOS)
TEST(StandaloneVadTest, DISABLED_ActivityDetection) {
#else
TEST(StandaloneVadTest, ActivityDetection) {
#endif
rtc::scoped_ptr<StandaloneVad> vad(StandaloneVad::Create());
const size_t kDataLength = kLength10Ms;
int16_t data[kDataLength] = {0};