run_tests.sh 746 字节
Newer Older
1 2
#!/bin/bash
cd `dirname $0`
3

4
set -e
5 6 7

protostr=`dirname $0`/protostr

8
files=`ls $protostr | grep -v "unittest"`
9

10
./generate_protostr.sh
11

12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
. ./file_list.sh

if [ -z $1 ]; then
  for file in $files
  do
      base_protostr=$protostr/$file
      new_protostr=$protostr/$file.unittest
      diff $base_protostr $new_protostr -u
  done
else
  for file in ${configs[*]}
  do
    if ! $1 $protostr/$file.protostr $protostr/$file.protostr.unittest; then
      diff $protostr/$file.protostr $protostr/$file.protostr.unittest -u
    fi
  done

  for file in ${whole_configs[*]}
  do
    if ! $1 $protostr/$file.protostr $protostr/$file.protostr.unittest --whole; then
      diff $protostr/$file.protostr $protostr/$file.protostr.unittest -u
    fi
  done
fi