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

Netcore tests #774

Merged
merged 9 commits into from
Jul 20, 2016
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Backup*
*.user
.vs
project.lock.json
*~

msbuild.log
TestResult.xml
Expand Down
37 changes: 37 additions & 0 deletions Src/Support/GoogleApis.Auth.Tests_dotnetcore/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"version": "1.0.0-*",

"dependencies": {
"Google.Apis.Core": "1.14",
"Google.Apis.Auth": "1.14",
"GoogleApis.Tests_dotnetcore": {
"target": "project"
},
"Nunit": "3.4.0",
"dotnet-test-nunit": "3.4.0-beta-1"
},

"compile": "../GoogleApis.Auth.Tests/**/*.cs",

"exclude": [
"../GoogleApis.Auth.Tests/Program.cs",
"../GoogleApis.Auth.Tests/OAuth2/Flows/*.cs"
],

"testRunner": "nunit",

"frameworks": {
"netcoreapp1.0": {
"imports": [
"netcoreapp1.0",
"portable-net45+win8"

This comment was marked as spam.

This comment was marked as spam.

],
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0-*",
"type": "platform"
}
}
}
}
}
38 changes: 38 additions & 0 deletions Src/Support/GoogleApis.Tests_dotnetcore/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"version": "1.0.0-*",

"dependencies": {
"Google.Apis.Core": "1.14",
"Nunit": "3.4.0",
"dotnet-test-nunit": "3.4.0-beta-1"
},

"compile": "../GoogleApis.Tests/**/*.cs",

"exclude": [
"../GoogleApis.Tests/Program.cs",
"../GoogleApis.Tests/Apis/*/*.cs",
"../GoogleApis.Tests/[Mock]/CountableMessageHandler.cs",
"../GoogleApis.Tests/[Mock]/MockBackOffHandler.cs",
"../GoogleApis.Tests/[Mock]/MockClientService.cs",
"../GoogleApis.Tests/[Mock]/MockHttpClientFactory.cs",
"../GoogleApis.Tests/[Mock]/MockMessageHandler.cs"
],

"testRunner": "nunit",

"frameworks": {
"netcoreapp1.0": {
"imports": [
"netcoreapp1.0",
"portable-net45+win8"
],
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0-*",
"type": "platform"
}
}
}
}
}
6 changes: 6 additions & 0 deletions Src/global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"projects": [ "Support" ],
"sdk": {
"version": "1.0.0-preview2-003121"
}
}
29 changes: 29 additions & 0 deletions run_tests.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
@echo off
rem Runs the tests locally.

setlocal

set runner_root=%USERPROFILE%\testrunner
set nunit="%runner_root%\NUnit.ConsoleRunner.3.2.1\tools\nunit3-console.exe"

if not exist %nunit% (
rem Grabs the nunit test runner.
echo Installing nunit runner.
nuget install NUnit.ConsoleRunner -Version 3.2.1 -OutputDirectory "%runner_root%"
) else (
echo Nunit runner already installed.
)

rem Build the code with the travis configuration.
pushd Src\Support
msbuild /p:Configuration=ReleaseTravis GoogleApisClient.sln

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.


set output=bin\ReleaseSigned

%nunit% --where "cat != IgnoreOnTravis" ^

This comment was marked as spam.

This comment was marked as spam.

"GoogleApis.Tests\%output%\Google.Apis.Tests.exe" ^
"GoogleApis.Auth.Tests\%output%\Google.Apis.Auth.Tests.exe" ^
"GoogleApis.Auth.DotNet4.Tests\%output%\Google.Apis.Auth.DotNet4.Tests.exe"

popd
echo Done.
26 changes: 26 additions & 0 deletions run_tests_dotnetcore.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@echo off
rem Runs the .NET Core tests locally.

setlocal

REM Build the support libraries.
msbuild SupportLibraries.proj

REM Clean slate after the build.
set workspace=%~dp0
set fallback=%workspace%\NuPkgs
set packages=%workspace%\packages

REM Restore the test projects.
dotnet restore ^
"Src\Support\GoogleApis.Tests_dotnetcore" ^
"Src\Support\GoogleApis.Auth.Tests_dotnetcore" ^
--packages "%packages%" ^
-f "%fallback%" ^
--no-cache

REM Run the tests.
dotnet test "Src\Support\GoogleApis.Tests_dotnetcore"
dotnet test "Src\Support\GoogleApis.Auth.Tests_dotnetcore"

echo Done.