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

Run tests during AppVeyor builds #51

Merged
merged 26 commits into from
Jun 10, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Build scripts support --with-tests parameter
  • Loading branch information
jariq committed Jun 7, 2017
commit 935056a5e413d6159602f6dc5ae01a04a59198c3
10 changes: 8 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@ environment:
install:
- cmd: IF "%Platform%"=="monoandroid2.3" (powershell -File ./build/appveyor-install-android-sdk.ps1)
build_script:
- cmd: cd build && build-%Platform%.bat
- cmd: cd build
- cmd: IF "%Platform%"=="net20" (build-net20.bat --with-tests)
- cmd: IF "%Platform%"=="net40" (build-net40.bat --with-tests)
- cmd: IF "%Platform%"=="net45" (build-net45.bat)
- cmd: IF "%Platform%"=="sl5" (build-sl5.bat)
- cmd: IF "%Platform%"=="netstandard1.3" (build-netstandard1.3.bat --with-tests)
- cmd: IF "%Platform%"=="monoandroid2.3" (build-monoandroid2.3.bat)
- cmd: IF "%Platform%"=="xamarinios1.0" (build-xamarinios1.0.bat)
test_script:
- cmd: IF "%Platform%"=="net20" (nunit-console-x86 .\src\Pkcs11Interop\Pkcs11InteropTests\bin\Release\Pkcs11InteropTests.dll)
- cmd: IF "%Platform%"=="net40" (nunit-console .\src\Pkcs11Interop\Pkcs11InteropTests\bin\Release\Pkcs11InteropTests.dll)
- cmd: IF "%Platform%"=="net45" (nunit-console .\src\Pkcs11Interop\Pkcs11InteropTests\bin\Release\Pkcs11InteropTests.dll)
- cmd: IF "%Platform%"=="netstandard1.3" (dotnet test .\src\Pkcs11Interop.NetStandard\Pkcs11Interop.DotNetCore.Tests\Pkcs11Interop.DotNetCore.Tests.csproj --configuration Release)
artifacts:
- path: build/$(Platform)
Expand Down
17 changes: 10 additions & 7 deletions build/build-all.bat
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
@setlocal

call build-net20.bat || goto :error
call build-net40.bat || goto :error
call build-net45.bat || goto :error
call build-sl5.bat || goto :error
call build-netstandard1.3.bat || goto :error
call build-monoandroid2.3.bat || goto :error
call build-xamarinios1.0.bat || goto :error
@rem Argument "--with-tests" forces the build of test projects
@set arg1=%1

call build-net20.bat %arg1% || goto :error
call build-net40.bat %arg1% || goto :error
call build-net45.bat %arg1% || goto :error
call build-sl5.bat %arg1% || goto :error
call build-netstandard1.3.bat %arg1% || goto :error
call build-monoandroid2.3.bat %arg1% || goto :error
call build-xamarinios1.0.bat %arg1% || goto :error

@echo *** BUILD ALL SUCCESSFUL ***
@endlocal
Expand Down
21 changes: 15 additions & 6 deletions build/build-monoandroid2.3.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
@setlocal

@rem Argument "--with-tests" forces the build of test project
@set arg1=%1

@rem Initialize Visual Studio build environment:
@rem - Visual Studio 2017 Community/Professional/Enterprise is the preferred option
@rem - Visual Studio 2015 is the fallback option (which might or might not work)
Expand All @@ -19,13 +22,19 @@ call %tools%
@rem Delete output directory
rmdir /S /Q monoandroid2.3

@rem Clean project
msbuild ..\src\Pkcs11Interop.Android\Pkcs11Interop.Android\Pkcs11Interop.Android.csproj ^
/p:Configuration=Release /p:Platform=AnyCPU /target:Clean || goto :error
@rem Clean solution
msbuild ..\src\Pkcs11Interop.Android\Pkcs11Interop.Android.sln ^
/p:Configuration=Release /p:Platform="Any CPU" /target:Clean || goto :error

@rem Build project
msbuild ..\src\Pkcs11Interop.Android\Pkcs11Interop.Android\Pkcs11Interop.Android.csproj ^
/p:Configuration=Release /p:Platform=AnyCPU /target:Build || goto :error
@if "%arg1%"=="--with-tests" (
@rem Build both Pkcs11Interop.Android and Pkcs11Interop.Android.Tests projects via solution
msbuild ..\src\Pkcs11Interop.Android\Pkcs11Interop.Android.sln ^
/p:Configuration=Release /p:Platform="Any CPU" /target:Build || goto :error
) else (
@rem Build only Pkcs11Interop.Android project
msbuild ..\src\Pkcs11Interop.Android\Pkcs11Interop.Android\Pkcs11Interop.Android.csproj ^
/p:Configuration=Release /p:Platform=AnyCPU /target:Build || goto :error
)

