[acceptance-test] Ensure the exit code of the main test script is used
authorAlexander Köplinger <alex.koeplinger@outlook.com>
Wed, 16 Mar 2016 21:15:15 +0000 (22:15 +0100)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Wed, 16 Mar 2016 21:22:31 +0000 (22:22 +0100)
Due to our usage of chained commands it'd use the exit code of the last command,
which is not what we want. We use chaining because e.g. in the ms-test-suite
case we still want to run the systemruntimebringup suite even if the conformance
suite had a failing test.

acceptance-tests/ms-test-suite.mk
acceptance-tests/roslyn.mk

index 05f99482a28f1634fac2c37860d06136fe33328a..c1c16199481352d873f6df2c7a077a43197dcbe3 100644 (file)
@@ -1,9 +1,10 @@
 check-ms-test-suite:
        @if $(MAKE) validate-ms-test-suite RESET_VERSIONS=1; then \
-               $(MAKE) -C $(MSTESTSUITE_PATH)/conformance build MCS="$(MCS) -t:library -warn:1 -r:nunit.framework"; \
-               $(MAKE) -C $(MSTESTSUITE_PATH)/conformance run NUNIT-CONSOLE="$(RUNTIME) $(CLASS)/nunit-console.exe -nologo -exclude=MonoBug,BadTest" NUNIT_XML_RESULT=$(abs_top_builddir)/acceptance-tests/TestResult-ms-test-suite-conformance.xml; \
-               $(MAKE) -C $(MSTESTSUITE_PATH)/systemruntimebringup build MCS="$(MCS) -debug -warn:1"; \
-               $(MAKE) -C $(MSTESTSUITE_PATH)/systemruntimebringup run MONO="$(RUNTIME)"; \
+               $(MAKE) -C $(MSTESTSUITE_PATH)/conformance build MCS="$(MCS) -t:library -warn:1 -r:nunit.framework" && \
+               $(MAKE) -C $(MSTESTSUITE_PATH)/conformance run NUNIT-CONSOLE="$(RUNTIME) $(CLASS)/nunit-console.exe -nologo -exclude=MonoBug,BadTest" NUNIT_XML_RESULT=$(abs_top_builddir)/acceptance-tests/TestResult-ms-test-suite-conformance.xml || EXIT_CODE=1; \
+               $(MAKE) -C $(MSTESTSUITE_PATH)/systemruntimebringup build MCS="$(MCS) -debug -warn:1" && \
+               $(MAKE) -C $(MSTESTSUITE_PATH)/systemruntimebringup run MONO="$(RUNTIME)" || EXIT_CODE=1; \
+               exit $$EXIT_CODE; \
        else \
                echo "*** [ms-test-suite] Getting the repository failed, you probably don't have access to this Xamarin-internal resource. Skipping."; \
        fi
\ No newline at end of file
index e20b01e4979a0c05a239578a0d5bd6cb1af5fa32..17e0e4ce67580a5f3a762dbd89ca5d8bb8ab667f 100644 (file)
@@ -19,5 +19,6 @@ check-roslyn:
        cd $(ROSLYN_PATH); \
        sed -i -e 'N; s/bootstrapArg=".*\n.*"/bootstrapArg=""/g' cibuild.sh; \
        sed -i -e 's#-xml Binaries/\$$BUILD_CONFIGURATION/xUnitResults/#-nunit $(abs_top_builddir)/acceptance-tests/TestResult-#g' cibuild.sh; \
-       ./cibuild.sh --mono-path $$PREFIX/bin; \
-       sed -i -e 's/\\4.5"/\\4.5-api"/g' $$PREFIX/lib/mono/xbuild-frameworks/.NETFramework/v4.5/RedistList/FrameworkList.xml;
+       ./cibuild.sh --mono-path $$PREFIX/bin || EXIT_CODE=1; \
+       sed -i -e 's/\\4.5"/\\4.5-api"/g' $$PREFIX/lib/mono/xbuild-frameworks/.NETFramework/v4.5/RedistList/FrameworkList.xml; \
+       exit $$EXIT_CODE