diff --git a/.travis.build.sh b/.travis.build.sh new file mode 100755 index 000000000..ed1b3213a --- /dev/null +++ b/.travis.build.sh @@ -0,0 +1,19 @@ +#! /bin/sh +set -e + +ncpus=1 +if test -x /usr/bin/getconf; then + ncpus=$(/usr/bin/getconf _NPROCESSORS_ONLN) +fi + +echo "Timestamp" && date +cmake .. +echo "" +echo "Timestamp" && date +echo "Starting build with -j$ncpus ..." + +make -j$ncpus + +# Run tests +#echo "Timestamp" && date +#make test diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..1a376503f --- /dev/null +++ b/.travis.yml @@ -0,0 +1,31 @@ +language: cpp +compiler: + - gcc + - clang +before_install: + - sudo apt-get install swig + - sudo add-apt-repository "deb http://ftp.us.debian.org/debian/ experimental main" -y + - sudo apt-get update + - apt-cache policy oce-draw tcl8.5-dev tk8.5-dev + - sudo apt-get install -t experimental oce-draw liboce-ocaf-dev liboce-visualization-dev liboce-ocaf-lite-dev liboce-modeling-dev liboce-foundation-dev liboce-ocaf9 liboce-visualization9 liboce-ocaf-lite9 liboce-modeling9 liboce-foundation9 tcl8.5-dev tk8.5-dev tcl8.5 tk8.5 +before_script: + - mkdir cmake-build + - cd cmake-build +# Depth is necessary, otherwise DRAWEXE exits with this message: +# Tcl Exception: ** Exception ** 0x7fee03adb307 : Aspect_WindowDefinitionError: Xw_Window, couldn't find compatible Visual (RGBA, double-buffered) +script: xvfb-run -s "-screen 0 1024x768x16" ../.travis.build.sh +#after_script: +# - test ! -r occt/summary.xml || xsltproc --param duration 1 ../.travis.xsl occt/summary.xml +# - if [ -r occt/summary.xml ]; then +# xsltproc ../.travis.xsl occt/summary.xml > occt/summary.failed; +# if [ -s occt/summary.failed ]; then +# echo "FAILED TESTS:"; +# cat occt/summary.failed; +# for file in $(cat occt/summary.failed); do head -n -1 occt/$file.{tcl,log}; done; +# fi; +# fi +branches: + only: + - master + - /^review/ +# diff --git a/README.md b/README.md index 341b8844f..b59d96eef 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +Travis-CI Build Status : +[![Build Status](https://travis-ci.org/dbarbier/pythonocc-core.png?branch=master)](https://travis-ci.org/dbarbier/pythonocc-core) + pythonocc-core ============== diff --git a/src/Visualization/Display3d.cpp b/src/Visualization/Display3d.cpp index 2ac4dcd1f..caf3b18c8 100644 --- a/src/Visualization/Display3d.cpp +++ b/src/Visualization/Display3d.cpp @@ -38,7 +38,15 @@ void Display3d::Init(long window_handle) { printf(" ###### 3D rendering pipe initialisation #####\n"); printf("Display3d class initialization starting ...\n"); - // Create Graphic Device and Window + // Create graphic driver + Handle(Aspect_DisplayConnection) aDisplayConnection = new Aspect_DisplayConnection(); + printf("Aspect_DisplayConnection created.\n"); + if (GetGraphicDriver().IsNull()) + { + GetGraphicDriver() = Graphic3d::InitGraphicDriver (aDisplayConnection); + } + printf("Graphic_Driver created.\n"); + // Create Graphic Device and Window #ifdef WNT myWindow = new WNT_Window((Aspect_Handle) window_handle); printf("WNT window created.\n"); @@ -46,26 +54,19 @@ void Display3d::Init(long window_handle) myWindow = new Cocoa_Window((NSView *) window_handle); printf("Cocoa window created.\n"); #else - Handle(Aspect_DisplayConnection) aDisplayConnection = new Aspect_DisplayConnection(); myWindow =new Xw_Window(aDisplayConnection, (Window) window_handle); printf("Xw_Window created.\n"); #endif - // Create graphic driver - Handle(Aspect_DisplayConnection) aDisplayConnection = new Aspect_DisplayConnection(); - if (GetGraphicDriver().IsNull()) - { - GetGraphicDriver() = Graphic3d::InitGraphicDriver (aDisplayConnection); - } // Create V3dViewer and V3d_View myV3dViewer = new V3d_Viewer(GetGraphicDriver(), (short* const)"viewer"); - printf("Viewer created.\n"); + printf("V3d_Viewer created.\n"); myV3dView = myV3dViewer->CreateView(); - printf("View created\n"); + printf("V3d_View created\n"); myV3dView->SetWindow(myWindow); if (!myWindow->IsMapped()) myWindow->Map(); // Create AISInteractiveViewer myAISContext = new AIS_InteractiveContext(myV3dViewer); - printf("Interactive context created.\n"); + printf("AIS_InteractiveContext created.\n"); printf("Display3d class successfully initialized.\n"); printf(" ########################################\n"); }