diff options
author | Sven Boemer <sbomer@gmail.com> | 2019-05-03 10:20:04 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2019-05-03 10:20:04 +0300 |
commit | 6280036e1f428c543445a638c22e5c2d8c744199 (patch) | |
tree | cb93b327a43fda14747258688a764ec82efc6f68 /test/Mono.Linker.Tests | |
parent | cb3c1e82f4b5de712257b3e3a8a31ed0ae4b9cc2 (diff) |
Use SDK-style projects (#471)
* Use SDK-style projects for linker and tests
* Clean up linker project file
Separate out the illink build properties from the monolinker
properties. Also disable building illink for net46 on unix/core
msbuild, which doesn't work due to missing reference assemblies. This
check is more specific than what we used to have, so that illink can
potentially be built with the mono runtime.
Building this project with "nuget restore" and "msbuild" will only
work with the default configuration because nuget restore does not set
the configuration and would see a different target framework from msbuild.
* Fix assembly title and description for illink
* Fix debug and optimization info for illink configurations
* Remove references to old illink solutions
* Update cecil submodule to latest mono/cecil
* Fix typo
* Update cecil configurations in illink.sln
* Fix cecil strongname build failure with arcade
Work around https://github.com/dotnet/arcade/issues/2321
* Remove unused configs from monolinker.sln
Also add a missing release config for cecil
* Set PublicKey and PublicKeyToken in cecil overrides
Diffstat (limited to 'test/Mono.Linker.Tests')
-rw-r--r-- | test/Mono.Linker.Tests/Mono.Linker.Tests.csproj | 119 | ||||
-rw-r--r-- | test/Mono.Linker.Tests/TestCases/TestDatabase.cs | 2 |
2 files changed, 31 insertions, 90 deletions
diff --git a/test/Mono.Linker.Tests/Mono.Linker.Tests.csproj b/test/Mono.Linker.Tests/Mono.Linker.Tests.csproj index f37575b0c..8764b7f05 100644 --- a/test/Mono.Linker.Tests/Mono.Linker.Tests.csproj +++ b/test/Mono.Linker.Tests/Mono.Linker.Tests.csproj @@ -1,106 +1,40 @@ -<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <PropertyGroup> - <ILLinkBuild Condition=" $(Configuration.StartsWith('illink')) ">true</ILLinkBuild> - <ILLinkBuild Condition=" '$(ILLinkBuild)' == '' ">false</ILLinkBuild> - </PropertyGroup> - <Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" Condition=" $(ILLinkBuild) " /> - <PropertyGroup> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProductVersion>8.0.50727</ProductVersion> - <ProjectGuid>{400A1561-B6B6-482D-9E4C-3DDAEDE5BD07}</ProjectGuid> - <OutputType>Library</OutputType> - <AppDesignerFolder>Properties</AppDesignerFolder> - <AssemblyName>Mono.Linker.Tests</AssemblyName> - <StartupObject> - </StartupObject> - <TargetFramework Condition=" $(ILLinkBuild) ">netcoreapp3.0</TargetFramework> - <EnableDefaultCompileItems Condition=" $(ILLinkBuild) ">false</EnableDefaultCompileItems> - <TargetFrameworkVersion Condition=" ! $(ILLinkBuild) ">v4.7.1</TargetFrameworkVersion> +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup Condition=" $(Configuration.StartsWith('illink')) "> + <TargetFramework>netcoreapp3.0</TargetFramework> + <ILLinkBuild>true</ILLinkBuild> + <DefineConstants>$(DefineConstants);ILLINK</DefineConstants> + <DefineConstants Condition=" '$(Configuration)' == 'illink_Debug' ">$(DefineConstants);DEBUG</DefineConstants> <!-- Simulate https://github.com/dotnet/sdk/pull/2073 until it ships. --> <DefineConstants Condition=" '$(TargetFramework)' == 'netcoreapp3.0' ">$(DefineConstants);NETCOREAPP</DefineConstants> - <DefineConstants Condition=" $(ILLinkBuild) ">$(DefineConstants);ILLINK</DefineConstants> - <DefineConstants Condition=" '$(Configuration)' == 'illink_Debug' ">$(DefineConstants);DEBUG</DefineConstants> + <DefineConstants Condition=" '$(ArcadeBuild)' == 'true' ">$(DefineConstants);ARCADE</DefineConstants> - <IsTestProject Condition=" $(ILLinkBuild) ">true</IsTestProject> <!-- Arcade's custom test imports assume that we are using xunit. --> <DisableArcadeTestFramework Condition=" '$(ArcadeBuild)' == 'true' ">true</DisableArcadeTestFramework> - <RootNamespace>Mono.Linker.Tests</RootNamespace> </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - <DebugSymbols>true</DebugSymbols> - <DebugType>full</DebugType> - <Optimize>false</Optimize> - <OutputPath>bin\Debug\</OutputPath> - <DefineConstants>DEBUG;TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> + + <PropertyGroup Condition=" ! $(Configuration.StartsWith('illink')) "> + <TargetFramework>net471</TargetFramework> + <ILLinkBuild>false</ILLinkBuild> </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> - <Optimize>true</Optimize> - <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> + + <PropertyGroup> + <IsTestProject>true</IsTestProject> + <EnableDefaultCompileItems>false</EnableDefaultCompileItems> </PropertyGroup> - <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" Condition=" ! $(ILLinkBuild) " /> - <!-- To modify your build process, add your task inside one of the targets below and uncomment it. - Other similar extension points exist, see Microsoft.Common.targets. - <Target Name="BeforeBuild"> - </Target> - <Target Name="AfterBuild"> - </Target> - --> - <ItemGroup Condition=" ! $(ILLinkBuild) "> - <Reference Include="System" /> - <Reference Include="System.Xml" /> - <Reference Include="System.Core" /> - <Reference Include="nunit.framework"> - <HintPath>..\..\packages\NUnit.3.6.1\lib\net45\nunit.framework.dll</HintPath> - </Reference> - </ItemGroup> + <ItemGroup> <Folder Include="Properties\" /> <Folder Include="TestCasesRunner\" /> <Folder Include="Extensions\" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\..\external\cecil\Mono.Cecil.csproj"> - <SetConfiguration Condition=" '$(Configuration)' == 'illink_Debug' ">Configuration=netstandard_Debug</SetConfiguration> - <SetConfiguration Condition=" '$(Configuration)' == 'illink_Release' ">Configuration=netstandard_Release</SetConfiguration> - <Project>{D68133BD-1E63-496E-9EDE-4FBDBF77B486}</Project> - <Name>Mono.Cecil</Name> - </ProjectReference> - <ProjectReference Include="..\..\external\cecil\symbols\mdb\Mono.Cecil.Mdb.csproj"> - <SetConfiguration Condition=" '$(Configuration)' == 'illink_Debug' ">Configuration=netstandard_Debug</SetConfiguration> - <SetConfiguration Condition=" '$(Configuration)' == 'illink_Release' ">Configuration=netstandard_Release</SetConfiguration> - <Project>{8559dd7f-a16f-46d0-a05a-9139faeba8fd}</Project> - <Name>Mono.Cecil.Mdb</Name> - </ProjectReference> - <ProjectReference Include="..\..\external\cecil\symbols\pdb\Mono.Cecil.Pdb.csproj"> - <SetConfiguration Condition=" '$(Configuration)' == 'illink_Debug' ">Configuration=netstandard_Debug</SetConfiguration> - <SetConfiguration Condition=" '$(Configuration)' == 'illink_Release' ">Configuration=netstandard_Release</SetConfiguration> - <Project>{63e6915c-7ea4-4d76-ab28-0d7191eea626}</Project> - <Name>Mono.Cecil.Pdb</Name> - </ProjectReference> - <ProjectReference Include="..\..\src\linker\Mono.Linker.csproj"> - <Project>{DD28E2B1-057B-4B4D-A04D-B2EBD9E76E46}</Project> - <Name>Mono.Linker</Name> - </ProjectReference> - <ProjectReference Include="..\Mono.Linker.Tests.Cases\Mono.Linker.Tests.Cases.csproj"> - <SetConfiguration Condition=" '$(Configuration)' == 'illink_Debug' ">Configuration=illink_Debug</SetConfiguration> - <SetConfiguration Condition=" '$(Configuration)' == 'illink_Release' ">Configuration=illink_Release</SetConfiguration> - <Project>{B6BEE6AA-ADA0-4E1D-9A17-FBF2936F82B5}</Project> - <Name>Mono.Linker.Tests.Cases</Name> - </ProjectReference> - <ProjectReference Include="..\Mono.Linker.Tests.Cases.Expectations\Mono.Linker.Tests.Cases.Expectations.csproj"> - <Project>{2C26601F-3E2F-45B9-A02F-58EE9296E19E}</Project> - <Name>Mono.Linker.Tests.Cases.Expectations</Name> - </ProjectReference> - </ItemGroup> - <ItemGroup> - <None Include="packages.config" /> + <ProjectReference Include="..\..\external\cecil\Mono.Cecil.csproj" /> + <ProjectReference Include="..\..\external\cecil\symbols\mdb\Mono.Cecil.Mdb.csproj" /> + <ProjectReference Include="..\..\external\cecil\symbols\pdb\Mono.Cecil.Pdb.csproj" /> + <ProjectReference Include="..\..\src\linker\Mono.Linker.csproj" /> + <ProjectReference Include="..\Mono.Linker.Tests.Cases\Mono.Linker.Tests.Cases.csproj" /> + <ProjectReference Include="..\Mono.Linker.Tests.Cases.Expectations\Mono.Linker.Tests.Cases.Expectations.csproj" /> </ItemGroup> <ItemGroup> <Compile Include="TestCasesRunner\CompilerOptions.cs" /> @@ -166,5 +100,10 @@ <MSBuild Projects="$(IlasmProject)" Targets="CopyILAsmTool" Properties="BaseIntermediateOutputPath=$(IlasmDir);__BuildPhase=Copy" /> </Target> - <Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" Condition=" $(ILLinkBuild) " /> + <ItemGroup Condition=" ! $(ILLinkBuild) "> + <PackageReference Include="NUnit" Version="3.6.1" /> + <PackageReference Include="NUnit.ConsoleRunner" Version="3.6.1" /> + <PackageReference Include="NUnit.Extension.NUnitV2ResultWriter" Version="3.5.0" /> + </ItemGroup> + </Project> diff --git a/test/Mono.Linker.Tests/TestCases/TestDatabase.cs b/test/Mono.Linker.Tests/TestCases/TestDatabase.cs index 3f5ab6f5a..874f555d3 100644 --- a/test/Mono.Linker.Tests/TestCases/TestDatabase.cs +++ b/test/Mono.Linker.Tests/TestCases/TestDatabase.cs @@ -189,6 +189,8 @@ namespace Mono.Linker.Tests.TestCases #if NETCOREAPP3_0 var tfm = "netcoreapp3.0"; +#elif NET471 + var tfm = "net471"; #else var tfm = ""; #endif |