Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
2c8ab3f1
Unverified
Commit
2c8ab3f1
authored
Dec 04, 2018
by
Chris Johnson
Committed by
GitHub
Dec 04, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: Add initial support for PlatformIO and Arduino
parent
fe14e303
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
77 additions
and
0 deletions
+77
-0
.travis.yml
.travis.yml
+9
-0
build-platformio.sh
ci/build-platformio.sh
+2
-0
install-platformio.sh
ci/install-platformio.sh
+5
-0
gmock_main.cc
googlemock/src/gmock_main.cc
+16
-0
gtest_main.cc
googletest/src/gtest_main.cc
+14
-0
platformio.ini
platformio.ini
+31
-0
No files found.
.travis.yml
View file @
2c8ab3f1
...
@@ -11,6 +11,12 @@ language: cpp
...
@@ -11,6 +11,12 @@ language: cpp
matrix
:
matrix
:
include
:
include
:
-
os
:
linux
-
os
:
linux
dist
:
trusty
sudo
:
required
group
:
deprecated-2017Q3
install
:
./ci/install-platformio.sh
script
:
./ci/build-platformio.sh
-
os
:
linux
compiler
:
gcc
compiler
:
gcc
sudo
:
true
sudo
:
true
install
:
./ci/install-linux.sh && ./ci/log-config.sh
install
:
./ci/install-linux.sh && ./ci/log-config.sh
...
@@ -44,6 +50,9 @@ matrix:
...
@@ -44,6 +50,9 @@ matrix:
env
:
BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS=-std=c++11
env
:
BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS=-std=c++11
if
:
type != pull_request
if
:
type != pull_request
before_install
:
-
chmod -R +x ./ci/*.sh
# These are the install and build (script) phases for the most common entries in the matrix. They could be included
# These are the install and build (script) phases for the most common entries in the matrix. They could be included
# in each entry in the matrix, but that is just repetitive.
# in each entry in the matrix, but that is just repetitive.
install
:
install
:
...
...
ci/build-platformio.sh
0 → 100644
View file @
2c8ab3f1
# run PlatformIO builds
platformio run
ci/install-platformio.sh
0 → 100644
View file @
2c8ab3f1
# install PlatformIO
sudo
pip
install
-U
platformio
# update PlatformIO
platformio update
googlemock/src/gmock_main.cc
View file @
2c8ab3f1
...
@@ -32,6 +32,20 @@
...
@@ -32,6 +32,20 @@
#include "gmock/gmock.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "gtest/gtest.h"
#ifdef ARDUINO
void
setup
()
{
int
argc
=
0
;
char
**
argv
=
nullptr
;
// Since Google Mock depends on Google Test, InitGoogleMock() is
// also responsible for initializing Google Test. Therefore there's
// no need for calling testing::InitGoogleTest() separately.
testing
::
InitGoogleMock
(
&
argc
,
argv
);
}
void
loop
()
{
RUN_ALL_TESTS
();
}
#else
// MS C++ compiler/linker has a bug on Windows (not on Windows CE), which
// MS C++ compiler/linker has a bug on Windows (not on Windows CE), which
// causes a link error when _tmain is defined in a static library and UNICODE
// causes a link error when _tmain is defined in a static library and UNICODE
// is enabled. For this reason instead of _tmain, main function is used on
// is enabled. For this reason instead of _tmain, main function is used on
...
@@ -52,3 +66,5 @@ GTEST_API_ int main(int argc, char** argv) {
...
@@ -52,3 +66,5 @@ GTEST_API_ int main(int argc, char** argv) {
testing
::
InitGoogleMock
(
&
argc
,
argv
);
testing
::
InitGoogleMock
(
&
argc
,
argv
);
return
RUN_ALL_TESTS
();
return
RUN_ALL_TESTS
();
}
}
#endif
googletest/src/gtest_main.cc
View file @
2c8ab3f1
...
@@ -30,8 +30,22 @@
...
@@ -30,8 +30,22 @@
#include <stdio.h>
#include <stdio.h>
#include "gtest/gtest.h"
#include "gtest/gtest.h"
#ifdef ARDUINO
void
setup
()
{
int
argc
=
0
;
char
**
argv
=
nullptr
;
testing
::
InitGoogleTest
(
&
argc
,
argv
);
}
void
loop
()
{
RUN_ALL_TESTS
();
}
#else
GTEST_API_
int
main
(
int
argc
,
char
**
argv
)
{
GTEST_API_
int
main
(
int
argc
,
char
**
argv
)
{
printf
(
"Running main() from %s
\n
"
,
__FILE__
);
printf
(
"Running main() from %s
\n
"
,
__FILE__
);
testing
::
InitGoogleTest
(
&
argc
,
argv
);
testing
::
InitGoogleTest
(
&
argc
,
argv
);
return
RUN_ALL_TESTS
();
return
RUN_ALL_TESTS
();
}
}
#endif
platformio.ini
0 → 100644
View file @
2c8ab3f1
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; http://docs.platformio.org/page/projectconf.html
[platformio]
#src_dir = ./googlemock
#src_dir = ./googletest
src_dir
=
.
[env:googletest_esp32]
platform
=
espressif32
board
=
esp32dev
framework
=
arduino
build_flags
=
-I./googletest/include -I./googletest
src_filter
=
+<*> -<.git/> -<googlemock> -<googletest/codegear/> -<googletest/samples> -<googletest/test/> -<googletest/xcode> -<googletest/src> +<googletest/src/gtest-all.cc> +<googletest/src/gtest_main.cc>
upload_speed
=
921600
[env:googlemock_esp32]
platform
=
espressif32
board
=
esp32dev
framework
=
arduino
build_flags
=
-I./googlemock/include -I./googletest/include -I./googletest -I./googlemock
src_filter
=
+<*> -<.git/> -<googletest> -<googlemock/test/> -<googlemock/src> +<googlemock/src/gmock-all.cc> +<googlemock/src/gmock_main.cc> +<googletest/src/gtest-all.cc>
upload_speed
=
921600
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment