From b90a8f6564adf05788166b7b52ecbaf5d267886a Mon Sep 17 00:00:00 2001 From: Peter Honeder Date: Mon, 13 Jul 2015 13:38:47 -0700 Subject: [PATCH] added pester-tests target to Makefile, added that as a dependency to make test --- scripts/Makefile | 8 +++++++- .../pester => src/pester-tests}/Get-HelloWorld.Tests.ps1 | 0 {scripts/pester => src/pester-tests}/Get-HelloWorld.ps1 | 0 3 files changed, 7 insertions(+), 1 deletion(-) rename {scripts/pester => src/pester-tests}/Get-HelloWorld.Tests.ps1 (100%) rename {scripts/pester => src/pester-tests}/Get-HelloWorld.ps1 (100%) diff --git a/scripts/Makefile b/scripts/Makefile index 4b6ce2d5a..31464ba83 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -169,7 +169,13 @@ run-file: $(POWERSHELL_RUN_TARGETS) dotnetlibs/corerun dotnetlibs/Microsoft.Powe if ! diff dotnetlibs/corerun $(MONAD_EXT)/coreclr/Release/corerun; then cp -r $(MONAD_EXT)/coreclr/Release/* dotnetlibs; fi cd exec_env/app_base && ./runps.sh --file $(PSSCRIPT) -test: dotnetlibs/ps_test_runner.exe dotnetlibs/corerun dotnetlibs/api-ms-win-core-registry-l1-1-0.dll +pester-tests: $(POWERSHELL_RUN_TARGETS) dotnetlibs/corerun dotnetlibs/Microsoft.PowerShell.Commands.Management.dll dotnetlibs/Microsoft.PowerShell.Commands.Utility.dll dotnetlibs/Microsoft.PowerShell.Security.dll dotnetlibs/api-ms-win-core-registry-l1-1-0.dll internal-prepare-exec_env + # check if corerun is the right one (could be the debug version) + if ! diff dotnetlibs/corerun $(MONAD_EXT)/coreclr/Release/corerun; then cp -r $(MONAD_EXT)/coreclr/Release/* dotnetlibs; fi + # execute the pester tests, pester needs a TEMP environment variable to be set + cd exec_env/app_base && PSMODULEPATH=$(shell pwd)/exec_env/app_base/Modules LD_LIBRARY_PATH=. ./corerun powershell-simple.exe 'cd ../../../src/pester-tests; $$env:TEMP="/tmp"; invoke-pester' + +test: dotnetlibs/ps_test_runner.exe dotnetlibs/corerun dotnetlibs/api-ms-win-core-registry-l1-1-0.dll pester-tests cd dotnetlibs && LD_LIBRARY_PATH=. ./corerun ps_test_runner.exe # this is an internal target, it's not intended to be called manually diff --git a/scripts/pester/Get-HelloWorld.Tests.ps1 b/src/pester-tests/Get-HelloWorld.Tests.ps1 similarity index 100% rename from scripts/pester/Get-HelloWorld.Tests.ps1 rename to src/pester-tests/Get-HelloWorld.Tests.ps1 diff --git a/scripts/pester/Get-HelloWorld.ps1 b/src/pester-tests/Get-HelloWorld.ps1 similarity index 100% rename from scripts/pester/Get-HelloWorld.ps1 rename to src/pester-tests/Get-HelloWorld.ps1