Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#
# Copyright (c) Microsoft Corporation, 2014
#
Import-Module $PSScriptRoot\..\LanguageTestSupport.psm1

try {
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
Describe 'NestedModules' -Tags "CI" {

Import-Module $PSScriptRoot\..\LanguageTestSupport.psm1

function New-TestModule {
param(
[string]$Name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
# Copyright (c) Microsoft Corporation, 2015
#

Import-Module $PSScriptRoot\..\LanguageTestSupport.psm1

Describe 'Classes inheritance syntax' -Tags "CI" {

It 'Base types' {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ Describe 'using module' -Tags "CI" {
BeforeAll {
$originalPSModulePath = $env:PSModulePath

Import-Module $PSScriptRoot\..\LanguageTestSupport.psm1

function New-TestModule {
param(
[string]$Name,
Expand Down
2 changes: 0 additions & 2 deletions test/powershell/Language/Classes/scripting.enums.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ Describe 'enums' -Tags "CI" {

Describe 'Basic enum errors' -Tags "CI" {

Import-Module $PSScriptRoot\..\LanguageTestSupport.psm1

AfterAll {
Remove-Module LanguageTestSupport
}
Expand Down
3 changes: 1 addition & 2 deletions test/powershell/Language/Parser/Parsing.Tests.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Import-Module $PSScriptRoot\..\LanguageTestSupport.psm1
set-strictmode -v 2
set-strictmode -v 2

Describe 'for statement parsing' -Tags "CI" {
ShouldBeParseError 'for' MissingOpenParenthesisAfterKeyword 4 -CheckColumnNumber
Expand Down
3 changes: 0 additions & 3 deletions test/powershell/Language/Parser/UsingNamespace.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ using namespace System.Diagnostics
using namespace System.Diagnostics; using namespace System.Runtime.CompilerServices
using namespace System.Collections.Generic

Import-Module $PSScriptRoot\..\LanguageTestSupport.psm1
Import-Module $PSScriptRoot\..\..\Common\Test.Helpers.psm1

# Flags is System.FlagsAttribute
# This tests our implicit 'using namespace System'
# despite having other explicit using namespace statements.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ $script2 = @'
"line 3"
'@

$testroot = resolve-path (join-path $psscriptroot ../../..)
$common = join-path $testroot Common
$helperModule = join-path $common Test.Helpers.psm1

Describe "Breakpoints when set should be hit" -tag "CI" {
BeforeAll {
$path = setup -pass -f TestScript_1.ps1 -content $script1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
$testroot = resolve-path (join-path $psscriptroot ../../..)
$common = join-path $testroot Common
$helperModule = join-path $common Test.Helpers.psm1

Describe 'native commands lifecycle' -tags 'Feature' {

BeforeAll {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
Import-Module $PSScriptRoot\..\..\Common\Test.Helpers.psm1
Describe "Job Cmdlet Tests" -Tag "CI" {
Context "Simple Jobs" {
BeforeEach {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
Import-Module $PSScriptRoot\..\..\Common\Test.Helpers.psm1
Describe "Basic FileSystem Provider Tests" -Tags "CI" {
BeforeAll {
$testDir = "TestDir"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
Import-Module $PSScriptRoot\..\..\Common\Test.Helpers.psm1

Describe "Start-Process" -Tags @("CI","SLOW") {

BeforeAll {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# determine whether we're elevated
Describe "Set-Date" -Tag "CI" {
BeforeAll {
Import-Module (join-path $psscriptroot "../../Common/Test.Helpers.psm1")
$IsElevated = Test-IsElevated
}

Expand Down
2 changes: 0 additions & 2 deletions test/powershell/engine/Module/NewModuleManifest.Tests.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
Import-Module $PSScriptRoot\..\..\Common\Test.Helpers.psm1

Describe "New-ModuleManifest tests" -tags "CI" {
BeforeEach {
New-Item -ItemType Directory -Path testdrive:/module
Expand Down
2 changes: 0 additions & 2 deletions test/powershell/engine/Module/TestModuleManifest.Tests.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
Import-Module $PSScriptRoot\..\..\Common\Test.Helpers.psm1

Describe "Test-ModuleManifest tests" -tags "CI" {

AfterEach {
Expand Down
21 changes: 21 additions & 0 deletions test/tools/Modules/HelpersCommon/HelpersCommon.psd1
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# Module manifest for module 'HelpersCommon'
#

@{

RootModule = 'HelpersCommon.psm1'

ModuleVersion = '1.0'

GUID = 'cc1c8e94-51d1-4bc1-b508-62bc09f02f54'

CompanyName = 'Microsoft Corporation'

Copyright = 'Copyright (C) Microsoft Corporation, All rights reserved.'

Description = 'Temporary module contains functions for using in tests'

FunctionsToExport = 'Wait-UntilTrue', 'Test-IsElevated', 'ShouldBeErrorId'

}
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ function ShouldBeErrorId

try
{
& $sb
Throw "Exception expected, execution should not have reached here"
& $sb | Out-Null
Throw "No Exception!"
}
catch
{
$_.FullyQualifiedErrorId | Should Be $FullyQualifiedErrorId
$_.FullyQualifiedErrorId | Should Be $FullyQualifiedErrorId | Out-Null
# Write the exception to output that allow us to check later other properies of the exception
Write-Output $_
}
}

export-modulemember -function Wait-UntilTrue,Test-IsElevated, ShouldBeErrorId

21 changes: 21 additions & 0 deletions test/tools/Modules/HelpersHostCS/HelpersHostCS.psd1
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# Module manifest for module 'HelpersHostCS'
#

@{

RootModule = 'HelpersHostCS.psm1'

ModuleVersion = '1.0'

GUID = '40a19c05-d765-41a1-995e-98ca5f247ee1'

CompanyName = 'Microsoft Corporation'

Copyright = 'Copyright (C) Microsoft Corporation, All rights reserved.'

Description = 'Simple console host for console IO tests.'

FunctionsToExport = 'New-TestHost'

}
Loading