Debian Codegraph @

testsuite/bug-i37.pl

raw
1 #! /usr/bin/perl
2
3 # bug i37 - Off-by-one error in setting maximum allowed 'i' in cp9_ShiftCMBands().
4 #
5 # EPN, Fri May 31 13:04:57 2013
6 #
7 # i37.1: fasta file to test for bug (sequence reported by Zasha)
8
9 $usage = "perl bug-i37.pl <cmsearch> <path to bug-i37.cm>\n";
10 if ($#ARGV != 1) { die "Wrong argument number.\n$usage"; }
11
12 $cmsearch = shift;
13 $cmfile = shift;
14 $ok = 1;
15
16 # Make our test sequence file, i37.1
17 #
18 open (OUT, ">i37.1") || die;
19 print OUT <<END;
20 >problemsequence
21 UUGCGCUAUCAUAAUAUACAUAUAUGGGAGUCUGUGUACAGUCUGAGAGGAAGUGUAAAC
22 UUCGACCGCACCUGAUCUGGGUAAUGCCAGCGUAGGGAAAAGUAUUUGUAAAAACCUUGU
23 GGUUUUACUAAAAGUGGCGAGCGAUUCGCCUAUCUUUAGGAUACUGAUGCAUGCUACACC
24 UUUUCCAUAUUGGAGAAGGU
25 END
26 close OUT;
27
28 if ($ok) {
29 $output = `$cmsearch --cpu 0 --cyk --notrunc -g --toponly $cmfile i37.1`;
30 if ($? != 0) { $ok = 0; }
31 # make sure output includes an 'ok' string indicating success
32 if($output !~ /\n.ok.\n/) {
33 $ok = 0;
34 }
35 }
36
37 foreach $tmpfile ("i37.1") {
38 unlink $tmpfile if -e $tmpfile;
39 }
40 if ($ok) { print "ok\n"; exit 0; }
41 else { print "FAILED\n"; exit 1; }
42
43