Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/linker.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/linker
diff options
context:
space:
mode:
authorMike Voorhees <michaelv@unity3d.com>2017-05-16 22:15:11 +0300
committerMarek Safar <marek.safar@gmail.com>2017-05-28 14:45:00 +0300
commit3f0ff0798aed66904f364e99ec0d3cb3ed4f7b4e (patch)
treeb1714d73117b50594325e634f4dc60129d73317a /linker
parentc8e4128a4acc7e75cf085f3b2431d05fdfc969f0 (diff)
Switch to explicit references only. No more assuming all .dlls in the sandboxed directory
are meant to be passed as references when compiling the test cases
Diffstat (limited to 'linker')
-rw-r--r--linker/Tests/TestCasesRunner/TestCaseMetadaProvider.cs3
-rw-r--r--linker/Tests/TestCasesRunner/TestCaseSandbox.cs18
-rw-r--r--linker/Tests/TestCasesRunner/TestRunner.cs4
3 files changed, 11 insertions, 14 deletions
diff --git a/linker/Tests/TestCasesRunner/TestCaseMetadaProvider.cs b/linker/Tests/TestCasesRunner/TestCaseMetadaProvider.cs
index 477fdcfde..67eb9814c 100644
--- a/linker/Tests/TestCasesRunner/TestCaseMetadaProvider.cs
+++ b/linker/Tests/TestCasesRunner/TestCaseMetadaProvider.cs
@@ -34,8 +34,9 @@ namespace Mono.Linker.Tests.TestCasesRunner {
return new TestCaseLinkerOptions {CoreLink = coreLink, Il8n = il8n, IncludeBlacklistStep = blacklist};
}
- public virtual IEnumerable<string> GetReferencedAssemblies ()
+ public virtual IEnumerable<string> GetReferencedAssemblies (NPath workingDirectory)
{
+ yield return workingDirectory.Combine ("Mono.Linker.Tests.Cases.Expectations.dll").ToString ();
yield return "mscorlib.dll";
foreach (var referenceAttr in _testCaseTypeDefinition.CustomAttributes.Where (attr => attr.AttributeType.Name == nameof (ReferenceAttribute))) {
diff --git a/linker/Tests/TestCasesRunner/TestCaseSandbox.cs b/linker/Tests/TestCasesRunner/TestCaseSandbox.cs
index 7eb29f4b7..03e990ff0 100644
--- a/linker/Tests/TestCasesRunner/TestCaseSandbox.cs
+++ b/linker/Tests/TestCasesRunner/TestCaseSandbox.cs
@@ -47,14 +47,6 @@ namespace Mono.Linker.Tests.TestCasesRunner {
get { return _directory.Files ("*.cs"); }
}
- public IEnumerable<NPath> InputDirectoryReferences {
- get { return InputDirectory.Files ("*.dll"); }
- }
-
- public IEnumerable<NPath> ExpectationsDirectoryReferences {
- get { return ExpectationsDirectory.Files ("*.dll"); }
- }
-
public IEnumerable<NPath> LinkXmlFiles {
get { return InputDirectory.Files ("*.xml"); }
}
@@ -66,18 +58,22 @@ namespace Mono.Linker.Tests.TestCasesRunner {
if (_testCase.HasLinkXmlFile)
_testCase.LinkXmlFile.Copy (InputDirectory);
- GetExpectationsAssemblyPath ().Copy (InputDirectory);
+ CopyToInputAndExpectations (GetExpectationsAssemblyPath ());
foreach (var dep in metadataProvider.AdditionalFilesToSandbox ()) {
dep.FileMustExist ().Copy (_directory);
}
-
- InputDirectoryReferences.Copy (ExpectationsDirectory);
}
private static NPath GetExpectationsAssemblyPath ()
{
return new Uri (typeof (KeptAttribute).Assembly.CodeBase).LocalPath.ToNPath ();
}
+
+ protected void CopyToInputAndExpectations (NPath source)
+ {
+ source.Copy (InputDirectory);
+ source.Copy (ExpectationsDirectory);
+ }
}
} \ No newline at end of file
diff --git a/linker/Tests/TestCasesRunner/TestRunner.cs b/linker/Tests/TestCasesRunner/TestRunner.cs
index b43fda635..f29774064 100644
--- a/linker/Tests/TestCasesRunner/TestRunner.cs
+++ b/linker/Tests/TestCasesRunner/TestRunner.cs
@@ -40,10 +40,10 @@ namespace Mono.Linker.Tests.TestCasesRunner {
var compiler = _factory.CreateCompiler ();
var sourceFiles = sandbox.SourceFiles.Select(s => s.ToString()).ToArray();
- var references = metadataProvider.GetReferencedAssemblies ().Concat (sandbox.InputDirectoryReferences.Select (r => r.ToString ())).ToArray ();
+ var references = metadataProvider.GetReferencedAssemblies(sandbox.InputDirectory);
var inputAssemblyPath = compiler.CompileTestIn (sandbox.InputDirectory, sourceFiles, references, null);
- references = metadataProvider.GetReferencedAssemblies ().Concat (sandbox.ExpectationsDirectoryReferences.Select (r => r.ToString ())).ToArray ();
+ references = metadataProvider.GetReferencedAssemblies(sandbox.ExpectationsDirectory);
var expectationsAssemblyPath = compiler.CompileTestIn (sandbox.ExpectationsDirectory, sourceFiles, references, new [] { "INCLUDE_EXPECTATIONS" });
return new ManagedCompilationResult (inputAssemblyPath, expectationsAssemblyPath);
}