Skip to contentSkip to conversation

ptest-runner: pass libdir to DEFAULT_DIRECTORY when compiling

PATCH In review Li Zhou 2 participants 2 messages Jan 16, 2019

lore
Share & tools
lore

Li Zhou

author
#0 lore raw

PATCH 1/1 ptest-runner: pass libdir to DEFAULT_DIRECTORY when compiling

Ptest data are installed to PTEST_PATH ?= "${libdir}/${BPN}/ptest". When libdir isn't "/usr/lib", it will cause "No ptests found" error when running "ptest-runner" command. Here pass libdir to DEFAULT_DIRECTORY when compiling to avoid that error.

---
 ...r-remove-DEFAULT_DIRECTORY-s-hard-coded-i.patch | 36 ++++++++++++++++++++++
 .../ptest-runner/ptest-runner_2.3.bb               |  5 +--
 2 files changed, 39 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-support/ptest-runner/ptest-runner/0001-ptest-runner-remove-DEFAULT_DIRECTORY-s-hard-coded-i.patch
meta/recipes-support/ptest-runner/ptest-runner/0001-ptest-runner-remove-DEFAULT_DIRECTORY-s-hard-coded-i.patch new file +36 -0
new file mode 100644
index 0000000..56e1f96
@@ -0,0 +1,36 @@
+From 6a663ac38c71108890e42f451f3a7b22afee0a40 Mon Sep 17 00:00:00 2001
+From: Li Zhou <[email protected]>
+Date: Wed, 16 Jan 2019 15:00:17 +0800
+Subject: [PATCH] ptest-runner: remove DEFAULT_DIRECTORY's hard coded
+ initialization
+
+Ptest data are installed to PTEST_PATH ?= "${libdir}/${BPN}/ptest".
+Here make DEFAULT_DIRECTORY be able to be defined outside of c code,
+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.
+
+Upstream-Status: Pending
+
+Signed-off-by: Li Zhou <[email protected]>
+---
+ 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
+
meta/recipes-support/ptest-runner/ptest-runner_2.3.bb +3 -2
index 26add9b..9866d1a 100644
@@ -10,12 +10,13 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=751419260aa954499f7abaabaa882bbe"
 SRCREV = "80712583732b4a809532f644fb09e7d2e812d7ba"
 PV = "2.3+git${SRCPV}"
 
-SRC_URI = "git://git.yoctoproject.org/ptest-runner2"
+SRC_URI = "git://git.yoctoproject.org/ptest-runner2 \
+           file://0001-ptest-runner-remove-DEFAULT_DIRECTORY-s-hard-coded-i.patch"
 S = "${WORKDIR}/git"
 
 FILES_${PN} = "${bindir}/ptest-runner"
 
-EXTRA_OEMAKE = "-e MAKEFLAGS="
+EXTRA_OEMAKE = "-e MAKEFLAGS= CFLAGS="${CFLAGS} -DDEFAULT_DIRECTORY=\\\"${libdir}\\\"""
 
 do_compile () {
 	oe_runmake
Signature · 1 line
1.9.1
#1 lore raw

We maintain ptest-runner, so send a patch to that and just change the srcrev in the recipe.

Ross

Quoted 83 lines · Li Zhou

Ptest data are installed to PTEST_PATH ?= "${libdir}/${BPN}/ptest". When libdir isn't "/usr/lib", it will cause "No ptests found" error when running "ptest-runner" command. Here pass libdir to DEFAULT_DIRECTORY when compiling to avoid that error.

---
 ...r-remove-DEFAULT_DIRECTORY-s-hard-coded-i.patch | 36 ++++++++++++++++++++++
 .../ptest-runner/ptest-runner_2.3.bb               |  5 +--
 2 files changed, 39 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-support/ptest-runner/ptest-runner/0001-ptest-runner-remove-DEFAULT_DIRECTORY-s-hard-coded-i.patch
meta/recipes-support/ptest-runner/ptest-runner/0001-ptest-runner-remove-DEFAULT_DIRECTORY-s-hard-coded-i.patch new file +36 -0
new file mode 100644
index 0000000..56e1f96
@@ -0,0 +1,36 @@
+From 6a663ac38c71108890e42f451f3a7b22afee0a40 Mon Sep 17 00:00:00 2001
+From: Li Zhou <[email protected]>
+Date: Wed, 16 Jan 2019 15:00:17 +0800
+Subject: [PATCH] ptest-runner: remove DEFAULT_DIRECTORY's hard coded
+ initialization
+
+Ptest data are installed to PTEST_PATH ?= "${libdir}/${BPN}/ptest".
+Here make DEFAULT_DIRECTORY be able to be defined outside of c code,
+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.
+
+Upstream-Status: Pending
+
+Signed-off-by: Li Zhou <[email protected]>
+---
+ 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
+
meta/recipes-support/ptest-runner/ptest-runner_2.3.bb +3 -3
index 26add9b..9866d1a 100644
@@ -10,12 +10,13 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=751419260aa954499f7abaabaa882bbe"
 SRCREV = "80712583732b4a809532f644fb09e7d2e812d7ba"
 PV = "2.3+git${SRCPV}"
 
-SRC_URI = "git://git.yoctoproject.org/ptest-runner2"
+SRC_URI = "git://git.yoctoproject.org/ptest-runner2 \
+           file://0001-ptest-runner-remove-DEFAULT_DIRECTORY-s-hard-coded-i.patch"
 S = "${WORKDIR}/git"
 
 FILES_${PN} = "${bindir}/ptest-runner"
 
-EXTRA_OEMAKE = "-e MAKEFLAGS="
+EXTRA_OEMAKE = "-e MAKEFLAGS= CFLAGS="${CFLAGS} -DDEFAULT_DIRECTORY=\\\"${libdir}\\\"""
 
 do_compile () {
        oe_runmake
--

1.9.1

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core