* [Buildroot] [PATCH 0/1] gmock: new package
@ 2015-03-02 14:01 Carlos Santos
2015-03-02 14:01 ` [Buildroot] [PATCH 1/1] " Carlos Santos
0 siblings, 1 reply; 16+ messages in thread
From: Carlos Santos @ 2015-03-02 14:01 UTC (permalink / raw)
To: buildroot
Warning: This change requires an updated recipe for gtest (submittted
as a separate patch) because Gmock requires the gtest-config, which is
installed only if gtest is built with autotools.
Carlos Santos (1):
gmock: new package
package/Config.in | 1 +
package/gmock/Config.in | 26 ++++++++++++++++++++++++++
package/gmock/gmock.hash | 3 +++
package/gmock/gmock.mk | 47 +++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 77 insertions(+)
create mode 100644 package/gmock/Config.in
create mode 100644 package/gmock/gmock.hash
create mode 100644 package/gmock/gmock.mk
--
1.8.3.1
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Buildroot] [PATCH 1/1] gmock: new package
2015-03-02 14:01 [Buildroot] [PATCH 0/1] gmock: new package Carlos Santos
@ 2015-03-02 14:01 ` Carlos Santos
2015-04-19 11:03 ` Fabio Porcedda
` (2 more replies)
0 siblings, 3 replies; 16+ messages in thread
From: Carlos Santos @ 2015-03-02 14:01 UTC (permalink / raw)
To: buildroot
Inspired by jMock, EasyMock, and Hamcrest, and designed with C++'s
specifics in mind, Google C++ Mocking Framework (or Google Mock for
short) is a library for writing and using C++ mock classes.
Google Mock:
* lets you create mock classes trivially using simple macros,
* supports a rich set of matchers and actions,
* handles unordered, partially ordered, or completely ordered
expectations,
* is extensible by users, and
* works on Linux, Mac OS X, Windows, Windows Mobile, minGW, and
Symbian.
http://code.google.com/p/googlemock/
Signed-off-by: Marcelo Barbosa <marcelo.barbosa@datacom.ind.br>
Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
---
package/Config.in | 1 +
package/gmock/Config.in | 26 ++++++++++++++++++++++++++
package/gmock/gmock.hash | 3 +++
package/gmock/gmock.mk | 47 +++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 77 insertions(+)
create mode 100644 package/gmock/Config.in
create mode 100644 package/gmock/gmock.hash
create mode 100644 package/gmock/gmock.mk
diff --git a/package/Config.in b/package/Config.in
index 262a7fb..26db447 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -932,6 +932,7 @@ menu "Other"
source "package/flann/Config.in"
source "package/glibmm/Config.in"
source "package/glm/Config.in"
+ source "package/gmock/Config.in"
source "package/gmp/Config.in"
source "package/gsl/Config.in"
source "package/gtest/Config.in"
diff --git a/package/gmock/Config.in b/package/gmock/Config.in
new file mode 100644
index 0000000..001da22
--- /dev/null
+++ b/package/gmock/Config.in
@@ -0,0 +1,26 @@
+config BR2_PACKAGE_GMOCK
+ bool "gmock"
+ depends on BR2_USE_WCHAR
+ depends on BR2_TOOLCHAIN_HAS_THREADS
+ depends on BR2_INSTALL_LIBSTDCPP
+ depends on BR2_USE_MMU # fork()
+ help
+ Inspired by jMock, EasyMock, and Hamcrest, and designed with C++'s
+ specifics in mind, Google C++ Mocking Framework (or Google Mock for
+ short) is a library for writing and using C++ mock classes.
+
+ Google Mock:
+
+ * lets you create mock classes trivially using simple macros,
+ * supports a rich set of matchers and actions,
+ * handles unordered, partially ordered, or completely ordered
+ expectations,
+ * is extensible by users, and
+ * works on Linux, Mac OS X, Windows, Windows Mobile, minGW, and
+ Symbian.
+
+ http://code.google.com/p/googlemock/
+
+comment "gmock needs a toolchain w/ C++, wchar, threads"
+ depends on BR2_USE_MMU
+ depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || !BR2_INSTALL_LIBSTDCPP
diff --git a/package/gmock/gmock.hash b/package/gmock/gmock.hash
new file mode 100644
index 0000000..4d038e2
--- /dev/null
+++ b/package/gmock/gmock.hash
@@ -0,0 +1,3 @@
+# No upstream hashes for the following:
+md5 073b984d8798ea1594f5e44d85b20d66 gmock-1.7.0.zip
+sha1 f9d9dd882a25f4069ed9ee48e70aff1b53e3c5a5 gmock-1.7.0.zip
diff --git a/package/gmock/gmock.mk b/package/gmock/gmock.mk
new file mode 100644
index 0000000..5ecf940
--- /dev/null
+++ b/package/gmock/gmock.mk
@@ -0,0 +1,47 @@
+################################################################################
+#
+# gmock
+#
+################################################################################
+
+GMOCK_VERSION = 1.7.0
+GMOCK_SOURCE = gmock-$(GMOCK_VERSION).zip
+GMOCK_SITE = http://googlemock.googlecode.com/files
+GMOCK_INSTALL_STAGING = YES
+GMOCK_INSTALL_TARGET = NO
+GMOCK_LICENSE = BSD-3c
+GMOCK_LICENSE_FILES = LICENSE
+GMOCK_DEPENDENCIES = gtest
+HOST_GMOCK_DEPENDENCIES = host-python
+
+GMOCK_CONF_OPTS = --with-gtest=$(STAGING_DIR)/usr/lib/
+
+define GMOCK_EXTRACT_CMDS
+ $(UNZIP) $(DL_DIR)/$(GMOCK_SOURCE) -d $(BUILD_DIR)
+endef
+
+define GMOCK_INSTALL_STAGING_CMDS
+ $(INSTALL) -D -m 0755 $(@D)/lib/.libs/libgmock.a $(STAGING_DIR)/usr/lib/libgmock.a
+ $(INSTALL) -D -m 0755 $(@D)/lib/.libs/libgmock_main.a $(STAGING_DIR)/usr/lib/libgmock_main.a
+ $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/include/gmock/
+ cp -rp $(@D)/include/gmock/* $(STAGING_DIR)/usr/include/gmock/
+endef
+
+
+# Unzipping inside $(@D) and moving everything from the created subdirectory is
+# required because unzipping directly in $(BUILD_DIR) would cause host-gmock to
+# overwrite the gmock subdir instead of unzipping in a host-gmock subdir.
+define HOST_GMOCK_EXTRACT_CMDS
+ $(UNZIP) $(DL_DIR)/$(GMOCK_SOURCE) -d $(@D)
+ mv $(@D)/gmock-$(GMOCK_VERSION)/* $(@D)
+ rmdir $(@D)/gmock-$(GMOCK_VERSION)
+endef
+
+define HOST_GMOCK_INSTALL_CMDS
+ $(INSTALL) -D -m 0755 $(@D)/scripts/generator/gmock_gen.py $(HOST_DIR)/usr/bin/gmock_gen.py
+ ln -sf gmock_gen.py $(HOST_DIR)/usr/bin/gmock_gen
+ cp -rp $(@D)/scripts/generator/cpp $(HOST_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages
+endef
+
+$(eval $(autotools-package))
+$(eval $(host-generic-package))
--
1.8.3.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [Buildroot] [PATCH 1/1] gmock: new package
2015-03-02 14:01 ` [Buildroot] [PATCH 1/1] " Carlos Santos
@ 2015-04-19 11:03 ` Fabio Porcedda
2015-04-27 21:52 ` Thomas Petazzoni
2015-05-15 18:05 ` [Buildroot] [PATCH v2 " Carlos Santos
2 siblings, 0 replies; 16+ messages in thread
From: Fabio Porcedda @ 2015-04-19 11:03 UTC (permalink / raw)
To: buildroot
On Mon, Mar 2, 2015 at 3:01 PM, Carlos Santos <casantos@datacom.ind.br> wrote:
> Inspired by jMock, EasyMock, and Hamcrest, and designed with C++'s
> specifics in mind, Google C++ Mocking Framework (or Google Mock for
> short) is a library for writing and using C++ mock classes.
>
> Google Mock:
>
> * lets you create mock classes trivially using simple macros,
> * supports a rich set of matchers and actions,
> * handles unordered, partially ordered, or completely ordered
> expectations,
> * is extensible by users, and
> * works on Linux, Mac OS X, Windows, Windows Mobile, minGW, and
> Symbian.
>
> http://code.google.com/p/googlemock/
>
> Signed-off-by: Marcelo Barbosa <marcelo.barbosa@datacom.ind.br>
> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
> ---
> package/Config.in | 1 +
> package/gmock/Config.in | 26 ++++++++++++++++++++++++++
> package/gmock/gmock.hash | 3 +++
> package/gmock/gmock.mk | 47 +++++++++++++++++++++++++++++++++++++++++++++++
> 4 files changed, 77 insertions(+)
> create mode 100644 package/gmock/Config.in
> create mode 100644 package/gmock/gmock.hash
> create mode 100644 package/gmock/gmock.mk
This patch depends on this patch:
http://patchwork.ozlabs.org/patch/445112/
Without that patch this package fails to build.
You have already said it in the mail "[PATCH 0/1] gmock: new package"
but that mail is not visible in patchwork so I've replayed to this
mail.
> diff --git a/package/Config.in b/package/Config.in
> index 262a7fb..26db447 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -932,6 +932,7 @@ menu "Other"
> source "package/flann/Config.in"
> source "package/glibmm/Config.in"
> source "package/glm/Config.in"
> + source "package/gmock/Config.in"
> source "package/gmp/Config.in"
> source "package/gsl/Config.in"
> source "package/gtest/Config.in"
> diff --git a/package/gmock/Config.in b/package/gmock/Config.in
> new file mode 100644
> index 0000000..001da22
> --- /dev/null
> +++ b/package/gmock/Config.in
> @@ -0,0 +1,26 @@
> +config BR2_PACKAGE_GMOCK
> + bool "gmock"
> + depends on BR2_USE_WCHAR
> + depends on BR2_TOOLCHAIN_HAS_THREADS
> + depends on BR2_INSTALL_LIBSTDCPP
> + depends on BR2_USE_MMU # fork()
> + help
> + Inspired by jMock, EasyMock, and Hamcrest, and designed with C++'s
> + specifics in mind, Google C++ Mocking Framework (or Google Mock for
> + short) is a library for writing and using C++ mock classes.
> +
> + Google Mock:
> +
> + * lets you create mock classes trivially using simple macros,
> + * supports a rich set of matchers and actions,
> + * handles unordered, partially ordered, or completely ordered
> + expectations,
> + * is extensible by users, and
> + * works on Linux, Mac OS X, Windows, Windows Mobile, minGW, and
> + Symbian.
> +
> + http://code.google.com/p/googlemock/
> +
> +comment "gmock needs a toolchain w/ C++, wchar, threads"
> + depends on BR2_USE_MMU
> + depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || !BR2_INSTALL_LIBSTDCPP
> diff --git a/package/gmock/gmock.hash b/package/gmock/gmock.hash
> new file mode 100644
> index 0000000..4d038e2
> --- /dev/null
> +++ b/package/gmock/gmock.hash
> @@ -0,0 +1,3 @@
> +# No upstream hashes for the following:
> +md5 073b984d8798ea1594f5e44d85b20d66 gmock-1.7.0.zip
> +sha1 f9d9dd882a25f4069ed9ee48e70aff1b53e3c5a5 gmock-1.7.0.zip
> diff --git a/package/gmock/gmock.mk b/package/gmock/gmock.mk
> new file mode 100644
> index 0000000..5ecf940
> --- /dev/null
> +++ b/package/gmock/gmock.mk
> @@ -0,0 +1,47 @@
> +################################################################################
> +#
> +# gmock
> +#
> +################################################################################
> +
> +GMOCK_VERSION = 1.7.0
> +GMOCK_SOURCE = gmock-$(GMOCK_VERSION).zip
> +GMOCK_SITE = http://googlemock.googlecode.com/files
> +GMOCK_INSTALL_STAGING = YES
> +GMOCK_INSTALL_TARGET = NO
> +GMOCK_LICENSE = BSD-3c
> +GMOCK_LICENSE_FILES = LICENSE
> +GMOCK_DEPENDENCIES = gtest
> +HOST_GMOCK_DEPENDENCIES = host-python
> +
> +GMOCK_CONF_OPTS = --with-gtest=$(STAGING_DIR)/usr/lib/
> +
> +define GMOCK_EXTRACT_CMDS
> + $(UNZIP) $(DL_DIR)/$(GMOCK_SOURCE) -d $(BUILD_DIR)
> +endef
> +
> +define GMOCK_INSTALL_STAGING_CMDS
> + $(INSTALL) -D -m 0755 $(@D)/lib/.libs/libgmock.a $(STAGING_DIR)/usr/lib/libgmock.a
> + $(INSTALL) -D -m 0755 $(@D)/lib/.libs/libgmock_main.a $(STAGING_DIR)/usr/lib/libgmock_main.a
> + $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/include/gmock/
> + cp -rp $(@D)/include/gmock/* $(STAGING_DIR)/usr/include/gmock/
> +endef
> +
> +
> +# Unzipping inside $(@D) and moving everything from the created subdirectory is
> +# required because unzipping directly in $(BUILD_DIR) would cause host-gmock to
> +# overwrite the gmock subdir instead of unzipping in a host-gmock subdir.
> +define HOST_GMOCK_EXTRACT_CMDS
> + $(UNZIP) $(DL_DIR)/$(GMOCK_SOURCE) -d $(@D)
> + mv $(@D)/gmock-$(GMOCK_VERSION)/* $(@D)
> + rmdir $(@D)/gmock-$(GMOCK_VERSION)
> +endef
> +
> +define HOST_GMOCK_INSTALL_CMDS
> + $(INSTALL) -D -m 0755 $(@D)/scripts/generator/gmock_gen.py $(HOST_DIR)/usr/bin/gmock_gen.py
> + ln -sf gmock_gen.py $(HOST_DIR)/usr/bin/gmock_gen
> + cp -rp $(@D)/scripts/generator/cpp $(HOST_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages
> +endef
> +
> +$(eval $(autotools-package))
> +$(eval $(host-generic-package))
> --
> 1.8.3.1
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
BR
--
Fabio Porcedda
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Buildroot] [PATCH 1/1] gmock: new package
2015-03-02 14:01 ` [Buildroot] [PATCH 1/1] " Carlos Santos
2015-04-19 11:03 ` Fabio Porcedda
@ 2015-04-27 21:52 ` Thomas Petazzoni
2015-05-15 18:05 ` [Buildroot] [PATCH v2 " Carlos Santos
2 siblings, 0 replies; 16+ messages in thread
From: Thomas Petazzoni @ 2015-04-27 21:52 UTC (permalink / raw)
To: buildroot
Dear Carlos Santos,
On Mon, 2 Mar 2015 11:01:23 -0300, Carlos Santos wrote:
> diff --git a/package/gmock/gmock.hash b/package/gmock/gmock.hash
> new file mode 100644
> index 0000000..4d038e2
> --- /dev/null
> +++ b/package/gmock/gmock.hash
> @@ -0,0 +1,3 @@
> +# No upstream hashes for the following:
We use:
# Locally computed
and a single sha256 hash.
> +md5 073b984d8798ea1594f5e44d85b20d66 gmock-1.7.0.zip
> +sha1 f9d9dd882a25f4069ed9ee48e70aff1b53e3c5a5 gmock-1.7.0.zip
> diff --git a/package/gmock/gmock.mk b/package/gmock/gmock.mk
> new file mode 100644
> index 0000000..5ecf940
> --- /dev/null
> +++ b/package/gmock/gmock.mk
> @@ -0,0 +1,47 @@
> +################################################################################
> +#
> +# gmock
> +#
> +################################################################################
> +
> +GMOCK_VERSION = 1.7.0
> +GMOCK_SOURCE = gmock-$(GMOCK_VERSION).zip
> +GMOCK_SITE = http://googlemock.googlecode.com/files
> +GMOCK_INSTALL_STAGING = YES
> +GMOCK_INSTALL_TARGET = NO
> +GMOCK_LICENSE = BSD-3c
> +GMOCK_LICENSE_FILES = LICENSE
> +GMOCK_DEPENDENCIES = gtest
> +HOST_GMOCK_DEPENDENCIES = host-python
> +
> +GMOCK_CONF_OPTS = --with-gtest=$(STAGING_DIR)/usr/lib/
> +
> +define GMOCK_EXTRACT_CMDS
> + $(UNZIP) $(DL_DIR)/$(GMOCK_SOURCE) -d $(BUILD_DIR)
> +endef
> +
> +define GMOCK_INSTALL_STAGING_CMDS
> + $(INSTALL) -D -m 0755 $(@D)/lib/.libs/libgmock.a $(STAGING_DIR)/usr/lib/libgmock.a
> + $(INSTALL) -D -m 0755 $(@D)/lib/.libs/libgmock_main.a $(STAGING_DIR)/usr/lib/libgmock_main.a
> + $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/include/gmock/
> + cp -rp $(@D)/include/gmock/* $(STAGING_DIR)/usr/include/gmock/
> +endef
Why don't you use the default rule for autotools-package staging
installation?
> +
> +
> +# Unzipping inside $(@D) and moving everything from the created subdirectory is
> +# required because unzipping directly in $(BUILD_DIR) would cause host-gmock to
> +# overwrite the gmock subdir instead of unzipping in a host-gmock subdir.
> +define HOST_GMOCK_EXTRACT_CMDS
> + $(UNZIP) $(DL_DIR)/$(GMOCK_SOURCE) -d $(@D)
> + mv $(@D)/gmock-$(GMOCK_VERSION)/* $(@D)
> + rmdir $(@D)/gmock-$(GMOCK_VERSION)
> +endef
> +
> +define HOST_GMOCK_INSTALL_CMDS
> + $(INSTALL) -D -m 0755 $(@D)/scripts/generator/gmock_gen.py $(HOST_DIR)/usr/bin/gmock_gen.py
> + ln -sf gmock_gen.py $(HOST_DIR)/usr/bin/gmock_gen
> + cp -rp $(@D)/scripts/generator/cpp $(HOST_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages
> +endef
> +
> +$(eval $(autotools-package))
> +$(eval $(host-generic-package))
Who is using host-gmock? Your code is not using it apparently, so it
seems like dead code. Can you explain more how it is supposed to be
used? And why would it be a host-generic-package and not
host-autotools-package?
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Buildroot] [PATCH v2 1/1] gmock: new package
2015-03-02 14:01 ` [Buildroot] [PATCH 1/1] " Carlos Santos
2015-04-19 11:03 ` Fabio Porcedda
2015-04-27 21:52 ` Thomas Petazzoni
@ 2015-05-15 18:05 ` Carlos Santos
2015-07-14 10:09 ` Samuel Martin
` (2 more replies)
2 siblings, 3 replies; 16+ messages in thread
From: Carlos Santos @ 2015-05-15 18:05 UTC (permalink / raw)
To: buildroot
Inspired by jMock, EasyMock, and Hamcrest, and designed with C++'s
specifics in mind, Google C++ Mocking Framework (or Google Mock for
short) is a library for writing and using C++ mock classes.
Google Mock:
* lets you create mock classes trivially using simple macros,
* supports a rich set of matchers and actions,
* handles unordered, partially ordered, or completely ordered
expectations,
* is extensible by users, and
* works on Linux, Mac OS X, Windows, Windows Mobile, minGW, and
Symbian.
http://code.google.com/p/googlemock/
There are both host and target packages. The target one has include
files required to compile the tests and the static libraries required
to link/run them. The host package installs gmock_gen, a Python script
used to generate code mocks.
Signed-off-by: Marcelo Barbosa <marcelo.barbosa@datacom.ind.br>
Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
---
package/Config.in | 1 +
package/gmock/Config.in | 31 +++++++++++++++++++++++++++++
package/gmock/gmock.hash | 2 ++
package/gmock/gmock.mk | 52 ++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 86 insertions(+)
create mode 100644 package/gmock/Config.in
create mode 100644 package/gmock/gmock.hash
create mode 100644 package/gmock/gmock.mk
diff --git a/package/Config.in b/package/Config.in
index af4d2b7..3190bf8 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1014,6 +1014,7 @@ menu "Other"
source "package/flann/Config.in"
source "package/glibmm/Config.in"
source "package/glm/Config.in"
+ source "package/gmock/Config.in"
source "package/gmp/Config.in"
source "package/gsl/Config.in"
source "package/gtest/Config.in"
diff --git a/package/gmock/Config.in b/package/gmock/Config.in
new file mode 100644
index 0000000..8a18c29
--- /dev/null
+++ b/package/gmock/Config.in
@@ -0,0 +1,31 @@
+config BR2_PACKAGE_GMOCK
+ bool "gmock"
+ depends on BR2_USE_WCHAR
+ depends on BR2_TOOLCHAIN_HAS_THREADS
+ depends on BR2_INSTALL_LIBSTDCPP
+ depends on BR2_USE_MMU # fork()
+ help
+ Inspired by jMock, EasyMock, and Hamcrest, and designed with C++'s
+ specifics in mind, Google C++ Mocking Framework (or Google Mock for
+ short) is a library for writing and using C++ mock classes.
+
+ Google Mock:
+
+ * lets you create mock classes trivially using simple macros,
+ * supports a rich set of matchers and actions,
+ * handles unordered, partially ordered, or completely ordered
+ expectations,
+ * is extensible by users, and
+ * works on Linux, Mac OS X, Windows, Windows Mobile, minGW, and
+ Symbian.
+
+ http://code.google.com/p/googlemock/
+
+ There are both host and target packages. The target one has include
+ files required to compile the tests and the static libraries required
+ to link/run them. The host package installs gmock_gen, a Python script
+ used to generate code mocks.
+
+comment "gmock needs a toolchain w/ C++, wchar, threads"
+ depends on BR2_USE_MMU
+ depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || !BR2_INSTALL_LIBSTDCPP
diff --git a/package/gmock/gmock.hash b/package/gmock/gmock.hash
new file mode 100644
index 0000000..2b71739
--- /dev/null
+++ b/package/gmock/gmock.hash
@@ -0,0 +1,2 @@
+# Locally computed
+sha256 26fcbb5925b74ad5fc8c26b0495dfc96353f4d553492eb97e85a8a6d2f43095b gmock-1.7.0.zip
diff --git a/package/gmock/gmock.mk b/package/gmock/gmock.mk
new file mode 100644
index 0000000..3a7173e
--- /dev/null
+++ b/package/gmock/gmock.mk
@@ -0,0 +1,52 @@
+################################################################################
+#
+# gmock
+#
+################################################################################
+
+GMOCK_VERSION = 1.7.0
+GMOCK_SOURCE = gmock-$(GMOCK_VERSION).zip
+GMOCK_SITE = http://googlemock.googlecode.com/files
+GMOCK_INSTALL_STAGING = YES
+GMOCK_INSTALL_TARGET = NO
+GMOCK_LICENSE = BSD-3c
+GMOCK_LICENSE_FILES = LICENSE
+GMOCK_DEPENDENCIES = gtest
+HOST_GMOCK_DEPENDENCIES = host-python
+
+GMOCK_CONF_OPTS = --enable-static --disable-shared
+
+define GMOCK_EXTRACT_CMDS
+ $(UNZIP) $(DL_DIR)/$(GMOCK_SOURCE) -d $(BUILD_DIR)
+endef
+
+# We can't use the default rule for autotools-package staging because it fails
+# because it tries to rebuild/install gtest stuff and fails after this error:
+# "'make install' is dangerous and not supported. Instead, see README for
+# how to integrate Google Test into your build system."
+define GMOCK_INSTALL_STAGING_CMDS
+ $(INSTALL) -D -m 0755 $(@D)/lib/.libs/libgmock.a $(STAGING_DIR)/usr/lib/libgmock.a
+ $(INSTALL) -D -m 0755 $(@D)/lib/.libs/libgmock_main.a $(STAGING_DIR)/usr/lib/libgmock_main.a
+ $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/include/gmock/
+ cp -rp $(@D)/include/gmock/* $(STAGING_DIR)/usr/include/gmock/
+endef
+
+# Unzipping inside $(@D) and moving everything from the created subdirectory is
+# required because unzipping directly in $(BUILD_DIR) would cause host-gmock to
+# overwrite the gmock subdir instead of unzipping in a host-gmock subdir.
+define HOST_GMOCK_EXTRACT_CMDS
+ $(UNZIP) $(DL_DIR)/$(GMOCK_SOURCE) -d $(@D)
+ mv $(@D)/gmock-$(GMOCK_VERSION)/* $(@D)
+ rmdir $(@D)/gmock-$(GMOCK_VERSION)
+endef
+
+define HOST_GMOCK_INSTALL_CMDS
+ $(INSTALL) -D -m 0755 $(@D)/scripts/generator/gmock_gen.py $(HOST_DIR)/usr/bin/gmock_gen.py
+ ln -sf gmock_gen.py $(HOST_DIR)/usr/bin/gmock_gen
+ cp -rp $(@D)/scripts/generator/cpp $(HOST_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages
+endef
+
+$(eval $(autotools-package))
+# The host package does not build anything, just installs gmock_gen stuff, so
+# it does not need to be a host-autotools-package.
+$(eval $(host-generic-package))
--
2.1.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [Buildroot] [PATCH v2 1/1] gmock: new package
2015-05-15 18:05 ` [Buildroot] [PATCH v2 " Carlos Santos
@ 2015-07-14 10:09 ` Samuel Martin
2015-07-14 10:23 ` Thomas Petazzoni
2015-07-16 11:34 ` Carlos Santos
2015-07-23 20:39 ` [Buildroot] [PATCH V3 " Carlos Santos
2015-07-31 11:53 ` [Buildroot] [PATCH V4 " Carlos Santos
2 siblings, 2 replies; 16+ messages in thread
From: Samuel Martin @ 2015-07-14 10:09 UTC (permalink / raw)
To: buildroot
Carlos, all,
On Fri, May 15, 2015 at 8:05 PM, Carlos Santos <casantos@datacom.ind.br> wrote:
> Inspired by jMock, EasyMock, and Hamcrest, and designed with C++'s
> specifics in mind, Google C++ Mocking Framework (or Google Mock for
> short) is a library for writing and using C++ mock classes.
>
> Google Mock:
>
> * lets you create mock classes trivially using simple macros,
> * supports a rich set of matchers and actions,
> * handles unordered, partially ordered, or completely ordered
> expectations,
> * is extensible by users, and
> * works on Linux, Mac OS X, Windows, Windows Mobile, minGW, and
> Symbian.
>
> http://code.google.com/p/googlemock/
>
> There are both host and target packages. The target one has include
> files required to compile the tests and the static libraries required
> to link/run them. The host package installs gmock_gen, a Python script
> used to generate code mocks.
>
> Signed-off-by: Marcelo Barbosa <marcelo.barbosa@datacom.ind.br>
> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
> ---
> package/Config.in | 1 +
> package/gmock/Config.in | 31 +++++++++++++++++++++++++++++
> package/gmock/gmock.hash | 2 ++
> package/gmock/gmock.mk | 52 ++++++++++++++++++++++++++++++++++++++++++++++++
> 4 files changed, 86 insertions(+)
> create mode 100644 package/gmock/Config.in
> create mode 100644 package/gmock/gmock.hash
> create mode 100644 package/gmock/gmock.mk
>
> diff --git a/package/Config.in b/package/Config.in
> index af4d2b7..3190bf8 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -1014,6 +1014,7 @@ menu "Other"
> source "package/flann/Config.in"
> source "package/glibmm/Config.in"
> source "package/glm/Config.in"
> + source "package/gmock/Config.in"
> source "package/gmp/Config.in"
> source "package/gsl/Config.in"
> source "package/gtest/Config.in"
> diff --git a/package/gmock/Config.in b/package/gmock/Config.in
> new file mode 100644
> index 0000000..8a18c29
> --- /dev/null
> +++ b/package/gmock/Config.in
> @@ -0,0 +1,31 @@
> +config BR2_PACKAGE_GMOCK
> + bool "gmock"
> + depends on BR2_USE_WCHAR
> + depends on BR2_TOOLCHAIN_HAS_THREADS
> + depends on BR2_INSTALL_LIBSTDCPP
> + depends on BR2_USE_MMU # fork()
> + help
> + Inspired by jMock, EasyMock, and Hamcrest, and designed with C++'s
> + specifics in mind, Google C++ Mocking Framework (or Google Mock for
> + short) is a library for writing and using C++ mock classes.
> +
> + Google Mock:
> +
> + * lets you create mock classes trivially using simple macros,
> + * supports a rich set of matchers and actions,
> + * handles unordered, partially ordered, or completely ordered
> + expectations,
> + * is extensible by users, and
> + * works on Linux, Mac OS X, Windows, Windows Mobile, minGW, and
> + Symbian.
> +
> + http://code.google.com/p/googlemock/
> +
> + There are both host and target packages. The target one has include
> + files required to compile the tests and the static libraries required
> + to link/run them. The host package installs gmock_gen, a Python script
> + used to generate code mocks.
> +
> +comment "gmock needs a toolchain w/ C++, wchar, threads"
> + depends on BR2_USE_MMU
> + depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || !BR2_INSTALL_LIBSTDCPP
> diff --git a/package/gmock/gmock.hash b/package/gmock/gmock.hash
> new file mode 100644
> index 0000000..2b71739
> --- /dev/null
> +++ b/package/gmock/gmock.hash
> @@ -0,0 +1,2 @@
> +# Locally computed
> +sha256 26fcbb5925b74ad5fc8c26b0495dfc96353f4d553492eb97e85a8a6d2f43095b gmock-1.7.0.zip
> diff --git a/package/gmock/gmock.mk b/package/gmock/gmock.mk
> new file mode 100644
> index 0000000..3a7173e
> --- /dev/null
> +++ b/package/gmock/gmock.mk
> @@ -0,0 +1,52 @@
> +################################################################################
> +#
> +# gmock
> +#
> +################################################################################
> +
> +GMOCK_VERSION = 1.7.0
According to [1], gmock version must be the same as the gtest's one,
so maybe we should do:
GMOCK_VERSION = $(GTEST_VERSION)
(but, taking care of the *.mk inclusion to get GTEST_VERSION defined
before including gmock.mk).
> +GMOCK_SOURCE = gmock-$(GMOCK_VERSION).zip
> +GMOCK_SITE = http://googlemock.googlecode.com/files
> +GMOCK_INSTALL_STAGING = YES
> +GMOCK_INSTALL_TARGET = NO
> +GMOCK_LICENSE = BSD-3c
> +GMOCK_LICENSE_FILES = LICENSE
> +GMOCK_DEPENDENCIES = gtest
> +HOST_GMOCK_DEPENDENCIES = host-python
Does this require python2? or can it work with python3?
> +
> +GMOCK_CONF_OPTS = --enable-static --disable-shared
Why do you always force the static lib to be built? is it for the same
reason as gtest [2]?
> +
> +define GMOCK_EXTRACT_CMDS
> + $(UNZIP) $(DL_DIR)/$(GMOCK_SOURCE) -d $(BUILD_DIR)
> +endef
> +
> +# We can't use the default rule for autotools-package staging because it fails
> +# because it tries to rebuild/install gtest stuff and fails after this error:
> +# "'make install' is dangerous and not supported. Instead, see README for
> +# how to integrate Google Test into your build system."
> +define GMOCK_INSTALL_STAGING_CMDS
> + $(INSTALL) -D -m 0755 $(@D)/lib/.libs/libgmock.a $(STAGING_DIR)/usr/lib/libgmock.a
> + $(INSTALL) -D -m 0755 $(@D)/lib/.libs/libgmock_main.a $(STAGING_DIR)/usr/lib/libgmock_main.a
> + $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/include/gmock/
> + cp -rp $(@D)/include/gmock/* $(STAGING_DIR)/usr/include/gmock/
> +endef
> +
> +# Unzipping inside $(@D) and moving everything from the created subdirectory is
> +# required because unzipping directly in $(BUILD_DIR) would cause host-gmock to
> +# overwrite the gmock subdir instead of unzipping in a host-gmock subdir.
> +define HOST_GMOCK_EXTRACT_CMDS
> + $(UNZIP) $(DL_DIR)/$(GMOCK_SOURCE) -d $(@D)
> + mv $(@D)/gmock-$(GMOCK_VERSION)/* $(@D)
> + rmdir $(@D)/gmock-$(GMOCK_VERSION)
> +endef
> +
> +define HOST_GMOCK_INSTALL_CMDS
> + $(INSTALL) -D -m 0755 $(@D)/scripts/generator/gmock_gen.py $(HOST_DIR)/usr/bin/gmock_gen.py
> + ln -sf gmock_gen.py $(HOST_DIR)/usr/bin/gmock_gen
> + cp -rp $(@D)/scripts/generator/cpp $(HOST_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages
> +endef
> +
> +$(eval $(autotools-package))
> +# The host package does not build anything, just installs gmock_gen stuff, so
> +# it does not need to be a host-autotools-package.
> +$(eval $(host-generic-package))
AFAI understand, host-gmock only install tools needed when building a
package depending on gmock (target package).
Since host-gmock is not a dependency of gmock, a package using gmock
will have to depend on both gmock and host-gmock at buildtime.
Maybe, it would be good to make gmock depends on host-gmock to ensure
that all needed tools will be available when building a package
depending on gmock, but without the explicitly dependency on
host-gmock.
Thoughts?
Please, take into account these comments and submit a new version of
this patch if you are still interested in having it in the official
Buildroot tree, meanwhile it'll be marked as "Change Requested" in
patchwork.
[1] https://code.google.com/p/googlemock/source/browse/trunk/README#43
[2] http://git.buildroot.net/buildroot/tree/package/gtest/gtest.mk#n15
Regards,
--
Samuel
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Buildroot] [PATCH v2 1/1] gmock: new package
2015-07-14 10:09 ` Samuel Martin
@ 2015-07-14 10:23 ` Thomas Petazzoni
2015-07-16 11:34 ` Carlos Santos
1 sibling, 0 replies; 16+ messages in thread
From: Thomas Petazzoni @ 2015-07-14 10:23 UTC (permalink / raw)
To: buildroot
Samuel, Carlos,
On Tue, 14 Jul 2015 12:09:34 +0200, Samuel Martin wrote:
> > +################################################################################
> > +#
> > +# gmock
> > +#
> > +################################################################################
> > +
> > +GMOCK_VERSION = 1.7.0
> According to [1], gmock version must be the same as the gtest's one,
> so maybe we should do:
> GMOCK_VERSION = $(GTEST_VERSION)
> (but, taking care of the *.mk inclusion to get GTEST_VERSION defined
> before including gmock.mk).
I don't think this is a good idea. gmock is included *before* gtest,
and there's not much that can be done about this.
So instead, I would recommend to just to:
# Make sure this remains the same version as the gtest one
GMOCK_VERSION = 1.7.0
and then in gtest.mk:
# Make sure this remains the same version as the gmock one
GTEST_VERSION = 1.7.0
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Buildroot] [PATCH v2 1/1] gmock: new package
2015-07-14 10:09 ` Samuel Martin
2015-07-14 10:23 ` Thomas Petazzoni
@ 2015-07-16 11:34 ` Carlos Santos
2015-07-16 20:51 ` Carlos Santos
1 sibling, 1 reply; 16+ messages in thread
From: Carlos Santos @ 2015-07-16 11:34 UTC (permalink / raw)
To: buildroot
> From: "Samuel Martin" <s.martin49@gmail.com>
> To: "Carlos Santos" <casantos@datacom.ind.br>
> Cc: "buildroot" <buildroot@buildroot.org>
> Sent: Tuesday, July 14, 2015 7:09:34 AM
> Subject: Re: [Buildroot] [PATCH v2 1/1] gmock: new package
>> diff --git a/package/gmock/gmock.mk b/package/gmock/gmock.mk
>> new file mode 100644
>> index 0000000..3a7173e
>> --- /dev/null
>> +++ b/package/gmock/gmock.mk
>> @@ -0,0 +1,52 @@
>> +################################################################################
>> +#
>> +# gmock
>> +#
>> +################################################################################
>> +
>> +GMOCK_VERSION = 1.7.0
> According to [1], gmock version must be the same as the gtest's one,
> so maybe we should do:
> GMOCK_VERSION = $(GTEST_VERSION)
> (but, taking care of the *.mk inclusion to get GTEST_VERSION defined
> before including gmock.mk).
>
>> +GMOCK_SOURCE = gmock-$(GMOCK_VERSION).zip
>> +GMOCK_SITE = http://googlemock.googlecode.com/files
>> +GMOCK_INSTALL_STAGING = YES
>> +GMOCK_INSTALL_TARGET = NO
>> +GMOCK_LICENSE = BSD-3c
>> +GMOCK_LICENSE_FILES = LICENSE
>> +GMOCK_DEPENDENCIES = gtest
>> +HOST_GMOCK_DEPENDENCIES = host-python
> Does this require python2? or can it work with ?
I did not test with python3. I will give it a try and update gmock.mk accordingly.
>> +GMOCK_CONF_OPTS = --enable-static --disable-shared
> Why do you always force the static lib to be built? is it for the same
> reason as gtest [2]?
It's required in order to keep the GMock package completely separated from GTest. According to [3] "Google Mock can be used as a DLL, but the same DLL must contain Google Test as well. See Google Test's README file for instructions on how to set up necessary compiler settings".
[...]
>> +# The host package does not build anything, just installs gmock_gen stuff, so
>> +# it does not need to be a host-autotools-package.
>> +$(eval $(host-generic-package))
>
> AFAI understand, host-gmock only install tools needed when building a
> package depending on gmock (target package).
> Since host-gmock is not a dependency of gmock, a package using gmock
> will have to depend on both gmock and host-gmock at buildtime.
> Maybe, it would be good to make gmock depends on host-gmock to ensure
> that all needed tools will be available when building a package
> depending on gmock, but without the explicitly dependency on
> host-gmock.
Yes, I will add a dependence on host-gmock.
> Please, take into account these comments and submit a new version of
> this patch if you are still interested in having it in the official
> Buildroot tree, meanwhile it'll be marked as "Change Requested" in
> patchwork.
>
>
> [1] https://code.google.com/p/googlemock/source/browse/trunk/README#43
> [2] http://git.buildroot.net/buildroot/tree/package/gtest/gtest.mk#n15
[3] https://code.google.com/p/googlemock/source/browse/trunk/README#276
Carlos Santos (Casantos)
DATACOM, P&D
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Buildroot] [PATCH v2 1/1] gmock: new package
2015-07-16 11:34 ` Carlos Santos
@ 2015-07-16 20:51 ` Carlos Santos
2015-07-16 22:57 ` Samuel Martin
0 siblings, 1 reply; 16+ messages in thread
From: Carlos Santos @ 2015-07-16 20:51 UTC (permalink / raw)
To: buildroot
> From: "Carlos Santos" <casantos@datacom.ind.br>
> To: "Samuel Martin" <s.martin49@gmail.com>
> Cc: "buildroot" <buildroot@buildroot.org>
> Sent: Thursday, July 16, 2015 8:34:51 AM
> Subject: Re: [Buildroot] [PATCH v2 1/1] gmock: new package
[...]
>> From: "Samuel Martin" <s.martin49@gmail.com>
>> To: "Carlos Santos" <casantos@datacom.ind.br>
>> Cc: "buildroot" <buildroot@buildroot.org>
>> Sent: Tuesday, July 14, 2015 7:09:34 AM
>> Subject: Re: [Buildroot] [PATCH v2 1/1] gmock: new package
[...]
>>> +GMOCK_SOURCE = gmock-$(GMOCK_VERSION).zip
>>> +GMOCK_SITE = http://googlemock.googlecode.com/files
>>> +GMOCK_INSTALL_STAGING = YES
>>> +GMOCK_INSTALL_TARGET = NO
>>> +GMOCK_LICENSE = BSD-3c
>>> +GMOCK_LICENSE_FILES = LICENSE
>>> +GMOCK_DEPENDENCIES = gtest
>>> +HOST_GMOCK_DEPENDENCIES = host-python
>> Does this require python2? or can it work with python3?
>
> I did not test with python3. I will give it a try and update gmock.mk
> accordingly.
Is there a way to select between host-python and host-python3? I can select either python or python3 via menuconfig in
Target packages -> Interpreter languages and scripting
but this would add python to the target system.
Carlos Santos (Casantos)
DATACOM, P&D
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Buildroot] [PATCH v2 1/1] gmock: new package
2015-07-16 20:51 ` Carlos Santos
@ 2015-07-16 22:57 ` Samuel Martin
0 siblings, 0 replies; 16+ messages in thread
From: Samuel Martin @ 2015-07-16 22:57 UTC (permalink / raw)
To: buildroot
Carlos,
On Thu, Jul 16, 2015 at 10:51 PM, Carlos Santos <casantos@datacom.ind.br> wrote:
[...]
>
> Is there a way to select between host-python and host-python3? I can select either python or python3 via menuconfig in
>
> Target packages -> Interpreter languages and scripting
>
> but this would add python to the target system.
When you select python3 for the target, the host-python3 is built and
set as default python interpreter in $(HOST_DIR) ; iow,
$(HOST_DIR)/usr/bin/python points to python3.
So the way of buiilding host-python3 is selecting python3 for the target.
Regards,
--
Samuel
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Buildroot] [PATCH V3 1/1] gmock: new package
2015-05-15 18:05 ` [Buildroot] [PATCH v2 " Carlos Santos
2015-07-14 10:09 ` Samuel Martin
@ 2015-07-23 20:39 ` Carlos Santos
2015-07-28 15:42 ` Romain Naour
2015-07-31 11:53 ` [Buildroot] [PATCH V4 " Carlos Santos
2 siblings, 1 reply; 16+ messages in thread
From: Carlos Santos @ 2015-07-23 20:39 UTC (permalink / raw)
To: buildroot
Inspired by jMock, EasyMock, and Hamcrest, and designed with C++'s
specifics in mind, Google C++ Mocking Framework (or Google Mock for
short) is a library for writing and using C++ mock classes.
Google Mock:
* lets you create mock classes trivially using simple macros,
* supports a rich set of matchers and actions,
* handles unordered, partially ordered, or completely ordered
expectations,
* is extensible by users, and
* works on Linux, Mac OS X, Windows, Windows Mobile, minGW, and
Symbian.
http://code.google.com/p/googlemock/
There are both host and target packages. The target one has include
files required to compile the tests and the static libraries required
to link/run them. The host package installs gmock_gen, a Python script
used to generate code mocks.
Notice that GMock 1.7.0 requires the Python 2 host package even if
Python 3 is selected as a target package.
Signed-off-by: Marcelo Barbosa <marcelo.barbosa@datacom.ind.br>
Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
---
package/Config.in | 1 +
package/gmock/0001-fuse_gtest_files-python2.patch | 8 ++++
package/gmock/0002-gmock_gen-python2.patch | 8 ++++
package/gmock/Config.in | 31 +++++++++++++
package/gmock/gmock.hash | 2 +
package/gmock/gmock.mk | 56 +++++++++++++++++++++++
package/gtest/gtest.mk | 1 +
7 files changed, 107 insertions(+)
create mode 100644 package/gmock/0001-fuse_gtest_files-python2.patch
create mode 100644 package/gmock/0002-gmock_gen-python2.patch
create mode 100644 package/gmock/Config.in
create mode 100644 package/gmock/gmock.hash
create mode 100644 package/gmock/gmock.mk
diff --git a/package/Config.in b/package/Config.in
index 9942e3a..c95bfe6 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1042,6 +1042,7 @@ menu "Other"
source "package/gflags/Config.in"
source "package/glibmm/Config.in"
source "package/glm/Config.in"
+ source "package/gmock/Config.in"
source "package/gmp/Config.in"
source "package/gsl/Config.in"
source "package/gtest/Config.in"
diff --git a/package/gmock/0001-fuse_gtest_files-python2.patch b/package/gmock/0001-fuse_gtest_files-python2.patch
new file mode 100644
index 0000000..dc0096e
--- /dev/null
+++ b/package/gmock/0001-fuse_gtest_files-python2.patch
@@ -0,0 +1,8 @@
+--- ./gtest/scripts/fuse_gtest_files.py.orig 2013-09-18 14:48:30.000000000 -0300
++++ ./gtest/scripts/fuse_gtest_files.py 2015-07-22 15:42:53.291591205 -0300
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python2
+ #
+ # Copyright 2009, Google Inc.
+ # All rights reserved.
diff --git a/package/gmock/0002-gmock_gen-python2.patch b/package/gmock/0002-gmock_gen-python2.patch
new file mode 100644
index 0000000..9015a22
--- /dev/null
+++ b/package/gmock/0002-gmock_gen-python2.patch
@@ -0,0 +1,8 @@
+--- ./scripts/generator/gmock_gen.py.orig 2013-09-18 14:50:15.000000000 -0300
++++ ./scripts/generator/gmock_gen.py 2015-07-22 17:06:51.071815634 -0300
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python2
+ #
+ # Copyright 2008 Google Inc. All Rights Reserved.
+ #
diff --git a/package/gmock/Config.in b/package/gmock/Config.in
new file mode 100644
index 0000000..d792945
--- /dev/null
+++ b/package/gmock/Config.in
@@ -0,0 +1,31 @@
+config BR2_PACKAGE_GMOCK
+ bool "gmock"
+ depends on BR2_USE_WCHAR
+ depends on BR2_TOOLCHAIN_HAS_THREADS
+ depends on BR2_INSTALL_LIBSTDCPP
+ depends on BR2_USE_MMU # fork()
+ help
+ Inspired by jMock, EasyMock, and Hamcrest, and designed with C++'s
+ specifics in mind, Google C++ Mocking Framework (or Google Mock for
+ short) is a library for writing and using C++ mock classes.
+
+ Google Mock:
+
+ * lets you create mock classes trivially using simple macros,
+ * supports a rich set of matchers and actions,
+ * handles unordered, partially ordered, or completely ordered
+ expectations,
+ * is extensible by users, and
+ * works on Linux, Mac OS X, Windows, Windows Mobile, minGW, and
+ Symbian.
+
+ http://code.google.com/p/googlemock/
+
+ There are both host and target packages. The target one has include
+ files required to compile the tests and the static libraries required
+ to link/run them. The host package installs gmock_gen, a Python script
+ used to generate code mocks.
+
+comment "gmock needs a toolchain w/ C++, wchar, threads"
+ depends on BR2_USE_MMU
+ depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || !BR2_INSTALL_LIBSTDCPP
diff --git a/package/gmock/gmock.hash b/package/gmock/gmock.hash
new file mode 100644
index 0000000..2b71739
--- /dev/null
+++ b/package/gmock/gmock.hash
@@ -0,0 +1,2 @@
+# Locally computed
+sha256 26fcbb5925b74ad5fc8c26b0495dfc96353f4d553492eb97e85a8a6d2f43095b gmock-1.7.0.zip
diff --git a/package/gmock/gmock.mk b/package/gmock/gmock.mk
new file mode 100644
index 0000000..aad2183
--- /dev/null
+++ b/package/gmock/gmock.mk
@@ -0,0 +1,56 @@
+################################################################################
+#
+# gmock
+#
+################################################################################
+
+# Make sure this remains the same version as the gtest one
+GMOCK_VERSION = 1.7.0
+GMOCK_SOURCE = gmock-$(GMOCK_VERSION).zip
+GMOCK_SITE = http://googlemock.googlecode.com/files
+GMOCK_INSTALL_STAGING = YES
+GMOCK_INSTALL_TARGET = NO
+GMOCK_LICENSE = BSD-3c
+GMOCK_LICENSE_FILES = LICENSE
+GMOCK_DEPENDENCIES = gtest host-gmock
+
+# GMock 1.7.0 relies on Python 2.7 syntax which is NOT compatible with Python3.
+HOST_GMOCK_DEPENDENCIES = host-python
+HOST_GMOCK_PYTHONPATH=$(HOST_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages
+
+GMOCK_CONF_OPTS = --enable-static --disable-shared
+
+define GMOCK_EXTRACT_CMDS
+ $(UNZIP) $(DL_DIR)/$(GMOCK_SOURCE) -d $(BUILD_DIR)
+endef
+
+# We can't use the default rule for autotools-package staging because it fails
+# because it tries to rebuild/install gtest stuff and fails after this error:
+# "'make install' is dangerous and not supported. Instead, see README for
+# how to integrate Google Test into your build system."
+define GMOCK_INSTALL_STAGING_CMDS
+ $(INSTALL) -D -m 0755 $(@D)/lib/.libs/libgmock.a $(STAGING_DIR)/usr/lib/libgmock.a
+ $(INSTALL) -D -m 0755 $(@D)/lib/.libs/libgmock_main.a $(STAGING_DIR)/usr/lib/libgmock_main.a
+ $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/include/gmock/
+ cp -rp $(@D)/include/gmock/* $(STAGING_DIR)/usr/include/gmock/
+endef
+
+# Unzipping inside $(@D) and moving everything from the created subdirectory is
+# required because unzipping directly in $(BUILD_DIR) would cause host-gmock to
+# overwrite the gmock subdir instead of unzipping in a host-gmock subdir.
+define HOST_GMOCK_EXTRACT_CMDS
+ $(UNZIP) $(DL_DIR)/$(GMOCK_SOURCE) -d $(@D)
+ mv $(@D)/gmock-$(GMOCK_VERSION)/* $(@D)
+ rmdir $(@D)/gmock-$(GMOCK_VERSION)
+endef
+
+define HOST_GMOCK_INSTALL_CMDS
+ $(INSTALL) -D -m 0755 $(@D)/scripts/generator/gmock_gen.py $(HOST_DIR)/usr/bin/gmock_gen.py
+ ln -sf gmock_gen.py $(HOST_DIR)/usr/bin/gmock_gen
+ cp -rp $(@D)/scripts/generator/cpp $(HOST_GMOCK_PYTHONPATH)
+endef
+
+$(eval $(autotools-package))
+# The host package does not build anything, just installs gmock_gen stuff, so
+# it does not need to be a host-autotools-package.
+$(eval $(host-generic-package))
diff --git a/package/gtest/gtest.mk b/package/gtest/gtest.mk
index 562acf0..da08621 100644
--- a/package/gtest/gtest.mk
+++ b/package/gtest/gtest.mk
@@ -4,6 +4,7 @@
#
################################################################################
+# Make sure this remains the same version as the gmock one
GTEST_VERSION = 1.7.0
GTEST_SOURCE = gtest-$(GTEST_VERSION).zip
GTEST_SITE = http://googletest.googlecode.com/files
--
1.8.3.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [Buildroot] [PATCH V3 1/1] gmock: new package
2015-07-23 20:39 ` [Buildroot] [PATCH V3 " Carlos Santos
@ 2015-07-28 15:42 ` Romain Naour
0 siblings, 0 replies; 16+ messages in thread
From: Romain Naour @ 2015-07-28 15:42 UTC (permalink / raw)
To: buildroot
Hi Carlos,
Le 23/07/2015 22:39, Carlos Santos a ?crit :
> Inspired by jMock, EasyMock, and Hamcrest, and designed with C++'s
> specifics in mind, Google C++ Mocking Framework (or Google Mock for
> short) is a library for writing and using C++ mock classes.
>
> Google Mock:
>
> * lets you create mock classes trivially using simple macros,
> * supports a rich set of matchers and actions,
> * handles unordered, partially ordered, or completely ordered
> expectations,
> * is extensible by users, and
> * works on Linux, Mac OS X, Windows, Windows Mobile, minGW, and
> Symbian.
>
> http://code.google.com/p/googlemock/
>
> There are both host and target packages. The target one has include
> files required to compile the tests and the static libraries required
> to link/run them. The host package installs gmock_gen, a Python script
> used to generate code mocks.
>
> Notice that GMock 1.7.0 requires the Python 2 host package even if
> Python 3 is selected as a target package.
>
> Signed-off-by: Marcelo Barbosa <marcelo.barbosa@datacom.ind.br>
> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
> ---
> package/Config.in | 1 +
> package/gmock/0001-fuse_gtest_files-python2.patch | 8 ++++
> package/gmock/0002-gmock_gen-python2.patch | 8 ++++
> package/gmock/Config.in | 31 +++++++++++++
> package/gmock/gmock.hash | 2 +
> package/gmock/gmock.mk | 56 +++++++++++++++++++++++
> package/gtest/gtest.mk | 1 +
> 7 files changed, 107 insertions(+)
> create mode 100644 package/gmock/0001-fuse_gtest_files-python2.patch
> create mode 100644 package/gmock/0002-gmock_gen-python2.patch
> create mode 100644 package/gmock/Config.in
> create mode 100644 package/gmock/gmock.hash
> create mode 100644 package/gmock/gmock.mk
>
> diff --git a/package/Config.in b/package/Config.in
> index 9942e3a..c95bfe6 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -1042,6 +1042,7 @@ menu "Other"
> source "package/gflags/Config.in"
> source "package/glibmm/Config.in"
> source "package/glm/Config.in"
> + source "package/gmock/Config.in"
> source "package/gmp/Config.in"
> source "package/gsl/Config.in"
> source "package/gtest/Config.in"
> diff --git a/package/gmock/0001-fuse_gtest_files-python2.patch b/package/gmock/0001-fuse_gtest_files-python2.patch
> new file mode 100644
> index 0000000..dc0096e
> --- /dev/null
> +++ b/package/gmock/0001-fuse_gtest_files-python2.patch
> @@ -0,0 +1,8 @@
> +--- ./gtest/scripts/fuse_gtest_files.py.orig 2013-09-18 14:48:30.000000000 -0300
> ++++ ./gtest/scripts/fuse_gtest_files.py 2015-07-22 15:42:53.291591205 -0300
> +@@ -1,4 +1,4 @@
> +-#!/usr/bin/env python
> ++#!/usr/bin/env python2
> + #
> + # Copyright 2009, Google Inc.
> + # All rights reserved.
> diff --git a/package/gmock/0002-gmock_gen-python2.patch b/package/gmock/0002-gmock_gen-python2.patch
> new file mode 100644
> index 0000000..9015a22
> --- /dev/null
> +++ b/package/gmock/0002-gmock_gen-python2.patch
> @@ -0,0 +1,8 @@
> +--- ./scripts/generator/gmock_gen.py.orig 2013-09-18 14:50:15.000000000 -0300
> ++++ ./scripts/generator/gmock_gen.py 2015-07-22 17:06:51.071815634 -0300
> +@@ -1,4 +1,4 @@
> +-#!/usr/bin/env python
> ++#!/usr/bin/env python2
> + #
> + # Copyright 2008 Google Inc. All Rights Reserved.
> + #
These two patches can be squashed since they do the same thing.
Also, a short description and a Sob line are needed.
See:
http://buildroot.uclibc.org/downloads/manual/manual.html#_format_and_licensing_of_the_package_patches
> diff --git a/package/gmock/Config.in b/package/gmock/Config.in
> new file mode 100644
> index 0000000..d792945
> --- /dev/null
> +++ b/package/gmock/Config.in
> @@ -0,0 +1,31 @@
> +config BR2_PACKAGE_GMOCK
> + bool "gmock"
Here gmock must select gtest package since it's a mandatory dependency.
select BR2_PACKAGE_GTEST
> + depends on BR2_USE_WCHAR
> + depends on BR2_TOOLCHAIN_HAS_THREADS
> + depends on BR2_INSTALL_LIBSTDCPP
> + depends on BR2_USE_MMU # fork()
> + help
> + Inspired by jMock, EasyMock, and Hamcrest, and designed with C++'s
> + specifics in mind, Google C++ Mocking Framework (or Google Mock for
> + short) is a library for writing and using C++ mock classes.
> +
> + Google Mock:
> +
> + * lets you create mock classes trivially using simple macros,
> + * supports a rich set of matchers and actions,
> + * handles unordered, partially ordered, or completely ordered
> + expectations,
> + * is extensible by users, and
> + * works on Linux, Mac OS X, Windows, Windows Mobile, minGW, and
> + Symbian.
> +
> + http://code.google.com/p/googlemock/
> +
> + There are both host and target packages. The target one has include
> + files required to compile the tests and the static libraries required
> + to link/run them. The host package installs gmock_gen, a Python script
> + used to generate code mocks.
> +
> +comment "gmock needs a toolchain w/ C++, wchar, threads"
> + depends on BR2_USE_MMU
> + depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || !BR2_INSTALL_LIBSTDCPP
> diff --git a/package/gmock/gmock.hash b/package/gmock/gmock.hash
> new file mode 100644
> index 0000000..2b71739
> --- /dev/null
> +++ b/package/gmock/gmock.hash
> @@ -0,0 +1,2 @@
> +# Locally computed
> +sha256 26fcbb5925b74ad5fc8c26b0495dfc96353f4d553492eb97e85a8a6d2f43095b gmock-1.7.0.zip
> diff --git a/package/gmock/gmock.mk b/package/gmock/gmock.mk
> new file mode 100644
> index 0000000..aad2183
> --- /dev/null
> +++ b/package/gmock/gmock.mk
> @@ -0,0 +1,56 @@
> +################################################################################
> +#
> +# gmock
> +#
> +################################################################################
> +
> +# Make sure this remains the same version as the gtest one
> +GMOCK_VERSION = 1.7.0
> +GMOCK_SOURCE = gmock-$(GMOCK_VERSION).zip
> +GMOCK_SITE = http://googlemock.googlecode.com/files
> +GMOCK_INSTALL_STAGING = YES
> +GMOCK_INSTALL_TARGET = NO
> +GMOCK_LICENSE = BSD-3c
> +GMOCK_LICENSE_FILES = LICENSE
> +GMOCK_DEPENDENCIES = gtest host-gmock
> +
> +# GMock 1.7.0 relies on Python 2.7 syntax which is NOT compatible with Python3.
> +HOST_GMOCK_DEPENDENCIES = host-python
> +HOST_GMOCK_PYTHONPATH=$(HOST_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages
> +
> +GMOCK_CONF_OPTS = --enable-static --disable-shared
Maybe add a comment to explain why we want only static libraries.
You can use the answer you gave to Samuel.
Otherwise, your patch is almost ready.
I build it with a uClibc-ng and musl ARM toolchains.
Best regards,
Romain Naour
> +
> +define GMOCK_EXTRACT_CMDS
> + $(UNZIP) $(DL_DIR)/$(GMOCK_SOURCE) -d $(BUILD_DIR)
> +endef
> +
> +# We can't use the default rule for autotools-package staging because it fails
> +# because it tries to rebuild/install gtest stuff and fails after this error:
> +# "'make install' is dangerous and not supported. Instead, see README for
> +# how to integrate Google Test into your build system."
> +define GMOCK_INSTALL_STAGING_CMDS
> + $(INSTALL) -D -m 0755 $(@D)/lib/.libs/libgmock.a $(STAGING_DIR)/usr/lib/libgmock.a
> + $(INSTALL) -D -m 0755 $(@D)/lib/.libs/libgmock_main.a $(STAGING_DIR)/usr/lib/libgmock_main.a
> + $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/include/gmock/
> + cp -rp $(@D)/include/gmock/* $(STAGING_DIR)/usr/include/gmock/
> +endef
> +
> +# Unzipping inside $(@D) and moving everything from the created subdirectory is
> +# required because unzipping directly in $(BUILD_DIR) would cause host-gmock to
> +# overwrite the gmock subdir instead of unzipping in a host-gmock subdir.
> +define HOST_GMOCK_EXTRACT_CMDS
> + $(UNZIP) $(DL_DIR)/$(GMOCK_SOURCE) -d $(@D)
> + mv $(@D)/gmock-$(GMOCK_VERSION)/* $(@D)
> + rmdir $(@D)/gmock-$(GMOCK_VERSION)
> +endef
> +
> +define HOST_GMOCK_INSTALL_CMDS
> + $(INSTALL) -D -m 0755 $(@D)/scripts/generator/gmock_gen.py $(HOST_DIR)/usr/bin/gmock_gen.py
> + ln -sf gmock_gen.py $(HOST_DIR)/usr/bin/gmock_gen
> + cp -rp $(@D)/scripts/generator/cpp $(HOST_GMOCK_PYTHONPATH)
> +endef
> +
> +$(eval $(autotools-package))
> +# The host package does not build anything, just installs gmock_gen stuff, so
> +# it does not need to be a host-autotools-package.
> +$(eval $(host-generic-package))
> diff --git a/package/gtest/gtest.mk b/package/gtest/gtest.mk
> index 562acf0..da08621 100644
> --- a/package/gtest/gtest.mk
> +++ b/package/gtest/gtest.mk
> @@ -4,6 +4,7 @@
> #
> ################################################################################
>
> +# Make sure this remains the same version as the gmock one
> GTEST_VERSION = 1.7.0
> GTEST_SOURCE = gtest-$(GTEST_VERSION).zip
> GTEST_SITE = http://googletest.googlecode.com/files
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Buildroot] [PATCH V4 1/1] gmock: new package
2015-05-15 18:05 ` [Buildroot] [PATCH v2 " Carlos Santos
2015-07-14 10:09 ` Samuel Martin
2015-07-23 20:39 ` [Buildroot] [PATCH V3 " Carlos Santos
@ 2015-07-31 11:53 ` Carlos Santos
2015-07-31 14:06 ` Romain Naour
2015-10-03 15:14 ` Peter Korsgaard
2 siblings, 2 replies; 16+ messages in thread
From: Carlos Santos @ 2015-07-31 11:53 UTC (permalink / raw)
To: buildroot
Inspired by jMock, EasyMock, and Hamcrest, and designed with C++'s
specifics in mind, Google C++ Mocking Framework (or Google Mock for
short) is a library for writing and using C++ mock classes.
Google Mock:
* lets you create mock classes trivially using simple macros,
* supports a rich set of matchers and actions,
* handles unordered, partially ordered, or completely ordered
expectations,
* is extensible by users, and
* works on Linux, Mac OS X, Windows, Windows Mobile, minGW, and
Symbian.
http://code.google.com/p/googlemock/
There are both host and target packages. The target one has include
files required to compile the tests and the static libraries required
to link/run them. The host package installs gmock_gen, a Python script
used to generate code mocks.
Notice that GMock 1.7.0 requires the Python 2 host package even if
Python 3 is selected as a target package.
Signed-off-by: Marcelo Barbosa <marcelo.barbosa@datacom.ind.br>
Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
---
package/Config.in | 1 +
package/gmock/0001-force-use-python2.patch | 20 ++++++++++
package/gmock/Config.in | 32 +++++++++++++++
package/gmock/gmock.hash | 2 +
package/gmock/gmock.mk | 62 ++++++++++++++++++++++++++++++
package/gtest/gtest.mk | 1 +
6 files changed, 118 insertions(+)
create mode 100644 package/gmock/0001-force-use-python2.patch
create mode 100644 package/gmock/Config.in
create mode 100644 package/gmock/gmock.hash
create mode 100644 package/gmock/gmock.mk
diff --git a/package/Config.in b/package/Config.in
index 43c58ca..70593fb 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1053,6 +1053,7 @@ menu "Other"
source "package/gflags/Config.in"
source "package/glibmm/Config.in"
source "package/glm/Config.in"
+ source "package/gmock/Config.in"
source "package/gmp/Config.in"
source "package/gsl/Config.in"
source "package/gtest/Config.in"
diff --git a/package/gmock/0001-force-use-python2.patch b/package/gmock/0001-force-use-python2.patch
new file mode 100644
index 0000000..5dcb231
--- /dev/null
+++ b/package/gmock/0001-force-use-python2.patch
@@ -0,0 +1,20 @@
+Force use of Python 2 even when Python 3 is the default Python interpreter.
+
+Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
+
+--- ./gtest/scripts/fuse_gtest_files.py.orig 2013-09-18 14:48:30.000000000 -0300
++++ ./gtest/scripts/fuse_gtest_files.py 2015-07-22 15:42:53.291591205 -0300
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python2
+ #
+ # Copyright 2009, Google Inc.
+ # All rights reserved.
+--- ./scripts/generator/gmock_gen.py.orig 2013-09-18 14:50:15.000000000 -0300
++++ ./scripts/generator/gmock_gen.py 2015-07-22 17:06:51.071815634 -0300
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python2
+ #
+ # Copyright 2008 Google Inc. All Rights Reserved.
+ #
diff --git a/package/gmock/Config.in b/package/gmock/Config.in
new file mode 100644
index 0000000..ec3eb92
--- /dev/null
+++ b/package/gmock/Config.in
@@ -0,0 +1,32 @@
+config BR2_PACKAGE_GMOCK
+ bool "gmock"
+ select BR2_PACKAGE_GTEST
+ depends on BR2_USE_WCHAR
+ depends on BR2_TOOLCHAIN_HAS_THREADS
+ depends on BR2_INSTALL_LIBSTDCPP
+ depends on BR2_USE_MMU # fork()
+ help
+ Inspired by jMock, EasyMock, and Hamcrest, and designed with C++'s
+ specifics in mind, Google C++ Mocking Framework (or Google Mock for
+ short) is a library for writing and using C++ mock classes.
+
+ Google Mock:
+
+ * lets you create mock classes trivially using simple macros,
+ * supports a rich set of matchers and actions,
+ * handles unordered, partially ordered, or completely ordered
+ expectations,
+ * is extensible by users, and
+ * works on Linux, Mac OS X, Windows, Windows Mobile, minGW, and
+ Symbian.
+
+ http://code.google.com/p/googlemock/
+
+ There are both host and target packages. The target one has include
+ files required to compile the tests and the static libraries required
+ to link/run them. The host package installs gmock_gen, a Python script
+ used to generate code mocks.
+
+comment "gmock needs a toolchain w/ C++, wchar, threads"
+ depends on BR2_USE_MMU
+ depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || !BR2_INSTALL_LIBSTDCPP
diff --git a/package/gmock/gmock.hash b/package/gmock/gmock.hash
new file mode 100644
index 0000000..2b71739
--- /dev/null
+++ b/package/gmock/gmock.hash
@@ -0,0 +1,2 @@
+# Locally computed
+sha256 26fcbb5925b74ad5fc8c26b0495dfc96353f4d553492eb97e85a8a6d2f43095b gmock-1.7.0.zip
diff --git a/package/gmock/gmock.mk b/package/gmock/gmock.mk
new file mode 100644
index 0000000..a0351d0
--- /dev/null
+++ b/package/gmock/gmock.mk
@@ -0,0 +1,62 @@
+################################################################################
+#
+# gmock
+#
+################################################################################
+
+# Make sure this remains the same version as the gtest one
+GMOCK_VERSION = 1.7.0
+GMOCK_SOURCE = gmock-$(GMOCK_VERSION).zip
+GMOCK_SITE = http://googlemock.googlecode.com/files
+GMOCK_INSTALL_STAGING = YES
+GMOCK_INSTALL_TARGET = NO
+GMOCK_LICENSE = BSD-3c
+GMOCK_LICENSE_FILES = LICENSE
+GMOCK_DEPENDENCIES = gtest host-gmock
+
+# GMock 1.7.0 relies on Python 2.7 syntax which is NOT compatible with Python3.
+HOST_GMOCK_DEPENDENCIES = host-python
+HOST_GMOCK_PYTHONPATH=$(HOST_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages
+
+# Static linking is required in order to keep the GMock package completely
+# separated from GTest. According to GMock's README file:
+#
+# "Google Mock can be used as a DLL, but the same DLL must contain Google
+# Test as well. See Google Test's README file for instructions on how to
+# set up necessary compiler settings".
+GMOCK_CONF_OPTS = --enable-static --disable-shared
+
+define GMOCK_EXTRACT_CMDS
+ $(UNZIP) $(DL_DIR)/$(GMOCK_SOURCE) -d $(BUILD_DIR)
+endef
+
+# We can't use the default rule for autotools-package staging because it fails
+# because it tries to rebuild/install gtest stuff and fails after this error:
+# "'make install' is dangerous and not supported. Instead, see README for
+# how to integrate Google Test into your build system."
+define GMOCK_INSTALL_STAGING_CMDS
+ $(INSTALL) -D -m 0755 $(@D)/lib/.libs/libgmock.a $(STAGING_DIR)/usr/lib/libgmock.a
+ $(INSTALL) -D -m 0755 $(@D)/lib/.libs/libgmock_main.a $(STAGING_DIR)/usr/lib/libgmock_main.a
+ $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/include/gmock/
+ cp -rp $(@D)/include/gmock/* $(STAGING_DIR)/usr/include/gmock/
+endef
+
+# Unzipping inside $(@D) and moving everything from the created subdirectory is
+# required because unzipping directly in $(BUILD_DIR) would cause host-gmock to
+# overwrite the gmock subdir instead of unzipping in a host-gmock subdir.
+define HOST_GMOCK_EXTRACT_CMDS
+ $(UNZIP) $(DL_DIR)/$(GMOCK_SOURCE) -d $(@D)
+ mv $(@D)/gmock-$(GMOCK_VERSION)/* $(@D)
+ rmdir $(@D)/gmock-$(GMOCK_VERSION)
+endef
+
+define HOST_GMOCK_INSTALL_CMDS
+ $(INSTALL) -D -m 0755 $(@D)/scripts/generator/gmock_gen.py $(HOST_DIR)/usr/bin/gmock_gen.py
+ ln -sf gmock_gen.py $(HOST_DIR)/usr/bin/gmock_gen
+ cp -rp $(@D)/scripts/generator/cpp $(HOST_GMOCK_PYTHONPATH)
+endef
+
+$(eval $(autotools-package))
+# The host package does not build anything, just installs gmock_gen stuff, so
+# it does not need to be a host-autotools-package.
+$(eval $(host-generic-package))
diff --git a/package/gtest/gtest.mk b/package/gtest/gtest.mk
index 562acf0..da08621 100644
--- a/package/gtest/gtest.mk
+++ b/package/gtest/gtest.mk
@@ -4,6 +4,7 @@
#
################################################################################
+# Make sure this remains the same version as the gmock one
GTEST_VERSION = 1.7.0
GTEST_SOURCE = gtest-$(GTEST_VERSION).zip
GTEST_SITE = http://googletest.googlecode.com/files
--
1.8.3.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [Buildroot] [PATCH V4 1/1] gmock: new package
2015-07-31 11:53 ` [Buildroot] [PATCH V4 " Carlos Santos
@ 2015-07-31 14:06 ` Romain Naour
2015-09-17 19:21 ` Carlos Santos
2015-10-03 15:14 ` Peter Korsgaard
1 sibling, 1 reply; 16+ messages in thread
From: Romain Naour @ 2015-07-31 14:06 UTC (permalink / raw)
To: buildroot
Hi Carlos,
Le 31/07/2015 13:53, Carlos Santos a ?crit :
> Inspired by jMock, EasyMock, and Hamcrest, and designed with C++'s
> specifics in mind, Google C++ Mocking Framework (or Google Mock for
> short) is a library for writing and using C++ mock classes.
>
> Google Mock:
>
> * lets you create mock classes trivially using simple macros,
> * supports a rich set of matchers and actions,
> * handles unordered, partially ordered, or completely ordered
> expectations,
> * is extensible by users, and
> * works on Linux, Mac OS X, Windows, Windows Mobile, minGW, and
> Symbian.
>
> http://code.google.com/p/googlemock/
>
> There are both host and target packages. The target one has include
> files required to compile the tests and the static libraries required
> to link/run them. The host package installs gmock_gen, a Python script
> used to generate code mocks.
>
> Notice that GMock 1.7.0 requires the Python 2 host package even if
> Python 3 is selected as a target package.
>
> Signed-off-by: Marcelo Barbosa <marcelo.barbosa@datacom.ind.br>
> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
Reviewed-by: Romain Naour <romain.naour@openwide.fr>
Best regards,
Romain Naour
> ---
> package/Config.in | 1 +
> package/gmock/0001-force-use-python2.patch | 20 ++++++++++
> package/gmock/Config.in | 32 +++++++++++++++
> package/gmock/gmock.hash | 2 +
> package/gmock/gmock.mk | 62 ++++++++++++++++++++++++++++++
> package/gtest/gtest.mk | 1 +
> 6 files changed, 118 insertions(+)
> create mode 100644 package/gmock/0001-force-use-python2.patch
> create mode 100644 package/gmock/Config.in
> create mode 100644 package/gmock/gmock.hash
> create mode 100644 package/gmock/gmock.mk
>
> diff --git a/package/Config.in b/package/Config.in
> index 43c58ca..70593fb 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -1053,6 +1053,7 @@ menu "Other"
> source "package/gflags/Config.in"
> source "package/glibmm/Config.in"
> source "package/glm/Config.in"
> + source "package/gmock/Config.in"
> source "package/gmp/Config.in"
> source "package/gsl/Config.in"
> source "package/gtest/Config.in"
> diff --git a/package/gmock/0001-force-use-python2.patch b/package/gmock/0001-force-use-python2.patch
> new file mode 100644
> index 0000000..5dcb231
> --- /dev/null
> +++ b/package/gmock/0001-force-use-python2.patch
> @@ -0,0 +1,20 @@
> +Force use of Python 2 even when Python 3 is the default Python interpreter.
> +
> +Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
> +
> +--- ./gtest/scripts/fuse_gtest_files.py.orig 2013-09-18 14:48:30.000000000 -0300
> ++++ ./gtest/scripts/fuse_gtest_files.py 2015-07-22 15:42:53.291591205 -0300
> +@@ -1,4 +1,4 @@
> +-#!/usr/bin/env python
> ++#!/usr/bin/env python2
> + #
> + # Copyright 2009, Google Inc.
> + # All rights reserved.
> +--- ./scripts/generator/gmock_gen.py.orig 2013-09-18 14:50:15.000000000 -0300
> ++++ ./scripts/generator/gmock_gen.py 2015-07-22 17:06:51.071815634 -0300
> +@@ -1,4 +1,4 @@
> +-#!/usr/bin/env python
> ++#!/usr/bin/env python2
> + #
> + # Copyright 2008 Google Inc. All Rights Reserved.
> + #
> diff --git a/package/gmock/Config.in b/package/gmock/Config.in
> new file mode 100644
> index 0000000..ec3eb92
> --- /dev/null
> +++ b/package/gmock/Config.in
> @@ -0,0 +1,32 @@
> +config BR2_PACKAGE_GMOCK
> + bool "gmock"
> + select BR2_PACKAGE_GTEST
> + depends on BR2_USE_WCHAR
> + depends on BR2_TOOLCHAIN_HAS_THREADS
> + depends on BR2_INSTALL_LIBSTDCPP
> + depends on BR2_USE_MMU # fork()
> + help
> + Inspired by jMock, EasyMock, and Hamcrest, and designed with C++'s
> + specifics in mind, Google C++ Mocking Framework (or Google Mock for
> + short) is a library for writing and using C++ mock classes.
> +
> + Google Mock:
> +
> + * lets you create mock classes trivially using simple macros,
> + * supports a rich set of matchers and actions,
> + * handles unordered, partially ordered, or completely ordered
> + expectations,
> + * is extensible by users, and
> + * works on Linux, Mac OS X, Windows, Windows Mobile, minGW, and
> + Symbian.
> +
> + http://code.google.com/p/googlemock/
> +
> + There are both host and target packages. The target one has include
> + files required to compile the tests and the static libraries required
> + to link/run them. The host package installs gmock_gen, a Python script
> + used to generate code mocks.
> +
> +comment "gmock needs a toolchain w/ C++, wchar, threads"
> + depends on BR2_USE_MMU
> + depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || !BR2_INSTALL_LIBSTDCPP
> diff --git a/package/gmock/gmock.hash b/package/gmock/gmock.hash
> new file mode 100644
> index 0000000..2b71739
> --- /dev/null
> +++ b/package/gmock/gmock.hash
> @@ -0,0 +1,2 @@
> +# Locally computed
> +sha256 26fcbb5925b74ad5fc8c26b0495dfc96353f4d553492eb97e85a8a6d2f43095b gmock-1.7.0.zip
> diff --git a/package/gmock/gmock.mk b/package/gmock/gmock.mk
> new file mode 100644
> index 0000000..a0351d0
> --- /dev/null
> +++ b/package/gmock/gmock.mk
> @@ -0,0 +1,62 @@
> +################################################################################
> +#
> +# gmock
> +#
> +################################################################################
> +
> +# Make sure this remains the same version as the gtest one
> +GMOCK_VERSION = 1.7.0
> +GMOCK_SOURCE = gmock-$(GMOCK_VERSION).zip
> +GMOCK_SITE = http://googlemock.googlecode.com/files
> +GMOCK_INSTALL_STAGING = YES
> +GMOCK_INSTALL_TARGET = NO
> +GMOCK_LICENSE = BSD-3c
> +GMOCK_LICENSE_FILES = LICENSE
> +GMOCK_DEPENDENCIES = gtest host-gmock
> +
> +# GMock 1.7.0 relies on Python 2.7 syntax which is NOT compatible with Python3.
> +HOST_GMOCK_DEPENDENCIES = host-python
> +HOST_GMOCK_PYTHONPATH=$(HOST_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages
> +
> +# Static linking is required in order to keep the GMock package completely
> +# separated from GTest. According to GMock's README file:
> +#
> +# "Google Mock can be used as a DLL, but the same DLL must contain Google
> +# Test as well. See Google Test's README file for instructions on how to
> +# set up necessary compiler settings".
> +GMOCK_CONF_OPTS = --enable-static --disable-shared
> +
> +define GMOCK_EXTRACT_CMDS
> + $(UNZIP) $(DL_DIR)/$(GMOCK_SOURCE) -d $(BUILD_DIR)
> +endef
> +
> +# We can't use the default rule for autotools-package staging because it fails
> +# because it tries to rebuild/install gtest stuff and fails after this error:
> +# "'make install' is dangerous and not supported. Instead, see README for
> +# how to integrate Google Test into your build system."
> +define GMOCK_INSTALL_STAGING_CMDS
> + $(INSTALL) -D -m 0755 $(@D)/lib/.libs/libgmock.a $(STAGING_DIR)/usr/lib/libgmock.a
> + $(INSTALL) -D -m 0755 $(@D)/lib/.libs/libgmock_main.a $(STAGING_DIR)/usr/lib/libgmock_main.a
> + $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/include/gmock/
> + cp -rp $(@D)/include/gmock/* $(STAGING_DIR)/usr/include/gmock/
> +endef
> +
> +# Unzipping inside $(@D) and moving everything from the created subdirectory is
> +# required because unzipping directly in $(BUILD_DIR) would cause host-gmock to
> +# overwrite the gmock subdir instead of unzipping in a host-gmock subdir.
> +define HOST_GMOCK_EXTRACT_CMDS
> + $(UNZIP) $(DL_DIR)/$(GMOCK_SOURCE) -d $(@D)
> + mv $(@D)/gmock-$(GMOCK_VERSION)/* $(@D)
> + rmdir $(@D)/gmock-$(GMOCK_VERSION)
> +endef
> +
> +define HOST_GMOCK_INSTALL_CMDS
> + $(INSTALL) -D -m 0755 $(@D)/scripts/generator/gmock_gen.py $(HOST_DIR)/usr/bin/gmock_gen.py
> + ln -sf gmock_gen.py $(HOST_DIR)/usr/bin/gmock_gen
> + cp -rp $(@D)/scripts/generator/cpp $(HOST_GMOCK_PYTHONPATH)
> +endef
> +
> +$(eval $(autotools-package))
> +# The host package does not build anything, just installs gmock_gen stuff, so
> +# it does not need to be a host-autotools-package.
> +$(eval $(host-generic-package))
> diff --git a/package/gtest/gtest.mk b/package/gtest/gtest.mk
> index 562acf0..da08621 100644
> --- a/package/gtest/gtest.mk
> +++ b/package/gtest/gtest.mk
> @@ -4,6 +4,7 @@
> #
> ################################################################################
>
> +# Make sure this remains the same version as the gmock one
> GTEST_VERSION = 1.7.0
> GTEST_SOURCE = gtest-$(GTEST_VERSION).zip
> GTEST_SITE = http://googletest.googlecode.com/files
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Buildroot] [PATCH V4 1/1] gmock: new package
2015-07-31 14:06 ` Romain Naour
@ 2015-09-17 19:21 ` Carlos Santos
0 siblings, 0 replies; 16+ messages in thread
From: Carlos Santos @ 2015-09-17 19:21 UTC (permalink / raw)
To: buildroot
Hello,
Gentle reminder: this change still needs to be applied:
http://patchwork.ozlabs.org/patch/502506/
Carlos Santos (Casantos)
DATACOM, P&D
----- Original Message -----
> From: "Romain Naour" <romain.naour@openwide.fr>
> To: "Carlos Santos" <casantos@datacom.ind.br>, buildroot at buildroot.org
> Sent: Friday, July 31, 2015 11:06:11 AM
> Subject: Re: [Buildroot] [PATCH V4 1/1] gmock: new package
> Hi Carlos,
>
> Le 31/07/2015 13:53, Carlos Santos a ?crit :
>> Inspired by jMock, EasyMock, and Hamcrest, and designed with C++'s
>> specifics in mind, Google C++ Mocking Framework (or Google Mock for
>> short) is a library for writing and using C++ mock classes.
>>
>> Google Mock:
>>
>> * lets you create mock classes trivially using simple macros,
>> * supports a rich set of matchers and actions,
>> * handles unordered, partially ordered, or completely ordered
>> expectations,
>> * is extensible by users, and
>> * works on Linux, Mac OS X, Windows, Windows Mobile, minGW, and
>> Symbian.
>>
>> http://code.google.com/p/googlemock/
>>
>> There are both host and target packages. The target one has include
>> files required to compile the tests and the static libraries required
>> to link/run them. The host package installs gmock_gen, a Python script
>> used to generate code mocks.
>>
>> Notice that GMock 1.7.0 requires the Python 2 host package even if
>> Python 3 is selected as a target package.
>>
>> Signed-off-by: Marcelo Barbosa <marcelo.barbosa@datacom.ind.br>
>> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
>
> Reviewed-by: Romain Naour <romain.naour@openwide.fr>
>
> Best regards,
> Romain Naour
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Buildroot] [PATCH V4 1/1] gmock: new package
2015-07-31 11:53 ` [Buildroot] [PATCH V4 " Carlos Santos
2015-07-31 14:06 ` Romain Naour
@ 2015-10-03 15:14 ` Peter Korsgaard
1 sibling, 0 replies; 16+ messages in thread
From: Peter Korsgaard @ 2015-10-03 15:14 UTC (permalink / raw)
To: buildroot
>>>>> "Carlos" == Carlos Santos <casantos@datacom.ind.br> writes:
Hi,
Sorry for the slow response!
> Inspired by jMock, EasyMock, and Hamcrest, and designed with C++'s
> specifics in mind, Google C++ Mocking Framework (or Google Mock for
> short) is a library for writing and using C++ mock classes.
> Google Mock:
> * lets you create mock classes trivially using simple macros,
> * supports a rich set of matchers and actions,
> * handles unordered, partially ordered, or completely ordered
> expectations,
> * is extensible by users, and
> * works on Linux, Mac OS X, Windows, Windows Mobile, minGW, and
> Symbian.
> http://code.google.com/p/googlemock/
> There are both host and target packages. The target one has include
> files required to compile the tests and the static libraries required
> to link/run them. The host package installs gmock_gen, a Python script
> used to generate code mocks.
> Notice that GMock 1.7.0 requires the Python 2 host package even if
> Python 3 is selected as a target package.
> Signed-off-by: Marcelo Barbosa <marcelo.barbosa@datacom.ind.br>
> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
Committed, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2015-10-03 15:14 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-02 14:01 [Buildroot] [PATCH 0/1] gmock: new package Carlos Santos
2015-03-02 14:01 ` [Buildroot] [PATCH 1/1] " Carlos Santos
2015-04-19 11:03 ` Fabio Porcedda
2015-04-27 21:52 ` Thomas Petazzoni
2015-05-15 18:05 ` [Buildroot] [PATCH v2 " Carlos Santos
2015-07-14 10:09 ` Samuel Martin
2015-07-14 10:23 ` Thomas Petazzoni
2015-07-16 11:34 ` Carlos Santos
2015-07-16 20:51 ` Carlos Santos
2015-07-16 22:57 ` Samuel Martin
2015-07-23 20:39 ` [Buildroot] [PATCH V3 " Carlos Santos
2015-07-28 15:42 ` Romain Naour
2015-07-31 11:53 ` [Buildroot] [PATCH V4 " Carlos Santos
2015-07-31 14:06 ` Romain Naour
2015-09-17 19:21 ` Carlos Santos
2015-10-03 15:14 ` Peter Korsgaard
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.