ci.parsetestargs.cmd 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. ::-------------------------------------------------------------------------------------------------------
  2. :: Copyright (C) Microsoft. All rights reserved.
  3. :: Copyright (c) 2021 ChakraCore Project Contributors. All rights reserved.
  4. :: Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  5. ::-------------------------------------------------------------------------------------------------------
  6. if "%_ENTRY_SCRIPT_NAME%"=="" (
  7. echo This script is a utility and should not be called as a script entry point.
  8. )
  9. :ContinueArgParse
  10. if not "%1"=="" (
  11. :: _TestArch
  12. if "%1"=="x86" (
  13. set _TestArch=x86
  14. shift
  15. goto :ContinueArgParse
  16. ) else if "%1"=="x64" (
  17. set _TestArch=x64
  18. shift
  19. goto :ContinueArgParse
  20. )
  21. REM arm tests not supported at present
  22. :: _TestArch (deprecated name)
  23. if "%1"=="amd64" (
  24. set _TestArch=x64
  25. shift
  26. goto :ContinueArgParse
  27. )
  28. :: _TestType (new names)
  29. if "%1"=="debug" (
  30. set _TestType=debug
  31. shift
  32. goto :ContinueArgParse
  33. ) else if "%1"=="test" (
  34. set _TestType=test
  35. shift
  36. goto :ContinueArgParse
  37. )
  38. :: _TestType (old names)
  39. if "%1"=="chk" (
  40. set _TestType=debug
  41. shift
  42. goto :ContinueArgParse
  43. )
  44. if "%1"=="-swb" (
  45. :: todo: disallow -swb -disablejit combination
  46. set _SpecialBuild=.SWB
  47. goto :ContinueArgParse
  48. )
  49. if "%1"=="-dirs" (
  50. set _ReducedTestRun=1
  51. REM fallthrough to default (also add this to %_ExtraTestArgs%)
  52. )
  53. if "%1"=="-tags" (
  54. set _ReducedTestRun=1
  55. REM fallthrough to default (also add this to %_ExtraTestArgs%)
  56. )
  57. if "%1"=="-nottags" (
  58. set _ReducedTestRun=1
  59. REM fallthrough to default (also add this to %_ExtraTestArgs%)
  60. )
  61. if "%1"=="-disablejit" (
  62. set _SpecialBuild=.NoJIT
  63. shift
  64. goto :ContinueArgParse
  65. )
  66. if "%1"=="-lite" (
  67. set _SpecialBuild=.Lite
  68. REM fallthrough to default (also add this to %_ExtraTestArgs%)
  69. )
  70. :: default
  71. set _ExtraTestArgs=%_ExtraTestArgs% %1
  72. shift
  73. goto :ContinueArgParse
  74. )
  75. if "%_TestArch%"=="" (
  76. goto :invalidTestArch
  77. )
  78. if "%_TestType%"=="" (
  79. goto :invalidTestType
  80. )
  81. goto :end
  82. :: ============================================================================
  83. :: Invald Test Arch
  84. :: ============================================================================
  85. :invalidTestArch
  86. echo None of the parameters were a valid test architecture. Please specify both architecture and type.
  87. goto :examples
  88. :: ============================================================================
  89. :: Invald Test Type
  90. :: ============================================================================
  91. :invalidTestType
  92. echo None of the parameters were a valid test type. Please specify both architecture and type.
  93. goto :examples
  94. :: ============================================================================
  95. :: Examples
  96. :: ============================================================================
  97. :examples
  98. echo Examples:
  99. echo.
  100. echo %_ENTRY_SCRIPT_NAME% x86 debug
  101. echo %_ENTRY_SCRIPT_NAME% x86 test
  102. echo.
  103. echo %_ENTRY_SCRIPT_NAME% x64 debug
  104. echo %_ENTRY_SCRIPT_NAME% x64 test
  105. goto :end
  106. :: ============================================================================
  107. :: Epilogue of script (cleanup)
  108. :: ============================================================================
  109. :end