run_tests.sh 1.2 KB
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
      diff $base_protostr $new_protostr -u
H
hanchao 已提交
20
      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 28
      diff $protostr/$file.protostr $protostr/$file.protostr.unittest -u
    fi
    if ! $1 $protostr/$file.protostr $protostr/$file.protostr.non_file_config.unittest; then
H
hanchao 已提交
29
      diff $protostr/$file.protostr $protostr/$file.protostr.non_file_config.unittest -u
30 31 32 33
    fi
  done

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