jenkins.parsetestargs.cmd 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. ::-------------------------------------------------------------------------------------------------------
  2. :: Copyright (C) Microsoft. All rights reserved.
  3. :: Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. ::-------------------------------------------------------------------------------------------------------
  5. if not "%JENKINS_BUILD%" == "True" (
  6. echo This script should be run under a Jenkins Build environment
  7. exit /b 2
  8. )
  9. if "%_ENTRY_SCRIPT_NAME%"=="" (
  10. echo This script is a utility and should not be called as a script entry point.
  11. )
  12. :ContinueArgParse
  13. if not "%1"=="" (
  14. :: _TestArch
  15. if "%1"=="x86" (
  16. set _TestArch=x86
  17. shift
  18. goto :ContinueArgParse
  19. ) else if "%1"=="x64" (
  20. set _TestArch=x64
  21. shift
  22. goto :ContinueArgParse
  23. )
  24. REM arm tests not supported at present
  25. :: _TestArch (deprecated name)
  26. if "%1"=="amd64" (
  27. set _TestArch=x64
  28. shift
  29. goto :ContinueArgParse
  30. )
  31. :: _TestType (new names)
  32. if "%1"=="debug" (
  33. set _TestType=debug
  34. shift
  35. goto :ContinueArgParse
  36. ) else if "%1"=="test" (
  37. set _TestType=test
  38. shift
  39. goto :ContinueArgParse
  40. )
  41. :: _TestType (old names)
  42. if "%1"=="chk" (
  43. set _TestType=debug
  44. shift
  45. goto :ContinueArgParse
  46. )
  47. if "%1"=="-disablejit" (
  48. set _NoJIT=.NoJIT
  49. REM fallthrough to default (also add this to %_ExtraTestArgs%)
  50. )
  51. :: default
  52. set _ExtraTestArgs=%_ExtraTestArgs% %1
  53. shift
  54. goto :ContinueArgParse
  55. )
  56. if "%_TestArch%"=="" (
  57. goto :invalidTestArch
  58. )
  59. if "%_TestType%"=="" (
  60. goto :invalidTestType
  61. )
  62. goto :end
  63. :: ============================================================================
  64. :: Invald Test Arch
  65. :: ============================================================================
  66. :invalidTestArch
  67. echo None of the parameters were a valid test architecture. Please specify both architecture and type.
  68. goto :examples
  69. :: ============================================================================
  70. :: Invald Test Type
  71. :: ============================================================================
  72. :invalidTestType
  73. echo None of the parameters were a valid test type. Please specify both architecture and type.
  74. goto :examples
  75. :: ============================================================================
  76. :: Examples
  77. :: ============================================================================
  78. :examples
  79. echo Examples:
  80. echo.
  81. echo %_ENTRY_SCRIPT_NAME% x86 debug
  82. echo %_ENTRY_SCRIPT_NAME% x86 test
  83. echo.
  84. echo %_ENTRY_SCRIPT_NAME% x64 debug
  85. echo %_ENTRY_SCRIPT_NAME% x64 test
  86. goto :end
  87. :: ============================================================================
  88. :: Epilogue of script (cleanup)
  89. :: ============================================================================
  90. :end