Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

move modem and things to contrib dir #241

Merged
merged 4 commits into from
Feb 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "test/googletest"]
path = test/googletest
[submodule "contrib/test/googletest"]
path = contrib/test/googletest
url = https://github.com/google/googletest.git
[submodule "test/arduino-mock"]
path = test/arduino-mock
[submodule "contrib/test/arduino-mock"]
path = contrib/test/arduino-mock
url = https://github.com/ed7coyne/arduino-mock.git
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ before_script:
- ( cd ${ARDUINO_HOME}/libraries && ln -s ${TRAVIS_BUILD_DIR} firebase-arduino && ln -s ${TRAVIS_BUILD_DIR}/src/third-party/arduino-json-5.6.7 ArduinoJson && ln -s ${HOME}/SoftwareSerial ./ && ln -s ${HOME}/Adafruit_NeoPixel ./ && ln -s ${HOME}/Adafruit-GFX-Library ./ && ln -s ${HOME}/Adafruit_SSD1306 ./)
script:
- ${ARDUINO_ROOT}/arduino-builder -verbose -hardware ${ARDUINO_ROOT}/hardware/ -tools ${ARDUINO_ESP8266_ROOT}/tools/ -tools ${ARDUINO_ROOT}/tools-builder/ -fqbn esp8266com:esp8266:nodemcuv2 -libraries ${ARDUINO_HOME}/libraries/ -prefs build.flash_ld=${ARDUINO_ESP8266_ROOT}/tools/sdk/ld/eagle.flash.4m.ld -prefs build.flash_freq=40 -prefs build.flash_size=4M examples/FirebaseDemo_ESP8266/FirebaseDemo_ESP8266.ino
- ${ARDUINO_ROOT}/arduino-builder -verbose -hardware ${ARDUINO_ROOT}/hardware/ -tools ${ARDUINO_ESP8266_ROOT}/tools/ -tools ${ARDUINO_ROOT}/tools-builder/ -fqbn esp8266com:esp8266:nodemcuv2 -libraries ${ARDUINO_HOME}/libraries/ -prefs build.flash_ld=${ARDUINO_ESP8266_ROOT}/tools/sdk/ld/eagle.flash.4m.ld -prefs build.flash_freq=40 -prefs build.flash_size=4M examples/FirebaseSerialHost_ESP8266/FirebaseSerialHost_ESP8266.ino
- ${ARDUINO_ROOT}/arduino-builder -verbose -hardware ${ARDUINO_ROOT}/hardware/ -tools ${ARDUINO_ESP8266_ROOT}/tools/ -tools ${ARDUINO_ROOT}/tools-builder/ -fqbn esp8266com:esp8266:nodemcuv2 -libraries ${ARDUINO_HOME}/libraries/ -prefs build.flash_ld=${ARDUINO_ESP8266_ROOT}/tools/sdk/ld/eagle.flash.4m.ld -prefs build.flash_freq=40 -prefs build.flash_size=4M examples/FirebaseNeoPixel_ESP8266/FirebaseNeoPixel_ESP8266.ino
- ${ARDUINO_ROOT}/arduino-builder -verbose -hardware ${ARDUINO_ROOT}/hardware/ -tools ${ARDUINO_ESP8266_ROOT}/tools/ -tools ${ARDUINO_ROOT}/tools-builder/ -fqbn esp8266com:esp8266:nodemcuv2 -libraries ${ARDUINO_HOME}/libraries/ -prefs build.flash_ld=${ARDUINO_ESP8266_ROOT}/tools/sdk/ld/eagle.flash.4m.ld -prefs build.flash_freq=40 -prefs build.flash_size=4M examples/FirebaseStream_ESP8266/FirebaseStream_ESP8266.ino
- ${ARDUINO_ROOT}/arduino-builder -verbose -hardware ${ARDUINO_ROOT}/hardware/ -tools ${ARDUINO_ESP8266_ROOT}/tools/ -tools ${ARDUINO_ROOT}/tools-builder/ -fqbn esp8266com:esp8266:nodemcuv2 -libraries ${ARDUINO_HOME}/libraries/ -prefs build.flash_ld=${ARDUINO_ESP8266_ROOT}/tools/sdk/ld/eagle.flash.4m.ld -prefs build.flash_freq=40 -prefs build.flash_size=4M examples/FirebaseRoom_ESP8266/FirebaseRoom_ESP8266.ino
- ( cd test && make check )
- ( cd test/modem/ && make test )
- test/travis/check_all_examples_use_standard_init.sh
- ( cd contrib/test && make check )
- ( cd contrib/test/modem/ && make test )
- contrib/test/travis/check_all_examples_use_standard_init.sh
8 changes: 8 additions & 0 deletions contrib/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# firebase-arduino contrib

The `contrib` features projects around `firebase-arduino` library:

