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
diff options
context:
space:
mode:
-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);
}