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

[WIP] Appveyor test #118

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ IF(UNIX)
ENDIF()
ENDIF()

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_USER_MOD_PATH} $ENV{CMAKE_USER_MOD_PATH})
MESSAGE("${CMAKE_MODULE_PATH}")

#add CMake build info
ADD_DEFINITIONS(-DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}")
Expand Down
32 changes: 32 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
configuration:
- Debug
- Release

environment:
CTEST_OUTPUT_ON_FAILURE: 1
matrix:
- BUILD: msvc
- BUILD: msvc
PLATFORM: x64
- BUILD: mingw
- BUILD: qmake
QTDIR: C:\Qt\5.9.1\mingw53_32
# PATH : '%PATH%;%QTDIR%\bin;C:\MinGW\bin'
PATH : '%PATH%;%QTDIR%\bin;C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\bin'

build_script:
- python support/appveyor-build.py

before_build:
# Workaround for CMake not wanting sh.exe on PATH for MinGW.
- set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
- git submodule update --init --recursive

on_failure:
- appveyor PushArtifact Testing/Temporary/LastTest.log
- appveyor AddTest test

# Uncomment this to debug AppVeyor failures.
#on_finish:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
# update
5 changes: 5 additions & 0 deletions nitrokey-app-qt5.pro
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
CONFIG += qt c++14 debug
QT += core gui widgets

win32-g++ {
QMAKE_CXXFLAGS_CXX14 = -std=c++14
QMAKE_CXXFLAGS_GNUCXX14 = -std=c++14
}

target.path = /usr/local/bin
desktop.path = /usr/share/applications
desktop.files += nitrokey-app.desktop
Expand Down
40 changes: 40 additions & 0 deletions support/appveyor-build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env python
# Build the project on AppVeyor.

import os
from subprocess import check_call

build = os.environ['BUILD']
config = os.environ['CONFIGURATION']
platform = os.environ.get('PLATFORM')
path = os.environ['PATH']
cmake_command = ['cmake', '-DFMT_PEDANTIC=ON', '-DCMAKE_BUILD_TYPE=' + config]

if build == 'mingw':
cmake_command.append('-GMinGW Makefiles')
cmake_command.append(r'-DCMAKE_USER_MOD_PATH=C:/Qt/5.9.1/mingw53_32/lib/cmake')
build_command = ['mingw32-make', '-j2']
test_command = ['mingw32-make', 'test']
# Remove the path to Git bin directory from $PATH because it breaks
# MinGW config.
path = path.replace(r'C:/Program Files (x86)/Git/bin', '')
#os.environ['PATH'] = r'C:/MinGW/bin;' + path
elif build == 'qmake':
cmake_command = ['qmake', '.']
build_command = ['mingw32-make', '-j2']
test_command = ['true']
else:
# Add MSBuild 14.0 to PATH as described in
# http://help.appveyor.com/discussions/problems/2229-v140-not-found-on-vs2105rc.
os.environ['PATH'] = r'C:/Program Files (x86)/MSBuild/14.0/Bin;' + path
generator = 'Visual Studio 14 2015'
if platform == 'x64':
generator += ' Win64'
cmake_command.append('-G' + generator)
cmake_command.append(r'-DCMAKE_USER_MOD_PATH=C:/Qt/5.9.1/msvc2015/lib/cmake')
build_command = ['cmake', '--build', '.', '--config', config, '--', '/m:2']
test_command = ['ctest', '-C', config]

check_call(cmake_command)
check_call(build_command)
check_call(test_command)