@rem Copy result to output directory
mkdir monoandroid2.3 || goto :error
Expand Down
27 changes: 24 additions & 3 deletions build/build-net20.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
@setlocal

@rem Argument "--with-tests" forces the build of test project
@set arg1=%1

@rem Initialize Visual Studio build environment:
@rem - Visual Studio 2017 Community/Professional/Enterprise is the preferred option
@rem - Visual Studio 2015 is the fallback option (which might or might not work)
Expand All @@ -19,9 +22,27 @@ call %tools%
@rem Delete output directory
rmdir /S /Q net20

@rem Clean and build solution
msbuild ..\src\Pkcs11Interop\Pkcs11Interop.sln /p:Configuration=Release /p:Platform="Any CPU" /p:TargetFrameworkVersion=v2.0 /target:Clean || goto :error
msbuild ..\src\Pkcs11Interop\Pkcs11Interop.sln /p:Configuration=Release /p:Platform="Any CPU" /p:TargetFrameworkVersion=v2.0 /target:Build || goto :error
@rem Clean solution
msbuild ..\src\Pkcs11Interop\Pkcs11Interop.sln ^
/p:Configuration=Release /p:Platform="Any CPU" /p:TargetFrameworkVersion=v2.0 ^
/target:Clean || goto :error

@rem Build Pkcs11Interop project
msbuild ..\src\Pkcs11Interop\Pkcs11Interop\Pkcs11Interop.csproj ^
/p:Configuration=Release /p:Platform=AnyCPU /p:TargetFrameworkVersion=v2.0 ^
/target:Build || goto :error

@rem Build Pkcs11Interop.StrongName project
msbuild ..\src\Pkcs11Interop\Pkcs11Interop.StrongName\Pkcs11Interop.StrongName.csproj ^
/p:Configuration=Release /p:Platform=AnyCPU /p:TargetFrameworkVersion=v2.0 ^
/target:Build || goto :error

@if "%arg1%"=="--with-tests" (
@rem Build Pkcs11InteropTests project
msbuild ..\src\Pkcs11Interop\Pkcs11InteropTests\Pkcs11InteropTests.csproj ^
/p:Configuration=Release /p:Platform=AnyCPU /p:TargetFrameworkVersion=v2.0 ^
/target:Build || goto :error
)

@rem Copy result to output directory
mkdir net20 || goto :error
Expand Down
27 changes: 24 additions & 3 deletions build/build-net40.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
@setlocal

@rem Argument "--with-tests" forces the build of test project
@set arg1=%1

@rem Initialize Visual Studio build environment:
@rem - Visual Studio 2017 Community/Professional/Enterprise is the preferred option
@rem - Visual Studio 2015 is the fallback option (which might or might not work)
Expand All @@ -19,9 +22,27 @@ call %tools%
@rem Delete output directory
rmdir /S /Q net40

@rem Clean and build solution
msbuild ..\src\Pkcs11Interop\Pkcs11Interop.sln /p:Configuration=Release /p:Platform="Any CPU" /p:TargetFrameworkVersion=v4.0 /target:Clean || goto :error
msbuild ..\src\Pkcs11Interop\Pkcs11Interop.sln /p:Configuration=Release /p:Platform="Any CPU" /p:TargetFrameworkVersion=v4.0 /target:Build || goto :error
@rem Clean solution
msbuild ..\src\Pkcs11Interop\Pkcs11Interop.sln ^
/p:Configuration=Release /p:Platform="Any CPU" /p:TargetFrameworkVersion=v4.0 ^
/target:Clean || goto :error

@rem Build Pkcs11Interop project
msbuild ..\src\Pkcs11Interop\Pkcs11Interop\Pkcs11Interop.csproj ^
/p:Configuration=Release /p:Platform=AnyCPU /p:TargetFrameworkVersion=v4.0 ^
/target:Build || goto :error

@rem Build Pkcs11Interop.StrongName project
msbuild ..\src\Pkcs11Interop\Pkcs11Interop.StrongName\Pkcs11Interop.StrongName.csproj ^
/p:Configuration=Release /p:Platform=AnyCPU /p:TargetFrameworkVersion=v4.0 ^
/target:Build || goto :error

@if "%arg1%"=="--with-tests" (
@rem Build Pkcs11InteropTests project
msbuild ..\src\Pkcs11Interop\Pkcs11InteropTests\Pkcs11InteropTests.csproj ^
/p:Configuration=Release /p:Platform=AnyCPU /p:TargetFrameworkVersion=v4.0 ^
/target:Build || goto :error
)

@rem Copy result to output directory
mkdir net40 || goto :error
Expand Down
27 changes: 24 additions & 3 deletions build/build-net45.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
@setlocal

@rem Argument "--with-tests" forces the build of test project
@set arg1=%1

@rem Initialize Visual Studio build environment:
@rem - Visual Studio 2017 Community/Professional/Enterprise is the preferred option
@rem - Visual Studio 2015 is the fallback option (which might or might not work)
Expand All @@ -19,9 +22,27 @@ call %tools%
@rem Delete output directory
rmdir /S /Q net45

@rem Clean and build solution
msbuild ..\src\Pkcs11Interop\Pkcs11Interop.sln /p:Configuration=Release /p:Platform="Any CPU" /p:TargetFrameworkVersion=v4.5 /target:Clean || goto :error
msbuild ..\src\Pkcs11Interop\Pkcs11Interop.sln /p:Configuration=Release /p:Platform="Any CPU" /p:TargetFrameworkVersion=v4.5 /target:Build || goto :error
@rem Clean solution
msbuild ..\src\Pkcs11Interop\Pkcs11Interop.sln ^
/p:Configuration=Release /p:Platform="Any CPU" /p:TargetFrameworkVersion=v4.5 ^
/target:Clean || goto :error

@rem Build Pkcs11Interop project
msbuild ..\src\Pkcs11Interop\Pkcs11Interop\Pkcs11Interop.csproj ^
/p:Configuration=Release /p:Platform=AnyCPU /p:TargetFrameworkVersion=v4.5 ^
/target:Build || goto :error

@rem Build Pkcs11Interop.StrongName project
msbuild ..\src\Pkcs11Interop\Pkcs11Interop.StrongName\Pkcs11Interop.StrongName.csproj ^
/p:Configuration=Release /p:Platform=AnyCPU /p:TargetFrameworkVersion=v4.5 ^
/target:Build || goto :error

@if "%arg1%"=="--with-tests" (
@rem Build Pkcs11InteropTests project
msbuild ..\src\Pkcs11Interop\Pkcs11InteropTests\Pkcs11InteropTests.csproj ^
/p:Configuration=Release /p:Platform=AnyCPU /p:TargetFrameworkVersion=v4.5 ^
/target:Build || goto :error
)

@rem Copy result to output directory
mkdir net45 || goto :error
Expand Down
25 changes: 21 additions & 4 deletions build/build-netstandard1.3.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
@setlocal

@rem Argument "--with-tests" forces the build of test project
@set arg1=%1

@rem Initialize build environment of Visual Studio 2017 Community/Professional/Enterprise
@set tools=
@set tmptools="c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsMSBuildCmd.bat"
Expand All @@ -15,10 +18,24 @@ call %tools%
@rem Delete output directory
rmdir /S /Q netstandard1.3

@rem Build solution
msbuild ..\src\Pkcs11Interop.NetStandard\Pkcs11Interop.NetStandard.sln /p:Configuration=Release /p:Platform="Any CPU" /target:Clean || goto :error
msbuild ..\src\Pkcs11Interop.NetStandard\Pkcs11Interop.NetStandard.sln /p:Configuration=Release /p:Platform="Any CPU" /target:Restore || goto :error
msbuild ..\src\Pkcs11Interop.NetStandard\Pkcs11Interop.NetStandard.sln /p:Configuration=Release /p:Platform="Any CPU" /target:Build || goto :error
@rem Clean solution
msbuild ..\src\Pkcs11Interop.NetStandard\Pkcs11Interop.NetStandard.sln ^
/p:Configuration=Release /p:Platform="Any CPU" /p:TargetFrameworkVersion=v2.0 ^
/target:Clean || goto :error

@rem Build Pkcs11Interop.NetStandard project
msbuild ..\src\Pkcs11Interop.NetStandard\Pkcs11Interop.NetStandard\Pkcs11Interop.NetStandard.csproj ^
/p:Configuration=Release /p:Platform=AnyCPU /target:Build || goto :error

@rem Build Pkcs11Interop.NetStandard.StrongName project
msbuild ..\src\Pkcs11Interop.NetStandard\Pkcs11Interop.NetStandard.StrongName\Pkcs11Interop.NetStandard.StrongName.csproj ^
/p:Configuration=Release /p:Platform=AnyCPU /target:Build || goto :error

@if "%arg1%"=="--with-tests" (
@rem Build Pkcs11Interop.DotNetCore.Tests project
msbuild ..\src\Pkcs11Interop.NetStandard\Pkcs11Interop.DotNetCore.Tests\Pkcs11Interop.DotNetCore.Tests.csproj ^
/p:Configuration=Release /p:Platform=AnyCPU /target:Build || goto :error
)

