-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[generator] Constructors support [Obsolete] (#273)
Fixes: dotnet/android#1396 If `//constructor/@deprecated` has a value of `deprecated`, then the constructor should be `[Obsolete]`. This is what is already done with methods.
- Loading branch information
1 parent
6807817
commit 56e978f
Showing
7 changed files
with
96 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
|
||
These tests are not intuitive at all. So we need some documentation here. | ||
|
||
These tests compare outcomes from generator to the "expected" outcomes. | ||
|
||
It does not work together with class-parse, so you cannot pass any jars | ||
nor java sources, which is a pain point (but those who created these tests | ||
didn't care). | ||
|
||
There are two "expected" set of files. One is "expected" and the other is | ||
"expected.ji". They are different per Java.Interop output methods. | ||
|
||
The differences between "expected" and "expected.ji" are almost only | ||
annoying, but this test blindly compares those differences. So if you are | ||
going to add tests you will have to duplicate your work twice... | ||
|
||
Tests that use `BaseGeneratorTest` are organized as: | ||
|
||
./BaseGeneratorTest.cs - sets up generation and compilation options. | ||
./Compiler.cs - implements C# compilation with `CodeDomProvider`. | ||
./(others).cs - the actual `TestFixture`s. | ||
|
||
What those tests do are: | ||
|
||
- invoke class-parse (and perhaps jar2xml), to generate XML API inputs to generator. | ||
- invoke generator, to generate comparable sources. | ||
- optionally invoke csc to see if it builds. | ||
|
||
`BaseGeneratorTest` takes the arguments below, | ||
|
||
- outputRelativePath - path to generator output subdir | ||
- apiDescriptionFile - path to the input API XML output. Sadly existing tests | ||
are organized horribly and they reside in the "expected" directory. | ||
- expectedRelativePath - path to the "expected" file generation. | ||
- additionalSupportPaths - path to additional compilation items. | ||
|
||
The test outputs are generated to `out` and `out.ji` directories, per | ||
the generator's output method. | ||
|
||
When you are creating a new test, it is easier to once generate results in | ||
those `out` and `out.ji` directories, and copy them as "expected" and | ||
"expected.ji" with required changes (so that they become really expected | ||
contents). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 2012 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "generator", "generator.csproj", "{D14A1B5C-2060-4930-92BE-F7190256C735}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "generator-Tests", "Tests\generator-Tests.csproj", "{4EEAB1A7-99C1-4302-9C18-01A7B481409B}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{D14A1B5C-2060-4930-92BE-F7190256C735}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{D14A1B5C-2060-4930-92BE-F7190256C735}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{D14A1B5C-2060-4930-92BE-F7190256C735}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{D14A1B5C-2060-4930-92BE-F7190256C735}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{4EEAB1A7-99C1-4302-9C18-01A7B481409B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{4EEAB1A7-99C1-4302-9C18-01A7B481409B}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{4EEAB1A7-99C1-4302-9C18-01A7B481409B}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{4EEAB1A7-99C1-4302-9C18-01A7B481409B}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
EndGlobal |