Skip to content

Commit 3f91eca

Browse files
committed
[lldb] Fix TestModuleLoadedNotifys API test to work correctly on most of Linux targets.
The different build configuration and target Linux system can load a different number of .so libraries (2 and more). As example, Linux x86_64 host shows the following loaded modules: ``` Loaded files: ld-linux-x86-64.so.2 Loaded files: [vdso] Loaded files: a.out Loaded files: libstdc++.so.6, libm.so.6, libgcc_s.so.1, libc.so.6 ``` avg_solibs_added_per_event = 1.75 But Linux Aarch64 (remote target) with statically linked C++ library (clang) shows: ``` Loaded files: ld-2.31.so Loaded files: [vdso] Loaded files: a.out Loaded files: libm.so.6, libc.so.6 ``` avg_solibs_added_per_event = 1.25 Increase precision by 1 digit to fix the test.
1 parent fb0c705 commit 3f91eca

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lldb/test/API/functionalities/target-new-solib-notifications/TestModuleLoadedNotifys.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,6 @@ def test_launch_notifications(self):
118118
# On Linux we get events for ld.so, [vdso], the binary and then all libraries.
119119

120120
avg_solibs_added_per_event = round(
121-
float(total_solibs_added) / float(total_modules_added_events)
121+
10.0 * float(total_solibs_added) / float(total_modules_added_events)
122122
)
123-
self.assertGreater(avg_solibs_added_per_event, 1)
123+
self.assertGreater(avg_solibs_added_per_event, 10)

0 commit comments

Comments
 (0)