@rem Copy result to output directory
mkdir netstandard1.3 || goto :error
Expand Down
28 changes: 20 additions & 8 deletions build/build-sl5.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
@setlocal

@rem Argument "--with-tests" forces the build of test project
@set arg1=%1

@rem Add signtool.exe location to PATH
@set PATH=%PATH%;C:\Program Files (x86)\Microsoft SDKs\ClickOnce\SignTool\

@rem Initialize Visual Studio build environment:
@rem - Visual Studio 2017 Community/Professional/Enterprise is the preferred option
@rem - Visual Studio 2015 is the fallback option (which might or might not work)
Expand All @@ -19,17 +25,23 @@ call %tools%
@rem Delete output directory
rmdir /S /Q sl5

@rem Clean project
msbuild ..\src\Pkcs11Interop.Silverlight\Pkcs11Interop.Silverlight\Pkcs11Interop.Silverlight.csproj ^
/p:Configuration=Release /p:Platform=AnyCPU /target:Clean || goto :error
msbuild ..\src\Pkcs11Interop.Silverlight\Pkcs11Interop.Silverlight.StrongName\Pkcs11Interop.Silverlight.StrongName.csproj ^
/p:Configuration=Release /p:Platform=AnyCPU /target:Clean || goto :error
@rem Clean solution
msbuild ..\src\Pkcs11Interop.Silverlight\Pkcs11Interop.Silverlight.sln ^
/p:Configuration=Release /p:Platform="Any CPU" /target:Clean || goto :error

@rem Build project
@rem Build Pkcs11Interop.Silverlight project
msbuild ..\src\Pkcs11Interop.Silverlight\Pkcs11Interop.Silverlight\Pkcs11Interop.Silverlight.csproj ^
/p:Configuration=Release /p:Platform=AnyCPU /target:Build || goto :error
/p:Configuration=Release /p:Platform=AnyCPU /target:Build || goto :error

@rem Build Pkcs11Interop.Silverlight.StrongName project
msbuild ..\src\Pkcs11Interop.Silverlight\Pkcs11Interop.Silverlight.StrongName\Pkcs11Interop.Silverlight.StrongName.csproj ^
/p:Configuration=Release /p:Platform=AnyCPU /target:Build || goto :error
/p:Configuration=Release /p:Platform=AnyCPU /target:Build || goto :error

@if "%arg1%"=="--with-tests" (
@rem Build Pkcs11Interop.Silverlight.Tests project
msbuild ..\src\Pkcs11Interop.Silverlight\Pkcs11Interop.Silverlight.Tests\Pkcs11Interop.Silverlight.Tests.csproj ^
/p:Configuration=Release /p:Platform=AnyCPU /target:Build || goto :error
)

@rem Copy result to output directory
mkdir sl5 || goto :error
Expand Down
21 changes: 15 additions & 6 deletions build/build-xamarinios1.0.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
@setlocal

@rem Argument "--with-tests" forces the build of test project
@set arg1=%1

@rem Initialize Visual Studio build environment:
@rem - Visual Studio 2017 Community/Professional/Enterprise is the preferred option
@rem - Visual Studio 2015 is the fallback option (which might or might not work)
Expand All @@ -19,13 +22,19 @@ call %tools%
@rem Delete output directory
rmdir /S /Q xamarinios1.0

@rem Clean project
msbuild ..\src\Pkcs11Interop.iOS\Pkcs11Interop.iOS\Pkcs11Interop.iOS.csproj ^
/p:Configuration=Release /p:Platform=AnyCPU /target:Clean || goto :error
@rem Clean solution
msbuild ..\src\Pkcs11Interop.iOS\Pkcs11Interop.iOS.sln ^
/p:Configuration=Release /p:Platform="Any CPU" /target:Clean || goto :error

@rem Build project
msbuild ..\src\Pkcs11Interop.iOS\Pkcs11Interop.iOS\Pkcs11Interop.iOS.csproj ^
/p:Configuration=Release /p:Platform=AnyCPU /target:Build || goto :error
@if "%arg1%"=="--with-tests" (
@rem Build both Pkcs11Interop.iOS and Pkcs11Interop.iOS.Tests projects via solution
msbuild ..\src\Pkcs11Interop.iOS\Pkcs11Interop.iOS.sln ^
/p:Configuration=Release /p:Platform="Any CPU" /target:Build || goto :error
) else (
@rem Build only Pkcs11Interop.iOS project
msbuild ..\src\Pkcs11Interop.iOS\Pkcs11Interop.iOS\Pkcs11Interop.iOS.csproj ^
/p:Configuration=Release /p:Platform=AnyCPU /target:Build || goto :error
)

@rem Copy result to output directory
mkdir xamarinios1.0 || goto :error
Expand Down