Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experimental CircleCI integration #6

Merged
merged 2 commits into from
Apr 18, 2019
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
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
1 change: 1 addition & 0 deletions third_party/cpp-base64
Submodule cpp-base64 added at 642080
1 change: 1 addition & 0 deletions third_party/stylesheet
Submodule stylesheet added at c81c4b