Skip to contentSkip to conversation

catch2: new package

PATCH Superseded Bartosz Golaszewski 3 participants 6 messages Oct 11, 2018 – Oct 15, 2018

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 catch2: new package

From: Bartosz Golaszewski <[email protected]>

Add a recipe for the catch2 testing framework. There's a bug upstream which makes it impossible to build with gcc7 so include a patch.

---
 .../0001-internal-fix-build-in-GCC-7.patch    | 35 +++++++++++++++++++
 meta-oe/recipes-test/catch2/catch2_2.4.1.bb   | 25 +++++++++++++
 2 files changed, 60 insertions(+)
 create mode 100644 meta-oe/recipes-test/catch2/catch2/0001-internal-fix-build-in-GCC-7.patch
 create mode 100644 meta-oe/recipes-test/catch2/catch2_2.4.1.bb
meta-oe/recipes-test/catch2/catch2/0001-internal-fix-build-in-GCC-7.patch new file +35 -0
new file mode 100644
index 000000000..606398afa
@@ -0,0 +1,35 @@
+From 857bf7e83db330682a4c722d0b57be1e4481f4e2 Mon Sep 17 00:00:00 2001
+From: Bartosz Golaszewski <[email protected]>
+Date: Thu, 11 Oct 2018 09:44:24 +0200
+Subject: [PATCH] internal: fix build in GCC 7
+
+The following error is emitted by gcc 7:
+
+include/internal/catch_tostring.cpp:217:21: error: comparison is always true due to limited range of data type [-Werror=type-limits]
+|      } else if ('\0' <= value && value < ' ') {
+|                 ~~~~~^~~~~~~~
+| cc1plus: all warnings being treated as errors
+
+We can drop the first part of the if.
+
+Signed-off-by: Bartosz Golaszewski <[email protected]>
+---
+ include/internal/catch_tostring.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/internal/catch_tostring.cpp b/include/internal/catch_tostring.cpp
+index 4e0c027d..59cc8dec 100644
+--- a/include/internal/catch_tostring.cpp
++++ b/include/internal/catch_tostring.cpp
+@@ -214,7 +214,7 @@ std::string StringMaker<char>::convert(char value) {
+         return "'\\n'";
+     } else if (value == '\t') {
+         return "'\\t'";
+-    } else if ('\0' <= value && value < ' ') {
++    } else if (value < ' ') {
+         return ::Catch::Detail::stringify(static_cast<unsigned int>(value));
+     } else {
+         char chstr[] = "' '";
+-- 
+2.19.1
+
meta-oe/recipes-test/catch2/catch2_2.4.1.bb new file +25 -0
new file mode 100644
index 000000000..ba14a362c
@@ -0,0 +1,25 @@
+DESCRIPTION = "A modern, C++-native, header-only, test framework for unit-tests, \
+TDD and BDD - using C++11, C++14, C++17 and later."
+AUTHOR = "Phil Nash, Martin Horenovsky and others"
+HOMEPAGE = "https://github.com/catchorg/Catch2"
+LICENSE = "BSL-1.0"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=e4224ccaecb14d942c71d31bef20d78c"
+
+SRC_URI = "git://github.com/catchorg/Catch2.git \
+           file://0001-internal-fix-build-in-GCC-7.patch"
+SRCREV = "9e1bdca4667295fcb16265eae00efa8423f07007"
+
+S = "${WORKDIR}/git"
+
+DEPENDS = "python-native"
+
+inherit cmake python3native
+
+# Header-only library
+ALLOW_EMPTY_${PN} = "1"
+
+do_install_append() {
+    rm ${D}/usr/share/Catch2/lldbinit
+    rm ${D}/usr/share/Catch2/gdbinit
+    rmdir ${D}/usr/share/Catch2/
+}
Signature · 1 line
2.19.1
#1 lore raw

Hi Bartosz,
As I learned quite recently, you have to do the following for header-only libraries:
RDEPENDS_${PN}-dev = ""
RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"

Regards,
Vyacheslav

Quoted 99 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Add a recipe for the catch2 testing framework. There's a bug upstream which makes it impossible to build with gcc7 so include a patch.

---
 .../0001-internal-fix-build-in-GCC-7.patch    | 35 +++++++++++++++++++
 meta-oe/recipes-test/catch2/catch2_2.4.1.bb   | 25 +++++++++++++
 2 files changed, 60 insertions(+)
 create mode 100644
meta-oe/recipes-test/catch2/catch2/0001-internal-fix-build-in-GCC-7.patch
 create mode 100644 meta-oe/recipes-test/catch2/catch2_2.4.1.bb

diff --git a/meta-oe/recipes-test/catch2/catch2/0001-internal-fix-build-in-GCC-7.patch b/meta-oe/recipes-test/catch2/catch2/0001-internal-fix-build-in-GCC-7.patch new file mode 100644
index 000000000..606398afa
--- /dev/null
+++
b/meta-oe/recipes-test/catch2/catch2/0001-internal-fix-build-in-GCC-7.patch

meta-oe/recipes-test/catch2/catch2/0001-internal-fix-build-in-GCC-7.patch new file +8 -0
@@ -0,0 +1,35 @@
+From 857bf7e83db330682a4c722d0b57be1e4481f4e2 Mon Sep 17 00:00:00 2001
+From: Bartosz Golaszewski <[email protected]>
+Date: Thu, 11 Oct 2018 09:44:24 +0200
+Subject: [PATCH] internal: fix build in GCC 7
+
+The following error is emitted by gcc 7:
+
+include/internal/catch_tostring.cpp:217:21: error: comparison is always

true due to limited range of data type [-Werror=type-limits]

+|      } else if ('\0' <= value && value < ' ') {
+|                 ~~~~~^~~~~~~~
+| cc1plus: all warnings being treated as errors
meta-oe/recipes-test/catch2/catch2/0001-internal-fix-build-in-GCC-7.patch new file +9 -0
+
+We can drop the first part of the if.
+
+Signed-off-by: Bartosz Golaszewski <[email protected]>
+---
+ include/internal/catch_tostring.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/internal/catch_tostring.cpp

b/include/internal/catch_tostring.cpp

meta-oe/recipes-test/catch2/catch2/0001-internal-fix-build-in-GCC-7.patch new file +10 -0
+index 4e0c027d..59cc8dec 100644
+--- a/include/internal/catch_tostring.cpp
++++ b/include/internal/catch_tostring.cpp
+@@ -214,7 +214,7 @@ std::string StringMaker<char>::convert(char value) {
+         return "'\\n'";
+     } else if (value == '\t') {
+         return "'\\t'";
+-    } else if ('\0' <= value && value < ' ') {
++    } else if (value < ' ') {
+         return ::Catch::Detail::stringify(static_cast<unsigned

int>(value));

meta-oe/recipes-test/catch2/catch2/0001-internal-fix-build-in-GCC-7.patch new file +5 -0
+     } else {
+         char chstr[] = "' '";
+--
+2.19.1
+
meta-oe/recipes-test/catch2/catch2_2.4.1.bb new file +1 -0
new file mode 100644
index 000000000..ba14a362c
@@ -0,0 +1,25 @@
+DESCRIPTION = "A modern, C++-native, header-only, test framework for

unit-tests, \

meta-oe/recipes-test/catch2/catch2_2.4.1.bb new file +5 -0
+TDD and BDD - using C++11, C++14, C++17 and later."
+AUTHOR = "Phil Nash, Martin Horenovsky and others"
+HOMEPAGE = "https://github.com/catchorg/Catch2"
+LICENSE = "BSL-1.0"
+LIC_FILES_CHKSUM =

"file://LICENSE.txt;md5=e4224ccaecb14d942c71d31bef20d78c"

meta-oe/recipes-test/catch2/catch2_2.4.1.bb new file +19 -1
+
+SRC_URI = "git://github.com/catchorg/Catch2.git \
+           file://0001-internal-fix-build-in-GCC-7.patch"
+SRCREV = "9e1bdca4667295fcb16265eae00efa8423f07007"
+
+S = "${WORKDIR}/git"
+
+DEPENDS = "python-native"
+
+inherit cmake python3native
+
+# Header-only library
+ALLOW_EMPTY_${PN} = "1"
+
+do_install_append() {
+    rm ${D}/usr/share/Catch2/lldbinit
+    rm ${D}/usr/share/Catch2/gdbinit
+    rmdir ${D}/usr/share/Catch2/
+}
--

2.19.1

--

#2 lore raw

czw., 11 paź 2018 o 11:35 Vyacheslav Yurkov <[email protected]> napisał(a):

Quoted 6 lines

Hi Bartosz,
As I learned quite recently, you have to do the following for header-only libraries:
RDEPENDS_${PN}-dev = ""
RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"

Any hint on what it does exactly and why it's needed?

Bart

Quoted 94 lines

Regards,
Vyacheslav

Quoted 90 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Add a recipe for the catch2 testing framework. There's a bug upstream which makes it impossible to build with gcc7 so include a patch.

---
 .../0001-internal-fix-build-in-GCC-7.patch    | 35 +++++++++++++++++++
 meta-oe/recipes-test/catch2/catch2_2.4.1.bb   | 25 +++++++++++++
 2 files changed, 60 insertions(+)
 create mode 100644 meta-oe/recipes-test/catch2/catch2/0001-internal-fix-build-in-GCC-7.patch
 create mode 100644 meta-oe/recipes-test/catch2/catch2_2.4.1.bb
meta-oe/recipes-test/catch2/catch2/0001-internal-fix-build-in-GCC-7.patch new file +35 -0
new file mode 100644
index 000000000..606398afa
@@ -0,0 +1,35 @@
+From 857bf7e83db330682a4c722d0b57be1e4481f4e2 Mon Sep 17 00:00:00 2001
+From: Bartosz Golaszewski <[email protected]>
+Date: Thu, 11 Oct 2018 09:44:24 +0200
+Subject: [PATCH] internal: fix build in GCC 7
+
+The following error is emitted by gcc 7:
+
+include/internal/catch_tostring.cpp:217:21: error: comparison is always true due to limited range of data type [-Werror=type-limits]
+|      } else if ('\0' <= value && value < ' ') {
+|                 ~~~~~^~~~~~~~
+| cc1plus: all warnings being treated as errors
+
+We can drop the first part of the if.
+
+Signed-off-by: Bartosz Golaszewski <[email protected]>
+---
+ include/internal/catch_tostring.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/internal/catch_tostring.cpp b/include/internal/catch_tostring.cpp
+index 4e0c027d..59cc8dec 100644
+--- a/include/internal/catch_tostring.cpp
++++ b/include/internal/catch_tostring.cpp
+@@ -214,7 +214,7 @@ std::string StringMaker<char>::convert(char value) {
+         return "'\\n'";
+     } else if (value == '\t') {
+         return "'\\t'";
+-    } else if ('\0' <= value && value < ' ') {
++    } else if (value < ' ') {
+         return ::Catch::Detail::stringify(static_cast<unsigned int>(value));
+     } else {
+         char chstr[] = "' '";
+--
+2.19.1
+
meta-oe/recipes-test/catch2/catch2_2.4.1.bb new file +25 -1
new file mode 100644
index 000000000..ba14a362c
@@ -0,0 +1,25 @@
+DESCRIPTION = "A modern, C++-native, header-only, test framework for unit-tests, \
+TDD and BDD - using C++11, C++14, C++17 and later."
+AUTHOR = "Phil Nash, Martin Horenovsky and others"
+HOMEPAGE = "https://github.com/catchorg/Catch2"
+LICENSE = "BSL-1.0"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=e4224ccaecb14d942c71d31bef20d78c"
+
+SRC_URI = "git://github.com/catchorg/Catch2.git \
+           file://0001-internal-fix-build-in-GCC-7.patch"
+SRCREV = "9e1bdca4667295fcb16265eae00efa8423f07007"
+
+S = "${WORKDIR}/git"
+
+DEPENDS = "python-native"
+
+inherit cmake python3native
+
+# Header-only library
+ALLOW_EMPTY_${PN} = "1"
+
+do_install_append() {
+    rm ${D}/usr/share/Catch2/lldbinit
+    rm ${D}/usr/share/Catch2/gdbinit
+    rmdir ${D}/usr/share/Catch2/
+}
--

2.19.1

--

#3 lore raw

You should use it instead
ALLOW_EMPTY_${PN} = "1"

The header-only package is required during the build (for dependent recipes) and for SDK, this is where -dev package would be used. But if you create main empty package, it would be installed in the image, which is basically useless.

Vyacheslav

Quoted 121 lines · Bartosz Golaszewski

czw., 11 paź 2018 o 11:35 Vyacheslav Yurkov <[email protected]> napisał(a):

Quoted 3 lines

Hi Bartosz,
As I learned quite recently, you have to do the following for

header-only libraries:

Quoted 3 lines

RDEPENDS_${PN}-dev = ""
RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"

Any hint on what it does exactly and why it's needed?

Bart

Quoted 4 lines

Regards,
Vyacheslav

On Thu, Oct 11, 2018 at 11:08 AM Bartosz Golaszewski <[email protected]>

Quoted 6 lines · wrote:
Quoted 6 lines

From: Bartosz Golaszewski <[email protected]>

Add a recipe for the catch2 testing framework. There's a bug upstream which makes it impossible to build with gcc7 so include a patch.

Quoted 6 lines
Quoted 6 lines
---
 .../0001-internal-fix-build-in-GCC-7.patch    | 35 +++++++++++++++++++
 meta-oe/recipes-test/catch2/catch2_2.4.1.bb   | 25 +++++++++++++
 2 files changed, 60 insertions(+)
 create mode 100644

meta-oe/recipes-test/catch2/catch2/0001-internal-fix-build-in-GCC-7.patch

Quoted 3 lines
Quoted 3 lines
 create mode 100644 meta-oe/recipes-test/catch2/catch2_2.4.1.bb

diff --git

a/meta-oe/recipes-test/catch2/catch2/0001-internal-fix-build-in-GCC-7.patch b/meta-oe/recipes-test/catch2/catch2/0001-internal-fix-build-in-GCC-7.patch

Quoted 4 lines
Quoted 4 lines

new file mode 100644
index 000000000..606398afa
--- /dev/null
+++

b/meta-oe/recipes-test/catch2/catch2/0001-internal-fix-build-in-GCC-7.patch

Quoted 9 lines

meta-oe/recipes-test/catch2/catch2/0001-internal-fix-build-in-GCC-7.patch line 8

Quoted 9 lines
meta-oe/recipes-test/catch2/catch2/0001-internal-fix-build-in-GCC-7.patch new file +8 -0
@@ -0,0 +1,35 @@
+From 857bf7e83db330682a4c722d0b57be1e4481f4e2 Mon Sep 17 00:00:00 2001
+From: Bartosz Golaszewski <[email protected]>
+Date: Thu, 11 Oct 2018 09:44:24 +0200
+Subject: [PATCH] internal: fix build in GCC 7
+
+The following error is emitted by gcc 7:
+
+include/internal/catch_tostring.cpp:217:21: error: comparison is

always true due to limited range of data type [-Werror=type-limits]

Quoted 4 lines
Quoted 4 lines
meta-oe/recipes-test/catch2/catch2/0001-internal-fix-build-in-GCC-7.patch new file +4 -0
+|      } else if ('\0' <= value && value < ' ') {
+|                 ~~~~~^~~~~~~~
+| cc1plus: all warnings being treated as errors
+
Quoted 8 lines

meta-oe/recipes-test/catch2/catch2/0001-internal-fix-build-in-GCC-7.patch

Quoted 8 lines
meta-oe/recipes-test/catch2/catch2/0001-internal-fix-build-in-GCC-7.patch new file +8 -0
+We can drop the first part of the if.
+
+Signed-off-by: Bartosz Golaszewski <[email protected]>
+---
+ include/internal/catch_tostring.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/internal/catch_tostring.cpp

b/include/internal/catch_tostring.cpp

Quoted 4 lines

meta-oe/recipes-test/catch2/catch2/0001-internal-fix-build-in-GCC-7.patch

Quoted 4 lines
meta-oe/recipes-test/catch2/catch2/0001-internal-fix-build-in-GCC-7.patch new file +4 -0
+index 4e0c027d..59cc8dec 100644
+--- a/include/internal/catch_tostring.cpp
++++ b/include/internal/catch_tostring.cpp
+@@ -214,7 +214,7 @@ std::string StringMaker<char>::convert(char value)

{

Quoted 6 lines

meta-oe/recipes-test/catch2/catch2/0001-internal-fix-build-in-GCC-7.patch

Quoted 6 lines
meta-oe/recipes-test/catch2/catch2/0001-internal-fix-build-in-GCC-7.patch new file +6 -0
+         return "'\\n'";
+     } else if (value == '\t') {
+         return "'\\t'";
+-    } else if ('\0' <= value && value < ' ') {
++    } else if (value < ' ') {
+         return ::Catch::Detail::stringify(static_cast<unsigned

int>(value));

Quoted 6 lines

Review

Quoted 6 lines
meta-oe/recipes-test/catch2/catch2/0001-internal-fix-build-in-GCC-7.patch new file +5 -0
+     } else {
+         char chstr[] = "' '";
+--
+2.19.1
+
(quoted diff) +0 -0

b/meta-oe/recipes-test/catch2/catch2_2.4.1.bb

Quoted 6 lines

meta-oe/recipes-test/catch2/catch2_2.4.1.bb line 1

Quoted 6 lines

new file mode 100644
index 000000000..ba14a362c

meta-oe/recipes-test/catch2/catch2_2.4.1.bb new file +1 -0
@@ -0,0 +1,25 @@
+DESCRIPTION = "A modern, C++-native, header-only, test framework for

unit-tests, \

Quoted 5 lines

meta-oe/recipes-test/catch2/catch2_2.4.1.bb

Quoted 5 lines
meta-oe/recipes-test/catch2/catch2_2.4.1.bb new file +5 -0
+TDD and BDD - using C++11, C++14, C++17 and later."
+AUTHOR = "Phil Nash, Martin Horenovsky and others"
+HOMEPAGE = "https://github.com/catchorg/Catch2"
+LICENSE = "BSL-1.0"
+LIC_FILES_CHKSUM =

"file://LICENSE.txt;md5=e4224ccaecb14d942c71d31bef20d78c"

Quoted 23 lines
Quoted 23 lines
meta-oe/recipes-test/catch2/catch2_2.4.1.bb new file +19 -1
+
+SRC_URI = "git://github.com/catchorg/Catch2.git \
+           file://0001-internal-fix-build-in-GCC-7.patch"
+SRCREV = "9e1bdca4667295fcb16265eae00efa8423f07007"
+
+S = "${WORKDIR}/git"
+
+DEPENDS = "python-native"
+
+inherit cmake python3native
+
+# Header-only library
+ALLOW_EMPTY_${PN} = "1"
+
+do_install_append() {
+    rm ${D}/usr/share/Catch2/lldbinit
+    rm ${D}/usr/share/Catch2/gdbinit
+    rmdir ${D}/usr/share/Catch2/
+}
--

2.19.1

--

#4 lore raw
In reply to Bartosz Golaszewski
Quoted 22 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Add a recipe for the catch2 testing framework. There's a bug upstream which makes it impossible to build with gcc7 so include a patch.

---
 .../0001-internal-fix-build-in-GCC-7.patch    | 35 +++++++++++++++++++
 meta-oe/recipes-test/catch2/catch2_2.4.1.bb   | 25 +++++++++++++
 2 files changed, 60 insertions(+)
 create mode 100644 meta-oe/recipes-test/catch2/catch2/0001-internal-fix-build-in-GCC-7.patch
 create mode 100644 meta-oe/recipes-test/catch2/catch2_2.4.1.bb
meta-oe/recipes-test/catch2/catch2/0001-internal-fix-build-in-GCC-7.patch new file +3 -0
new file mode 100644
index 000000000..606398afa
@@ -0,0 +1,35 @@
+From 857bf7e83db330682a4c722d0b57be1e4481f4e2 Mon Sep 17 00:00:00 2001
+From: Bartosz Golaszewski <[email protected]>
+Date: Thu, 11 Oct 2018 09:44:24 +0200

meta-oe/recipes-test/catch2/catch2/0001-internal-fix-build-in-GCC-7.patch line 13

Quoted 10 lines
meta-oe/recipes-test/catch2/catch2/0001-internal-fix-build-in-GCC-7.patch new file +10 -0
+Subject: [PATCH] internal: fix build in GCC 7
+
+The following error is emitted by gcc 7:
+
+include/internal/catch_tostring.cpp:217:21: error: comparison is always true due to limited range of data type [-Werror=type-limits]
+|      } else if ('\0' <= value && value < ' ') {
+|                 ~~~~~^~~~~~~~
+| cc1plus: all warnings being treated as errors
+
+We can drop the first part of the if.

Please add the "Upstream-Status:" bits

please review
https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines

Quoted 32 lines
meta-oe/recipes-test/catch2/catch2/0001-internal-fix-build-in-GCC-7.patch new file +22 -0
+
+Signed-off-by: Bartosz Golaszewski <[email protected]>
+---
+ include/internal/catch_tostring.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/internal/catch_tostring.cpp b/include/internal/catch_tostring.cpp
+index 4e0c027d..59cc8dec 100644
+--- a/include/internal/catch_tostring.cpp
++++ b/include/internal/catch_tostring.cpp
+@@ -214,7 +214,7 @@ std::string StringMaker<char>::convert(char value) {
+         return "'\\n'";
+     } else if (value == '\t') {
+         return "'\\t'";
+-    } else if ('\0' <= value && value < ' ') {
++    } else if (value < ' ') {
+         return ::Catch::Detail::stringify(static_cast<unsigned int>(value));
+     } else {
+         char chstr[] = "' '";
+-- 
+2.19.1
+
meta-oe/recipes-test/catch2/catch2_2.4.1.bb new file +4 -0
new file mode 100644
index 000000000..ba14a362c
@@ -0,0 +1,25 @@
+DESCRIPTION = "A modern, C++-native, header-only, test framework for unit-tests, \
+TDD and BDD - using C++11, C++14, C++17 and later."
+AUTHOR = "Phil Nash, Martin Horenovsky and others"
+HOMEPAGE = "https://github.com/catchorg/Catch2"

meta-oe/recipes-test/catch2/catch2_2.4.1.bb line 14

Quoted 10 lines
meta-oe/recipes-test/catch2/catch2_2.4.1.bb new file +10 -0
+LICENSE = "BSL-1.0"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=e4224ccaecb14d942c71d31bef20d78c"
+
+SRC_URI = "git://github.com/catchorg/Catch2.git \
+           file://0001-internal-fix-build-in-GCC-7.patch"
+SRCREV = "9e1bdca4667295fcb16265eae00efa8423f07007"
+
+S = "${WORKDIR}/git"
+
+DEPENDS = "python-native"

Don't need this if you inherit python3native

meta-oe/recipes-test/catch2/catch2_2.4.1.bb line 24

Quoted 10 lines
meta-oe/recipes-test/catch2/catch2_2.4.1.bb new file +10 -0
+
+inherit cmake python3native
+
+# Header-only library
+ALLOW_EMPTY_${PN} = "1"
+
+do_install_append() {
+    rm ${D}/usr/share/Catch2/lldbinit
+    rm ${D}/usr/share/Catch2/gdbinit
+    rmdir ${D}/usr/share/Catch2/

Please use the variable "datadir" instead of hard coding.

- armin

Quoted 1 line
meta-oe/recipes-test/catch2/catch2_2.4.1.bb new file +1 -0
+}
#5 lore raw

czw., 11 paź 2018 o 16:32 akuster808 <[email protected]> napisał(a):

Quoted 76 lines · Bartosz Golaszewski
Quoted 22 lines

From: Bartosz Golaszewski <[email protected]>

Add a recipe for the catch2 testing framework. There's a bug upstream which makes it impossible to build with gcc7 so include a patch.

---
 .../0001-internal-fix-build-in-GCC-7.patch    | 35 +++++++++++++++++++
 meta-oe/recipes-test/catch2/catch2_2.4.1.bb   | 25 +++++++++++++
 2 files changed, 60 insertions(+)
 create mode 100644 meta-oe/recipes-test/catch2/catch2/0001-internal-fix-build-in-GCC-7.patch
 create mode 100644 meta-oe/recipes-test/catch2/catch2_2.4.1.bb
meta-oe/recipes-test/catch2/catch2/0001-internal-fix-build-in-GCC-7.patch new file +3 -0
new file mode 100644
index 000000000..606398afa
@@ -0,0 +1,35 @@
+From 857bf7e83db330682a4c722d0b57be1e4481f4e2 Mon Sep 17 00:00:00 2001
+From: Bartosz Golaszewski <[email protected]>
+Date: Thu, 11 Oct 2018 09:44:24 +0200

meta-oe/recipes-test/catch2/catch2/0001-internal-fix-build-in-GCC-7.patch line 13

Quoted 10 lines
meta-oe/recipes-test/catch2/catch2/0001-internal-fix-build-in-GCC-7.patch new file +10 -0
+Subject: [PATCH] internal: fix build in GCC 7
+
+The following error is emitted by gcc 7:
+
+include/internal/catch_tostring.cpp:217:21: error: comparison is always true due to limited range of data type [-Werror=type-limits]
+|      } else if ('\0' <= value && value < ' ') {
+|                 ~~~~~^~~~~~~~
+| cc1plus: all warnings being treated as errors
+
+We can drop the first part of the if.

Please add the "Upstream-Status:" bits

please review
https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines

Quoted 35 lines
meta-oe/recipes-test/catch2/catch2/0001-internal-fix-build-in-GCC-7.patch new file +22 -0
+
+Signed-off-by: Bartosz Golaszewski <[email protected]>
+---
+ include/internal/catch_tostring.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/internal/catch_tostring.cpp b/include/internal/catch_tostring.cpp
+index 4e0c027d..59cc8dec 100644
+--- a/include/internal/catch_tostring.cpp
++++ b/include/internal/catch_tostring.cpp
+@@ -214,7 +214,7 @@ std::string StringMaker<char>::convert(char value) {
+         return "'\\n'";
+     } else if (value == '\t') {
+         return "'\\t'";
+-    } else if ('\0' <= value && value < ' ') {
++    } else if (value < ' ') {
+         return ::Catch::Detail::stringify(static_cast<unsigned int>(value));
+     } else {
+         char chstr[] = "' '";
+--
+2.19.1
+
meta-oe/recipes-test/catch2/catch2_2.4.1.bb new file +7 -0
new file mode 100644
index 000000000..ba14a362c
@@ -0,0 +1,25 @@
+DESCRIPTION = "A modern, C++-native, header-only, test framework for unit-tests, \
+TDD and BDD - using C++11, C++14, C++17 and later."
+AUTHOR = "Phil Nash, Martin Horenovsky and others"
+HOMEPAGE = "https://github.com/catchorg/Catch2"
+LICENSE = "BSL-1.0"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=e4224ccaecb14d942c71d31bef20d78c"
+
Quoted 8 lines

meta-oe/recipes-test/catch2/catch2_2.4.1.bb line 14

Quoted 7 lines
meta-oe/recipes-test/catch2/catch2_2.4.1.bb new file +7 -0
+SRC_URI = "git://github.com/catchorg/Catch2.git \
+           file://0001-internal-fix-build-in-GCC-7.patch"
+SRCREV = "9e1bdca4667295fcb16265eae00efa8423f07007"
+
+S = "${WORKDIR}/git"
+
+DEPENDS = "python-native"

Don't need this if you inherit python3native

If I don't do it, cmake fails with the following message:

| DEBUG: Executing shell function do_configure
| -- The CXX compiler identification is GNU 8.2.0
| -- Check for working CXX compiler:

/<snip!>/build/tmp/work/cortexa8hf-neon-poky-linux-gnueabi/catch2/2.4.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++ | -- Check for working CXX compiler:
/<snip!>/build/tmp/work/cortexa8hf-neon-poky-linux-gnueabi/catch2/2.4.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++ -- works

| -- Detecting CXX compiler ABI info
| -- Detecting CXX compiler ABI info - done
| -- Detecting CXX compile features
| -- Detecting CXX compile features - done
| -- Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE)
| CMake Error at CMakeLists.txt:43 (message):
|   Python not found, but required for tests
|
|
| -- Configuring incomplete, errors occurred!

Seems that other cmake based projects do the same in their recipes.

Bart

Quoted 16 lines

meta-oe/recipes-test/catch2/catch2_2.4.1.bb line 24

Quoted 10 lines
meta-oe/recipes-test/catch2/catch2_2.4.1.bb new file +10 -0
+
+inherit cmake python3native
+
+# Header-only library
+ALLOW_EMPTY_${PN} = "1"
+
+do_install_append() {
+    rm ${D}/usr/share/Catch2/lldbinit
+    rm ${D}/usr/share/Catch2/gdbinit
+    rmdir ${D}/usr/share/Catch2/

Please use the variable "datadir" instead of hard coding.

- armin

Quoted 1 line
meta-oe/recipes-test/catch2/catch2_2.4.1.bb new file +1 -0
+}