[PATCH 1/2] tests: commandtest: handle tcmalloc hacking environment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If one of the libraries is compiled with tcmalloc then
the latter will add GLIBCPP_FORCE_NEW and GLIBCXX_FORCE_NEW to
environment at startup and thus break commandtest.
---
 tests/commandhelper.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/tests/commandhelper.c b/tests/commandhelper.c
index 1da2834..0f6ce07 100644
--- a/tests/commandhelper.c
+++ b/tests/commandhelper.c
@@ -94,8 +94,15 @@ int main(int argc, char **argv) {
     for (i = 0; i < n; i++) {
         /* Ignore the variables used to instruct the loader into
          * behaving differently, as they could throw the tests off. */
-        if (!STRPREFIX(newenv[i], "LD_"))
-            fprintf(log, "ENV:%s\n", newenv[i]);
+        if (STRPREFIX(newenv[i], "LD_"))
+            continue;
+
+        /* Fix tests if tcmalloc is used in libraries */
+        if (STRPREFIX(newenv[i], "GLIBCPP_FORCE_NEW=") ||
+            STRPREFIX(newenv[i], "GLIBCXX_FORCE_NEW="))
+            continue;
+
+        fprintf(log, "ENV:%s\n", newenv[i]);
     }
 
     open_max = sysconf(_SC_OPEN_MAX);
-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux