premake/Linux/build-scripts/run.tests.sh
author Ryan C. Gordon
Mon, 04 Jan 2016 16:25:27 -0500
changeset 10006 5229da175b57
parent 7925 f090a47eb7f7
permissions -rwxr-xr-x
x11: Support _NET_WM_USER_TIME and give _NET_ACTIVE_WINDOW a valid timestamp.

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