linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Stein <alexander.stein@mailbox.org>
To: linux-gpio@vger.kernel.org
Cc: Alexander Stein <alexander.stein@mailbox.org>
Subject: [libgpiod] [PATCH 3/5] bindings: cxx: Split out catch's main()
Date: Wed,  7 Aug 2019 21:51:30 +0200	[thread overview]
Message-ID: <20190807195132.7538-3-alexander.stein@mailbox.org> (raw)
In-Reply-To: <20190807195132.7538-1-alexander.stein@mailbox.org>

Compiling the source using CATCH_CONFIG_MAIN to provide main() takes
several seconds, so split it out from any library testing code, so it
really needs to be built once only.

Signed-off-by: Alexander Stein <alexander.stein@mailbox.org>
---
 bindings/cxx/tests/Makefile.am             | 3 ++-
 bindings/cxx/tests/gpiod-cxx-test-main.cpp | 2 ++
 bindings/cxx/tests/gpiod-cxx-test.cpp      | 2 --
 3 files changed, 4 insertions(+), 3 deletions(-)
 create mode 100644 bindings/cxx/tests/gpiod-cxx-test-main.cpp

diff --git a/bindings/cxx/tests/Makefile.am b/bindings/cxx/tests/Makefile.am
index d1da0d3..5800a23 100644
--- a/bindings/cxx/tests/Makefile.am
+++ b/bindings/cxx/tests/Makefile.am
@@ -15,7 +15,8 @@ AM_LDFLAGS += -pthread
 
 bin_PROGRAMS = gpiod-cxx-test
 
-gpiod_cxx_test_SOURCES =	gpiod-cxx-test.cpp \
+gpiod_cxx_test_SOURCES =	gpiod-cxx-test-main.cpp \
+				gpiod-cxx-test.cpp \
 				gpio-mockup.cpp \
 				gpio-mockup.hpp \
 				tests-chip.cpp \
diff --git a/bindings/cxx/tests/gpiod-cxx-test-main.cpp b/bindings/cxx/tests/gpiod-cxx-test-main.cpp
new file mode 100644
index 0000000..4ed06df
--- /dev/null
+++ b/bindings/cxx/tests/gpiod-cxx-test-main.cpp
@@ -0,0 +1,2 @@
+#define CATCH_CONFIG_MAIN
+#include <catch2/catch.hpp>
diff --git a/bindings/cxx/tests/gpiod-cxx-test.cpp b/bindings/cxx/tests/gpiod-cxx-test.cpp
index 236fd2d..e110a3c 100644
--- a/bindings/cxx/tests/gpiod-cxx-test.cpp
+++ b/bindings/cxx/tests/gpiod-cxx-test.cpp
@@ -5,8 +5,6 @@
  * Copyright (C) 2019 Bartosz Golaszewski <bgolaszewski@baylibre.com>
  */
 
-#define CATCH_CONFIG_MAIN
-#include <catch2/catch.hpp>
 #include <linux/version.h>
 #include <sys/utsname.h>
 #include <system_error>
-- 
2.22.0


  parent reply	other threads:[~2019-08-07 19:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-07 19:51 [libgpiod] [PATCH 1/5] bindings: cxx: Use 'upstream' include path Alexander Stein
2019-08-07 19:51 ` [libgpiod] [PATCH 2/5] bindings: cxx: Try using pkg-config to detect catch2 Alexander Stein
2019-08-07 19:51 ` Alexander Stein [this message]
2019-08-07 19:51 ` [libgpiod] [PATCH 4/5] bindings: cxx: Fix compile errors Alexander Stein
2019-08-08 15:25   ` Bartosz Golaszewski
2019-08-08 15:37     ` Bartosz Golaszewski
2019-08-07 19:51 ` [libgpiod] [PATCH 5/5] bindings: cxx: Workaround --success run Alexander Stein
2019-08-08 15:27   ` Bartosz Golaszewski
2019-08-08 18:41     ` Alexander Stein
2019-08-09  6:55       ` Bartosz Golaszewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190807195132.7538-3-alexander.stein@mailbox.org \
    --to=alexander.stein@mailbox.org \
    --cc=linux-gpio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).