From: Louis Dionne Date: Tue, 31 Mar 2020 17:46:16 +0000 (-0400) Subject: [libc++] Make sure substitutions are expanded inside FILE_DEPENDENCIES X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=89fe36d08a9ad01f7f5a4a704a6f7382e26b32f9;p=platform%2Fupstream%2Fllvm.git [libc++] Make sure substitutions are expanded inside FILE_DEPENDENCIES --- diff --git a/libcxx/test/libcxx/selftest/test.file_dependencies.sh.cpp b/libcxx/test/libcxx/selftest/test.file_dependencies.sh.cpp index 1d85b60..5974393 100644 --- a/libcxx/test/libcxx/selftest/test.file_dependencies.sh.cpp +++ b/libcxx/test/libcxx/selftest/test.file_dependencies.sh.cpp @@ -8,5 +8,7 @@ //===----------------------------------------------------------------------===// // FILE_DEPENDENCIES: test.pass.cpp +// FILE_DEPENDENCIES: %s // RUN: echo %{file_dependencies} | grep 'test.pass.cpp' +// RUN: echo %{file_dependencies} | grep '%s' diff --git a/libcxx/utils/libcxx/test/format.py b/libcxx/utils/libcxx/test/format.py index 6dabc03..a9eb7d9 100644 --- a/libcxx/utils/libcxx/test/format.py +++ b/libcxx/utils/libcxx/test/format.py @@ -112,8 +112,6 @@ class LibcxxTestFormat(object): script = lit.TestRunner.parseIntegratedTestScript( test, additional_parsers=parsers, require_script=is_sh_test) - local_cwd = os.path.dirname(test.getSourcePath()) - data_files = [os.path.join(local_cwd, f) for f in test.file_dependencies] # Check if a result for the test was returned. If so return that # result. if isinstance(script, lit.Test.Result): @@ -128,7 +126,14 @@ class LibcxxTestFormat(object): tmpDir, tmpBase = lit.TestRunner.getTempPaths(test) substitutions = lit.TestRunner.getDefaultSubstitutions(test, tmpDir, tmpBase) + + # Apply substitutions in FILE_DEPENDENCIES markup + data_files = lit.TestRunner.applySubstitutions(test.file_dependencies, substitutions, + recursion_limit=10) + local_cwd = os.path.dirname(test.getSourcePath()) + data_files = [f if os.path.isabs(f) else os.path.join(local_cwd, f) for f in data_files] substitutions.append(('%{file_dependencies}', ' '.join(data_files))) + script = lit.TestRunner.applySubstitutions(script, substitutions, recursion_limit=10)