run_tests.sh 1002 字节
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
. ./file_list.sh

if [ -z $1 ]; then
  for file in $files
  do
      base_protostr=$protostr/$file
      new_protostr=$protostr/$file.unittest
H
hanchao 已提交
19 20
      diff $base_protostr $new_protostr -u &&
      diff $protostr/$file $protostr/$file.non_file_config.unittest -u
21 22 23 24 25
  done
else
  for file in ${configs[*]}
  do
    if ! $1 $protostr/$file.protostr $protostr/$file.protostr.unittest; then
H
hanchao 已提交
26 27
      diff $protostr/$file.protostr $protostr/$file.protostr.unittest -u &&
      diff $protostr/$file.protostr $protostr/$file.protostr.non_file_config.unittest -u
28 29 30 31
    fi
  done

  for file in ${whole_configs[*]}
H
hanchao 已提交
32
do
33
    if ! $1 $protostr/$file.protostr $protostr/$file.protostr.unittest --whole; then
H
hanchao 已提交
34 35
      diff $protostr/$file.protostr $protostr/$file.protostr.unittest -u &&
      diff $protostr/$file.protostr $protostr/$file.protostr.non_file_config.unittest -u
36 37 38
    fi
  done
fi