|
NCBI Home IEB Home C++ Toolkit docs C Toolkit source browser C Toolkit source browser (2) |
NCBI C++ Toolkit Cross ReferenceC++/compilers/msvc800_prj/check.sh |
source navigation diff markup identifier search freetext search file search |
1 #! /bin/sh
2 # $Id: check.sh 143106 2008-10-15 14:27:33Z ivanov $
3 # Author: Vladimir Ivanov (ivanov@ncbi.nlm.nih.gov)
4 #
5 # Check C++ Toolkit in all previously built configurations
6 # (see 'cfgs.log', generated with 'build.sh' script).
7 #
8 # USAGE:
9 # check.sh {run | concat | concat_err | concat_cfg | load_to_db}
10 #
11 # Use 'run' command first, than use other commands.
12 # For 'concat_cfg' -- use 'run', 'concat' and 'concat_err' commands first.
13
14
15 ########### Arguments
16
17 script="$0"
18 method="$1"
19
20
21 ########## Functions
22
23 error()
24 {
25 echo "[`basename $script`] ERROR: $1"
26 exit 1
27 }
28
29
30 ########## Main
31
32 errcode=0
33
34 # Get build directory
35 build_dir=`dirname $script`
36 build_dir=`(cd "$build_dir"; pwd)`
37
38 if [ ! -d $build_dir ] ; then
39 error "Build directory $build_dir not found"
40 fi
41 cd $build_dir || error "Cannot change directory"
42
43 res_log="$build_dir/check.sh.log"
44 res_concat="$build_dir/check.sh.out"
45 res_concat_err="$build_dir/check.sh.out_err"
46
47 cfgs="`cat cfgs.log`"
48 if [ -z "$cfgs" ] ; then
49 error "Build some configurations first"
50 fi
51
52 # Initialization
53
54 case "$method" in
55 run )
56 rm -f "$res_log"
57 rm -f "$build_dir/check.sh.*.log" > /dev/null 2>&1
58 # Init checks
59 $build_dir/../../scripts/common/check/check_make_win_cfg.sh init || \
60 error "Check initialization failed"
61 ;;
62 clean )
63 # not implemented, 'clean' method is not used on Windows
64 exit 0
65 ;;
66 concat )
67 cp $res_log $res_concat
68 ;;
69 concat_err )
70 egrep 'ERR \[|TO -' $res_log > $res_concat_err
71 ;;
72 concat_cfg )
73 #rm -f "$build_dir/check.sh.*.out" > /dev/null 2>&1
74 rm -f "$build_dir/check.sh.*.out_err" > /dev/null 2>&1
75 ;;
76 load_to_db )
77 ;;
78 * )
79 error "Invalid method name"
80 ;;
81 esac
82
83
84 # Run checks for each previously built configuration
85
86 for cfg in $cfgs ; do
87 if [ -z "$cfg" ] ; then
88 error "Unknown configuration name"
89 fi
90 x_tree=`echo $cfg | sed -e 's/,.*$//'`
91 x_sol=`echo $cfg | sed -e 's/^[^,]*,//' -e 's/,.*$//' -e 's/\.sln//' -e 's|\\\|/|g'`
92 x_cfg=`echo $cfg | sed -e 's/^.*,//'`
93 echo CHECK_$method: $x_tree/$x_sol/$x_cfg
94
95 cd $build_dir
96 check_dir="$x_tree/build/${x_sol}.check/$x_cfg"
97 if [ ! -d "$check_dir" ] ; then
98 error "Check directory \"$check_dir\" not found"
99 fi
100 if test "$method" != "run"; then
101 test -x "$check_dir/check.sh" || error "Run checks first. $check_dir/check.sh not found."
102 fi
103
104 # Action
105
106 case "$method" in
107 run )
108 ../../scripts/common/check/check_make_win_cfg.sh create "$x_sol" "$x_tree" "$x_cfg" || \
109 error "Creating check script for \"$check_dir\" failed"
110 $check_dir/check.sh run || errcode=$?
111 cat $check_dir/check.sh.log >> $res_log
112 cat $check_dir/check.sh.log >> $build_dir/check.sh.${x_tree}_${x_cfg}.log
113 ;;
114 concat )
115 $check_dir/check.sh concat
116 cat $check_dir/check.sh.out >> $res_concat
117 ;;
118 concat_err )
119 $check_dir/check.sh concat_err
120 cat $check_dir/check.sh.out_err >> $res_concat_err
121 ;;
122 concat_cfg )
123 # Copy log entries
124 egrep 'ERR \[|TO -' $check_dir/check.sh.log >> $build_dir/check.sh.${x_tree}_${x_cfg}.out_err
125 # see below copying of failed tests outputs
126 ;;
127 load_to_db )
128 $check_dir/check.sh load_to_db
129 ;;
130 esac
131 done
132
133 if test "$method" = "concat_cfg"; then
134 for cfg in $cfgs ; do
135 x_tree=`echo $cfg | sed -e 's/,.*$//'`
136 x_sol=`echo $cfg | sed -e 's/^[^,]*,//' -e 's/,.*$//' -e 's/\.sln//' -e 's|\\\|/|g'`
137 x_cfg=`echo $cfg | sed -e 's/^.*,//'`
138 cd $build_dir
139 check_dir="$x_tree/build/${x_sol}.check/$x_cfg"
140 #cat $check_dir/check.sh.out >> $build_dir/check.sh.${x_tree}_${x_cfg}.out
141 cat $check_dir/check.sh.out_err >> $build_dir/check.sh.${x_tree}_${x_cfg}.out_err
142 done
143 fi
144
145 exit $errcode
|
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more information. |