#! /bin/bash import landlab landlab.test()
parser.add_option("-v", "--verbose", action="count", dest="verbose", default=1, help="increase verbosity [%default]") parser.add_option( "--doctests", action="store_true", dest="doctests", default=False, help="Run doctests in module [%default]" ) parser.add_option( "--coverage", action="store_true", dest="coverage", default=False, help="report coverage of landlab [%default]" ) parser.add_option( "-m", "--mode", action="store", dest="mode", default="fast", help='"fast", "full", or something that can be passed to ' "nosetests -A [%default]", ) (options, args) = parser.parse_args() import landlab result = landlab.test( label=options.mode, verbose=options.verbose, doctests=options.doctests, coverage=options.coverage, extra_argv=args ) if result.wasSuccessful(): sys.exit(0) else: sys.exit(1)
sys.path.pop(0) from optparse import OptionParser parser = OptionParser('usage: %prog [options] -- [nosetests options]') parser.add_option('-v', '--verbose', action='count', dest='verbose', default=1, help='increase verbosity [%default]') parser.add_option('--no-doctests', action='store_false', dest='doctests', default=True, help='Do not run doctests in module [%default]') parser.add_option('--coverage', action='store_true', dest='coverage', default=False, help='report coverage of landlab [%default]') parser.add_option('-m', '--mode', action='store', dest='mode', default='fast', help='"fast", "full", or something that can be passed to ' 'nosetests -A [%default]') (options, args) = parser.parse_args() import landlab result = landlab.test(label=options.mode, verbose=options.verbose, doctests=options.doctests, coverage=options.coverage, extra_argv=args, raise_warnings='release') if result.wasSuccessful(): sys.exit(0) else: sys.exit(1)
help='Run doctests in module [%default]') parser.add_option('--coverage', action='store_true', dest='coverage', default=False, help='report coverage of landlab [%default]') parser.add_option('-m', '--mode', action='store', dest='mode', default='fast', help='"fast", "full", or something that can be passed to ' 'nosetests -A [%default]') (options, args) = parser.parse_args() import landlab landlab.RasterModelGrid(4, 5) result = landlab.test(label=options.mode, verbose=options.verbose, doctests=options.doctests, coverage=options.coverage, extra_argv=args) if result.wasSuccessful(): sys.exit(0) else: sys.exit(1)
#! /bin/bash import sys import landlab result = landlab.test() if result.wasSuccessful(): sys.exit(0) else: sys.exit(1)