blob: 5c0f54333d600f5ca063fee58d15e39ebde2b128 [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
Edward Lemurf49a56b2017-11-29 20:29:30 +010020#if defined(WEBRTC_IOS)
21#define MAYBE_AppendResult DISABLED_AppendResult
22#else
23#define MAYBE_AppendResult AppendResult
24#endif
25TEST(PerfTest, MAYBE_AppendResult) {
Edward Lemurf7ff3e82017-11-22 16:32:01 +010026 testing::internal::CaptureStdout();
andrew@webrtc.org2009f6b2012-11-20 00:20:20 +000027 std::string expected = "RESULT measurementmodifier: trace= 42 units\n";
Edward Lemurf7ff3e82017-11-22 16:32:01 +010028 PrintResult("measurement", "modifier", "trace", 42, "units", false);
andrew@webrtc.org2009f6b2012-11-20 00:20:20 +000029
30 expected += "*RESULT foobar: baz= 7 widgets\n";
Edward Lemur2f061682017-11-24 13:40:01 +010031 PrintResult("foo", "bar", "baz", 7, "widgets", true);
32
33 expected += "RESULT foobar: baz= {1,2} lemurs\n";
34 PrintResultMeanAndError("foo", "bar", "baz", 1, 2, "lemurs", false);
35
36 expected += "RESULT foobar: baz= [1,2,3] units\n";
37 PrintResultList("foo", "bar", "baz", {1, 2, 3}, "units", false);
Edward Lemurf7ff3e82017-11-22 16:32:01 +010038
39 std::string output = testing::internal::GetCapturedStdout();
andrew@webrtc.org2009f6b2012-11-20 00:20:20 +000040 EXPECT_EQ(expected, output);
andrew@webrtc.org2009f6b2012-11-20 00:20:20 +000041}
42
43} // namespace test
44} // namespace webrtc