Added auto discovery fo files to monitor.
This commit is contained in:
@@ -13,7 +13,7 @@ function Get-Chronometer
|
|||||||
param(
|
param(
|
||||||
# Script file to measure execution times on
|
# Script file to measure execution times on
|
||||||
[Parameter(Position=0)]
|
[Parameter(Position=0)]
|
||||||
[string[]]
|
[object[]]
|
||||||
$Path,
|
$Path,
|
||||||
|
|
||||||
# Line numbers within the script file to measure
|
# Line numbers within the script file to measure
|
||||||
@@ -21,12 +21,23 @@ function Get-Chronometer
|
|||||||
$LineNumber = $null,
|
$LineNumber = $null,
|
||||||
|
|
||||||
# The script to start the scrupt or execute other commands
|
# The script to start the scrupt or execute other commands
|
||||||
[Parameter(Position=1)]
|
[Parameter(Position=0)]
|
||||||
[alias('Script','CommandScript')]
|
[alias('Script','CommandScript')]
|
||||||
[scriptblock]
|
[scriptblock]
|
||||||
$ScriptBlock
|
$ScriptBlock
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if($Path -eq $null)
|
||||||
|
{
|
||||||
|
$Path = Get-ChildItem -Recurse -Include *.psm1,*.ps1 -File
|
||||||
|
}
|
||||||
|
|
||||||
|
if($Path.FullName)
|
||||||
|
{
|
||||||
|
$Path = $Path.FullName
|
||||||
|
}
|
||||||
|
|
||||||
$Chronometer = [Chronometer]::New()
|
$Chronometer = [Chronometer]::New()
|
||||||
|
|
||||||
Write-Verbose "Setting breapoints"
|
Write-Verbose "Setting breapoints"
|
||||||
@@ -36,7 +47,7 @@ function Get-Chronometer
|
|||||||
{
|
{
|
||||||
Write-Verbose "Executing Script"
|
Write-Verbose "Executing Script"
|
||||||
[ScriptProfiler]::Start()
|
[ScriptProfiler]::Start()
|
||||||
[void] $ScriptBlock.Invoke()
|
[void] $ScriptBlock.Invoke($Path)
|
||||||
|
|
||||||
Write-Verbose "Clearing Breapoints"
|
Write-Verbose "Clearing Breapoints"
|
||||||
$Chronometer.ClearBreakpoint()
|
$Chronometer.ClearBreakpoint()
|
||||||
|
|||||||
@@ -52,6 +52,10 @@ Task Test -Depends UnitTests {
|
|||||||
# In Appveyor? Upload our tests! #Abstract this into a function?
|
# In Appveyor? Upload our tests! #Abstract this into a function?
|
||||||
If($ENV:BHBuildSystem -eq 'AppVeyor')
|
If($ENV:BHBuildSystem -eq 'AppVeyor')
|
||||||
{
|
{
|
||||||
|
[xml]$content = Get-Content "$ProjectRoot\$TestFile"
|
||||||
|
$content.'test-results'.'test-suite'.type = "Powershell"
|
||||||
|
$content.Save("$ProjectRoot\$TestFile")
|
||||||
|
|
||||||
"Uploading $ProjectRoot\$TestFile to AppVeyor"
|
"Uploading $ProjectRoot\$TestFile to AppVeyor"
|
||||||
"JobID: $env:APPVEYOR_JOB_ID"
|
"JobID: $env:APPVEYOR_JOB_ID"
|
||||||
(New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path "$ProjectRoot\$TestFile"))
|
(New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path "$ProjectRoot\$TestFile"))
|
||||||
|
|||||||
Reference in New Issue
Block a user