From 3f79ada2f272c6e065b0cb81568e2f83d018ab2a Mon Sep 17 00:00:00 2001 From: Morten Nielsen Date: Thu, 16 Jan 2020 00:07:27 -0800 Subject: [PATCH] Fix CI build and upgrade unit tests to target both NETFX and NetCore --- .github/workflows/CIBuild.yml | 9 ++- src/NmeaParser.sln | 44 +++++------ .../NmeaParser.Tests.Net.csproj | 30 ++++++++ .../NmeaParser.Tests.NET45.csproj | 77 ------------------- .../Properties/AssemblyInfo.cs | 20 ----- 5 files changed, 57 insertions(+), 123 deletions(-) create mode 100644 src/UnitTests/NmeaParser.Tests.NET/NmeaParser.Tests.Net.csproj delete mode 100644 src/UnitTests/NmeaParser.Tests.NET45/NmeaParser.Tests.NET45.csproj delete mode 100644 src/UnitTests/NmeaParser.Tests.NET45/Properties/AssemblyInfo.cs diff --git a/.github/workflows/CIBuild.yml b/.github/workflows/CIBuild.yml index 0aea018..913ffd6 100644 --- a/.github/workflows/CIBuild.yml +++ b/.github/workflows/CIBuild.yml @@ -18,8 +18,13 @@ jobs: - name: Clone NmeaParser uses: actions/checkout@v1 + - name: Setup Visual Studio Command Prompt + uses: warrenbuckley/Setup-MSBuild@v1 + - name: Build run: | - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" - msbuild /restore /t:Build src/NmeaParser.sln /p:Configuration=Release /p:JavaSdkDirectory="$(JAVA_HOME_8_X64)" + msbuild /restore /t:Build src/NmeaParser.sln /p:Configuration=Release + - name: Tests + run: | + dotnet test src/UnitTests/NmeaParser.Tests.NET/bin/Release/netcoreapp3.1/NmeaParser.Tests.Net.dll -v normal \ No newline at end of file diff --git a/src/NmeaParser.sln b/src/NmeaParser.sln index 2e70d94..7eff29c 100644 --- a/src/NmeaParser.sln +++ b/src/NmeaParser.sln @@ -1,6 +1,6 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 16 +# Visual Studio Version 16 VisualStudioVersion = 16.0.0.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NmeaParser", "NmeaParser", "{1701F3BA-A09C-4706-A612-24FD9340FC18}" @@ -34,18 +34,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NmeaParser.Tests.UWP", "Uni EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "NmeaParser.Tests", "UnitTests\NmeaParser.Tests\NmeaParser.Tests.shproj", "{979AE182-EB59-4181-9D45-3FD6E4817F11}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NmeaParser.Tests.NET45", "UnitTests\NmeaParser.Tests.NET45\NmeaParser.Tests.NET45.csproj", "{170EE734-37F0-425F-822B-B865348ECEC6}" - ProjectSection(ProjectDependencies) = postProject - {1ADC3666-1DDB-48C4-9811-1E58B6D09A7C} = {1ADC3666-1DDB-48C4-9811-1E58B6D09A7C} - EndProjectSection -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Android", "Android", "{456E7573-3324-43CB-8BA0-8D9C300EEB50}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleApp.Droid", "SampleApp.Droid\SampleApp.Droid.csproj", "{48540D33-4349-42D2-9D49-144A7049565A}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NmeaParser.Tests.Net", "UnitTests\NmeaParser.Tests.NET\NmeaParser.Tests.Net.csproj", "{73EFB2EF-DE40-46C4-9685-745A9815C0D2}" +EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution - UnitTests\NmeaParser.Tests\NmeaParser.Tests.projitems*{170ee734-37f0-425f-822b-b865348ecec6}*SharedItemsImports = 4 UnitTests\NmeaParser.Tests\NmeaParser.Tests.projitems*{92cad93b-6c3b-45a0-a723-be046de50fec}*SharedItemsImports = 4 UnitTests\NmeaParser.Tests\NmeaParser.Tests.projitems*{979ae182-eb59-4181-9d45-3fd6e4817f11}*SharedItemsImports = 13 EndGlobalSection @@ -138,22 +134,6 @@ Global {92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Release|x86.ActiveCfg = Release|x86 {92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Release|x86.Build.0 = Release|x86 {92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Release|x86.Deploy.0 = Release|x86 - {170EE734-37F0-425F-822B-B865348ECEC6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {170EE734-37F0-425F-822B-B865348ECEC6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {170EE734-37F0-425F-822B-B865348ECEC6}.Debug|ARM.ActiveCfg = Debug|Any CPU - {170EE734-37F0-425F-822B-B865348ECEC6}.Debug|ARM.Build.0 = Debug|Any CPU - {170EE734-37F0-425F-822B-B865348ECEC6}.Debug|x64.ActiveCfg = Debug|Any CPU - {170EE734-37F0-425F-822B-B865348ECEC6}.Debug|x64.Build.0 = Debug|Any CPU - {170EE734-37F0-425F-822B-B865348ECEC6}.Debug|x86.ActiveCfg = Debug|Any CPU - {170EE734-37F0-425F-822B-B865348ECEC6}.Debug|x86.Build.0 = Debug|Any CPU - {170EE734-37F0-425F-822B-B865348ECEC6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {170EE734-37F0-425F-822B-B865348ECEC6}.Release|Any CPU.Build.0 = Release|Any CPU - {170EE734-37F0-425F-822B-B865348ECEC6}.Release|ARM.ActiveCfg = Release|Any CPU - {170EE734-37F0-425F-822B-B865348ECEC6}.Release|ARM.Build.0 = Release|Any CPU - {170EE734-37F0-425F-822B-B865348ECEC6}.Release|x64.ActiveCfg = Release|Any CPU - {170EE734-37F0-425F-822B-B865348ECEC6}.Release|x64.Build.0 = Release|Any CPU - {170EE734-37F0-425F-822B-B865348ECEC6}.Release|x86.ActiveCfg = Release|Any CPU - {170EE734-37F0-425F-822B-B865348ECEC6}.Release|x86.Build.0 = Release|Any CPU {48540D33-4349-42D2-9D49-144A7049565A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {48540D33-4349-42D2-9D49-144A7049565A}.Debug|Any CPU.Build.0 = Debug|Any CPU {48540D33-4349-42D2-9D49-144A7049565A}.Debug|Any CPU.Deploy.0 = Debug|Any CPU @@ -178,6 +158,22 @@ Global {48540D33-4349-42D2-9D49-144A7049565A}.Release|x86.ActiveCfg = Release|Any CPU {48540D33-4349-42D2-9D49-144A7049565A}.Release|x86.Build.0 = Release|Any CPU {48540D33-4349-42D2-9D49-144A7049565A}.Release|x86.Deploy.0 = Release|Any CPU + {73EFB2EF-DE40-46C4-9685-745A9815C0D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {73EFB2EF-DE40-46C4-9685-745A9815C0D2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {73EFB2EF-DE40-46C4-9685-745A9815C0D2}.Debug|ARM.ActiveCfg = Debug|Any CPU + {73EFB2EF-DE40-46C4-9685-745A9815C0D2}.Debug|ARM.Build.0 = Debug|Any CPU + {73EFB2EF-DE40-46C4-9685-745A9815C0D2}.Debug|x64.ActiveCfg = Debug|Any CPU + {73EFB2EF-DE40-46C4-9685-745A9815C0D2}.Debug|x64.Build.0 = Debug|Any CPU + {73EFB2EF-DE40-46C4-9685-745A9815C0D2}.Debug|x86.ActiveCfg = Debug|Any CPU + {73EFB2EF-DE40-46C4-9685-745A9815C0D2}.Debug|x86.Build.0 = Debug|Any CPU + {73EFB2EF-DE40-46C4-9685-745A9815C0D2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {73EFB2EF-DE40-46C4-9685-745A9815C0D2}.Release|Any CPU.Build.0 = Release|Any CPU + {73EFB2EF-DE40-46C4-9685-745A9815C0D2}.Release|ARM.ActiveCfg = Release|Any CPU + {73EFB2EF-DE40-46C4-9685-745A9815C0D2}.Release|ARM.Build.0 = Release|Any CPU + {73EFB2EF-DE40-46C4-9685-745A9815C0D2}.Release|x64.ActiveCfg = Release|Any CPU + {73EFB2EF-DE40-46C4-9685-745A9815C0D2}.Release|x64.Build.0 = Release|Any CPU + {73EFB2EF-DE40-46C4-9685-745A9815C0D2}.Release|x86.ActiveCfg = Release|Any CPU + {73EFB2EF-DE40-46C4-9685-745A9815C0D2}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -191,9 +187,9 @@ Global {1ADC3666-1DDB-48C4-9811-1E58B6D09A7C} = {1701F3BA-A09C-4706-A612-24FD9340FC18} {92CAD93B-6C3B-45A0-A723-BE046DE50FEC} = {28B8E327-C504-4E08-B2CE-09D1CBB8B904} {979AE182-EB59-4181-9D45-3FD6E4817F11} = {28B8E327-C504-4E08-B2CE-09D1CBB8B904} - {170EE734-37F0-425F-822B-B865348ECEC6} = {28B8E327-C504-4E08-B2CE-09D1CBB8B904} {456E7573-3324-43CB-8BA0-8D9C300EEB50} = {A4B9D59A-C8C6-4199-A7F3-F3AF0C748281} {48540D33-4349-42D2-9D49-144A7049565A} = {456E7573-3324-43CB-8BA0-8D9C300EEB50} + {73EFB2EF-DE40-46C4-9685-745A9815C0D2} = {28B8E327-C504-4E08-B2CE-09D1CBB8B904} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {03788B53-C0BF-485B-AA19-A9EAB0E9AF7B} diff --git a/src/UnitTests/NmeaParser.Tests.NET/NmeaParser.Tests.Net.csproj b/src/UnitTests/NmeaParser.Tests.NET/NmeaParser.Tests.Net.csproj new file mode 100644 index 0000000..7c7832d --- /dev/null +++ b/src/UnitTests/NmeaParser.Tests.NET/NmeaParser.Tests.Net.csproj @@ -0,0 +1,30 @@ + + + + net451;netcoreapp3.1 + false + + + + + + + + + + + + + + NmeaSampleData.txt + PreserveNewest + + + TrimbleR2SampleData.txt + PreserveNewest + + + + + + \ No newline at end of file diff --git a/src/UnitTests/NmeaParser.Tests.NET45/NmeaParser.Tests.NET45.csproj b/src/UnitTests/NmeaParser.Tests.NET45/NmeaParser.Tests.NET45.csproj deleted file mode 100644 index c3d4368..0000000 --- a/src/UnitTests/NmeaParser.Tests.NET45/NmeaParser.Tests.NET45.csproj +++ /dev/null @@ -1,77 +0,0 @@ - - - - - Debug - AnyCPU - {170EE734-37F0-425F-822B-B865348ECEC6} - Library - Properties - NmeaParser.Tests.NET45 - NmeaParser.Tests.NET45 - v4.6.1 - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 15.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages - False - UnitTest - - - 8.0 - enable - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - PackageReference - - - - 1.4.0 - - - 1.4.0 - - - - - - - - - - {1adc3666-1ddb-48c4-9811-1e58b6d09a7c} - NmeaParser - - - - - NmeaSampleData.txt - PreserveNewest - - - TrimbleR2SampleData.txt - PreserveNewest - - - - - - \ No newline at end of file diff --git a/src/UnitTests/NmeaParser.Tests.NET45/Properties/AssemblyInfo.cs b/src/UnitTests/NmeaParser.Tests.NET45/Properties/AssemblyInfo.cs deleted file mode 100644 index 67a3afd..0000000 --- a/src/UnitTests/NmeaParser.Tests.NET45/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("NmeaParser.Tests.NET45")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("NmeaParser.Tests.NET45")] -[assembly: AssemblyCopyright("Copyright © 2017")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -[assembly: ComVisible(false)] - -[assembly: Guid("170ee734-37f0-425f-822b-b865348ecec6")] - -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")]