run.tests.bat 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. @echo off
  2. cd ..\tests
  3. call :pass checkkeys
  4. call :pass loopwave
  5. call :pass testatomic
  6. call :pass testaudioinfo
  7. call :pass testautomation
  8. call :pass testdraw2
  9. call :pass testdrawchessboard
  10. call :pass testerror
  11. call :pass testfile
  12. call :pass testfilesystem
  13. call :pass testgamecontroller
  14. call :pass testgesture
  15. call :pass testgl2
  16. call :pass testgles
  17. call :pass testhaptic
  18. call :pass testiconv
  19. call :pass testime
  20. call :pass testintersection
  21. call :pass testjoystick
  22. call :pass testkeys
  23. ::call :pass testloadso
  24. call :pass testlock
  25. call :pass testmessage
  26. call :pass testmultiaudio
  27. call :pass testnative
  28. call :pass testoverlay2
  29. call :pass testplatform
  30. call :pass testpower
  31. call :pass testrelative
  32. call :pass testrendercopyex
  33. call :pass testrendertarget
  34. call :pass testresample sample.wav newsample.wav 44100
  35. call :pass testrumble
  36. call :pass testscale
  37. call :pass testsem 1
  38. call :pass testshader
  39. call :testspecial testshape .\shapes
  40. call :testspecial testshape .\shapes
  41. call :testspecial testshape .\shapes
  42. call :pass testsprite2
  43. call :pass testspriteminimal
  44. call :pass teststreaming
  45. call :pass testthread
  46. call :pass testtimer
  47. call :pass testver
  48. call :pass testwm2
  49. call :pass torturethread
  50. :: leave the tests directory
  51. cd ..
  52. :: exit batch
  53. goto :eof
  54. :testspecial
  55. if not exist %1\Win32\Debug goto :eof
  56. cd %1\Win32\Debug
  57. call :randomfile %2
  58. cd ..\..\..
  59. call :pass testshape %RETURN%
  60. goto :eof
  61. :: pass label (similar to pass function in the Xcode tests command script)
  62. :pass
  63. setlocal enabledelayedexpansion
  64. set args=
  65. set /A count=0
  66. for %%x IN (%*) DO (
  67. if NOT !count! EQU 0 set args=!args! %%x
  68. set /A count=%count% + 1
  69. )
  70. endlocal & set callargs=%args%
  71. :: if it does not exist, break procedure
  72. if not exist %1\Win32\Debug goto endfunc
  73. :: goto directory
  74. echo Testing: %1
  75. title Testing: %1
  76. cd %1\Win32\Debug
  77. :: execute test
  78. ".\%1.exe"%callargs%
  79. cd ..\..\..
  80. pause
  81. :endfunc
  82. goto :eof
  83. :randomfile
  84. setlocal enabledelayedexpansion
  85. set count=0
  86. if not exist %1 goto :eof
  87. for %%d in (%1\*.*) DO (
  88. set /A count=count + 1
  89. )
  90. set /A count=%RANDOM% %% %count%
  91. for %%d in (%1\*.*) DO (
  92. if !count! EQU 0 (
  93. set rfile=%%d
  94. goto endrfile
  95. )
  96. set /A count=count-1
  97. )
  98. :endrfile
  99. set tmprfile=!rfile!
  100. endlocal & set RETURN=%tmprfile%
  101. goto :eof