jenkins.parsetestargs.cmd 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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"=="-swb" (
  48. :: todo: disallow -swb -disablejit combination
  49. set _SpecialBuild=.SWB
  50. goto :ContinueArgParse
  51. )
  52. if "%1"=="-dirs" (
  53. set _ReducedTestRun=1
  54. REM fallthrough to default (also add this to %_ExtraTestArgs%)
  55. )
  56. if "%1"=="-tags" (
  57. set _ReducedTestRun=1
  58. REM fallthrough to default (also add this to %_ExtraTestArgs%)
  59. )
  60. if "%1"=="-nottags" (
  61. set _ReducedTestRun=1
  62. REM fallthrough to default (also add this to %_ExtraTestArgs%)
  63. )
  64. if "%1"=="-disablejit" (
  65. set _SpecialBuild=.NoJIT
  66. REM fallthrough to default (also add this to %_ExtraTestArgs%)
  67. )
  68. if "%1"=="-lite" (
  69. set _SpecialBuild=.Lite
  70. REM fallthrough to default (also add this to %_ExtraTestArgs%)
  71. )
  72. :: default
  73. set _ExtraTestArgs=%_ExtraTestArgs% %1
  74. shift
  75. goto :ContinueArgParse
  76. )
  77. if "%_TestArch%"=="" (
  78. goto :invalidTestArch
  79. )
  80. if "%_TestType%"=="" (
  81. goto :invalidTestType
  82. )
  83. goto :end
  84. :: ============================================================================
  85. :: Invald Test Arch
  86. :: ============================================================================
  87. :invalidTestArch
  88. echo None of the parameters were a valid test architecture. Please specify both architecture and type.
  89. goto :examples
  90. :: ============================================================================
  91. :: Invald Test Type
  92. :: ============================================================================
  93. :invalidTestType
  94. echo None of the parameters were a valid test type. Please specify both architecture and type.
  95. goto :examples
  96. :: ============================================================================
  97. :: Examples
  98. :: ============================================================================
  99. :examples
  100. echo Examples:
  101. echo.
  102. echo %_ENTRY_SCRIPT_NAME% x86 debug
  103. echo %_ENTRY_SCRIPT_NAME% x86 test
  104. echo.
  105. echo %_ENTRY_SCRIPT_NAME% x64 debug
  106. echo %_ENTRY_SCRIPT_NAME% x64 test
  107. goto :end
  108. :: ============================================================================
  109. :: Epilogue of script (cleanup)
  110. :: ============================================================================
  111. :end