diff options
author | Tarek Mahmoud Sayed <tarekms@microsoft.com> | 2016-07-01 19:44:44 +0300 |
---|---|---|
committer | Tarek Mahmoud Sayed <tarekms@microsoft.com> | 2016-07-01 19:44:44 +0300 |
commit | 3e714b8b1efe68c693469b6cab7883ff8a1b51d8 (patch) | |
tree | 735c711f52be324ea6f7b9115f0f7f20223f64be /dir.targets | |
parent | 9e253430aea9b8d2420266183d479201af8ec505 (diff) |
Support filtering to TestTFM
This change is to support filtering according to the TestTFM. e.g. can do
“build.cmd /p:FilterToTestTFM=net46”
The change here is splitting the Build phase from the Test phase in dir.traversal.targets
so we don’t have to rebuild the test assemblies when passing TestTFM property to run the test.
Now if FilterToTestTFM is not specified, we default running the tests as netcoreapp1.0
so when issuing “build.cmd/sh” Command without passing FilterToTestTFM, it will
filter the tests to netcoreapp1.0 and run those tests.
I have enabled one of the test projects System.AppContext.Tests to support net46
as example, next step will be Enabling the rest of all projects to run against all
platforms (net46, net461, net462, netcore50 and netcore50aot)
Diffstat (limited to 'dir.targets')
-rw-r--r-- | dir.targets | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/dir.targets b/dir.targets index 87ba4ae6f6..6b16e9886d 100644 --- a/dir.targets +++ b/dir.targets @@ -17,6 +17,18 @@ <Target Name="GenerateTestProjectJson" /> <Target Name="GenerateAllTestProjectJsons" /> + <Target Name="UndefineTestTFM" BeforeTargets="AssignProjectConfiguration"> + <ItemGroup> + <ProjectReference> + <!-- + Always undefine TestTFM and FilterToTestTFM for all project reference as not needed for compilation and + avoid bin clash tool to fail + --> + <UndefineProperties>%(ProjectReference.UndefineProperties);TestTFM;FilterToTestTFM</UndefineProperties> + </ProjectReference> + </ItemGroup> + </Target> + <Import Project="$(ToolsDir)/Build.Common.targets" Condition="Exists('$(ToolsDir)/Build.Common.targets')" /> <!-- permit a wrapping build system to contribute targets to this build --> |