Skip to content

Commit

Permalink
Rename Publish-EchoArgs to Publish-PSTestTools
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
douglaswth committed Sep 13, 2016
1 parent 7e80702 commit 4d5d0a0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 4 additions & 4 deletions build.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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 = ""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
1 change: 1 addition & 0 deletions test/tools/EchoArgs/EchoArgs.cs
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 4d5d0a0

Please sign in to comment.