run.tests.command 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #!/bin/sh
  2. function pause() {
  3. read -p "$*"
  4. }
  5. function pass() {
  6. if [ -d "$1/Build/Debug" ]; then
  7. cd $1/Build/Debug
  8. echo "Testing:" $1
  9. echo "\033]0;Testing: $1\007"
  10. "./$@"
  11. cd ../../..
  12. pause "Press any key to continue..."
  13. fi
  14. }
  15. function randomfile() {
  16. fcount=($1/*.*)
  17. fcount=${#fcount[@]}
  18. fpick=$(($RANDOM % $fcount))
  19. for d in $1/*.*; do
  20. if [[ $fpick -eq 0 ]]; then
  21. RETURN=$d
  22. echo $d
  23. return
  24. fi
  25. fpick=$(($fpick - 1))
  26. done
  27. }
  28. function testspecial() {
  29. if [ -d "$1/Build/Debug" ]; then
  30. cd $1/Build/Debug
  31. randomfile $2
  32. cd ../../..
  33. pass $1 $RETURN
  34. fi
  35. }
  36. # change to directory above command file
  37. cd `dirname $0`/..
  38. cd tests
  39. pass "checkkeys"
  40. pass "loopwave"
  41. #pass "testatomic"
  42. pass "testaudioinfo"
  43. pass "testautomation"
  44. pass "testdraw2"
  45. pass "testchessboard"
  46. pass "testerror"
  47. pass "testfile"
  48. pass "testfilesystem"
  49. pass "testgamecontroller"
  50. pass "testgesture"
  51. pass "testgl2"
  52. pass "testgles"
  53. pass "testhaptic"
  54. pass "testiconv"
  55. pass "testime"
  56. pass "testintersection"
  57. pass "testjoystick"
  58. pass "testkeys"
  59. #pass "testloadso"
  60. pass "testlock"
  61. pass "testmessage"
  62. #pass "testmultiaudio"
  63. pass "testnative"
  64. pass "testoverlay2"
  65. pass "testplatform"
  66. pass "testpower"
  67. pass "testrelative"
  68. pass "testrendercopyex"
  69. pass "testrendertarget"
  70. pass "testresample" "sample.wav" "newsample.wav" "44100"
  71. pass "testrumble"
  72. pass "testscale"
  73. pass "testsem" 1
  74. pass "testshader"
  75. #testspecial "testshape" ./shapes
  76. #testspecial "testshape" ./shapes
  77. #testspecial "testshape" ./shapes
  78. pass "testsprite2"
  79. pass "testspriteminimal"
  80. pass "teststreaming"
  81. pass "testthread"
  82. pass "testtimer"
  83. pass "testver"
  84. pass "testwm2"
  85. pass "torturethread"
  86. cd ..