source: nappy/trunk/nappy/script/run_cmd_line_tests.py @ 5349

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/nappy/trunk/nappy/script/run_cmd_line_tests.py@5349
Revision 5349, 934 bytes checked in by astephen, 11 years ago (diff)

Removed command line test text files from scripts dir and updated run_cmd_line_tests.py

  • Property svn:executable set to *
Line 
1#!/usr/bin/env python
2
3"""
4run_cmd_line_tests.py
5=====================
6
7Usage:
8
9    run_cmd_line_tests.py <test_file> [<n>] [<n2> .... <nm>]
10
11Where:
12
13    <test_file>  has one cmd line test per line
14    n and friends are numbers of tests in <test_file>.
15
16"""
17
18
19import os
20
21import sys
22args = sys.argv[1:]
23
24if len(args) == 0:
25    print "Please provide at least the file arg."
26    sys.exit()
27
28fname = args[0]
29tests = open(fname).readlines()
30limited_tests = [int(i) for i in args[1:]]
31
32
33for count, test in enumerate(tests):
34    count = count + 1   
35    if limited_tests and count not in limited_tests:
36        continue
37
38    test = "python " + test
39    print "\n\n\n================================================================================"
40    print "         Test number: %s  " % count
41    print "==================================================================================="
42    print "Running: ", test
43    os.system(test) 
Note: See TracBrowser for help on using the repository browser.