Add test for standalone resource dependency
This commit is contained in:
parent
05e1d95b14
commit
3953a85a63
3 changed files with 71 additions and 0 deletions
12
TestAssets/TestProjects/TestAppWithResourceDeps/Program.cs
Normal file
12
TestAssets/TestProjects/TestAppWithResourceDeps/Program.cs
Normal file
|
@ -0,0 +1,12 @@
|
|||
using System;
|
||||
|
||||
namespace ConsoleApplication
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static int Main(string[] args)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
33
TestAssets/TestProjects/TestAppWithResourceDeps/project.json
Normal file
33
TestAssets/TestProjects/TestAppWithResourceDeps/project.json
Normal file
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"version": "1.0.0-*",
|
||||
"buildOptions": {
|
||||
"emitEntryPoint": true
|
||||
},
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.5.0-rc2-24027",
|
||||
"Microsoft.CSharp": "4.0.1-rc2-24027",
|
||||
"System.Dynamic.Runtime": "4.0.11-rc2-24027",
|
||||
"System.Reflection.Metadata": "1.3.0-rc2-24027",
|
||||
"System.Runtime.Serialization.Primitives": "4.1.1-rc2-24027",
|
||||
"System.Xml.XmlSerializer": "4.0.11-rc2-24027",
|
||||
"WindowsAzure.Storage": "6.2.2-preview"
|
||||
},
|
||||
"frameworks": {
|
||||
"netcoreapp1.0": {
|
||||
"imports": [
|
||||
"dnxcore50",
|
||||
"portable-net45+win8"
|
||||
]
|
||||
}
|
||||
},
|
||||
"runtimes": {
|
||||
"win7-x64": {},
|
||||
"win7-x86": {},
|
||||
"osx.10.10-x64": {},
|
||||
"osx.10.11-x64": {},
|
||||
"ubuntu.14.04-x64": {},
|
||||
"centos.7-x64": {},
|
||||
"rhel.7.2-x64": {},
|
||||
"debian.8-x64": {}
|
||||
}
|
||||
}
|
|
@ -21,6 +21,32 @@ namespace Microsoft.DotNet.Tools.Publish.Tests
|
|||
publishDir.Should().NotHaveFile("StandaloneApp.runtimeconfig.dev.json");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void StandaloneAppHasResourceDependency()
|
||||
{
|
||||
// WindowsAzure.Services brings in en, zh etc. resource DLLs.
|
||||
// The host has to be able to find these assemblies from the deps file
|
||||
// from the standalone app base under the ietf tag directory.
|
||||
|
||||
var testName = "TestAppWithResourceDeps";
|
||||
TestInstance instance =
|
||||
TestAssetsManager
|
||||
.CreateTestInstance(testName)
|
||||
.WithLockFiles()
|
||||
.WithBuildArtifacts();
|
||||
|
||||
var publishCommand = new PublishCommand(instance.TestRoot);
|
||||
publishCommand.Execute().Should().Pass();
|
||||
|
||||
var publishedDir = publishCommand.GetOutputDirectory();
|
||||
var extension = publishCommand.GetExecutableExtension();
|
||||
var outputExe = testName + extension;
|
||||
publishedDir.Should().HaveFiles(new[] { $"{testName}.dll", outputExe });
|
||||
|
||||
var command = new TestCommand(Path.Combine(publishedDir.FullName, outputExe));
|
||||
command.Execute("").Should().ExitWith(0);
|
||||
}
|
||||
|
||||
private DirectoryInfo Publish(TestInstance testInstance)
|
||||
{
|
||||
var publishCommand = new PublishCommand(Path.Combine(testInstance.TestRoot, "StandaloneApp"));
|
||||
|
|
Loading…
Reference in a new issue