source: icGREP/icgrep-devel/QA/editd/run_all.py @ 5225

Last change on this file since 5225 was 5225, checked in by lindanl, 3 years ago

Fix directory issue for editd test.

File size: 752 bytes
Line 
1from subprocess import *
2from string import *
3import sys, os, optparse
4
5if __name__ == "__main__":
6        option_parser = optparse.OptionParser(usage='python %prog [options] <grep_executable>', version='1.0')
7        option_parser.add_option('-e', '--exec_dir', dest = 'exec_dir', type='string', default='.', help = 'executable directory')
8        options, args = option_parser.parse_args(sys.argv[1:])
9        print options.exec_dir
10        out_f = open('OutputFiles/reads2', 'w')
11        expected_f = open('ExpectedOutput/reads2', 'r')
12        call([options.exec_dir+'/editd', '-f', 'TestFiles/reads2', 'chr.fa', '-display'], stdout=out_f)
13        if open('OutputFiles/reads2', 'r').read()==expected_f.read():
14                print 'Edit Distance test succeeded.'
15        else:
16                print 'Edit Distance test failed.'     
17                exit(1)
Note: See TracBrowser for help on using the repository browser.