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

Last change on this file since 5262 was 5262, checked in by hongpum, 2 years ago

Minor changes to make the test scripts compatible with py3

File size: 754 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.