From 4d5d0a0034dcc112c8b3fe3f8eef4b0e7c5acdad Mon Sep 17 00:00:00 2001 From: Douglas Thrift Date: Mon, 12 Sep 2016 10:39:42 -0700 Subject: [PATCH] Rename Publish-EchoArgs to Publish-PSTestTools * Rename Publish-EchoArgs to Publish-PSTestTools so it can be used for other tools as well in the future * Publish EchoArgs to the bin directory instead of run to match convention * Add source URL to EchoArgs header comment * Use wildcard of "*.nuget.props" to match "test/csharp/csharp.nuget.props" in .gitignore --- .gitignore | 3 +-- build.psm1 | 8 ++++---- .../NativeExecution/NativeCommandArguments.Tests.ps1 | 2 +- test/tools/EchoArgs/EchoArgs.cs | 1 + 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 99763674d..61dd6cb62 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,11 @@ bin/ obj/ -run/ project.lock.json *-tests.xml /debug/ /staging/ /Packages/ -test/csharp/csharp.nuget.props +*.nuget.props # dotnet cli install/uninstall scripts dotnet-install.ps1 diff --git a/build.psm1 b/build.psm1 index b668b3aec..0bee2ed8a 100644 --- a/build.psm1 +++ b/build.psm1 @@ -547,15 +547,16 @@ function Get-PesterTag { $o } -function Publish-EchoArgs { +function Publish-PSTestTools { [CmdletBinding()] param() Find-Dotnet + # Publish EchoArgs so it can be run by tests Push-Location "$PSScriptRoot/test/tools/EchoArgs" try { - dotnet publish --output run + dotnet publish --output bin } finally { Pop-Location } @@ -577,8 +578,7 @@ function Start-PSPester { ) Write-Verbose "Running pester tests at '$path' with tag '$($Tag -join ''', ''')' and ExcludeTag '$($ExcludeTag -join ''', ''')'" -Verbose - # Publish EchoArgs so it can be run by tests - Publish-EchoArgs + Publish-PSTestTools # All concatenated commands/arguments are suffixed with the delimiter (space) $Command = "" diff --git a/test/powershell/Scripting/NativeExecution/NativeCommandArguments.Tests.ps1 b/test/powershell/Scripting/NativeExecution/NativeCommandArguments.Tests.ps1 index 6d2541ea4..716aea86a 100644 --- a/test/powershell/Scripting/NativeExecution/NativeCommandArguments.Tests.ps1 +++ b/test/powershell/Scripting/NativeExecution/NativeCommandArguments.Tests.ps1 @@ -4,7 +4,7 @@ Describe "Native Command Arguments" -tags "CI" { while ($powershellTestDir -notmatch 'test[\\/]powershell$') { $powershellTestDir = Split-Path $powershellTestDir } - $echoArgs = Join-Path (Split-Path $powershellTestDir) tools/EchoArgs/run/echoargs + $echoArgs = Join-Path (Split-Path $powershellTestDir) tools/EchoArgs/bin/echoargs It "Should handle quoted spaces correctly" { $a = 'a"b c"d' diff --git a/test/tools/EchoArgs/EchoArgs.cs b/test/tools/EchoArgs/EchoArgs.cs index ca2958fdf..209d5d861 100644 --- a/test/tools/EchoArgs/EchoArgs.cs +++ b/test/tools/EchoArgs/EchoArgs.cs @@ -1,5 +1,6 @@ //--------------------------------------------------------------------- // Author: Keith Hill +// Source: https://github.com/Pscx/Pscx/blob/master/Src/EchoArgs/EchoArgs.cs // // Description: Very simple little console class that you can use to see // how PowerShell is passing parameters to legacy console