<s> from __future__ import print_function <EOL> import nose <EOL> import os <EOL> import sys <EOL> import glob <EOL> import shutil <EOL> import subprocess <EOL> import tempfile <EOL> from nose . tools import assert_true , assert_equal <EOL> from tools import integration , cleanfs , check_cmd , clean_import , dirtests , modtests , skip_then_continue <EOL> from xdress . astparsers import PARSERS_AVAILABLE <EOL> if sys . version_info [ <NUM_LIT:0> ] >= <NUM_LIT:3> : <EOL> basestring = str <EOL> PROJNAME = "<STR_LIT>" <EOL> PROJDIR = os . path . abspath ( PROJNAME ) <EOL> INSTDIR = os . path . join ( PROJDIR , '<STR_LIT>' ) <EOL> ROOTDIR = os . path . splitdrive ( INSTDIR ) [ <NUM_LIT:0> ] or '<STR_LIT:/>' <EOL> TESTDIR = os . path . join ( PROJDIR , PROJNAME , '<STR_LIT>' ) <EOL> THISDIR = os . path . dirname ( __file__ ) <EOL> GENERATED_PATHS = [ <EOL> [ PROJDIR , '<STR_LIT>' ] , <EOL> [ PROJDIR , PROJNAME , '<STR_LIT>' ] , <EOL> [ PROJDIR , PROJNAME , '<STR_LIT>' ] , <EOL> [ PROJDIR , PROJNAME , '<STR_LIT>' ] , <EOL> [ PROJDIR , PROJNAME , '<STR_LIT>' ] , <EOL> [ PROJDIR , PROJNAME , '<STR_LIT>' ] , <EOL> [ PROJDIR , PROJNAME , '<STR_LIT>' ] , <EOL> [ PROJDIR , PROJNAME , '<STR_LIT>' ] , <EOL> [ PROJDIR , PROJNAME , '<STR_LIT>' ] , <EOL> [ PROJDIR , PROJNAME , '<STR_LIT>' ] , <EOL> [ PROJDIR , PROJNAME , '<STR_LIT>' ] , <EOL> [ PROJDIR , PROJNAME , '<STR_LIT>' ] , <EOL> [ PROJDIR , PROJNAME , '<STR_LIT>' ] , <EOL> [ PROJDIR , PROJNAME , '<STR_LIT>' ] , <EOL> [ PROJDIR , PROJNAME , '<STR_LIT>' ] , <EOL> [ PROJDIR , PROJNAME , '<STR_LIT>' ] , <EOL> [ PROJDIR , PROJNAME , '<STR_LIT>' ] , <EOL> [ PROJDIR , PROJNAME , '<STR_LIT>' ] , <EOL> [ PROJDIR , '<STR_LIT:src>' , '<STR_LIT>' ] , <EOL> [ TESTDIR , '<STR_LIT>' ] , <EOL> [ TESTDIR , '<STR_LIT>' ] , <EOL> [ TESTDIR , '<STR_LIT>' ] , <EOL> [ TESTDIR , '<STR_LIT>' ] , <EOL> [ THISDIR , '<STR_LIT>' ] , <EOL> [ INSTDIR + '<STR_LIT:*>' ] , <EOL> ] <EOL> @ integration <EOL> def test_all ( ) : <EOL> parsers = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> cases = [ { '<STR_LIT>' : p } for p in parsers ] <EOL> cwd = os . getcwd ( ) <EOL> base = os . path . dirname ( cwd ) <EOL> path = base <EOL> if '<STR_LIT>' in os . environ : <EOL> path = path + '<STR_LIT::>' + os . environ [ '<STR_LIT>' ] <EOL> pyexec = sys . executable <EOL> xdexec = os . path . join ( base , '<STR_LIT>' , '<STR_LIT>' ) <EOL> defaults = { '<STR_LIT>' : cwd , '<STR_LIT>' : base , '<STR_LIT>' : pyexec , '<STR_LIT>' : xdexec , <EOL> '<STR_LIT>' : INSTDIR , '<STR_LIT>' : ROOTDIR , '<STR_LIT:path>' : path , <EOL> '<STR_LIT>' : os . path . join ( PROJDIR , '<STR_LIT>' ) } <EOL> commands = ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> ) <EOL> for case in cases : <EOL> parser = case [ '<STR_LIT>' ] <EOL> instdir = case [ '<STR_LIT>' ] = defaults [ '<STR_LIT>' ] + '<STR_LIT:->' + parser <EOL> builddir = case [ '<STR_LIT>' ] = defaults [ '<STR_LIT>' ] + '<STR_LIT:->' + parser <EOL> if not PARSERS_AVAILABLE [ parser ] : <EOL> yield skip_then_continue , parser + "<STR_LIT>" <EOL> continue <EOL> cleanfs ( GENERATED_PATHS ) <EOL> rtn = <NUM_LIT:1> <EOL> holdsrtn = [ rtn ] <EOL> fill = dict ( defaults ) <EOL> fill . update ( case ) <EOL> cmds = commands . format ( ** fill ) . strip ( ) . splitlines ( ) <EOL> for cmd in cmds : <EOL> yield check_cmd , cmd , PROJDIR , holdsrtn <EOL> rtn = holdsrtn [ <NUM_LIT:0> ] <EOL> if rtn != <NUM_LIT:0> : <EOL> break <EOL> if rtn != <NUM_LIT:0> : <EOL> break <EOL> instsite = os . path . join ( instdir , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> instsite = glob . glob ( instsite ) [ <NUM_LIT:0> ] <EOL> instproj = os . path . join ( instsite , PROJNAME ) <EOL> for testfile in dirtests ( TESTDIR ) : <EOL> with clean_import ( testfile , [ TESTDIR , instproj , instsite ] ) as testmod : <EOL> for test in modtests ( testmod ) : <EOL> print ( test ) <EOL> yield test <EOL> else : <EOL> cleanfs ( GENERATED_PATHS ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> nose . runmodule ( ) </s>
