Skip to content

Commit

Permalink
Merge pull request #6 from adobe/circleci
Browse files Browse the repository at this point in the history
Experimental CircleCI integration
  • Loading branch information
dirkschulze committed Apr 18, 2019
2 parents 5c9c14b + f721873 commit 8b7eaf5
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 10 deletions.
25 changes: 25 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: 2

jobs:
build:
docker:
- image: debian:stretch
steps:
- run:
name: Installing sudo
command: 'apt-get update && apt-get install -y sudo && rm -rf /var/lib/apt/lists/*'
- run:
name: Installing Build System
command: 'apt-get update && apt-get install -y git build-essential libboost-system-dev cmake python2.7'
- checkout
- run: git submodule sync
- run: git submodule update --init
- run:
name: Creating Build Files
command: 'cd svgnative && cmake -Bbuild/linux -H.'
- run:
name: Creating Binary Files
command: 'cd svgnative && cmake --build build/linux'
- run:
name: Run tests
command: 'cd svgnative && /usr/bin/python2.7 script/runTest.py --test=test'
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
branch = modifications
[submodule "third_party/cpp-base64"]
path = third_party/cpp-base64
url = https://github.com/ReneNyffenegger/cpp-base64
url = git@github.com:ReneNyffenegger/cpp-base64.git
3 changes: 2 additions & 1 deletion svgnative/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ cd build
cmake -Bbuild/win64 -H. -G "Visual Studio 15 2017 Win64"
cmake -Bbuild/win32 -H. -G "Visual Studio 15 2017"
cmake -Bbuild/mac -H. -G "Xcode"
cmake -Bbuild/linux -H.

cmake --build build/win64 --config Release
]]

cmake_minimum_required(VERSION 3.10.0)
cmake_minimum_required(VERSION 3.7.2)
project(SVGNativeViewer)
enable_language(CXX)
set(CMAKE_CXX_STANDARD 14)
Expand Down
19 changes: 11 additions & 8 deletions svgnative/script/runTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def readLine(p):
c = p.stdout.read(1)
return line

def exportTestFilesSequential(files, args):
def exportTestFilesSequential(files, args, hasError):
p = None
isExpectedFileMissing = False
inputFile = files.nextPath()
Expand All @@ -178,28 +178,31 @@ def exportTestFilesSequential(files, args):
p = Popen([args.program, inputFile, expectedFile])
if p == None:
print('Error opening testapp')
return -1
hasError = -1
return hasError
print('Created missing expectation file: ' + expectedFile)
else:
p = Popen([args.program, inputFile, actualFile])
if p == None:
print('Error opening testapp')
return -1
hasError = -1
return hasError
p.wait()
if not compare_text_files(expectedFile, actualFile, diffFile):
print(u'\u274c' + ' ' + inputFile + ' failed.')
print(' ' + inputFile + ' FAILED.')
hasError = -1
else:
print(u'\u2713' + ' ' + inputFile + ' passed.')
print(' ' + inputFile + ' passed.')

exportTestFilesSequential(files, args)
return 0
hasError = exportTestFilesSequential(files, args, hasError)
return hasError

def runTestApp(args):
filesIterator = DirectoryIterator(args.path, args.recursive)
files = filesIterator.fileArray()
testexpectations = filesIterator.testExpectations()

error = exportTestFilesSequential(filesIterator, args)
error = exportTestFilesSequential(filesIterator, args, 0)
if error == -1:
return error

Expand Down

0 comments on commit 8b7eaf5

Please sign in to comment.