Skip to content

Commit 6dd0504

Browse files
author
Zachary Crockett
committed
Merge pull request #24 from spark/feature/travis-ci
Feature/travis ci
2 parents 8fb2c8e + 033c04c commit 6dd0504

File tree

7 files changed

+17
-6
lines changed

7 files changed

+17
-6
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
language: cpp
2+
compiler:
3+
- gcc
4+
script: make test

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
CXX ?= g++
22
CXXFLAGS ?= -g -Wall -W -Winline -ansi
33
CXXFLAGS += -Ilib/tropicssl/include -Isrc -Itests/UnitTest++/src
4-
LDFLAGS ?=
54
RM = rm
65

76
.SUFFIXES: .o .cpp
@@ -10,7 +9,8 @@ name = SparkCoreCommunication
109
lib = src/lib$(name).a
1110
test = tests/test$(name)
1211
testlibdir = tests/UnitTest++
13-
testlib = $(testlibdir)/libUnitTest++.a
12+
testlib = UnitTest++
13+
testlibpath = $(testlibdir)/lib$(testlib).a
1414
testrunner = tests/Main.cpp
1515
ssllibdir = lib/tropicssl/library
1616
ssllib = $(ssllibdir)/libtropicssl.a
@@ -31,6 +31,7 @@ testobjects = tests/ConstructorFixture.o \
3131
tests/TestUserFunctions.o \
3232
tests/TestEvents.o
3333

34+
LDFLAGS ?= -L$(ssllibdir) -ltropicssl -Lsrc -l$(name) -L$(testlibdir) -l$(testlib)
3435

3536
all: $(lib)
3637

@@ -47,13 +48,12 @@ clean:
4748

4849
############### tests #############
4950

50-
test: $(lib) $(testlib) $(testobjects) $(ssllib)
51-
@$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $(test) $(testlib) \
52-
$(lib) $(ssllib) $(testobjects) $(testrunner)
51+
test: $(lib) $(testlibpath) $(testobjects) $(ssllib)
52+
@$(CXX) $(testrunner) $(CXXFLAGS) $(testobjects) $(LDFLAGS) -o $(test)
5353
@echo running unit tests...
5454
@./$(test)
5555

56-
$(testlib):
56+
$(testlibpath):
5757
$(MAKE) -C $(testlibdir)
5858

5959
testclean:

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[![Build Status](https://travis-ci.org/spark/core-communication-lib.svg)](https://travis-ci.org/spark/core-communication-lib)
2+
13
# Core Communication Library
24

35
This repository holds the firmware libraries used for the communication between the Spark Core and the Cloud service.

tests/TestAES.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#include <stdint.h>
2+
#include <string.h>
13
#include "UnitTest++.h"
24
#include "tropicssl/aes.h"
35

tests/TestDescriptor.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include <string.h>
12
#include "UnitTest++.h"
23
#include "spark_descriptor.h"
34

tests/TestEvents.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
License along with this library; if not, see <http://www.gnu.org/licenses/>.
2323
******************************************************************************
2424
*/
25+
#include <string.h>
2526
#include "UnitTest++.h"
2627
#include "events.h"
2728

tests/TestHandshake.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include <stdint.h>
12
#include "UnitTest++.h"
23
#include "handshake.h"
34
#include "tropicssl/rsa.h"

0 commit comments

Comments
 (0)