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