[yocto] [ptest-runner] ptest-runner: make DEFAULT_DIRECTORY be able to be defined when compiling

Li Zhou li.zhou at windriver.com
Sun Jan 20 18:11:36 PST 2019


In yocto project ptest data are installed to
PTEST_PATH ?= "${libdir}/${BPN}/ptest". Here make DEFAULT_DIRECTORY
be able to be defined outside of c code (e.g. passed in by CFLAGS),
in case libdir isn't "/usr/lib", which will cause "No ptests found"
error when running "ptest-runner" command. We will pass libdir to
DEFAULT_DIRECTORY when compiling to avoid that error.

Signed-off-by: Li Zhou <li.zhou at windriver.com>
---
 main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/main.c b/main.c
index 83600b7..e963efe 100644
--- a/main.c
+++ b/main.c
@@ -37,7 +37,9 @@
 
 #include "utils.h"
 
+#ifndef DEFAULT_DIRECTORY
 #define DEFAULT_DIRECTORY "/usr/lib"
+#endif
 #define DEFAULT_TIMEOUT 300
 
 static inline void
-- 
1.9.1



More information about the yocto mailing list