OSDN Git Service

more fix for test.sh
[android-x86/external-s2tc.git] / tests / test.sh
index 66502db..fe33174 100644 (file)
@@ -3,14 +3,16 @@
 set -e
 
 cd ..
-git clean -xdf
+make clean || true
 sh autogen.sh
 ./configure --prefix="`pwd`/tests" CXXFLAGS="-O3"
 make
 make install
 cd tests
 
-mkdir -p html
+rm -rf html
+rm *.dds
+mkdir html
 exec 3>html/index.html
 
 html_start()
@@ -169,25 +171,55 @@ fi
 html_start
 
 # TODO download test pictures that are not under the same license as this package
+xon()
+{
+       # downloads a texture from Xonotic
+       if ! [ -f "$2" ]; then
+               wget -O- "http://git.xonotic.org/?p=xonotic/xonotic-maps.pk3dir.git;a=blob_plain;f=$1" | convert "${1##*.}":- -geometry 512x512 "$2"
+       fi
+}
 # floor_tread01: GPLv2+
+xon textures/exx/floor/floor_tread01.tga floor_tread01.tga
 # floor_tread01_norm: GPLv2+
+xon textures/exx/floor/floor_tread01_norm.tga floor_tread01_norm_dxt3.tga
+xon textures/exx/floor/floor_tread01_norm.tga floor_tread01_norm_dxt5.tga
 # base_concrete1a: GPLv2+
-# disabled: GPLv2
+xon textures/trak4x/base/base_concrete1a.tga base_concrete1a.tga
+# disabled: GPLv2+
+xon textures/screens/screen_toggle0.tga disabled.tga
 # floor_tile3a: GPLv2+
+xon textures/trak4x/floor/floor_tile3a.tga floor_tile3a.tga
 # lift02: GPLv2+
+xon textures/facility114x/misc/lift02.tga lift02.tga
 # sunset: GPLv2+
+xon env/distant_sunset/distant_sunset_rt.jpg sunset.tga
 # amelia: no license
+if ! [ -f "amelia.tga" ]; then
+       wget -O- "http://www.godoon.com/gallery/media/slayers/amelia-wil-tesla-saillune/49212997-d81e-11df-8228-a8bfc396a36f.jpg" | convert JPG:- amelia.tga
+fi
 
-for i in dxtfail floor_tread01 floor_tread01_norm fract001 base_concrete1a disabled floor_tile3a lift02 sunset amelia noise noise_solid supernova; do
+for i in dxtfail floor_tread01 floor_tread01_norm_dxt5 floor_tread01_norm_dxt3 fract001 base_concrete1a disabled floor_tile3a lift02 sunset amelia noise noise_solid supernova; do
        html_rowstart "$i"
 
        html "$i".tga
 
        case "$i" in
-               *_norm)
+               *_norm*)
+                       goodmetric=NORMALMAP
+                       ;;
+               *)
+                       goodmetric=SRGB_MIXED
+                       ;;
+       esac
+       case "$i" in
+               *_dxt5)
                        fourcc=DXT5
                        nvopts="-bc3 -alpha"
                        ;;
+               *_dxt3)
+                       fourcc=DXT3
+                       nvopts="-bc2 -alpha"
+                       ;;
                *)
                        fourcc=DXT1
                        nvopts="-bc1"
@@ -204,15 +236,15 @@ for i in dxtfail floor_tread01 floor_tread01_norm fract001 base_concrete1a disab
                html "$i"-nvcompress.dds
        fi
 
-       S2TC_COLORDIST_MODE=SRGB_MIXED S2TC_RANDOM_COLORS=32 S2TC_REFINE_COLORS=CHECK  t "$i".tga "$i"-rand32-mrgb-r.dds bin/s2tc -t $fourcc
-       S2TC_COLORDIST_MODE=WAVG       S2TC_RANDOM_COLORS=32 S2TC_REFINE_COLORS=CHECK  t "$i".tga "$i"-rand32-wavg-r.dds bin/s2tc -t $fourcc
-       S2TC_COLORDIST_MODE=AVG        S2TC_RANDOM_COLORS=32 S2TC_REFINE_COLORS=CHECK  t "$i".tga "$i"-rand32-avg-r.dds  bin/s2tc -t $fourcc
+       S2TC_COLORDIST_MODE=$goodmetric S2TC_RANDOM_COLORS=32 S2TC_REFINE_COLORS=CHECK  t "$i".tga "$i"-rand32-mrgb-r.dds bin/s2tc -t $fourcc
+       S2TC_COLORDIST_MODE=WAVG        S2TC_RANDOM_COLORS=32 S2TC_REFINE_COLORS=CHECK  t "$i".tga "$i"-rand32-wavg-r.dds bin/s2tc -t $fourcc
+       S2TC_COLORDIST_MODE=AVG         S2TC_RANDOM_COLORS=32 S2TC_REFINE_COLORS=CHECK  t "$i".tga "$i"-rand32-avg-r.dds  bin/s2tc -t $fourcc
        if $use_libtxc_dxtn; then
-               LD_PRELOAD=/usr/lib/libtxc_dxtn.so                                     t "$i".tga "$i"-libtxc_dxtn.dds   bin/s2tc -t $fourcc
+               LD_PRELOAD=/usr/lib/libtxc_dxtn.so                                      t "$i".tga "$i"-libtxc_dxtn.dds   bin/s2tc -t $fourcc
                unset LD_PRELOAD
        fi
-       S2TC_COLORDIST_MODE=WAVG       S2TC_RANDOM_COLORS=0  S2TC_REFINE_COLORS=ALWAYS t "$i".tga "$i"-norand-wavg-r.dds bin/s2tc -t $fourcc
-       S2TC_COLORDIST_MODE=WAVG       S2TC_RANDOM_COLORS=-1 S2TC_REFINE_COLORS=ALWAYS t "$i".tga "$i"-faster-wavg-r.dds bin/s2tc -t $fourcc
+       S2TC_COLORDIST_MODE=WAVG        S2TC_RANDOM_COLORS=0  S2TC_REFINE_COLORS=ALWAYS t "$i".tga "$i"-norand-wavg-r.dds bin/s2tc -t $fourcc
+       S2TC_COLORDIST_MODE=WAVG        S2TC_RANDOM_COLORS=-1 S2TC_REFINE_COLORS=ALWAYS t "$i".tga "$i"-faster-wavg-r.dds bin/s2tc -t $fourcc
 
        html_rowend
 done