Merge "Log start of the test to logcat" am: 356b184468 am: e7f989d826
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1526419 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: If31b80253977f61e0cee5edf5ca9cdff4e73aa71
This commit is contained in:
commit
3f473c9dfb
1 changed files with 13 additions and 0 deletions
|
|
@ -17,6 +17,7 @@
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
#include <android-base/file.h>
|
#include <android-base/file.h>
|
||||||
|
#include <android-base/logging.h>
|
||||||
#include <android-base/properties.h>
|
#include <android-base/properties.h>
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
|
|
@ -268,6 +269,17 @@ service A something
|
||||||
ASSERT_EQ(1u, parser.parse_error_count());
|
ASSERT_EQ(1u, parser.parse_error_count());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class TestCaseLogger : public ::testing::EmptyTestEventListener {
|
||||||
|
void OnTestStart(const ::testing::TestInfo& test_info) override {
|
||||||
|
#ifdef __ANDROID__
|
||||||
|
LOG(INFO) << "===== " << test_info.test_suite_name() << "::" << test_info.name() << " ("
|
||||||
|
<< test_info.file() << ":" << test_info.line() << ")";
|
||||||
|
#else
|
||||||
|
UNUSED(test_info);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace init
|
} // namespace init
|
||||||
} // namespace android
|
} // namespace android
|
||||||
|
|
||||||
|
|
@ -284,5 +296,6 @@ int main(int argc, char** argv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
testing::InitGoogleTest(&argc, argv);
|
testing::InitGoogleTest(&argc, argv);
|
||||||
|
testing::UnitTest::GetInstance()->listeners().Append(new android::init::TestCaseLogger());
|
||||||
return RUN_ALL_TESTS();
|
return RUN_ALL_TESTS();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue