From: martinahansen Date: Thu, 12 Aug 2010 09:59:26 +0000 (+0000) Subject: polishing testing suite X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=62fc6316a78bc705496796b2310cb920d8dff5e2;p=biopieces.git polishing testing suite git-svn-id: http://biopieces.googlecode.com/svn/trunk@1056 74ccb610-7750-0410-82ae-013aeee3265d --- diff --git a/bp_test/lib/test.sh b/bp_test/lib/test.sh index 84ff16c..fd2566d 100755 --- a/bp_test/lib/test.sh +++ b/bp_test/lib/test.sh @@ -27,6 +27,18 @@ function assert_no_diff local src=$1 local dst=$2 + if [ ! -f $src ]; then + echo_red "FAIL" + log "FAIL" + return + fi + + if [ ! -f $dst ]; then + echo_red "FAIL" + log "FAIL" + return + fi + local diff=`diff -q $src $dst` if [ "$diff" != "" ]; then @@ -77,3 +89,10 @@ function echo_red echo -e "\033[31;38m$msg\033[0m" } + +function clean +{ + if [ -f "$tmp" ]; then + rm "$tmp" + fi +} diff --git a/bp_test/test/test_add_ident b/bp_test/test/test_add_ident index a35b990..6e32ab6 100755 --- a/bp_test/test/test_add_ident +++ b/bp_test/test/test_add_ident @@ -4,12 +4,12 @@ source "$BP_DIR/bp_test/lib/test.sh" run "$bp -I $in -O $tmp" assert_no_diff $tmp $out.1 -rm $tmp +clean run "$bp -I $in -k CUSTOM_KEY -O $tmp" assert_no_diff $tmp $out.2 -rm $tmp +clean run "$bp -I $in -p PREFIX -O $tmp" assert_no_diff $tmp $out.3 -rm $tmp +clean diff --git a/bp_test/test/test_align_seq b/bp_test/test/test_align_seq index 4266db8..61c5709 100755 --- a/bp_test/test/test_align_seq +++ b/bp_test/test/test_align_seq @@ -4,4 +4,4 @@ source "$BP_DIR/bp_test/lib/test.sh" run "$bp -I $in -O $tmp" assert_no_diff $tmp $out.1 -rm $tmp +clean diff --git a/bp_test/test/test_analyze_gc b/bp_test/test/test_analyze_gc index 4266db8..61c5709 100755 --- a/bp_test/test/test_analyze_gc +++ b/bp_test/test/test_analyze_gc @@ -4,4 +4,4 @@ source "$BP_DIR/bp_test/lib/test.sh" run "$bp -I $in -O $tmp" assert_no_diff $tmp $out.1 -rm $tmp +clean diff --git a/bp_test/test/test_analyze_vals b/bp_test/test/test_analyze_vals index 4fa0b2e..1e4b180 100755 --- a/bp_test/test/test_analyze_vals +++ b/bp_test/test/test_analyze_vals @@ -4,12 +4,12 @@ source "$BP_DIR/bp_test/lib/test.sh" run "$bp -I $in -o $tmp -x" assert_no_diff $tmp $out.1 -rm $tmp +clean run "$bp -I $in -k V0 -o $tmp -x" assert_no_diff $tmp $out.2 -rm $tmp +clean run "$bp -I $in -K V0 -o $tmp -x" assert_no_diff $tmp $out.3 -rm $tmp +clean diff --git a/bp_test/test/test_blast_seq b/bp_test/test/test_blast_seq index f6b6430..5c3c52b 100755 --- a/bp_test/test/test_blast_seq +++ b/bp_test/test/test_blast_seq @@ -7,22 +7,22 @@ run_quiet "create_blast_index -I $in.3 -d $tmp_dir -i 'protein' -x" run "$bp -I $in.2 -d $tmp_dir/nucleotide -O $tmp" assert_no_diff $tmp $out.1 -rm $tmp +clean run "$bp -I $in.2 -d $tmp_dir/protein -O $tmp" assert_no_diff $tmp $out.2 -rm $tmp +clean run "$bp -I $in.4 -d $tmp_dir/nucleotide -O $tmp" assert_no_diff $tmp $out.3 -rm $tmp +clean run "$bp -I $in.4 -d $tmp_dir/protein -O $tmp" assert_no_diff $tmp $out.4 -rm $tmp +clean run "$bp -I $in.2 -d $tmp_dir/nucleotide -p tblastx -O $tmp" assert_no_diff $tmp $out.5 -rm $tmp +clean rm -rf $tmp_dir diff --git a/bp_test/test/test_grab b/bp_test/test/test_grab index 4d97be0..4172e9b 100755 --- a/bp_test/test/test_grab +++ b/bp_test/test/test_grab @@ -4,40 +4,40 @@ source "$BP_DIR/bp_test/lib/test.sh" run "$bp -I $in -p SEQ -O $tmp" assert_no_diff $tmp $out.1 -rm $tmp +clean run "$bp -I $in -p SEQ,COUNT -O $tmp" assert_no_diff $tmp $out.2 -rm $tmp +clean run "$bp -I $in -P $in.pat -O $tmp" assert_no_diff $tmp $out.3 -rm $tmp +clean run "$bp -I $in -p SEQ -i -O $tmp" assert_no_diff $tmp $out.4 -rm $tmp +clean run "$bp -I $in -p SEQ -K -O $tmp" assert_no_diff $tmp $out.5 -rm $tmp +clean run "$bp -I $in -p SEQ -V -O $tmp" assert_no_diff $tmp $out.6 -rm $tmp +clean run "$bp -I $in -p SEQ -k PAT -O $tmp" assert_no_diff $tmp $out.7 -rm $tmp +clean run "$bp -I $in -r a -k SEQ -O $tmp" assert_no_diff $tmp $out.8 -rm $tmp +clean run "$bp -I $in -r a -k SEQ -c -O $tmp" assert_no_diff $tmp $out.9 -rm $tmp +clean run "$bp -I $in -e 'SEQ_LEN<10' -O $tmp" assert_no_diff $tmp $out.10 -rm $tmp +clean diff --git a/bp_test/test/test_lowercase_seq b/bp_test/test/test_lowercase_seq index 4266db8..61c5709 100755 --- a/bp_test/test/test_lowercase_seq +++ b/bp_test/test/test_lowercase_seq @@ -4,4 +4,4 @@ source "$BP_DIR/bp_test/lib/test.sh" run "$bp -I $in -O $tmp" assert_no_diff $tmp $out.1 -rm $tmp +clean diff --git a/bp_test/test/test_read_blast_tab b/bp_test/test/test_read_blast_tab index cc459f8..bff0470 100755 --- a/bp_test/test/test_read_blast_tab +++ b/bp_test/test/test_read_blast_tab @@ -4,8 +4,8 @@ source "$BP_DIR/bp_test/lib/test.sh" run "$bp -i $in -O $tmp" assert_no_diff $tmp $out.1 -rm $tmp +clean run "$bp -i $in -n 1 -O $tmp" assert_no_diff $tmp $out.2 -rm $tmp +clean diff --git a/bp_test/test/test_read_fasta b/bp_test/test/test_read_fasta index cc459f8..bff0470 100755 --- a/bp_test/test/test_read_fasta +++ b/bp_test/test/test_read_fasta @@ -4,8 +4,8 @@ source "$BP_DIR/bp_test/lib/test.sh" run "$bp -i $in -O $tmp" assert_no_diff $tmp $out.1 -rm $tmp +clean run "$bp -i $in -n 1 -O $tmp" assert_no_diff $tmp $out.2 -rm $tmp +clean diff --git a/bp_test/test/test_read_solexa b/bp_test/test/test_read_solexa index 63a1ad0..5d0a58b 100755 --- a/bp_test/test/test_read_solexa +++ b/bp_test/test/test_read_solexa @@ -4,20 +4,20 @@ source "$BP_DIR/bp_test/lib/test.sh" run "$bp -i $in -O $tmp" assert_no_diff $tmp $out.1 -rm $tmp +clean run "$bp -i $in -n 1 -O $tmp" assert_no_diff $tmp $out.2 -rm $tmp +clean run "$bp -i $in -c -O $tmp" assert_no_diff $tmp $out.3 -rm $tmp +clean run "$bp -i $in -s -O $tmp" assert_no_diff $tmp $out.4 -rm $tmp +clean run "$bp -i $in -s -C 30 -O $tmp" assert_no_diff $tmp $out.5 -rm $tmp +clean diff --git a/bp_test/test/test_read_tab b/bp_test/test/test_read_tab index ed2da1a..62adfcc 100755 --- a/bp_test/test/test_read_tab +++ b/bp_test/test/test_read_tab @@ -4,32 +4,32 @@ source "$BP_DIR/bp_test/lib/test.sh" run "$bp -i $in.1 -O $tmp" assert_no_diff $tmp $out.1 -rm $tmp +clean run "$bp -i $in.1 -s 1 -O $tmp" assert_no_diff $tmp $out.2 -rm $tmp +clean run "$bp -i $in.1 -s 1 -k ORGANISM,SEQ,COUNT -O $tmp" assert_no_diff $tmp $out.3 -rm $tmp +clean run "$bp -i $in.1 -s 1 -c 2,1 -O $tmp" assert_no_diff $tmp $out.4 -rm $tmp +clean run "$bp -i $in.1 -s 1 -c 2,1 -k COUNT,SEQ -O $tmp" assert_no_diff $tmp $out.5 -rm $tmp +clean run "$bp -i $in.2 -O $tmp" assert_no_diff $tmp $out.6 -rm $tmp +clean run "$bp -i $in.2 -n 1 -O $tmp" assert_no_diff $tmp $out.7 -rm $tmp +clean run "$bp -i $in.3 -d ';' -O $tmp" assert_no_diff $tmp $out.8 -rm $tmp +clean diff --git a/bp_test/test/test_swapcase_seq b/bp_test/test/test_swapcase_seq index 4266db8..61c5709 100755 --- a/bp_test/test/test_swapcase_seq +++ b/bp_test/test/test_swapcase_seq @@ -4,4 +4,4 @@ source "$BP_DIR/bp_test/lib/test.sh" run "$bp -I $in -O $tmp" assert_no_diff $tmp $out.1 -rm $tmp +clean diff --git a/bp_test/test/test_uppercase_seq b/bp_test/test/test_uppercase_seq index 4266db8..61c5709 100755 --- a/bp_test/test/test_uppercase_seq +++ b/bp_test/test/test_uppercase_seq @@ -4,4 +4,4 @@ source "$BP_DIR/bp_test/lib/test.sh" run "$bp -I $in -O $tmp" assert_no_diff $tmp $out.1 -rm $tmp +clean diff --git a/bp_test/test/test_write_blast b/bp_test/test/test_write_blast index 87ed9e0..741eb95 100755 --- a/bp_test/test/test_write_blast +++ b/bp_test/test/test_write_blast @@ -4,13 +4,13 @@ source "$BP_DIR/bp_test/lib/test.sh" run "$bp -I $in -o $tmp -x" assert_no_diff $tmp $out.1 -rm $tmp +clean run "$bp -I $in -c -o $tmp -x" assert_no_diff $tmp $out.2 -rm $tmp +clean run "$bp -I $in -Z -o $tmp.gz -x" gunzip $tmp.gz assert_no_diff $tmp $out.3 -rm $tmp +clean diff --git a/bp_test/test/test_write_fasta b/bp_test/test/test_write_fasta index 63b1ecf..68f37ce 100755 --- a/bp_test/test/test_write_fasta +++ b/bp_test/test/test_write_fasta @@ -4,13 +4,13 @@ source "$BP_DIR/bp_test/lib/test.sh" run "$bp -I $in -o $tmp -x" assert_no_diff $tmp $out.1 -rm $tmp +clean run "$bp -I $in -w 4 -o $tmp -x" assert_no_diff $tmp $out.2 -rm $tmp +clean run "$bp -I $in -w 4 -Z -o $tmp.gz -x" gunzip $tmp.gz assert_no_diff $tmp $out.3 -rm $tmp +clean diff --git a/bp_test/test/test_write_tab b/bp_test/test/test_write_tab index 21e9e35..7209fd7 100755 --- a/bp_test/test/test_write_tab +++ b/bp_test/test/test_write_tab @@ -4,25 +4,25 @@ source "$BP_DIR/bp_test/lib/test.sh" run "$bp -I $in -o $tmp -x" assert_no_diff $tmp $out.1 -rm $tmp +clean run "$bp -I $in -c -o $tmp -x" assert_no_diff $tmp $out.2 -rm $tmp +clean run "$bp -I $in -d ',' -o $tmp -x" assert_no_diff $tmp $out.3 -rm $tmp +clean run "$bp -I $in -Z -o $tmp.gz -x" gunzip $tmp.gz assert_no_diff $tmp $out.4 -rm $tmp +clean run "$bp -I $in -k 'Count' -o $tmp -x" assert_no_diff $tmp $out.5 -rm $tmp +clean run "$bp -I $in -K 'Count' -o $tmp -x" assert_no_diff $tmp $out.6 -rm $tmp +clean diff --git a/code_python/Cjung/Args.pyc b/code_python/Cjung/Args.pyc index 4c39c4a..795e1a5 100644 Binary files a/code_python/Cjung/Args.pyc and b/code_python/Cjung/Args.pyc differ