diff options
author | 2024-10-03 08:15:33 +0000 | |
---|---|---|
committer | 2024-10-08 14:36:38 +0000 | |
commit | 8d24de75151c74963c253b58173452b57d028d6a (patch) | |
tree | 9d9e7d9e1891d477cb8e644263ed6f8f949f8bb0 /libartbase/base/utils.cc | |
parent | b0349f656a4b4f95db7e9f4bab53657436c0df98 (diff) |
Skip gtest ImgDiagTest.ImageDiffPidSelf when running tests on VM.
We do skip this test on host, as it tries to access system files for
which it does not have permissions. It's the same situation on VM.
Test: checked that ImgDiagTest.ImageDiffPidSelf is skipped on VM:
. ./build/envsetup.sh
lunch riscv64-trunk_staging-eng
export SOONG_ALLOW_MISSING_DEPENDENCIES=true
art/tools/buildbot-build.sh --target -j72
export ART_TEST_SSH_USER=ubuntu
export ART_TEST_SSH_HOST=localhost
export ART_TEST_SSH_PORT=10001
export ART_TEST_ON_VM=true
. art/tools/buildbot-utils.sh
art/tools/buildbot-cleanup-device.sh
art/tools/buildbot-setup-device.sh
art/tools/buildbot-sync.sh
art/tools/run-gtests.sh \
/apex/com.android.art/bin/art/riscv64/art_imgdiag_tests
Change-Id: If183439b2e9269ab199450fa12a1a0e0ef2e8dee
Diffstat (limited to 'libartbase/base/utils.cc')
-rw-r--r-- | libartbase/base/utils.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libartbase/base/utils.cc b/libartbase/base/utils.cc index da53d0b99f..2c95986809 100644 --- a/libartbase/base/utils.cc +++ b/libartbase/base/utils.cc @@ -19,6 +19,7 @@ #include <dirent.h> #include <inttypes.h> #include <pthread.h> +#include <string.h> #include <sys/stat.h> #include <sys/types.h> #include <unistd.h> @@ -190,6 +191,11 @@ bool CacheOperationsMaySegFault() { #endif } +bool RunningOnVM() { + const char* on_vm = getenv("ART_TEST_ON_VM"); + return on_vm != nullptr && std::strcmp("true", on_vm) == 0; +} + uint32_t GetTid() { #if defined(__APPLE__) uint64_t owner; |