From c8d0aaa7ffd535ae6c90f5603f46370d652c4c46 Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Mon, 15 Jun 2020 19:15:14 -0400 Subject: [PATCH] [libc++] Automatically create the %T directory inside config tests --- libcxx/utils/libcxx/test/dsl.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libcxx/utils/libcxx/test/dsl.py b/libcxx/utils/libcxx/test/dsl.py index f3257353f9ac..9f5152d35fe4 100644 --- a/libcxx/utils/libcxx/test/dsl.py +++ b/libcxx/utils/libcxx/test/dsl.py @@ -44,8 +44,9 @@ def _executeScriptInternal(test, commands): params={}) _, tmpBase = libcxx.test.newformat._getTempPaths(test) execDir = os.path.dirname(test.getExecPath()) - if not os.path.exists(execDir): - os.makedirs(execDir) + for d in (execDir, os.path.dirname(tmpBase)): + if not os.path.exists(d): + os.makedirs(d) res = lit.TestRunner.executeScriptInternal(test, litConfig, tmpBase, parsedCommands, execDir) if isinstance(res, lit.Test.Result): res = ('', '', 127, None) @@ -76,7 +77,6 @@ def sourceBuilds(config, source): with open(test.getSourcePath(), 'w') as sourceFile: sourceFile.write(source) out, err, exitCode, timeoutInfo = _executeScriptInternal(test, [ - "mkdir -p %T", "%{cxx} %s %{flags} %{compile_flags} %{link_flags} -o %t.exe" ]) _executeScriptInternal(test, ['rm %t.exe']) @@ -96,7 +96,6 @@ def programOutput(config, program, args=[]): source.write(program) try: _, _, exitCode, _ = _executeScriptInternal(test, [ - "mkdir -p %T", "%{cxx} %s %{flags} %{compile_flags} %{link_flags} -o %t.exe", ]) if exitCode != 0: