コード例 #1
0
def _runGenericCase(inputFile, executable, verbose=False):
    stdout = sys.stdout if verbose else open(os.devnull, 'w')
    
    rtl.validateFileOrExit(inputFile)
    rtl.validateExeOrExit(executable)
    
    casebase = os.path.sep.join(inputFile.split(os.path.sep)[-1].split('.')[:-1])
    caseparent = os.path.sep.join(inputFile.split(os.path.sep)[:-1])
    logFile = caseparent + os.path.sep + casebase + '.log'
    
    returnCode = _runCase(executable, inputFile, logFile, stdout)
    print("COMPLETE with code {}".format(returnCode), flush=True)    
    
    return returnCode
コード例 #2
0
args = parser.parse_args()

caseName = args.caseName[0]
executable = args.executable[0]
sourceDirectory = args.sourceDirectory[0]
buildDirectory = args.buildDirectory[0]
tolerance = args.tolerance[0]
systemName = args.systemName[0]
compilerId = args.compilerId[0]
plotError = args.plot
noExec = args.noExec
verbose = args.verbose

# validate inputs
rtl.validateExeOrExit(executable)
rtl.validateDirOrExit(sourceDirectory)
if not os.path.isdir(buildDirectory):
    os.makedirs(buildDirectory)

### Map the system and compiler configurations to a solution set
# Internal names -> Human readable names
systemName_map = {"darwin": "macos", "linux": "linux", "windows": "windows"}
compilerId_map = {"gnu": "gnu", "intel": "intel"}
# Build the target output directory name or choose the default
supportedBaselines = ["macos-gnu", "linux-intel", "linux-gnu", "windows-intel"]
targetSystem = systemName_map.get(systemName.lower(), "")
targetCompiler = compilerId_map.get(compilerId.lower(), "")
outputType = os.path.join(targetSystem + "-" + targetCompiler)
if outputType not in supportedBaselines:
    outputType = supportedBaselines[0]