premake/MinGW/build-scripts/run.tests.bat
author Ryan C. Gordon
Tue, 29 Dec 2015 02:29:56 -0500
changeset 9986 081fbd89a347
parent 7925 f090a47eb7f7
permissions -rwxr-xr-x
NetBSD: improved joystick support (thanks, Thomas!).

This patch skips non-joystick HID devices and gives joysticks on NetBSD
a human readable name.

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