Fix: detect dlmopen() and disable corresponding tests if not available
[lttng-tools.git] / tests / regression / ust / ust-dl / test_ust-dl.py
index 22c1dca8de1ead15cd6520512225bb21d5556bf8..724598404ee6b40c63b91f22f716724733e019ae 100644 (file)
@@ -31,6 +31,9 @@ sys.path.append(test_utils_path)
 from test_utils import *
 
 
+have_dlmopen = (os.environ.get('LTTNG_TOOLS_HAVE_DLMOPEN') == '1')
+
+
 NR_TESTS = 14
 current_test = 1
 print("1..{0}".format(NR_TESTS))
@@ -49,7 +52,7 @@ test_env = os.environ.copy()
 test_env["LD_PRELOAD"] = test_env.get("LD_PRELOAD", "") + ":liblttng-ust-dl.so"
 test_env["LD_LIBRARY_PATH"] = test_env.get("LD_LIBRARY_PATH", "") + ":" + test_path
 test_process = subprocess.Popen(test_path + "prog",
-                                stdout=subprocess.PIPE, stderr=subprocess.PIPE,
+                                stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL,
                                 env=test_env)
 test_process.wait()
 
@@ -113,7 +116,11 @@ current_test += 1
 print_test_result(dlopen_event_found > 0, current_test, "lttng_ust_dl:dlopen event found in resulting trace")
 current_test += 1
 
-print_test_result(dlmopen_event_found > 0, current_test, "lttng_ust_dl:dlmopen event found in resulting trace")
+if have_dlmopen:
+    print_test_result(dlmopen_event_found > 0, current_test, "lttng_ust_dl:dlmopen event found in resulting trace")
+else:
+    skip_test(current_test, 'dlmopen() is not available')
+
 current_test += 1
 
 print_test_result(build_id_event_found > 0, current_test, "lttng_ust_dl:build_id event found in resulting trace")
This page took 0.025294 seconds and 5 git commands to generate.