Makefile target test uses the xUnit runner

Instead of the prior work-around.

Makefile target `internal-prepare-exec-env` was modified to create
`exec_env/testrun` and depend on `dotnetlibs/corerun` (on which it
already depended).
This commit is contained in:
Andrew Schwartzmeyer
2015-07-20 15:24:56 -07:00
parent d3aadb0a04
commit b055743728
2 changed files with 9 additions and 15 deletions
+5 -6
View File
@@ -143,11 +143,10 @@ prepare:
mono buildtemp/nuget.exe install Microsoft.Net.ToolsetCompilers -pre
# this is an internal target, it's not intended to be called manually
internal-prepare-exec_env: runps.sh $(POWERSHELL_RUN_TARGETS)
internal-prepare-exec_env: runps.sh $(POWERSHELL_RUN_TARGETS) dotnetlibs/corerun
rm -rf exec_env
mkdir exec_env
mkdir exec_env/app_base
mkdir exec_env/app_base/Modules
mkdir -p exec_env/app_base/Modules
mkdir -p exec_env/testrun
cp ../src/monad/monad/miscfiles/display/*.ps1xml exec_env/app_base
cp ../src/monad/monad/miscfiles/types/CoreClr/*.ps1xml exec_env/app_base
cp -r ../src/monad/monad/miscfiles/modules/* exec_env/app_base/Modules
@@ -180,8 +179,8 @@ pester-tests: $(POWERSHELL_RUN_TARGETS) dotnetlibs/corerun dotnetlibs/Microsoft.
# 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
test: internal-prepare-exec_env $(addprefix $(TESTRUN_FOLDER)/, ps_test.dll xunit.console.netcore.exe xunit.runner.utility.dll xunit.abstractions.dll xunit.execution.dll) dotnetlibs/corerun
cd exec_env/testrun && PSMODULEPATH=$(shell pwd)/exec_env/app_base/Modules LD_LIBRARY_PATH=../app_base ../app_base/corerun xunit.console.netcore.exe ps_test.dll
# this is an internal target, it's not intended to be called manually
internal-prepare-debugclr:
+4 -9
View File
@@ -1,14 +1,9 @@
TEST_FOLDER=../src/ps_test
TESTRUN_FOLDER=exec_env/testrun
TEST_SRCS=$(addprefix $(TEST_FOLDER)/, test_*.cs)
dotnetlibs/xunit%: $(MONAD_EXT)/xunit/xunit%
$(TESTRUN_FOLDER)/xunit%: $(MONAD_EXT)/xunit/xunit%
cp -f $^ $@
dotnetlibs/ps_test.dll: $(TEST_SRCS) $(addprefix dotnetlibs/, xunit.core.dll xunit.assert.dll System.Management.Automation.dll Microsoft.PowerShell.Commands.Management.dll $(ASSEMBLY_LOAD_CONTEXT_TARGET))
$(CSC) -out:$@ -noconfig -nostdlib -target:library $(addprefix -r:dotnetlibs/, System.Management.Automation.dll $(ASSEMBLY_LOAD_CONTEXT_TARGET) xunit.core.dll xunit.assert.dll) ${COREREF} $(TEST_SRCS)
dotnetlibs/ps_test_runner.exe: $(TEST_FOLDER)/ps_test.cs $(addprefix dotnetlibs/, ps_test.dll System.Management.Automation.dll Microsoft.PowerShell.Commands.Management.dll $(ASSEMBLY_LOAD_CONTEXT_TARGET) xunit.core.dll xunit.assert.dll)
$(CSC) -out:$@ -noconfig -nostdlib -target:exe $(addprefix -r:dotnetlibs/, ps_test.dll System.Management.Automation.dll $(ASSEMBLY_LOAD_CONTEXT_TARGET) xunit.core.dll xunit.assert.dll) ${COREREF} $<
xunit: $(addprefix dotnetlibs/, ps_test.dll corerun xunit.console.netcore.exe xunit.runner.utility.dll xunit.abstractions.dll xunit.execution.dll) internal-prepare-exec_env
cd exec_env/app_base && PSMODULEPATH=$(shell pwd)/exec_env/app_base/Modules LD_LIBRARY_PATH=. ./corerun xunit.console.netcore.exe ps_test.dll
$(TESTRUN_FOLDER)/ps_test.dll: $(TEST_SRCS) $(addprefix $(TESTRUN_FOLDER)/, xunit.core.dll xunit.assert.dll) $(addprefix dotnetlibs/, System.Management.Automation.dll Microsoft.PowerShell.Commands.Management.dll $(ASSEMBLY_LOAD_CONTEXT_TARGET))
$(CSC) -out:$@ -noconfig -nostdlib -target:library $(addprefix -r:$(TESTRUN_FOLDER)/, xunit.core.dll xunit.assert.dll) $(addprefix -r:dotnetlibs/, System.Management.Automation.dll $(ASSEMBLY_LOAD_CONTEXT_TARGET)) ${COREREF} $(TEST_SRCS)