Exit batch interpreter with error on failure: IOT-2119, RT#40028
authorC.J. Collier <cjcollier@linuxfoundation.org>
Wed, 26 Apr 2017 16:11:37 +0000 (09:11 -0700)
committerC.J. Collier <cjcollier@linuxfoundation.org>
Fri, 28 Apr 2017 18:03:08 +0000 (18:03 +0000)
Raise error on failure of "build"
Raise error on failure of "test"
Raise error on invalid target specification

Change-Id: Icbcaaa8d3b3541ecdce640632b6fdeff9df4b142
Signed-off-by: C.J. Collier <cjcollier@linuxfoundation.org>
Signed-off-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/19401
Reviewed-by: Pawel Winogrodzki <pawelwi@microsoft.com>
Reviewed-by: Omar Maabreh <omarm@microsoft.com>
Reviewed-by: Way Vadhanasin <wayvad@microsoft.com>
run.bat

diff --git a/run.bat b/run.bat
index a44f0c2..0fb581e 100644 (file)
--- a/run.bat
+++ b/run.bat
@@ -185,16 +185,25 @@ if "!RUN_ARG!"=="server" (
   echo   THREAD_COUNT=%THREAD_COUNT%
   echo   AUTOMATIC_UPDATE=%AUTOMATIC_UPDATE%
   echo.scons VERBOSE=1 %BUILD_OPTIONS%
-  scons VERBOSE=1 %BUILD_OPTIONS%
+  call scons.bat VERBOSE=1 %BUILD_OPTIONS%
+  if ERRORLEVEL 1 (
+    echo SCons failed - exiting run.bat with code 3
+    exit /B 3
+    )
 ) else if "!RUN_ARG!"=="clean" (
   del /S *.ilk
-  scons VERBOSE=1 %BUILD_OPTIONS% -c
+  call scons.bat VERBOSE=1 %BUILD_OPTIONS% -c
+  if ERRORLEVEL 1 (
+    echo SCons failed - exiting run.bat with code 2
+    exit /B 2
+    )
 ) else if "!RUN_ARG!"=="cleangtest" (
   rd /s /q extlibs\gtest\googletest-release-1.7.0
   del extlibs\gtest\release-1.7.0.zip
 ) else (
     echo.%0 - Script requires a valid argument!
-    goto :EOF
+    echo Exiting run.bat with code 1
+    exit /B 1
 )
 
 cd %IOTIVITY_DIR%