diff options
author | Mike Voorhees <michaelv@unity3d.com> | 2017-08-17 20:23:13 +0300 |
---|---|---|
committer | Mike Voorhees <michaelv@unity3d.com> | 2017-08-19 00:41:45 +0300 |
commit | 43aa37935673802a8f36175463834fbbf9170d92 (patch) | |
tree | 1a5ceddc9c7e47009b33424ef0f046cd6c9a6029 /linker/Tests/Mono.Linker.Tests.Cases.Expectations | |
parent | 90ad20a615da3066519aad3d85ee9f1466140cb6 (diff) |
Add ability to compile assemblies before and after a test case
Can now compile .il files into assemblies
Add support for [Define] to set defines for a test case
Implement some basic type forwarding test cases
Diffstat (limited to 'linker/Tests/Mono.Linker.Tests.Cases.Expectations')
4 files changed, 51 insertions, 0 deletions
diff --git a/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Metadata/DefineAttribute.cs b/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Metadata/DefineAttribute.cs new file mode 100644 index 000000000..14e95fd4d --- /dev/null +++ b/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Metadata/DefineAttribute.cs @@ -0,0 +1,12 @@ +using System; + +namespace Mono.Linker.Tests.Cases.Expectations.Metadata { + [AttributeUsage (AttributeTargets.Class, AllowMultiple = true)] + public class DefineAttribute : BaseMetadataAttribute { + public DefineAttribute (string name) + { + if (string.IsNullOrEmpty (name)) + throw new ArgumentException ("Value cannot be null or empty.", nameof (name)); + } + } +} diff --git a/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Metadata/SetupCompileAfterAttribute.cs b/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Metadata/SetupCompileAfterAttribute.cs new file mode 100644 index 000000000..fa580a2f8 --- /dev/null +++ b/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Metadata/SetupCompileAfterAttribute.cs @@ -0,0 +1,18 @@ +using System; + +namespace Mono.Linker.Tests.Cases.Expectations.Metadata { + /// <summary> + /// Use to compile an assembly after compiling the main test case executabe + /// </summary> + [AttributeUsage (AttributeTargets.Class, AllowMultiple = true)] + public class SetupCompileAfterAttribute : BaseMetadataAttribute { + public SetupCompileAfterAttribute (string outputName, string[] sourceFiles, string[] references = null, string[] defines = null) + { + if (sourceFiles == null) + throw new ArgumentNullException (nameof (sourceFiles)); + + if (string.IsNullOrEmpty (outputName)) + throw new ArgumentException ("Value cannot be null or empty.", nameof (outputName)); + } + } +} diff --git a/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Metadata/SetupCompileBeforeAttribute.cs b/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Metadata/SetupCompileBeforeAttribute.cs new file mode 100644 index 000000000..d9a3bd658 --- /dev/null +++ b/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Metadata/SetupCompileBeforeAttribute.cs @@ -0,0 +1,18 @@ +using System; + +namespace Mono.Linker.Tests.Cases.Expectations.Metadata { + /// <summary> + /// Use to compile an assembly before compiling the main test case executabe + /// </summary> + [AttributeUsage (AttributeTargets.Class, AllowMultiple = true)] + public class SetupCompileBeforeAttribute : BaseMetadataAttribute { + public SetupCompileBeforeAttribute (string outputName, string[] sourceFiles, string[] references = null, string[] defines = null, bool addAsReference = true) + { + if (sourceFiles == null) + throw new ArgumentNullException (nameof (sourceFiles)); + + if (string.IsNullOrEmpty (outputName)) + throw new ArgumentException ("Value cannot be null or empty.", nameof (outputName)); + } + } +} diff --git a/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Mono.Linker.Tests.Cases.Expectations.csproj b/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Mono.Linker.Tests.Cases.Expectations.csproj index fb1b6e3e1..20c4a9479 100644 --- a/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Mono.Linker.Tests.Cases.Expectations.csproj +++ b/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Mono.Linker.Tests.Cases.Expectations.csproj @@ -51,7 +51,10 @@ <Compile Include="Assertions\RemovedTypeInAssemblyAttribute.cs" /> <Compile Include="Assertions\SkipPeVerifyAttribute.cs" /> <Compile Include="Metadata\BaseMetadataAttribute.cs" /> + <Compile Include="Metadata\SetupCompileAfterAttribute.cs" /> + <Compile Include="Metadata\SetupCompileBeforeAttribute.cs" /> <Compile Include="Metadata\CoreLinkAttribute.cs" /> + <Compile Include="Metadata\DefineAttribute.cs" /> <Compile Include="Metadata\IncludeBlacklistStepAttribute.cs" /> <Compile Include="Metadata\Il8nAttribute.cs" /> <Compile Include="Metadata\KeepTypeForwarderOnlyAssembliesAttribute.cs" /> |