From 62fc6316a78bc705496796b2310cb920d8dff5e2 Mon Sep 17 00:00:00 2001 From: martinahansen Date: Thu, 12 Aug 2010 09:59:26 +0000 Subject: [PATCH] polishing testing suite git-svn-id: http://biopieces.googlecode.com/svn/trunk@1056 74ccb610-7750-0410-82ae-013aeee3265d --- bp_test/lib/test.sh | 19 +++++++++++++++++++ bp_test/test/test_add_ident | 6 +++--- bp_test/test/test_align_seq | 2 +- bp_test/test/test_analyze_gc | 2 +- bp_test/test/test_analyze_vals | 6 +++--- bp_test/test/test_blast_seq | 10 +++++----- bp_test/test/test_grab | 20 ++++++++++---------- bp_test/test/test_lowercase_seq | 2 +- bp_test/test/test_read_blast_tab | 4 ++-- bp_test/test/test_read_fasta | 4 ++-- bp_test/test/test_read_solexa | 10 +++++----- bp_test/test/test_read_tab | 16 ++++++++-------- bp_test/test/test_swapcase_seq | 2 +- bp_test/test/test_uppercase_seq | 2 +- bp_test/test/test_write_blast | 6 +++--- bp_test/test/test_write_fasta | 6 +++--- bp_test/test/test_write_tab | 12 ++++++------ code_python/Cjung/Args.pyc | Bin 5375 -> 5023 bytes 18 files changed, 74 insertions(+), 55 deletions(-) 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 4c39c4a68733e7fdac49e939fe26d08e98449439..795e1a5b55df1872c78e3b6dd439ae10af66b542 100644 GIT binary patch literal 5023 zcmb_g>uwau6+YcFV|&^**o%P$HlY&m?vVHb4hdvLE-cyQ63IdBT{-avjoQ;~yV;rU z*{&ME5-UZ4e|dtuLVo5=@;h&_FOYoSsTq%rj3TWvR##Vbow}XxJC}0*yZPwR-M3G= zGWyl<{w*H65s0KBJ17I$2_y|=CzP}%J2gq`@^xKy>RM^YPD3kGvNI)VL-sIaO5TdR z5&6^3v}7}qPRsL9%706cO-ni>Z!l$3(xzlh$sk;Q$kaX#2Crgr^KWd=of;PAuw6fK@NZtJnx{DqqMcT`YeN*n4 z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