blob: 6d4e8904d3419a8baef56c582a75ca5eec183c18 [file] [log] [blame]
David Pinedo4e886bf2015-06-30 15:37:50 -06001#!/bin/bash
2#set -x
3if [ -t 1 ] ; then
4 RED='\033[0;31m'
5 GREEN='\033[0;32m'
6 NC='\033[0m' # No Color
7else
8 RED=''
9 GREEN=''
10 NC=''
11fi
12
13printf "$GREEN[ RUN ]$NC $0\n"
14
David Pinedo4e886bf2015-06-30 15:37:50 -060015# Create a temp directory to run the test in
16rm -rf vktracereplay_tmp
17mkdir vktracereplay_tmp
18cd vktracereplay_tmp
David Pinedofe9f20d2015-08-10 16:51:33 -060019cp ../../vktrace/vkreplay .
20cp ../../vktrace/vktrace .
21cp ../../vktrace/libvulkan_trace.so .
22#cp ../../vktrace/libvulkan_replay.so .
David Pinedo4e886bf2015-06-30 15:37:50 -060023cp ../../demos/cube .
24cp ../../demos/*png .
25cp ../../demos/*spv .
26export LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH
David Pinedofe9f20d2015-08-10 16:51:33 -060027export VK_LAYER_PATH=`pwd`/../../layers
David Pinedo4e886bf2015-06-30 15:37:50 -060028(
Mark Lobodzinski092932a2015-08-27 11:47:25 -060029 ./vktrace -s 1 -p cube -o c01.vktrace -l0 libvulkan_trace.so &
David Pinedo4e886bf2015-06-30 15:37:50 -060030 P=$!
31 sleep 3
32 kill $P
33) >/dev/null 2>&1
34mv 1.ppm 1_trace.ppm
Mark Lobodzinski092932a2015-08-27 11:47:25 -060035./vkreplay -s 1 -t c01.vktrace >/dev/null 2>&1
David Pinedo4e886bf2015-06-30 15:37:50 -060036#cp cube 1.ppm # For testing this script -- force a failure
37#rm 1.ppm # For testing this script -- force a failure
38cmp -s 1.ppm 1_trace.ppm
39RES=$?
40cd ..
Cody Northrop06798a62015-08-10 17:06:42 -060041rm -rf vktracereplay_tmp
David Pinedo4e886bf2015-06-30 15:37:50 -060042
43if [ $RES -eq 0 ] ; then
44 printf "$GREEN[ PASSED ]$NC 1 test\n"
45 exit 0
46else
47 printf "$RED[ FAILED ]$NC screenshot file compare failed\n"
48 printf "$RED[ FAILED ]$NC 1 test\n"
49 printf "1 TEST FAILED\n"
50 exit 1
51fi