Merge changes from topic "nscobie-hwui_unit_tests"
* changes: Tweak GraphicsStats#findRootPath to accept various valid locations Enable hwui_unit_tests in presubmit for libs/hwui Fix GraphicsStats#findRootPath and disable CacheManager#trimMemory tests Change hwui_unit_tests (and benchmarks) to push to non-root writable dir
This commit is contained in:
@@ -634,7 +634,7 @@ cc_library_static {
|
||||
cc_defaults {
|
||||
name: "hwui_test_defaults",
|
||||
defaults: ["hwui_defaults"],
|
||||
test_suites: ["device-tests"],
|
||||
test_suites: ["general-tests"],
|
||||
header_libs: ["libandroid_headers_private"],
|
||||
target: {
|
||||
android: {
|
||||
|
||||
@@ -16,22 +16,22 @@
|
||||
<configuration description="Config for hwuimicro">
|
||||
<target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
|
||||
<option name="cleanup" value="true" />
|
||||
<option name="push" value="hwui_unit_tests->/data/nativetest/hwui_unit_tests" />
|
||||
<option name="push" value="hwuimicro->/data/benchmarktest/hwuimicro" />
|
||||
<option name="push" value="hwuimacro->/data/benchmarktest/hwuimacro" />
|
||||
<option name="push" value="hwui_unit_tests->/data/local/tmp/nativetest/hwui_unit_tests" />
|
||||
<option name="push" value="hwuimicro->/data/local/tmp/benchmarktest/hwuimicro" />
|
||||
<option name="push" value="hwuimacro->/data/local/tmp/benchmarktest/hwuimacro" />
|
||||
</target_preparer>
|
||||
<option name="test-suite-tag" value="apct" />
|
||||
<test class="com.android.tradefed.testtype.GTest" >
|
||||
<option name="native-test-device-path" value="/data/nativetest" />
|
||||
<option name="native-test-device-path" value="/data/local/tmp/nativetest" />
|
||||
<option name="module-name" value="hwui_unit_tests" />
|
||||
</test>
|
||||
<test class="com.android.tradefed.testtype.GoogleBenchmarkTest" >
|
||||
<option name="native-benchmark-device-path" value="/data/benchmarktest" />
|
||||
<option name="native-benchmark-device-path" value="/data/local/tmp/benchmarktest" />
|
||||
<option name="benchmark-module-name" value="hwuimicro" />
|
||||
<option name="file-exclusion-filter-regex" value=".*\.config$" />
|
||||
</test>
|
||||
<test class="com.android.tradefed.testtype.GoogleBenchmarkTest" >
|
||||
<option name="native-benchmark-device-path" value="/data/benchmarktest" />
|
||||
<option name="native-benchmark-device-path" value="/data/local/tmp/benchmarktest" />
|
||||
<option name="benchmark-module-name" value="hwuimacro" />
|
||||
<option name="file-exclusion-filter-regex" value=".*\.config$" />
|
||||
</test>
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
},
|
||||
{
|
||||
"name": "CtsAccelerationTestCases"
|
||||
},
|
||||
{
|
||||
"name": "hwui_unit_tests"
|
||||
}
|
||||
],
|
||||
"imports": [
|
||||
|
||||
@@ -32,7 +32,8 @@ static size_t getCacheUsage(GrDirectContext* grContext) {
|
||||
return cacheUsage;
|
||||
}
|
||||
|
||||
RENDERTHREAD_SKIA_PIPELINE_TEST(CacheManager, trimMemory) {
|
||||
// TOOD(258700630): fix this test and re-enable
|
||||
RENDERTHREAD_SKIA_PIPELINE_TEST(CacheManager, DISABLED_trimMemory) {
|
||||
int32_t width = DeviceInfo::get()->getWidth();
|
||||
int32_t height = DeviceInfo::get()->getHeight();
|
||||
GrDirectContext* grContext = renderThread.getGrContext();
|
||||
|
||||
@@ -14,17 +14,18 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <android-base/macros.h>
|
||||
#include <gmock/gmock.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "protos/graphicsstats.pb.h"
|
||||
#include "service/GraphicsStatsService.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "protos/graphicsstats.pb.h"
|
||||
#include "service/GraphicsStatsService.h"
|
||||
|
||||
using namespace android;
|
||||
using namespace android::uirenderer;
|
||||
|
||||
@@ -49,12 +50,14 @@ std::string findRootPath() {
|
||||
|
||||
// No code left untested
|
||||
TEST(GraphicsStats, findRootPath) {
|
||||
#ifdef __LP64__
|
||||
std::string expected = "/data/nativetest64/hwui_unit_tests";
|
||||
#else
|
||||
std::string expected = "/data/nativetest/hwui_unit_tests";
|
||||
#endif
|
||||
EXPECT_EQ(expected, findRootPath());
|
||||
// Different tools/infrastructure seem to push this to different locations. It shouldn't really
|
||||
// matter where the binary is, so add new locations here as needed. This test still seems good
|
||||
// as it's nice to understand the possibility space, and ensure findRootPath continues working
|
||||
// as expected.
|
||||
std::string acceptableLocations[] = {"/data/nativetest/hwui_unit_tests",
|
||||
"/data/nativetest64/hwui_unit_tests",
|
||||
"/data/local/tmp/nativetest/hwui_unit_tests/" ABI_STRING};
|
||||
EXPECT_THAT(acceptableLocations, ::testing::Contains(findRootPath()));
|
||||
}
|
||||
|
||||
TEST(GraphicsStats, saveLoad) {
|
||||
|
||||
Reference in New Issue
Block a user