2012-11-20 00:20:20 +00:00
|
|
|
/*
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "test/testsupport/perf_test.h"
|
2012-11-20 00:20:20 +00:00
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "test/gtest.h"
|
2012-11-20 00:20:20 +00:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
namespace test {
|
|
|
|
|
|
2017-11-29 20:29:30 +01:00
|
|
|
#if defined(WEBRTC_IOS)
|
|
|
|
|
#define MAYBE_AppendResult DISABLED_AppendResult
|
|
|
|
|
#else
|
|
|
|
|
#define MAYBE_AppendResult AppendResult
|
|
|
|
|
#endif
|
|
|
|
|
TEST(PerfTest, MAYBE_AppendResult) {
|
2017-11-22 16:32:01 +01:00
|
|
|
testing::internal::CaptureStdout();
|
2012-11-20 00:20:20 +00:00
|
|
|
std::string expected = "RESULT measurementmodifier: trace= 42 units\n";
|
2017-11-22 16:32:01 +01:00
|
|
|
PrintResult("measurement", "modifier", "trace", 42, "units", false);
|
2012-11-20 00:20:20 +00:00
|
|
|
|
|
|
|
|
expected += "*RESULT foobar: baz= 7 widgets\n";
|
2017-11-24 13:40:01 +01:00
|
|
|
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);
|
2017-11-22 16:32:01 +01:00
|
|
|
|
|
|
|
|
std::string output = testing::internal::GetCapturedStdout();
|
2012-11-20 00:20:20 +00:00
|
|
|
EXPECT_EQ(expected, output);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace test
|
|
|
|
|
} // namespace webrtc
|