Fix the unit test for header-abi-dumper -print-resource-dir

The resource dir has been changed from lib64 to lib since clang-r468909.
build-prebuilts.sh creates lib in the dist dir so that developers can
easily run the binaries.

Test: development/vndk/tools/header-checker/android/build-prebuilts.sh
Test: development/vndk/tools/header-checker/tests/test.py
Bug: 255702405
Change-Id: I9bed6f0fd7948830a89d9e24889d9341ebf1a9c4
This commit is contained in:
Hsin-Yi Chen
2022-11-16 23:25:16 +08:00
parent e1d600b62c
commit 315d047b46
3 changed files with 6 additions and 6 deletions

View File

@@ -149,6 +149,9 @@ mkdir -p "${CLANG_LIB_DIR_OUT}"
cp -R "${CLANG_LIB_DIR}/share" "${CLANG_LIB_DIR_OUT}/share"
cp -R "${CLANG_LIB_DIR}/include" "${CLANG_LIB_DIR_OUT}/include"
ln -s "lib64/clang/${LLVM_RELEASE_VERSION}/include" "${SOONG_DIST}/clang-headers"
# create symlink lib -> lib64 as toolchain libraries have a RUNPATH pointing to
# $ORIGIN/../lib instead of lib64
ln -s "lib64" "${SOONG_DIST}/lib"
# Normalize library file names. All library file names must match their soname.
function extract_soname () {

View File

@@ -60,10 +60,6 @@ update_prebuilts () {
rm .fetch* || true
find . | xargs touch
# create symlink lib -> lib64 as toolchain libraries have a RUNPATH pointing
# to $ORIGIN/../lib instead of lib64
ln -s lib64 lib
}

View File

@@ -405,8 +405,9 @@ class HeaderCheckerTest(unittest.TestCase):
resource_dir = subprocess.check_output(
["header-abi-dumper", "-print-resource-dir"], text=True,
stderr=subprocess.DEVNULL).strip()
self.assertEqual(os.path.dirname(resource_dir),
os.path.join(common_dir, "lib64", "clang"))
self.assertIn(os.path.dirname(resource_dir),
(os.path.join(common_dir, "lib64", "clang"),
os.path.join(common_dir, "lib", "clang")))
self.assertRegex(os.path.basename(resource_dir), r"^[\d.]+$")
def test_struct_extensions(self):