From 8dcb769bb7c7e620ef23de687b622a9b7fb698ba Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Tue, 3 Nov 2015 09:49:55 -0800 Subject: [PATCH] Fix xUnit tests Moved the xUnit tests build rules to their own Makefile, included by monad-build/Makefile. Temporarily introduced POWERSHELL_HOST to reenable running of xunit.console.netcore.exe until this is built-in to the native powershell host. --- Makefile | 3 ++- src/monad-build | 2 +- src/xunit-tests/xunit-tests.mk | 12 ++++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 src/xunit-tests/xunit-tests.mk 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