Skip to content

Commit

Permalink
Move sources to new structure
Browse files Browse the repository at this point in the history
Move files to new structure and merge them into one file during build
  • Loading branch information
nohwnd authored Apr 19, 2020
1 parent aa1ba7c commit 6ceec22
Show file tree
Hide file tree
Showing 177 changed files with 659 additions and 615 deletions.
Binary file removed .DS_Store
Binary file not shown.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,6 @@ DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.[Pp]ublish.xml
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ matrix:
# - brew tap caskroom/cask
- brew cask install powershell
- os: linux
dist: trusty
dist: bionic
# VM-based builds turned out to be faster
sudo: required
addons:
apt:
sources:
- sourceline: deb [arch=amd64] https://packages.microsoft.com/ubuntu/14.04/prod trusty main
- sourceline: deb [arch=amd64] https://packages.microsoft.com/ubuntu/18.04/prod bionic main
key_url: https://packages.microsoft.com/keys/microsoft.asc
packages:
- powershell
Expand Down
22 changes: 0 additions & 22 deletions Functions/Coverage.Plugin.ps1

This file was deleted.

118 changes: 0 additions & 118 deletions Functions/Pester.SafeCommands.ps1

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2011 Scott Muc and Manoj Mahalingam
Copyright 2020 Pester team

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -420,12 +420,12 @@ Starting test discovery in 1 files.
Test discovery finished. 83ms
[-] minimal output.fails 24ms (18ms|5ms)
Expected 2, but got 1.
at 1 | Should -Be 2, C:\Projects\pester\new-runtimepoc\Pester.RSpec.Demo.ts.ps1:289
at <ScriptBlock>, C:\Projects\pester\new-runtimepoc\Pester.RSpec.Demo.ts.ps1:289
at 1 | Should -Be 2, C:\Projects\pester\Pester.RSpec.Demo.ts.ps1:289
at <ScriptBlock>, C:\Projects\pester\Pester.RSpec.Demo.ts.ps1:289
[-] minimal output.child.fails 22ms (16ms|5ms)
Expected 2, but got 1.
at 1 | Should -Be 2, C:\Projects\pester\new-runtimepoc\Pester.RSpec.Demo.ts.ps1:298
at <ScriptBlock>, C:\Projects\pester\new-runtimepoc\Pester.RSpec.Demo.ts.ps1:298
at 1 | Should -Be 2, C:\Projects\pester\Pester.RSpec.Demo.ts.ps1:298
at <ScriptBlock>, C:\Projects\pester\Pester.RSpec.Demo.ts.ps1:298
Tests completed in 331ms
Tests Passed: 4, Failed: 2, Skipped: 0, Total: 6, NotRun: 0
```
Expand Down
34 changes: 0 additions & 34 deletions bin/pester.bat

This file was deleted.

71 changes: 71 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
$ErrorActionPreference = 'Stop'
Get-Module Pester | Remove-Module
if (Test-Path "$PSScriptRoot/bin") {
Remove-Item "$PSScriptRoot/bin" -Recurse -Force
}
$null = New-Item "$PSScriptRoot/bin" -ItemType Directory -Force

$script = @(
"$PSScriptRoot/src/functions/Pester.SafeCommands.ps1"
"$PSScriptRoot/src/Pester.Types.ps1"
"$PSScriptRoot/src/Pester.State.ps1"
"$PSScriptRoot/src/Pester.Utility.ps1"
"$PSScriptRoot/src/Pester.Runtime.psm1"
"$PSScriptRoot/src/TypeClass.psm1"
"$PSScriptRoot/src/Format.psm1"
"$PSScriptRoot/src/Pester.RSpec.ps1"
"$PSScriptRoot/src/Pester.ps1"

"$PSScriptRoot/src/functions/assertions/*"
"$PSScriptRoot/src/functions/*"

"$PSScriptRoot/src/Pester.psm1"
# "$PSScriptRoot/src/"
# "$PSScriptRoot/src/"
)

$sb = [System.Text.StringBuilder]""
foreach ($s in $script) {
foreach ($f in Get-ChildItem $s -File) {
$lines = Get-Content $f

$relativePath = ($f.FullName -replace ([regex]::Escape($PSScriptRoot))).TrimStart('\').TrimStart('/')
$null = $sb.AppendLine("# file $relativePath")
$noBuild = $false
foreach ($l in $lines) {
if ($l -match "^\s*#\s*if\s*-not\s*build\s*$") {
$noBuild = $true
}

if (-not $noBuild) {
$null = $sb.AppendLine($l)
}

if ($l -match "#\s*endif\s*$") {
$noBuild = $false
}
}
}
}

$sb.ToString() | Set-Content $PSScriptRoot/bin/Pester.psm1 -Encoding UTF8


$content = @(
,("$PSScriptRoot/src/csharp/*.cs","$PSScriptRoot/bin/csharp/")
,("$PSScriptRoot/src/en-US/*.txt","$PSScriptRoot/bin/en-US/")
,("$PSScriptRoot/src/nunit_schema_2.5.xsd", "$PSScriptRoot/bin/")
,("$PSScriptRoot/src/report.dtd", "$PSScriptRoot/bin/")
,("$PSScriptRoot/src/Pester.psd1", "$PSScriptRoot/bin/")
)

foreach ($c in $content) {
$source, $destination = $c

$null = New-Item -Force $destination -ItemType Directory

Get-ChildItem $source -File | Copy-Item -Destination $destination
}


Import-Module $PSScriptRoot/bin/Pester.psm1 -ErrorAction Stop
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
33 changes: 0 additions & 33 deletions en-US/RSpec.psd1

This file was deleted.

9 changes: 0 additions & 9 deletions new-runtimepoc/Pester.Types.ps1

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 5 additions & 2 deletions Dependencies/Format/Format.psm1 → src/Format.psm1
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Import-Module $PSScriptRoot\..\TypeClass\TypeClass.psm1 -DisableNameChecking
# if -not build
Import-Module "$PSScriptRoot/TypeClass.psm1" -DisableNameChecking
# endif

function Format-Collection ($Value, [switch]$Pretty) {
$Limit = 10
Expand Down Expand Up @@ -186,7 +188,7 @@ function Format-Type ([Type]$Value) {
[string]$Value
}


# if -not build
Export-ModuleMember -Function @(
'Format-Collection'
'Format-Object'
Expand All @@ -203,3 +205,4 @@ Export-ModuleMember -Function @(
'Get-DisplayProperty'
'Get-ShortType'
)
# endif
2 changes: 1 addition & 1 deletion new-runtimepoc/Pester.RSpec.ps1 → src/Pester.RSpec.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ function PostProcess-RspecTestRun ($TestRun) {
}

function Get-RSpecObjectDecoratorPlugin () {
Pester.Runtime\New-PluginObject -Name "RSpecObjectDecoratorPlugin" `
New-PluginObject -Name "RSpecObjectDecoratorPlugin" `
-EachTestTeardownEnd {
param ($Context)

Expand Down
12 changes: 9 additions & 3 deletions new-runtimepoc/Pester.Runtime.psm1 → src/Pester.Runtime.psm1
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
. $PSScriptRoot\Pester.Utility.ps1
. $PSScriptRoot\..\Functions\Pester.SafeCommands.ps1
. $PSScriptRoot\Pester.Types.ps1
# if -not build
. "$PSScriptRoot/Pester.Utility.ps1"
. "$PSScriptRoot/functions/Pester.SafeCommands.ps1"
. "$PSScriptRoot/Pester.Types.ps1"
# endif

# instances
$flags = [System.Reflection.BindingFlags]'Instance,NonPublic'
$script:SessionStateInternalProperty = [System.Management.Automation.SessionState].GetProperty('Internal', $flags)
$script:ScriptBlockSessionStateInternalProperty = [System.Management.Automation.ScriptBlock].GetProperty('SessionStateInternal', $flags)
Expand Down Expand Up @@ -2538,6 +2541,7 @@ function ConvertTo-HumanTime {
# initialize internal state
Reset-TestSuiteState

# if -not build
Export-ModuleMember -Function @(
# the core stuff I am mostly sure about
'Reset-TestSuiteState'
Expand Down Expand Up @@ -2574,3 +2578,5 @@ Export-ModuleMember -Function @(
'New-PluginObject'
'New-BlockContainerObject'
)

# endif
Loading

0 comments on commit 6ceec22

Please sign in to comment.