[libcxx-commits] [libcxx] d1217be - [libc++] NFC: Simplify how we run config tests
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Nov 3 11:59:52 PST 2020
Author: Louis Dionne
Date: 2020-11-03T14:59:41-05:00
New Revision: d1217be43f96db38441b3bffa288dfac381578ef
URL: https://github.com/llvm/llvm-project/commit/d1217be43f96db38441b3bffa288dfac381578ef
DIFF: https://github.com/llvm/llvm-project/commit/d1217be43f96db38441b3bffa288dfac381578ef.diff
LOG: [libc++] NFC: Simplify how we run config tests
We can use the convenience substitutions provided by the format instead
of bootstrapping our own.
Added:
Modified:
libcxx/test/libcxx/selftest/dsl/dsl.sh.py
libcxx/utils/libcxx/test/dsl.py
Removed:
################################################################################
diff --git a/libcxx/test/libcxx/selftest/dsl/dsl.sh.py b/libcxx/test/libcxx/selftest/dsl/dsl.sh.py
index 2a51828c6163..0393190df53c 100644
--- a/libcxx/test/libcxx/selftest/dsl/dsl.sh.py
+++ b/libcxx/test/libcxx/selftest/dsl/dsl.sh.py
@@ -66,6 +66,7 @@ def setUp(self):
self.config = lit.TestingConfig.TestingConfig.fromdefaults(self.litConfig)
self.config.test_source_root = SOURCE_ROOT
self.config.test_exec_root = EXEC_PATH
+ self.config.recursiveExpansionLimit = 10
base64Decode = lambda s: lit.util.to_string(base64.b64decode(s))
self.config.substitutions = [
('%{cxx}', base64Decode(CXX)),
diff --git a/libcxx/utils/libcxx/test/dsl.py b/libcxx/utils/libcxx/test/dsl.py
index 5171c7569bb9..93722a14685a 100644
--- a/libcxx/utils/libcxx/test/dsl.py
+++ b/libcxx/utils/libcxx/test/dsl.py
@@ -94,9 +94,7 @@ def sourceBuilds(config, source):
with _makeConfigTest(config) as test:
with open(test.getSourcePath(), 'w') as sourceFile:
sourceFile.write(source)
- out, err, exitCode, timeoutInfo = _executeScriptInternal(test, [
- "%{cxx} %s %{flags} %{compile_flags} %{link_flags} -o %t.exe"
- ])
+ out, err, exitCode, timeoutInfo = _executeScriptInternal(test, ['%{build}'])
_executeScriptInternal(test, ['rm %t.exe'])
return exitCode == 0
@@ -116,15 +114,11 @@ def programOutput(config, program, args=None, testPrefix=''):
with open(test.getSourcePath(), 'w') as source:
source.write(program)
try:
- _, _, exitCode, _ = _executeScriptInternal(test, [
- "%{cxx} %s %{flags} %{compile_flags} %{link_flags} -o %t.exe",
- ])
+ _, _, exitCode, _ = _executeScriptInternal(test, ['%{build}'])
if exitCode != 0:
return None
- out, err, exitCode, _ = _executeScriptInternal(test, [
- "%{{exec}} %t.exe {}".format(' '.join(args))
- ])
+ out, err, exitCode, _ = _executeScriptInternal(test, ["%{{run}} {}".format(' '.join(args))])
if exitCode != 0:
return None
More information about the libcxx-commits
mailing list