Skip to content

Commit

Permalink
Add X11 emulation to travis so tests can run after build
Browse files Browse the repository at this point in the history
Add guard against popping from empty stack
  • Loading branch information
Adam Reif committed Nov 13, 2017
1 parent 05ebef3 commit 3d64566
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ install:
- if [[ $TRAVIS_OS_NAME == 'osx' ]] ; then brew install qt5 ; fi
# - if [[ $TRAVIS_OS_NAME == 'osx' ]] ; then brew link --force qt5 && ln -s /usr/local/Cellar/qt5/5.9.1/mkspecs /usr/local/mkspecs && ln -s /usr/local/Cellar/qt5/5.9.1/plugins /usr/local/plugins ; fi

#emulate x server to run the gui on linux - necessary for testing
before_script:
- if [[ $TRAVIS_OS_NAME == 'linux' ]] ; then export DISPLAY=:99.0 ; fi
- if [[ $TRAVIS_OS_NAME == 'linux' ]] ; then sh -e /etc/init.d/xvfb start ; fi
- if [[ $TRAVIS_OS_NAME == 'linux' ]] ; then sleep 3 ; fi # give xvfb some time to start

script:
- if [[ $TRAVIS_OS_NAME == 'linux' ]] ; then cd bin && cmake -DCMAKE_C_COMPILER=gcc-5 -DCMAKE_CXX_COMPILER=g++-5 .. && make && ctest -V ; fi
- if [[ $TRAVIS_OS_NAME == 'osx' ]] ; then cd bin && cmake .. && make && ctest -V ; fi
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project(pfcrender)

# The project version number.
set(VERSION_MAJOR 0 CACHE STRING "Major version number.")
set(VERSION_MINOR 4 CACHE STRING "Minor version number.")
set(VERSION_MINOR 5 CACHE STRING "Minor version number.")
set(VERSION_PATCH 0 CACHE STRING "Patch version number.")
mark_as_advanced(VERSION_MAJOR VERSION_MINOR VERSION_PATCH)

Expand Down
5 changes: 4 additions & 1 deletion src/ViewModel/ViewModelBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@ ViewModelBuilder::_createGeometry(const QString& curve)
stack.push(pos);
continue;
case ']': // pop position and direction from stack
pos = stack.pop();
if(stack.isEmpty())
qWarning("Tried to pop from empty stack. Ignoring this character");
else
pos = stack.pop();
continue;
case '_': // special command: next color
// idx = colors.indexOf(pos.getColor())+1;
Expand Down

0 comments on commit 3d64566

Please sign in to comment.