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

@ -11,11 +11,15 @@
#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
#include "webrtc/modules/video_processing/include/video_processing.h"
#include "webrtc/modules/video_processing/test/video_processing_unittest.h"
#include "webrtc/test/testsupport/gtest_disable.h"
namespace webrtc {
TEST_F(VideoProcessingTest, DISABLED_ON_IOS(BrightnessDetection)) {
#if defined(WEBRTC_IOS)
#define MAYBE_BrightnessDetection DISABLED_BrightnessDetection
#else
#define MAYBE_BrightnessDetection BrightnessDetection
#endif
TEST_F(VideoProcessingTest, MAYBE_BrightnessDetection) {
uint32_t frameNum = 0;
int32_t brightnessWarning = 0;
uint32_t warningCount = 0;

View File

@ -12,11 +12,14 @@
#include "webrtc/modules/video_processing/include/video_processing.h"
#include "webrtc/modules/video_processing/content_analysis.h"
#include "webrtc/modules/video_processing/test/video_processing_unittest.h"
#include "webrtc/test/testsupport/gtest_disable.h"
namespace webrtc {
TEST_F(VideoProcessingTest, DISABLED_ON_IOS(ContentAnalysis)) {
#if defined(WEBRTC_IOS)
TEST_F(VideoProcessingTest, DISABLED_ContentAnalysis) {
#else
TEST_F(VideoProcessingTest, ContentAnalysis) {
#endif
VPMContentAnalysis ca__c(false);
VPMContentAnalysis ca__sse(true);
VideoContentMetrics* _cM_c;

View File

@ -16,11 +16,14 @@
#include "webrtc/modules/video_processing/test/video_processing_unittest.h"
#include "webrtc/system_wrappers/include/tick_util.h"
#include "webrtc/test/testsupport/fileutils.h"
#include "webrtc/test/testsupport/gtest_disable.h"
namespace webrtc {
TEST_F(VideoProcessingTest, DISABLED_ON_IOS(Deflickering)) {
#if defined(WEBRTC_IOS)
TEST_F(VideoProcessingTest, DISABLED_Deflickering) {
#else
TEST_F(VideoProcessingTest, Deflickering) {
#endif
enum { NumRuns = 30 };
uint32_t frameNum = 0;
const uint32_t frame_rate = 15;

View File

@ -17,7 +17,6 @@
#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
#include "webrtc/system_wrappers/include/tick_util.h"
#include "webrtc/test/testsupport/fileutils.h"
#include "webrtc/test/testsupport/gtest_disable.h"
namespace webrtc {
@ -92,7 +91,11 @@ void VideoProcessingTest::TearDown() {
vp_ = NULL;
}
TEST_F(VideoProcessingTest, DISABLED_ON_IOS(HandleNullBuffer)) {
#if defined(WEBRTC_IOS)
TEST_F(VideoProcessingTest, DISABLED_HandleNullBuffer) {
#else
TEST_F(VideoProcessingTest, HandleNullBuffer) {
#endif
// TODO(mikhal/stefan): Do we need this one?
VideoProcessing::FrameStats stats;
// Video frame with unallocated buffer.
@ -106,7 +109,11 @@ TEST_F(VideoProcessingTest, DISABLED_ON_IOS(HandleNullBuffer)) {
EXPECT_EQ(-3, vp_->BrightnessDetection(videoFrame, stats));
}
TEST_F(VideoProcessingTest, DISABLED_ON_IOS(HandleBadStats)) {
#if defined(WEBRTC_IOS)
TEST_F(VideoProcessingTest, DISABLED_HandleBadStats) {
#else
TEST_F(VideoProcessingTest, HandleBadStats) {
#endif
VideoProcessing::FrameStats stats;
vp_->ClearFrameStats(&stats);
rtc::scoped_ptr<uint8_t[]> video_buffer(new uint8_t[frame_length_]);
@ -120,7 +127,11 @@ TEST_F(VideoProcessingTest, DISABLED_ON_IOS(HandleBadStats)) {
EXPECT_EQ(-3, vp_->BrightnessDetection(video_frame_, stats));
}
TEST_F(VideoProcessingTest, DISABLED_ON_IOS(IdenticalResultsAfterReset)) {
#if defined(WEBRTC_IOS)
TEST_F(VideoProcessingTest, DISABLED_IdenticalResultsAfterReset) {
#else
TEST_F(VideoProcessingTest, IdenticalResultsAfterReset) {
#endif
VideoFrame video_frame2;
VideoProcessing::FrameStats stats;
// Only testing non-static functions here.
@ -153,7 +164,11 @@ TEST_F(VideoProcessingTest, DISABLED_ON_IOS(IdenticalResultsAfterReset)) {
EXPECT_TRUE(CompareFrames(video_frame_, video_frame2));
}
TEST_F(VideoProcessingTest, DISABLED_ON_IOS(FrameStats)) {
#if defined(WEBRTC_IOS)
TEST_F(VideoProcessingTest, DISABLED_FrameStats) {
#else
TEST_F(VideoProcessingTest, FrameStats) {
#endif
VideoProcessing::FrameStats stats;
vp_->ClearFrameStats(&stats);
rtc::scoped_ptr<uint8_t[]> video_buffer(new uint8_t[frame_length_]);
@ -178,7 +193,11 @@ TEST_F(VideoProcessingTest, DISABLED_ON_IOS(FrameStats)) {
EXPECT_FALSE(vp_->ValidFrameStats(stats));
}
TEST_F(VideoProcessingTest, DISABLED_ON_IOS(PreprocessorLogic)) {
#if defined(WEBRTC_IOS)
TEST_F(VideoProcessingTest, DISABLED_PreprocessorLogic) {
#else
TEST_F(VideoProcessingTest, PreprocessorLogic) {
#endif
// Disable temporal sampling (frame dropping).
vp_->EnableTemporalDecimation(false);
int resolution = 100;
@ -197,7 +216,11 @@ TEST_F(VideoProcessingTest, DISABLED_ON_IOS(PreprocessorLogic)) {
EXPECT_TRUE(vp_->PreprocessFrame(video_frame_) != nullptr);
}
TEST_F(VideoProcessingTest, DISABLED_ON_IOS(Resampler)) {
#if defined(WEBRTC_IOS)
TEST_F(VideoProcessingTest, DISABLED_Resampler) {
#else
TEST_F(VideoProcessingTest, Resampler) {
#endif
enum { NumRuns = 1 };
int64_t min_runtime = 0;