Skip to content

Commit 3bf938b

Browse files
committed
- improved travis
- moved cxxtest dependency to git submodule
1 parent 26f701a commit 3bf938b

File tree

8 files changed

+53
-23
lines changed

8 files changed

+53
-23
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@
88
path = submodules/googletest
99
url = https://github.com/google/googletest
1010
ignore = dirty
11+
[submodule "submodules/cxxtest"]
12+
path = submodules/cxxtest
13+
url = https://github.com/CxxTest/cxxtest

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ notifications:
1212
language: cpp
1313

1414
# non-root build
15-
sudo: false
15+
sudo: true
1616

1717
# specify language options
1818

@@ -31,3 +31,7 @@ compiler:
3131

3232
script:
3333
- make check
34+
35+
before_install:
36+
- sudo apt-get -qq update
37+
- sudo apt-get install -y gcc-avr binutils-avr avr-libc arduino

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# arduino-skeleton
2+
[![Build Status](https://travis-ci.org/dannyp11/arduino-skeleton.svg?branch=master)](https://travis-ci.org/dannyp11/arduino-skeleton)
3+
24
This is the first embarkment of my learning experience & side projects. Let's see how far I could go :)
35
Skeleton framework for Arduino with/without RTOS, uses avr gcc/ g++
46
Currently works with Unix system, compatible with Arduino framework (setup/loop) using sudar's repo

ReleaseNote.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ RelNote -*- mode : org -*-
3838
- State "DONE" from "CANCELED" [2017-07-30 Sun 13:45]
3939
** DONE avoid recompiling gtest library every time running make check
4040
- State "DONE" from "CANCELED" [2017-07-30 Sun 13:46]
41+
** DONE integrate Travis CI in project
42+
- State "DONE" from "FEEDBACK" [2017-07-30 Sun 16:39]
43+
- State "FEEDBACK" from "INPROGRESS" [2017-07-30 Sun 16:39]
4144
** TODO motion sensor test code
4245
** TODO hand clap sound detector
4346
* WAIT v2.2.0 - more integrated module in i2c-console

common/makefiles/unittest.mk

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
55
MKFILE_DIRNAME := $(notdir $(patsubst %/,%,$(dir $(MKFILE_PATH))))
66
TOP :=$(shell dirname $(MKFILE_PATH))/../../
77

8+
# cxxtest dir & pkg config
9+
CXXTEST_DIR ?=$(TOP)/submodules/cxxtest
10+
INCLUDES += $(CXXTEST_DIR)
11+
CXXTEST_GEN ?=$(CXXTEST_DIR)/bin/cxxtestgen
12+
813
# test objects definition
914
TEST_OBJECTS = $(patsubst %.cpp, %.ocxx, $(TEST_SOURCES))
1015
TEST_OBJECTS += $(patsubst %.c, %.ocxx, $(TEST_SOURCES))
@@ -22,7 +27,7 @@ IFLAGS = $(foreach d, $(INCLUDES), -I$d)
2227
# main rules to run
2328
##########################################################################################
2429
TEST_GEN:
25-
$(foreach f, $(TEST_HEADERS), cxxtestgen --error-printer -o $(f).cpp $(f) ; )
30+
$(foreach f, $(TEST_HEADERS), $(CXXTEST_GEN) --error-printer -o $(f).cpp $(f) ; )
2631
$(MAKE) test_compile
2732

2833
ifneq ($(filter $(BRIEF), $(TRUE)),) # check if compile message should be output, BRIEF means no

common/skeleton.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ PROGRAMMER = -c arduino -P $(TTY) -b 115200
1616
# Directory path ####################################################################
1717
OS_DIR = $(TOP)/submodules/ChibiOS/
1818
ARDUINO_MAKEFILE_DIR = $(TOP)/submodules/Arduino-Makefile
19+
CXXTEST_DIR = $(TOP)/submodules/cxxtest
20+
GTEST_DIR = $(TOP)/submodules/googletest
1921
UTILS_DIR = $(TOP)/common/utils/
2022
MKFILES_DIR = $(TOP)/common/makefiles/
2123

project_manager.sh

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,18 @@ print_warning()
4040
# run all make check in directory recursively
4141
function checkFolder()
4242
{
43+
local retVal=0
4344
find "$1" -name Makefile | while read line; do
44-
local TEST_DIR=$(dirname $line)/test/
45-
if [ -d "$TEST_DIR" ] ; then
46-
print_title "Checking in $(dirname ${line})" ;
47-
make -C $(dirname $line) check BRIEF=1 -j4
48-
fi
49-
done
45+
local TEST_DIR=$(dirname $line)/test/
46+
if [ -d "$TEST_DIR" ] ; then
47+
print_title "Checking in $(dirname ${line})"
48+
make -C $(dirname $line) check BRIEF=1 -j4
49+
50+
((retVal = retVal + $?))
51+
fi
52+
done
53+
54+
return $retVal
5055
}
5156

5257
# run make clean in dir recursively
@@ -60,24 +65,29 @@ function cleanFolder()
6065
# run make all in dir recursively
6166
function makeFolder()
6267
{
68+
local retVal=0
69+
6370
find "$1" -name Makefile | while read line; do
64-
print_title "Compile in $(dirname ${line})..." ;
65-
66-
if (($FULL_REPORT == 0)) ; then
67-
make -C $(dirname $line) all -j4 > /dev/null
68-
else
69-
make -C $(dirname $line) all -j4
70-
fi
71+
print_title "Compile in $(dirname ${line})..." ;
72+
73+
if (($FULL_REPORT == 0)) ; then
74+
make -C $(dirname $line) all -j4 > /dev/null
75+
else
76+
make -C $(dirname $line) all -j4
77+
fi
7178

72-
local MK_RESULT=$?
79+
local MK_RESULT=$?
80+
((retVal=retVal + MK_RESULT))
7381

74-
if (($MK_RESULT!=0)) ; then
75-
print_warning "Error code $MK_RESULT on compiling $(dirname $line)"
76-
if (($FORCE_CONTINUE == 0)) ; then
77-
exit $MK_RESULT
78-
fi
79-
fi
80-
done
82+
if (($MK_RESULT!=0)) ; then
83+
print_warning "Error code $MK_RESULT on compiling $(dirname $line)"
84+
if (($FORCE_CONTINUE == 0)) ; then
85+
exit $MK_RESULT
86+
fi
87+
fi
88+
done
89+
90+
return $retVal
8191
}
8292

8393
function checkDependency()

submodules/cxxtest

Submodule cxxtest added at 191addd

0 commit comments

Comments
 (0)