[igt-dev] [PATCH CI] tests/tools_test: Print everything when searching for tools

Petri Latvala petri.latvala at intel.com
Tue Jan 15 10:45:21 UTC 2019


---
 tests/tools_test.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/tests/tools_test.c b/tests/tools_test.c
index 88a6ae96..c3f57449 100644
--- a/tests/tools_test.c
+++ b/tests/tools_test.c
@@ -65,12 +65,18 @@ static bool chdir_to_tools_dir(void)
 	char path[PATH_MAX];
 
 	/* Try TOOLS relative to cwd */
-	if (chdir(TOOLS) == 0)
+	if (chdir(TOOLS) == 0) {
+		igt_info("Directory found at original cwd + TOOLS\n");
 		return true;
+	}
 
 	/* Try TOOLS and install dir relative to test binary */
-	if (readlink("/proc/self/exe", path, sizeof(path)) > 0)
-		chdir(dirname(path));
+	if (readlink("/proc/self/exe", path, sizeof(path)) > 0) {
+		igt_info("Readlink /proc/self/exe = %s\n", path);
+		if (chdir(dirname(path)) == 0)
+			igt_info("chdir to executable dir succeeded\n");
+	} else
+		igt_info("Readlink /proc/self/exe failed\n");
 
 	return chdir(TOOLS) == 0 || chdir("../../bin") == 0;
 }
-- 
2.19.1



More information about the igt-dev mailing list