blob: b88f7e1d4634756dc4c0d6b1574e9deee26a26cc [file] [log] [blame]
andrew@webrtc.org2009f6b2012-11-20 00:20:20 +00001/*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#include "test/testsupport/perf_test.h"
andrew@webrtc.org2009f6b2012-11-20 00:20:20 +000012
13#include <string>
14
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020015#include "test/gtest.h"
andrew@webrtc.org2009f6b2012-11-20 00:20:20 +000016
17namespace webrtc {
18namespace test {
19
20TEST(PerfTest, AppendResult) {
Edward Lemurf7ff3e82017-11-22 16:32:01 +010021 testing::internal::CaptureStdout();
andrew@webrtc.org2009f6b2012-11-20 00:20:20 +000022 std::string expected = "RESULT measurementmodifier: trace= 42 units\n";
Edward Lemurf7ff3e82017-11-22 16:32:01 +010023 PrintResult("measurement", "modifier", "trace", 42, "units", false);
andrew@webrtc.org2009f6b2012-11-20 00:20:20 +000024
25 expected += "*RESULT foobar: baz= 7 widgets\n";
Edward Lemurf7ff3e82017-11-22 16:32:01 +010026 PrintResult( "foo", "bar", "baz", 7, "widgets", true);
27
28 std::string output = testing::internal::GetCapturedStdout();
andrew@webrtc.org2009f6b2012-11-20 00:20:20 +000029 EXPECT_EQ(expected, output);
andrew@webrtc.org2009f6b2012-11-20 00:20:20 +000030}
31
32} // namespace test
33} // namespace webrtc