
It seems 'testing::internal::CaptureStdout()' causes problems when running on real iOS devices. No-Try: true Bug: webrtc:8592 Change-Id: Ia7ee636034c6bd1a1ad7a4fb6a2d32e236f64205 Reviewed-on: https://webrtc-review.googlesource.com/27140 Reviewed-by: Patrik Höglund <phoglund@webrtc.org> Commit-Queue: Edward Lemur <ehmaldonado@webrtc.org> Cr-Commit-Position: refs/heads/master@{#20948}
45 lines
1.3 KiB
C++
45 lines
1.3 KiB
C++
/*
|
|
* 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.
|
|
*/
|
|
|
|
#include "test/testsupport/perf_test.h"
|
|
|
|
#include <string>
|
|
|
|
#include "test/gtest.h"
|
|
|
|
namespace webrtc {
|
|
namespace test {
|
|
|
|
#if defined(WEBRTC_IOS)
|
|
#define MAYBE_AppendResult DISABLED_AppendResult
|
|
#else
|
|
#define MAYBE_AppendResult AppendResult
|
|
#endif
|
|
TEST(PerfTest, MAYBE_AppendResult) {
|
|
testing::internal::CaptureStdout();
|
|
std::string expected = "RESULT measurementmodifier: trace= 42 units\n";
|
|
PrintResult("measurement", "modifier", "trace", 42, "units", false);
|
|
|
|
expected += "*RESULT foobar: baz= 7 widgets\n";
|
|
PrintResult("foo", "bar", "baz", 7, "widgets", true);
|
|
|
|
expected += "RESULT foobar: baz= {1,2} lemurs\n";
|
|
PrintResultMeanAndError("foo", "bar", "baz", 1, 2, "lemurs", false);
|
|
|
|
expected += "RESULT foobar: baz= [1,2,3] units\n";
|
|
PrintResultList("foo", "bar", "baz", {1, 2, 3}, "units", false);
|
|
|
|
std::string output = testing::internal::GetCapturedStdout();
|
|
EXPECT_EQ(expected, output);
|
|
}
|
|
|
|
} // namespace test
|
|
} // namespace webrtc
|