run.tests.sh 1.6 KB

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