Skip to contentSkip to conversation

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

ptest-runner Li Zhou 2 participants 2 messages Jan 21, 2019

lore
Share & tools
lore

Li Zhou

author
#0 lore raw

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.

---
 main.c | 2 ++
 1 file changed, 2 insertions(+)
main.c +2 -0
index 83600b7..e963efe 100644
@@ -37,7 +37,9 @@
 
 #include "utils.h"
 
+#ifndef DEFAULT_DIRECTORY
 #define DEFAULT_DIRECTORY "/usr/lib"
+#endif
 #define DEFAULT_TIMEOUT 300
 
 static inline void
Signature · 1 line
1.9.1
#1 lore raw

Pushed, thx!,

http://git.yoctoproject.org/cgit/cgit.cgi/ptest-runner2/commit/?id=e1062f776eea60c50435c6b8ddf9714a31141aee

Feel free to update the recipe.

Cheers,
Anibal

Quoted 30 lines · Li Zhou

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.

---
 main.c | 2 ++
 1 file changed, 2 insertions(+)
main.c +2 -1
index 83600b7..e963efe 100644
@@ -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