diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-04-01 06:39:34 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-04-01 06:39:34 +0000 |
commit | 5c7d115eda084b2ab4222e82c93ceeb8daf3ecf5 (patch) | |
tree | be1aefb6079b0f12764691a388e0c3f3913a0466 | |
parent | 665809c35d5404159fee6c82e8d65ecdecc28d18 (diff) | |
parent | 414f20cbc5ad62c7865577de6b23d9701a08191b (diff) | |
download | vndk-5c7d115eda084b2ab4222e82c93ceeb8daf3ecf5.tar.gz |
Snap for 9867821 from 414f20cbc5ad62c7865577de6b23d9701a08191b to udc-releaseandroid-vts-14.0_r1android-security-14.0.0_r9android-security-14.0.0_r8android-security-14.0.0_r7android-security-14.0.0_r6android-security-14.0.0_r5android-security-14.0.0_r4android-security-14.0.0_r3android-security-14.0.0_r2android-security-14.0.0_r10android-security-14.0.0_r1android-platform-14.0.0_r9android-platform-14.0.0_r8android-platform-14.0.0_r7android-platform-14.0.0_r6android-platform-14.0.0_r5android-platform-14.0.0_r4android-platform-14.0.0_r3android-platform-14.0.0_r2android-platform-14.0.0_r1android-cts-14.0_r1android-14.0.0_r28android-14.0.0_r2android-14.0.0_r15android-14.0.0_r14android-14.0.0_r13android-14.0.0_r1android14-security-releaseandroid14-s2-releaseandroid14-s1-releaseandroid14-releaseandroid14-platform-release
Change-Id: I6d9ad79593131f5bb8b518dcbb8dacc9d6d692b0
-rw-r--r-- | files/vts_vndk_files_test.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/files/vts_vndk_files_test.py b/files/vts_vndk_files_test.py index 017ae9c..faa3e6a 100644 --- a/files/vts_vndk_files_test.py +++ b/files/vts_vndk_files_test.py @@ -64,19 +64,21 @@ class VtsVndkFilesTest(unittest.TestCase): return [] return self._dut.FindFiles(dir_path, "*", "!", "-type", "d") - def _Fail(self, unexpected_paths): + def _Fail(self, unexpected_paths, message): """Logs error and fails current test. Args: unexpected_paths: A list of strings, the paths to be shown in the log message. + message: A string, the error message. """ logging.error("Unexpected files:\n%s", "\n".join(unexpected_paths)) assert_lines = unexpected_paths[:20] if len(unexpected_paths) > 20: - assert_lines.append("...") - assert_lines.append( - "Total number of errors: %d" % len(unexpected_paths)) + assert_lines.extend([ + "...", + "Total number of errors: %d" % len(unexpected_paths)]) + assert_lines.append(message) self.fail("\n".join(assert_lines)) def _TestVndkDirectory(self, vndk_dir, vndk_list_names): @@ -95,7 +97,9 @@ class VtsVndkFilesTest(unittest.TestCase): unexpected = [x for x in self._ListFiles(vndk_dir) if target_path_module.basename(x) not in vndk_set] if unexpected: - self._Fail(unexpected) + self._Fail(unexpected, + "The above libraries are not %s." % + ", ".join(vndk_list_names)) def _TestNotInVndkDirecotory(self, vndk_dir, vndk_list_names, except_libs): """Verifies that VNDK directory doesn't contain specific files. @@ -116,7 +120,9 @@ class VtsVndkFilesTest(unittest.TestCase): unexpected = [x for x in self._ListFiles(vndk_dir) if target_path_module.basename(x) in vndk_set] if unexpected: - self._Fail(unexpected) + self._Fail(unexpected, + "%s must not contain %s libraries." % + (vndk_dir, ", ",join(vndk_list_names))) def _TestVndkCoreDirectory(self, bitness): """Verifies that VNDK directory doesn't contain extra files.""" |