Build VLC aliases cleanly (don't need to parse argv[0])
[vlc.git] / test / test.sh
1 #! /bin/sh
2
3 set -e
4 python setup.py build
5
6 cd ..
7 # TODO: FIXME !!
8 export PYTHONPATH=$PYTHONPATH:bindings/mediacontrol-python/build/lib.linux-i686-2.3:test/build/lib.linux-i686-2.3:test/build/lib.linux-x86_64-2.3:test/build/lib.linux-i686-2.4:test/build/lib.linux-x86_64-2.4
9
10 export LD_LIBRARY_PATH=src/.libs/
11
12 # Always dump core
13 ulimit -c unlimited
14
15 if [ "x$1" = "xdebug" ]
16 then
17   gdb python "test/test.sh"
18 else
19   python test/test.py -v 2>&1|perl  -e \
20 '$bold = "\033[1m";
21 $grey  = "\033[37m";
22 $green  = "\033[32m";
23 $blue  = "\033[34m";
24 $red  = "\033[31m";
25 $reset = "\033[0m";
26
27 # Combinations
28 $info   = $reset;
29 $ok     = $green;
30 $err    = $red.$bold;
31
32 while(<STDIN>)
33 {
34      $line = $_;
35      chomp $line;
36      if( $line =~ s/^(\[[A-z0-9]*\]\s.*)\.\.\.\sok$/$info$1\.\.\.$ok ok/g || 
37          $line =~ s/^(\[[A-z0-9]*\]\s.*)\.\.\.\sFAIL$/$info$1\.\.\.$err FAIL/g||
38          $line =~ s/^(\[[A-z0-9]*\]\s.*)\.\.\.(.)*$/$info$1\.\.\.$2/g || 
39          $line =~ s/^(ok)$/$ok$1/ig || $line =~ s/^FAIL$/$err FAIL/g || 
40          $line =~ s/(Ran\s.*)/$info$1/g )
41      {
42         print $line.$reset."\n";
43      }
44      else
45      {
46         print $grey.$line."\n";
47      }
48 }'
49 fi