1#!/bin/bash 2#set -x 3 4if [ -t 1 ] ; then 5 RED='\033[0;31m' 6 GREEN='\033[0;32m' 7 NC='\033[0m' # No Color 8else 9 RED='' 10 GREEN='' 11 NC='' 12fi 13# If we can't find the source dir then skip 14if [ ! -d "../../scripts" ]; then 15 printf "$GREEN[ SKIPPED ]$NC $0\n" 16 printf " To run validation DB checks you can manually execute\n" 17 printf " vk_validation_stats.py from the 'scripts' dir of your source tree\n" 18 exit 19fi 20 21printf "$GREEN[ RUN ]$NC $0\n" 22 23# Run doc validation from project scripts dir 24pushd ../../scripts 25 26# Validate that layer database matches source contents 27python3 vk_validation_stats.py 28 29RES=$? 30 31 32if [ $RES -eq 0 ] ; then 33 printf "$GREEN[ PASSED ]$NC 1 test\n" 34 exit 0 35else 36 printf "$RED[ FAILED ]$NC Validation of vk_validation_error_database.txt failed\n" 37 printf "$RED[ FAILED ]$NC 1 test\n" 38 printf "1 TEST FAILED\n" 39 exit 1 40fi 41# Restore original directory 42popd 43