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 {
|
|
|
|
|
|
|
|
|
|
TEST(PerfTest, 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-22 16:32:01 +01:00
|
|
|
PrintResult( "foo", "bar", "baz", 7, "widgets", true);
|
|
|
|
|
|
|
|
|
|
std::string output = testing::internal::GetCapturedStdout();
|
2012-11-20 00:20:20 +00:00
|
|
|
EXPECT_EQ(expected, output);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace test
|
|
|
|
|
} // namespace webrtc
|