Making argument forwarding tests run with dotnet test and removing the its special test scripts.
This commit is contained in:
parent
5c0eb19859
commit
64c17c5541
12 changed files with 36 additions and 119 deletions
|
@ -5,3 +5,4 @@ dotnet-compile.UnitTests
|
||||||
dotnet-build.Tests
|
dotnet-build.Tests
|
||||||
Microsoft.DotNet.Cli.Utils.Tests
|
Microsoft.DotNet.Cli.Utils.Tests
|
||||||
Microsoft.DotNet.Compiler.Common.Tests
|
Microsoft.DotNet.Compiler.Common.Tests
|
||||||
|
ArgumentForwardingTests
|
|
|
@ -1,2 +1 @@
|
||||||
argument-forwarding-tests
|
|
||||||
package-command-test
|
package-command-test
|
|
|
@ -1,35 +0,0 @@
|
||||||
#
|
|
||||||
# Copyright (c) .NET Foundation and contributors. All rights reserved.
|
|
||||||
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
||||||
#
|
|
||||||
|
|
||||||
. "$PSScriptRoot\..\common\_common.ps1"
|
|
||||||
|
|
||||||
$ArgTestRoot = "$RepoRoot\test\ArgumentForwardingTests"
|
|
||||||
$ArgTestOutputRoot = "$RepoRoot\artifacts\tests\arg-forwarding"
|
|
||||||
|
|
||||||
dotnet publish --framework "dnxcore50" --runtime "$Rid" --output "$ArgTestOutputRoot" --configuration "$Configuration" "$ArgTestRoot\Reflector"
|
|
||||||
if (!$?) {
|
|
||||||
Write-Host Command failed: dotnet publish --framework "dnxcore50" --runtime "$Rid" --output "$ArgTestOutputRoot" --configuration "$Configuration" "$ArgTestRoot\Reflector"
|
|
||||||
Exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
dotnet publish --framework "dnxcore50" --runtime "$Rid" --output "$ArgTestOutputRoot" --configuration "$Configuration" "$ArgTestRoot\ArgumentForwardingTests"
|
|
||||||
if (!$?) {
|
|
||||||
Write-Host Command failed: dotnet publish --framework "dnxcore50" --runtime "$Rid" --output "$ArgTestOutputRoot" --configuration "$Configuration" "$ArgTestRoot\ArgumentForwardingTests"
|
|
||||||
Exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
cp "$ArgTestRoot\Reflector\reflector_cmd.cmd" "$ArgTestOutputRoot"
|
|
||||||
|
|
||||||
pushd "$ArgTestOutputRoot"
|
|
||||||
|
|
||||||
& ".\corerun" "xunit.console.netcore.exe" "ArgumentForwardingTests.dll" -xml "$_-testResults.xml" -notrait category=failing
|
|
||||||
$exitCode = $LastExitCode
|
|
||||||
|
|
||||||
popd
|
|
||||||
|
|
||||||
# No need to output here, we'll get test results
|
|
||||||
if ($exitCode -ne 0) {
|
|
||||||
Exit 1
|
|
||||||
}
|
|
|
@ -1,30 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
#
|
|
||||||
# Copyright (c) .NET Foundation and contributors. All rights reserved.
|
|
||||||
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
||||||
#
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
SOURCE="${BASH_SOURCE[0]}"
|
|
||||||
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
|
|
||||||
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
|
|
||||||
SOURCE="$(readlink "$SOURCE")"
|
|
||||||
[[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
|
|
||||||
done
|
|
||||||
|
|
||||||
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
|
|
||||||
|
|
||||||
source "$DIR/../common/_common.sh"
|
|
||||||
|
|
||||||
ArgTestRoot="$REPOROOT/test/ArgumentForwardingTests"
|
|
||||||
ArgTestOutputRoot="$REPOROOT/artifacts/tests/arg-forwarding"
|
|
||||||
|
|
||||||
dotnet publish --framework "dnxcore50" --output "$ArgTestOutputRoot" --configuration "$CONFIGURATION" "$ArgTestRoot/Reflector"
|
|
||||||
dotnet publish --framework "dnxcore50" --output "$ArgTestOutputRoot" --configuration "$CONFIGURATION" "$ArgTestRoot/ArgumentForwardingTests"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
pushd "$ArgTestOutputRoot"
|
|
||||||
./corerun "xunit.console.netcore.exe" "ArgumentForwardingTests.dll" -xml "ArgumentForwardingTests-testResults.xml" -notrait category=failing
|
|
||||||
popd
|
|
|
@ -18,7 +18,7 @@ namespace Microsoft.DotNet.Tests.ArgumentForwarding
|
||||||
{
|
{
|
||||||
public class ArgumentForwardingTests : TestBase
|
public class ArgumentForwardingTests : TestBase
|
||||||
{
|
{
|
||||||
private static readonly string s_reflectorExeName = "Reflector" + Constants.ExeSuffix;
|
private static readonly string s_reflectorExeName = "ArgumentsReflector" + Constants.ExeSuffix;
|
||||||
private static readonly string s_reflectorCmdName = "reflector_cmd";
|
private static readonly string s_reflectorCmdName = "reflector_cmd";
|
||||||
|
|
||||||
private string ReflectorPath { get; set; }
|
private string ReflectorPath { get; set; }
|
||||||
|
@ -28,7 +28,7 @@ namespace Microsoft.DotNet.Tests.ArgumentForwarding
|
||||||
{
|
{
|
||||||
Console.WriteLine("Dummy Entrypoint.");
|
Console.WriteLine("Dummy Entrypoint.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArgumentForwardingTests()
|
public ArgumentForwardingTests()
|
||||||
{
|
{
|
||||||
// This test has a dependency on an argument reflector
|
// This test has a dependency on an argument reflector
|
||||||
|
@ -135,7 +135,7 @@ namespace Microsoft.DotNet.Tests.ArgumentForwarding
|
||||||
{
|
{
|
||||||
var rawArg = rawEvaluatedArgument[i];
|
var rawArg = rawEvaluatedArgument[i];
|
||||||
var escapedArg = escapedEvaluatedRawArgument[i];
|
var escapedArg = escapedEvaluatedRawArgument[i];
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
rawArg.Should().Be(escapedArg);
|
rawArg.Should().Be(escapedArg);
|
||||||
|
@ -175,7 +175,7 @@ namespace Microsoft.DotNet.Tests.ArgumentForwarding
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// EscapeAndEvaluateArgumentString returns a representation of string[] args
|
/// EscapeAndEvaluateArgumentString returns a representation of string[] args
|
||||||
/// when rawEvaluatedArgument is passed as an argument to a process using
|
/// when rawEvaluatedArgument is passed as an argument to a process using
|
||||||
/// Command.Create(). Ideally this should escape the argument such that
|
/// Command.Create(). Ideally this should escape the argument such that
|
||||||
/// the output is == rawEvaluatedArgument.
|
/// the output is == rawEvaluatedArgument.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="rawEvaluatedArgument">A string[] representing string[] args as already evaluated by a process</param>
|
/// <param name="rawEvaluatedArgument">A string[] representing string[] args as already evaluated by a process</param>
|
||||||
|
@ -195,7 +195,7 @@ namespace Microsoft.DotNet.Tests.ArgumentForwarding
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// EscapeAndEvaluateArgumentString returns a representation of string[] args
|
/// EscapeAndEvaluateArgumentString returns a representation of string[] args
|
||||||
/// when rawEvaluatedArgument is passed as an argument to a process using
|
/// when rawEvaluatedArgument is passed as an argument to a process using
|
||||||
/// Command.Create(). Ideally this should escape the argument such that
|
/// Command.Create(). Ideally this should escape the argument such that
|
||||||
/// the output is == rawEvaluatedArgument.
|
/// the output is == rawEvaluatedArgument.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="rawEvaluatedArgument">A string[] representing string[] args as already evaluated by a process</param>
|
/// <param name="rawEvaluatedArgument">A string[] representing string[] args as already evaluated by a process</param>
|
||||||
|
@ -218,7 +218,7 @@ namespace Microsoft.DotNet.Tests.ArgumentForwarding
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Parse the output of the reflector into a string array.
|
/// Parse the output of the reflector into a string array.
|
||||||
/// Reflector output is simply string[] args written to
|
/// Reflector output is simply string[] args written to
|
||||||
/// one string separated by commas.
|
/// one string separated by commas.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reflectorOutput"></param>
|
/// <param name="reflectorOutput"></param>
|
||||||
|
@ -230,7 +230,7 @@ namespace Microsoft.DotNet.Tests.ArgumentForwarding
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Parse the output of the reflector into a string array.
|
/// Parse the output of the reflector into a string array.
|
||||||
/// Reflector output is simply string[] args written to
|
/// Reflector output is simply string[] args written to
|
||||||
/// one string separated by commas.
|
/// one string separated by commas.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reflectorOutput"></param>
|
/// <param name="reflectorOutput"></param>
|
||||||
|
@ -262,7 +262,7 @@ namespace Microsoft.DotNet.Tests.ArgumentForwarding
|
||||||
{
|
{
|
||||||
StartInfo = new ProcessStartInfo
|
StartInfo = new ProcessStartInfo
|
||||||
{
|
{
|
||||||
FileName = s_reflectorExeName,
|
FileName = ReflectorPath,
|
||||||
Arguments = testUserArgument,
|
Arguments = testUserArgument,
|
||||||
UseShellExecute = false,
|
UseShellExecute = false,
|
||||||
RedirectStandardOutput = true,
|
RedirectStandardOutput = true,
|
|
@ -1,26 +0,0 @@
|
||||||
{
|
|
||||||
"version": "1.0.0-*",
|
|
||||||
"compilationOptions": {
|
|
||||||
"emitEntryPoint": true
|
|
||||||
},
|
|
||||||
|
|
||||||
"dependencies": {
|
|
||||||
"NETStandard.Library" : "1.0.0-rc2-23811",
|
|
||||||
"Microsoft.NETCore.TestHost": "1.0.0-rc2-23811",
|
|
||||||
|
|
||||||
"xunit": "2.1.0",
|
|
||||||
"xunit.console.netcore": "1.0.2-prerelease-00101",
|
|
||||||
"xunit.netcore.extensions": "1.0.0-prerelease-00153",
|
|
||||||
"xunit.runner.utility": "2.1.0",
|
|
||||||
|
|
||||||
"Microsoft.DotNet.ProjectModel": { "target": "project" },
|
|
||||||
"Microsoft.DotNet.Cli.Utils": { "target": "project" },
|
|
||||||
"Microsoft.DotNet.Tools.Tests.Utilities": { "target": "project" }
|
|
||||||
},
|
|
||||||
|
|
||||||
"frameworks": {
|
|
||||||
"dnxcore50": {
|
|
||||||
"imports": "portable-net45+win8"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -6,21 +6,22 @@
|
||||||
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"NETStandard.Library" : "1.0.0-rc2-23811",
|
"NETStandard.Library" : "1.0.0-rc2-23811",
|
||||||
"Microsoft.NETCore.TestHost": "1.0.0-rc2-23811",
|
|
||||||
|
|
||||||
"xunit": "2.1.0",
|
|
||||||
"xunit.console.netcore": "1.0.2-prerelease-00101",
|
|
||||||
"xunit.netcore.extensions": "1.0.0-prerelease-00153",
|
|
||||||
"xunit.runner.utility": "2.1.0",
|
|
||||||
|
|
||||||
"Microsoft.DotNet.ProjectModel": { "target": "project" },
|
"Microsoft.DotNet.ProjectModel": { "target": "project" },
|
||||||
"Microsoft.DotNet.Cli.Utils": { "target": "project" },
|
"Microsoft.DotNet.Cli.Utils": { "target": "project" },
|
||||||
"Microsoft.DotNet.Tools.Tests.Utilities": { "target": "project" }
|
"Microsoft.DotNet.Tools.Tests.Utilities": { "target": "project" },
|
||||||
|
|
||||||
|
"xunit": "2.1.0",
|
||||||
|
"dotnet-test-xunit": "1.0.0-dev-48273-16"
|
||||||
},
|
},
|
||||||
|
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"dnxcore50": {
|
"dnxcore50": {
|
||||||
"imports": "portable-net45+win8"
|
"imports": "portable-net45+win8"
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
|
||||||
|
"testRunner": "xunit",
|
||||||
|
|
||||||
|
"scripts": { "precompile": "dotnet build ../ArgumentsReflector/project.json --framework dnxcore50 --output %compile:RuntimeOutputDir%" }
|
||||||
}
|
}
|
|
@ -2,17 +2,6 @@
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Text;
|
|
||||||
using Xunit;
|
|
||||||
using Microsoft.DotNet.Cli.Utils;
|
|
||||||
using Microsoft.DotNet.ProjectModel;
|
|
||||||
using Microsoft.DotNet.Tools.Test.Utilities;
|
|
||||||
using Microsoft.Extensions.PlatformAbstractions;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using FluentAssertions;
|
|
||||||
|
|
||||||
namespace Microsoft.DotNet.Tests.ArgumentForwarding
|
namespace Microsoft.DotNet.Tests.ArgumentForwarding
|
||||||
{
|
{
|
18
test/ArgumentsReflector/project.json
Normal file
18
test/ArgumentsReflector/project.json
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
"version": "1.0.0-*",
|
||||||
|
"compilationOptions": {
|
||||||
|
"emitEntryPoint": true
|
||||||
|
},
|
||||||
|
|
||||||
|
"dependencies": {
|
||||||
|
"NETStandard.Library" : "1.0.0-rc2-23811"
|
||||||
|
},
|
||||||
|
|
||||||
|
"frameworks": {
|
||||||
|
"dnxcore50": {
|
||||||
|
"imports": "portable-net45+win8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"content": ["reflector_cmd.cmd"]
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue