From 3f058d4f3207f9014a6420c1e7df35a67963dda6 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Tue, 9 Feb 2016 10:51:03 -0800 Subject: [PATCH] Fix tests and add diagnostic message --- src/Microsoft.DotNet.Compiler.Common/Executable.cs | 5 +++++ test/dotnet-build.Tests/BuildOutputTests.cs | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.DotNet.Compiler.Common/Executable.cs b/src/Microsoft.DotNet.Compiler.Common/Executable.cs index 33d3a887f..eab60e6ef 100644 --- a/src/Microsoft.DotNet.Compiler.Common/Executable.cs +++ b/src/Microsoft.DotNet.Compiler.Common/Executable.cs @@ -32,6 +32,11 @@ namespace Microsoft.Dotnet.Cli.Compiler.Common public void MakeCompilationOutputRunnable() { + if (string.IsNullOrEmpty(_context.RuntimeIdentifier)) + { + throw new InvalidOperationException($"Can not make output runnable for framework {_context.TargetFramework}, because it doesn't have runtime target"); + } + var outputPath = _outputPaths.RuntimeOutputPath; CopyContentFiles(outputPath); diff --git a/test/dotnet-build.Tests/BuildOutputTests.cs b/test/dotnet-build.Tests/BuildOutputTests.cs index 778758180..dd6414771 100644 --- a/test/dotnet-build.Tests/BuildOutputTests.cs +++ b/test/dotnet-build.Tests/BuildOutputTests.cs @@ -68,10 +68,10 @@ namespace Microsoft.DotNet.Tools.Builder.Tests [Theory] // global.json exists - [InlineData(true, null, null, "src/TestLibrary/bin/debug/{fw}", "src/TestApp/bin/debug/{fw}", "src/TestApp/bin/debug/{fw}/{rid}")] - [InlineData(true, "out", null, "src/TestLibrary/bin/debug/{fw}", "src/TestApp/bin/debug/{fw}", "out")] - [InlineData(true, null, "build", "build/src/TestLibrary/bin/debug/{fw}", "build/src/TestApp/bin/debug/{fw}", "build/src/TestApp/bin/debug/{fw}/{rid}")] - [InlineData(true, "out", "build", "build/src/TestLibrary/bin/debug/{fw}", "build/src/TestApp/bin/debug/{fw}", "out")] + [InlineData(true, null, null, "src/TestLibrary/bin/Debug/{fw}", "src/TestApp/bin/Debug/{fw}", "src/TestApp/bin/Debug/{fw}/{rid}")] + [InlineData(true, "out", null, "src/TestLibrary/bin/Debug/{fw}", "src/TestApp/bin/Debug/{fw}", "out")] + [InlineData(true, null, "build", "build/src/TestLibrary/bin/Debug/{fw}", "build/src/TestApp/bin/Debug/{fw}", "build/src/TestApp/bin/Debug/{fw}/{rid}")] + [InlineData(true, "out", "build", "build/src/TestLibrary/bin/Debug/{fw}", "build/src/TestApp/bin/Debug/{fw}", "out")] //no global.json //[InlineData(false, null, null, "src/TestLibrary/bin/debug/{fw}", "src/TestApp/bin/debug/{fw}", "src/TestApp/bin/debug/{fw}/{rid}")] //[InlineData(false, "out", null, "src/TestLibrary/bin/debug/{fw}", "src/TestApp/bin/debug/{fw}", "out")]