diff --git a/libcxx/utils/libcxx/test/dsl.py b/libcxx/utils/libcxx/test/dsl.py index 5f88bd7d40dcf..523c5d93f71c5 100644 --- a/libcxx/utils/libcxx/test/dsl.py +++ b/libcxx/utils/libcxx/test/dsl.py @@ -34,8 +34,10 @@ def __init__(self): self.maxIndividualTestTime = 0 litConfig = FakeLitConfig() _, tmpBase = lit.TestRunner.getTempPaths(test) - execdir = os.path.dirname(test.getExecPath()) - res = lit.TestRunner.executeScriptInternal(test, litConfig, tmpBase, commands, execdir) + execDir = os.path.dirname(test.getExecPath()) + if not os.path.exists(execDir): + os.makedirs(execDir) + res = lit.TestRunner.executeScriptInternal(test, litConfig, tmpBase, commands, execDir) if isinstance(res, lit.Test.Result): res = ('', '', 127, None) return res @@ -110,7 +112,7 @@ def compilerMacros(config, flags=''): commands = libcxx.test.newformat.parseScript(test, preamble=commands, fileDependencies=[]) unparsedOutput, err, exitCode, timeoutInfo = _executeScriptInternal(test, commands) parsedMacros = dict() - defines = (l.strip() for l in unparsedOutput.split('\n') if l.startswith('#define')) + defines = (l.strip() for l in unparsedOutput.split('\n') if l.startswith('#define ')) for line in defines: line = line[len('#define '):] macro, _, value = line.partition(' ')