Ticket #12415: 12415_spkg_bin_sage.patch

File 12415_spkg_bin_sage.patch, 6.1 KB (added by jdemeyer, 7 years ago)

Apply to root repository

  • spkg/bin/sage

    # HG changeset patch
    # User David Roe <roed.math@gmail.com>
    # Date 1342063124 14400
    # Node ID 1af4599d6a864000bfb005127d5f699df78e6eed
    # Parent  b2dacdabf68cd0e9883d5c5da8872b0f52f2cfc2
    Change spkg/bin/sage to use the new doctesting framework
    
    diff --git a/spkg/bin/sage b/spkg/bin/sage
    a b  
    2929    echo "  -root               -- print the Sage root directory"
    3030    echo "  --nodotsage         -- run Sage without using the user's .sage directory:"
    3131    echo "                         create and use a temporary .sage directory instead"
    32     echo "  -t [options] <files|dir>"
    33     echo "                      -- test examples in .py, .pyx, .sage or .tex files"
    34     echo "                         options:"
    35     echo "                           -long  -- include lines with the phrase 'long time'"
    36     echo "                           -verbose  -- print debugging output during the test"
    37     echo "                           -optional  -- also test all #optional examples"
    38     echo "                           -only-optional <tag1,...,tagn>  -- only run tests"
    39     echo "                            including one of the #optional tags"
    40     echo "                           -randorder[=seed]  -- randomize order of tests"
     32    echo "  -t [options] <--all|files|dir>"
     33    echo "                      -- test examples in .py, .pyx, .sage, .tex or .rst files"
     34    echo "                         selected options:"
     35    echo "                           --long - include lines with the phrase 'long time'"
     36    echo "                           --verbose - print debugging output during the test"
     37    echo "                           --optional - controls which optional tests are run"
     38    echo "                           --help - show all testing options"
    4139    echo "  -upgrade [url]      -- download, build and install standard packages from"
    4240    echo "                         given url.  If url not given, automatically selects a"
    4341    echo "                         suitable mirror.  If url='ask', it lets you select"
     
    152150    echo "  -startuptime [module]  -- display how long each component of Sage takes to"
    153151    echo "                            start up; optionally specify a module to get more"
    154152    echo "                            details about that particular module"
    155     echo "  -t [options] <files|dir>"
    156     echo "                      -- test examples in .py, .pyx, .sage or .tex files"
    157     echo "                         options:"
    158     echo "                           -long  -- include lines with the phrase 'long time'"
    159     echo "                           -verbose  -- print debugging output during the test"
    160     echo "                           -optional  -- also test all #optional examples"
    161     echo "                           -only-optional <tag1,...,tagn>  -- only run tests"
    162     echo "                            including one of the #optional tags"
    163     echo "                           -randorder[=seed]  -- randomize order of tests"
    164     echo "  -tnew [...]         -- like -t above, but only tests files modified since"
    165     echo "                         last commit"
     153    echo "  -t [options] <--all|files|dir>"
     154    echo "                      -- test examples in .py, .pyx, .sage, .tex or .rst files"
     155    echo "                         selected options:"
     156    echo "                           --long - include lines with the phrase 'long time'"
     157    echo "                           --verbose - print debugging output during the test"
     158    echo "                           --optional - controls which optional tests are run"
     159    echo "                           --randorder[=seed] - randomize order of tests"
     160    echo "                           --new - only test files modified since last commit"
     161    echo "                           --initial - only show the first failure per block"
     162    echo "                           --debug - drop into PDB after an unexpected error"
     163    echo "                           --failed - only test files that failed last test"
     164    echo "                           --help - show all testing options"
    166165    echo "  -tp <N> [...]       -- like -t above, but tests in parallel using N threads"
    167166    echo "                         with 0 interpreted as a sensible default"
    168167    echo "  -testall [options]  -- test all source files, docs, and examples.  options"
     
    715714   exit $?
    716715fi
    717716
    718 if [ "$1" = '-t' -o "$1" = '-bt' ]; then
    719    if [ "$1" = '-bt' ]; then
    720       build_sage
    721    fi
    722    if ! [  -f  "$DOT_SAGE"/init.sage ]; then
    723       echo >&2 "init.sage does not exist ... creating"
    724       touch "$DOT_SAGE"/init.sage
    725    fi
    726    shift
    727    SAGE_BANNER="no"
    728    sage_setup
    729    sage-test "$@"
    730    exit $?
    731 fi
    732 
    733 if [ "$1" = '-tp' -o "$1" = '-btp' ]; then
    734    if [ "$1" = '-btp' ]; then
    735       build_sage
    736    fi
    737    if ! [  -f  "$DOT_SAGE"/init.sage ]; then
    738       echo >&2 "init.sage does not exist ... creating"
    739       touch "$DOT_SAGE"/init.sage
    740    fi
    741    shift
    742    SAGE_BANNER="no"
    743    sage_setup
    744    sage-ptest "$@"
    745    exit $?
     717if [ "$1" = '-t' -o "$1" = '-bt' -o "$1" = '-tp' -o "$1" = '-btp' ]; then
     718    if [ "$1" = '-bt' -o "$1" = '-btp' ]; then
     719        build_sage
     720    fi
     721    if [ ! -f  "$DOT_SAGE"/init.sage ]; then
     722        echo >&2 "init.sage does not exist ... creating"
     723        touch "$DOT_SAGE"/init.sage
     724    fi
     725    SAGE_BANNER="no"
     726    sage_setup
     727    if [ "$1" = '-tp' -o "$1" = '-btp' ]; then
     728        shift
     729        exec sage-runtests -p "$@"
     730    else
     731        shift
     732        exec sage-runtests "$@"
     733    fi
    746734fi
    747735
    748736if [ "$1" = '-tnew' -o "$1" = '-btnew' ]; then
    749    if [ "$1" = '-btnew' ]; then
    750       build_sage
    751    fi
    752    shift
    753    SAGE_BANNER="no"
    754    sage_setup
    755    sage-test-new "$@"
    756    exit $?
     737    if [ "$1" = '-btnew' ]; then
     738        build_sage
     739    fi
     740    shift
     741    SAGE_BANNER="no"
     742    sage_setup
     743    exec sage-runtests --new "$@"
    757744fi
    758745
    759746if [ "$1" = '-testall' -o "$1" = "--testall" ]; then
    760    shift
    761    SAGE_BANNER="no"
    762    sage_setup
    763    sage-maketest "$@"
    764    exit $?
     747    shift
     748    SAGE_BANNER="no"
     749    sage_setup
     750    exec sage-runtests -a "$@"
    765751fi
    766752
    767753if [ "$1" = '-patchbot' -o "$1" = "--patchbot" ]; then