David Pinedo | 4e886bf | 2015-06-30 15:37:50 -0600 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | #set -x |
| 3 | if [ -t 1 ] ; then |
| 4 | RED='\033[0;31m' |
| 5 | GREEN='\033[0;32m' |
| 6 | NC='\033[0m' # No Color |
| 7 | else |
| 8 | RED='' |
| 9 | GREEN='' |
| 10 | NC='' |
| 11 | fi |
| 12 | |
| 13 | printf "$GREEN[ RUN ]$NC $0\n" |
| 14 | |
David Pinedo | 4e886bf | 2015-06-30 15:37:50 -0600 | [diff] [blame] | 15 | # Create a temp directory to run the test in |
| 16 | rm -rf vktracereplay_tmp |
| 17 | mkdir vktracereplay_tmp |
| 18 | cd vktracereplay_tmp |
David Pinedo | fe9f20d | 2015-08-10 16:51:33 -0600 | [diff] [blame] | 19 | cp ../../vktrace/vkreplay . |
| 20 | cp ../../vktrace/vktrace . |
| 21 | cp ../../vktrace/libvulkan_trace.so . |
| 22 | #cp ../../vktrace/libvulkan_replay.so . |
David Pinedo | 4e886bf | 2015-06-30 15:37:50 -0600 | [diff] [blame] | 23 | cp ../../demos/cube . |
| 24 | cp ../../demos/*png . |
| 25 | cp ../../demos/*spv . |
| 26 | export LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH |
David Pinedo | fe9f20d | 2015-08-10 16:51:33 -0600 | [diff] [blame] | 27 | export VK_LAYER_PATH=`pwd`/../../layers |
David Pinedo | 4e886bf | 2015-06-30 15:37:50 -0600 | [diff] [blame] | 28 | ( |
Mark Lobodzinski | 092932a | 2015-08-27 11:47:25 -0600 | [diff] [blame] | 29 | ./vktrace -s 1 -p cube -o c01.vktrace -l0 libvulkan_trace.so & |
David Pinedo | 4e886bf | 2015-06-30 15:37:50 -0600 | [diff] [blame] | 30 | P=$! |
| 31 | sleep 3 |
| 32 | kill $P |
| 33 | ) >/dev/null 2>&1 |
| 34 | mv 1.ppm 1_trace.ppm |
Mark Lobodzinski | 092932a | 2015-08-27 11:47:25 -0600 | [diff] [blame] | 35 | ./vkreplay -s 1 -t c01.vktrace >/dev/null 2>&1 |
David Pinedo | 4e886bf | 2015-06-30 15:37:50 -0600 | [diff] [blame] | 36 | #cp cube 1.ppm # For testing this script -- force a failure |
| 37 | #rm 1.ppm # For testing this script -- force a failure |
| 38 | cmp -s 1.ppm 1_trace.ppm |
| 39 | RES=$? |
| 40 | cd .. |
Cody Northrop | 06798a6 | 2015-08-10 17:06:42 -0600 | [diff] [blame] | 41 | rm -rf vktracereplay_tmp |
David Pinedo | 4e886bf | 2015-06-30 15:37:50 -0600 | [diff] [blame] | 42 | |
| 43 | if [ $RES -eq 0 ] ; then |
| 44 | printf "$GREEN[ PASSED ]$NC 1 test\n" |
| 45 | exit 0 |
| 46 | else |
| 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 |
| 51 | fi |