Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Re-enable XmlSerializer.Generator tests - #23978

Merged
ericstj merged 8 commits into
dotnet:masterfrom
ericstj:serializerTest
Sep 13, 2017
Merged

ericstj merged 8 commits into
dotnet:masterfrom
ericstj:serializerTest

Conversation

@ericstj

@ericstj ericstj commented Sep 12, 2017

Copy link
Copy Markdown
Member

Please see individual commits.

In a nutshell this re-enables the tests and ensures they run on the test framework rather than the tool framework.

Tests may want to copy a ReferenceFromRuntime to the test output directory.

To do this, a test can set Private=true (same as you would for a Reference).

By default we don't do this, because anything in the runtime folder will be
part of the shared framework that the test runs on.

In the case of Microsoft.XmlSerializer.Generator it's reference is an
application and the project expects this to be next to the test assembly.
The test CLI uses the binaries that were just built as opposed to the tools CLI, which was previously
being used, which contains whatever binaries were in that LKG version of the shared framework.
This was needed after dotnet@664ca95
changed the tests to run from a binplaced location rather than the outputpath of the test.
Previously these were disabled if the generated dll was missing, now they'll fail if the DLL is missing.
…etcoreapp

The tests will also run on desktop (and potentially UWP).

In those cases we'll use the tool's shared-framework for GenerateSerializationAssembly since we don't
have a test shared framework (since we're not building netcoreapp).
@ericstj
ericstj force-pushed the serializerTest branch 2 times, most recently from 33b5926 to 6d9c253 Compare September 12, 2017 21:16

@shmao shmao left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for making the PR, @ericstj

<Exec Command="$(GeneratorCliPath)dotnet $(OutputPath)dotnet-Microsoft.XmlSerializer.Generator.dll $(OutputPath)Microsoft.XmlSerializer.Generator.Tests.dll /force /casesensitive" />
<Warning Condition="Exists('$(OutputPath)$(SerializerName).cs') != 'true'" Text="Fail to generate $(OutputPath)$(SerializerName).cs"/>
<Csc Condition="Exists('$(OutputPath)$(SerializerName).cs') == 'true'" ContinueOnError="true"
<Csc Condition="Exists('$(OutputPath)$(SerializerName).cs') == 'true' AND '$(MSBuildRuntimeType)' != 'core'" ContinueOnError="true"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want to remove ContinueOnError="true". But that can be done in a separate PR.

cc: @huanwu

@hqueue

hqueue commented Sep 15, 2017

Copy link
Copy Markdown
Member

In a nutshell this re-enables the tests and ensures they run on the test framework rather than the tool framework.

There is a problem in cross build environment, because we can't run on the test framework when we are cross-building corefx tests. I've opened the issue #24029 and PR #24030.

@karelz karelz added this to the 2.1.0 milestone Oct 11, 2017
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
Re-enable XmlSerializer.Generator tests

Commit migrated from dotnet/corefx@6b948dd
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants