diff --git a/Makefile b/Makefile index 270ab0f00..b2f631874 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,8 @@ bootstrap: tools/nuget.exe # run targets -export POWERSHELL=env TEMP=/tmp LD_LIBRARY_PATH=$(MONAD)/lib:$(PSLIB) PSMODULEPATH=$(PSLIB)/Modules $(MONAD)/bin/powershell $(PSLIB)/powershell.exe +export POWERSHELL_HOST=env TEMP=/tmp LD_LIBRARY_PATH=$(MONAD)/lib:$(PSLIB) PSMODULEPATH=$(PSLIB)/Modules $(MONAD)/bin/powershell +export POWERSHELL=$(POWERSHELL_HOST) $(PSLIB)/powershell.exe demo: $(POWERSHELL) '"a","b","c","a","a" | Select-Object -Unique' diff --git a/src/monad-build b/src/monad-build index 6ed63339e..254d126dd 160000 --- a/src/monad-build +++ b/src/monad-build @@ -1 +1 @@ -Subproject commit 6ed63339e8c6f8d66fb66b37ffde4e86aed07d0b +Subproject commit 254d126ddb2c7306d185030d7f837aa6fb27c9ff diff --git a/src/xunit-tests/xunit-tests.mk b/src/xunit-tests/xunit-tests.mk new file mode 100644 index 000000000..73d12d752 --- /dev/null +++ b/src/xunit-tests/xunit-tests.mk @@ -0,0 +1,12 @@ +# xUnit tests for PowerShell +# - results in xunit-tests.xml +# - see https://xunit.github.io/ +TEST_FOLDER=$(MONAD)/src/xunit-tests +TEST_SRCS=$(TEST_FOLDER)/test_*.cs +TEST_TARGETS=$(addprefix $(PSLIB)/, System.Management.Automation.dll Microsoft.PowerShell.Commands.Management.dll) + +$(PSLIB)/PowerShell.Linux.Test.dll: $(TEST_SRCS) $(TEST_TARGETS) + $(CSC) $(CSCOPTS_LIB) -out:$@ $(addprefix -r:$(MONAD_EXT)/xunit/, xunit.core.dll xunit.assert.dll) $(addprefix -r:, $(TEST_TARGETS)) $(COREREF) $(TEST_SRCS) + +test: $(PSLIB)/PowerShell.Linux.Test.dll + $(POWERSHELL_HOST) $(PSLIB)/xunit.console.netcore.exe $< -xml $(MONAD)/xunit-tests.xml