diff options
author | Andreas Gampe <agampe@google.com> | 2018-01-10 20:02:20 -0800 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2018-01-11 11:18:57 -0800 |
commit | 577e64677a7c33a9f46b87896b7762eb83ca5c63 (patch) | |
tree | bf21d4ba0f80cdabcd7265cfe7d34d4970b67999 /perfprofd/tests/perfprofd_test.cc | |
parent | d9084f6c49bed375441418e2f22c539ab0851735 (diff) | |
download | extras-577e64677a7c33a9f46b87896b7762eb83ca5c63.tar.gz |
Perfprofd: Generalize post-collection handling
Add a handler function to process to encoded protobuf. For now, just write
it to file, as before.
Test: mmma system/extras/perfprofd
Test: perfprofd_test
Change-Id: Ife55d6f62408fd1fd2eac5af3ad4cd319b985a69
Diffstat (limited to 'perfprofd/tests/perfprofd_test.cc')
-rw-r--r-- | perfprofd/tests/perfprofd_test.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/perfprofd/tests/perfprofd_test.cc b/perfprofd/tests/perfprofd_test.cc index 802f4d17..1ee1f777 100644 --- a/perfprofd/tests/perfprofd_test.cc +++ b/perfprofd/tests/perfprofd_test.cc @@ -534,7 +534,8 @@ TEST_F(PerfProfdTest, BadPerfRun) // Verify log contents const std::string expected = RAW_RESULT( - I: profile collection failed (perf record returned bad exit status) + W: perf bad exit status 1 + W: profile collection failed ); // check to make sure log excerpt matches @@ -615,7 +616,7 @@ TEST_F(PerfProfdTest, BasicRunWithCannedPerf) // Kick off encoder and check return code PROFILE_RESULT result = encode_to_proto(input_perf_data, encoded_file_path(dest_dir, 0).c_str(), config, 0, nullptr); - EXPECT_EQ(OK_PROFILE_COLLECTION, result); + ASSERT_EQ(OK_PROFILE_COLLECTION, result) << JoinTestLog(" "); // Read and decode the resulting perf.data.encoded file wireless_android_play_playlog::AndroidPerfProfile encodedProfile; @@ -703,7 +704,7 @@ TEST_F(PerfProfdTest, BasicRunWithCannedPerfWithSymbolizer) config, 0, &test_symbolizer); - EXPECT_EQ(OK_PROFILE_COLLECTION, result); + ASSERT_EQ(OK_PROFILE_COLLECTION, result); // Read and decode the resulting perf.data.encoded file wireless_android_play_playlog::AndroidPerfProfile encodedProfile; @@ -780,7 +781,7 @@ TEST_F(PerfProfdTest, CallchainRunWithCannedPerf) // Kick off encoder and check return code PROFILE_RESULT result = encode_to_proto(input_perf_data, encoded_file_path(dest_dir, 0).c_str(), config, 0, nullptr); - EXPECT_EQ(OK_PROFILE_COLLECTION, result); + ASSERT_EQ(OK_PROFILE_COLLECTION, result); // Read and decode the resulting perf.data.encoded file wireless_android_play_playlog::AndroidPerfProfile encodedProfile; @@ -864,7 +865,7 @@ TEST_F(PerfProfdTest, BasicRunWithLivePerf) int daemon_main_return_code = runner.invoke(); // Check return code from daemon - EXPECT_EQ(0, daemon_main_return_code); + ASSERT_EQ(0, daemon_main_return_code); // Read and decode the resulting perf.data.encoded file wireless_android_play_playlog::AndroidPerfProfile encodedProfile; @@ -916,7 +917,7 @@ TEST_F(PerfProfdTest, MultipleRunWithLivePerf) int daemon_main_return_code = runner.invoke(); // Check return code from daemon - EXPECT_EQ(0, daemon_main_return_code); + ASSERT_EQ(0, daemon_main_return_code); // Read and decode the resulting perf.data.encoded file wireless_android_play_playlog::AndroidPerfProfile encodedProfile; @@ -983,7 +984,7 @@ TEST_F(PerfProfdTest, CallChainRunWithLivePerf) int daemon_main_return_code = runner.invoke(); // Check return code from daemon - EXPECT_EQ(0, daemon_main_return_code); + ASSERT_EQ(0, daemon_main_return_code); // Read and decode the resulting perf.data.encoded file wireless_android_play_playlog::AndroidPerfProfile encodedProfile; |