From ad288d51e45cb3ddecabc906e32252caeefa5547 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 13 Nov 2017 12:39:47 -0800 Subject: [PATCH] Add the .appveyor.yml file for testing MSVC on AppVeyor CI Signed-off-by: Thiago Macieira --- .appveyor.yml | 35 +++++++++++++++++++++++++++++++++++ .gitattributes | 1 + maketag.pl | 17 ++++++++++++++--- 3 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 .appveyor.yml diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 0000000..a64cb3f --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,35 @@ +version: 0.5-build-{build} +pull_requests: + do_not_increment_build_number: true +image: +- Visual Studio 2015 +- Visual Studio 2013 +- Visual Studio 2017 +install: +- cmd: >- + set tests=1 + + if /i "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2013" (call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64) & (set tests=0) + + if /i "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" (call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64) & (set QTDIR=C:\Qt\5.9\msvc2015_64) + + if /i "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" (call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64) & (set QTDIR=C:\Qt\5.9\msvc2017_64) + + set path=%PATH%;%QTDIR%\bin +build_script: +- cmd: >- + nmake -f Makefile.nmake -nologo CFLAGS="-W3 -Os -MDd" + + cd tests + + if /i "%tests%"=="1" qmake CONFIG-=release CONFIG+=debug + + if /i "%tests%"=="1" nmake -nologo -s +test_script: +- cmd: >- + if /i "%tests%"=="1" nmake -s -nologo check + + if /i "%tests%"=="0" echo Tests skipped. +artifacts: +- path: lib\tinycbor.lib +deploy: off diff --git a/.gitattributes b/.gitattributes index 018cf2c..76ed256 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,4 @@ .tag export-subst .gitignore export-ignore .gitattributes export-ignore +.appveyor.yml text diff --git a/maketag.pl b/maketag.pl index 87e0a67..5b1a8b7 100644 --- a/maketag.pl +++ b/maketag.pl @@ -70,11 +70,22 @@ print VERSION "$v\n"; close VERSION; open VERSION, ">", "src/tinycbor-version.h" or die("Cannot open src/tinycbor-version.h: $!"); -print VERSION, "#define TINYCBOR_VERSION_MAJOR ", $v[0], "\n"; -print VERSION, "#define TINYCBOR_VERSION_MINOR ", $v[1], "\n"; -print VERSION, "#define TINYCBOR_VERSION_PATCH ", $v[2], "\n"; +print VERSION "#define TINYCBOR_VERSION_MAJOR ", $v[0], "\n"; +print VERSION "#define TINYCBOR_VERSION_MINOR ", $v[1], "\n"; +print VERSION "#define TINYCBOR_VERSION_PATCH ", $v[2], "\n"; close VERSION; +if (open APPVEYORYML, "<", ".appveyor.yml") { + my @contents = map { + s/^version:.*/version: $v[0].$v[1].$v[2]-build-{build}/; + $_; + } ; + close APPVEYORYML; + open APPVEYORYML, ">", ".appveyor.yml"; + print APPVEYORYML join('', @contents); + close APPVEYORYML; +} + # Print summary print "Tag created and next versions updated.\n"; print "Don't forget to create the docs.\n" if $v[2] == 1;