- `modem`: a firmware implementing a `UART` modem for firebase
- `firethings`: a firmware implementing `GPIO` state syncing with firebase
- `hardware`: hardware design for `ESP8266` reference boards
- `test`: test suite and mocks
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions test/Makefile → contrib/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
# limitations under the License.
#

FIREBASE_DIR=..
FIREBASE_DIR=../..
GTEST_DIR=googletest/googletest
ARDUINOJSON_DIR=../src/third-party/arduino-json-5.6.7
ARDUINOJSON_DIR=../../src/third-party/arduino-json-5.6.7

FIREBASE_SRCS=${FIREBASE_DIR}/src/FirebaseObject.cpp
GTEST_SRCS=${GTEST_DIR}/src/gtest-all.cpp
Expand All @@ -27,7 +27,7 @@ SRCS=FirebaseArduino_test.cpp\

OBJS=${SRCS:.cpp=.o}

CXXFLAGS=-I. -I../src -Igoogletest/googletest/include -Igoogletest/googletest -std=c++11 -g
CXXFLAGS=-I. -I${FIREBASE_DIR}/src -Igoogletest/googletest/include -Igoogletest/googletest -std=c++11 -g
LDFLAGS=-lpthread

all: check
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions contrib/test/arduino-mock
Submodule arduino-mock added at 0f7f9f
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions contrib/test/googletest
Submodule googletest added at a2b8a8
File renamed without changes.
9 changes: 6 additions & 3 deletions test/modem/Makefile → contrib/test/modem/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ ARDUINO_MOCK_DIR = ../arduino-mock/
# Where to find user code.
TEST_DIR = .

PROJECT_ROOT = ../../
FIREBASE_ROOT = ../../..
PROJECT_ROOT = ../..
SRC_ROOT = $(PROJECT_ROOT)/src
FIREBASE_SRC_ROOT = $(FIREBASE_ROOT)/src

# Flags passed to the preprocessor.
# Set Google Test and Google Mock's header directories as system
Expand All @@ -42,6 +44,7 @@ CPPFLAGS += -isystem $(GTEST_DIR)/include -isystem $(GMOCK_DIR)/include \
-I$(ARDUINO_MOCK_DIR)/include/ \
-I$(PROJECT_ROOT)/test/dummies \
-I$(PROJECT_ROOT)/src \
-I$(FIREBASE_ROOT)/src \
-I$(PROJECT_ROOT)

# Flags passed to the C++ compiler.
Expand Down Expand Up @@ -125,8 +128,8 @@ arduino_mock_all.a : ArduinoMockAll.o

# Builds shared objects.

Firebase.o : $(SRC_ROOT)/Firebase.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(SRC_ROOT)/Firebase.cpp
Firebase.o : $(FIREBASE_SRC_ROOT)/Firebase.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(FIREBASE_SRC_ROOT)/Firebase.cpp

FirebaseHttpClient_dummy.o : $(PROJECT_ROOT)/test/dummies/FirebaseHttpClient_dummy.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(PROJECT_ROOT)/test/dummies/FirebaseHttpClient_dummy.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/bin/bash
FBASE_SNIPPET=test/travis/firebase_init.cc.snip
FBASE_NOAUTH_SNIPPET=test/travis/no_firebase_init.cc.snip
FBASE_NOCONFIG_SNIPPET=test/travis/no_config_init.cc.snip
for example in `find examples/ -name *.ino`;
FBASE_SNIPPET=contrib/test/travis/firebase_init.cc.snip
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this test be in contrib? It seems part of the main project.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant this to be a file-comment, it is the entire script that seems part of the core project.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC I moved all the tests stuff to contrib/ for now, since it was pretty tangled.

So that we can easily package the Arduino library as: root - everything in contrib until we find a better organization/packaging option.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah I see, sounds like a good plan.

FBASE_NOAUTH_SNIPPET=contrib/test/travis/no_firebase_init.cc.snip
FBASE_NOCONFIG_SNIPPET=contrib/test/travis/no_config_init.cc.snip
for example in `find examples/ contrib/examples/ -name *.ino`;
do
echo $example;
(xxd -p $example | tr -d '\n' | grep -q `xxd -p $FBASE_SNIPPET | tr -d '\n'`) ||
(xxd -p $example | tr -d '\n' | grep -q `xxd -p $FBASE_NOAUTH_SNIPPET | tr -d '\n'`) ||
(xxd -p $example | tr -d '\n' | grep -q `xxd -p $FBASE_NOCONFIG_SNIPPET | tr -d '\n'`) ||
if [ $? -ne 0 ];
then
echo $example does not contain standard defined in test/travis/*_init.cc.snip.
echo $example does not contain standard defined in contrib/test/travis/*_init.cc.snip.
exit 1;
fi;
done;
1 change: 0 additions & 1 deletion test/arduino-mock
Submodule arduino-mock deleted from ff0f89
1 change: 0 additions & 1 deletion test/googletest
Submodule googletest deleted from ff07a5