diff --git a/libcxx/test/libcxx/selftest/dsl/dsl.sh.py b/libcxx/test/libcxx/selftest/dsl/dsl.sh.py --- a/libcxx/test/libcxx/selftest/dsl/dsl.sh.py +++ b/libcxx/test/libcxx/selftest/dsl/dsl.sh.py @@ -43,6 +43,17 @@ SOURCE_ROOT, EXEC_PATH, EXEC, CXX, FLAGS, COMPILE_FLAGS, LINK_FLAGS = args sys.argv[1:8] = [] +# Decode the substitutions that are base64 encoded. +def base64Decode(sub, encoded): + decoded = lit.util.to_string(base64.b64decode(encoded)) + print("Decoding substitution '{}' from base64: '{}'".format(sub, decoded)) + return decoded +CXX = base64Decode('%{cxx}', CXX) +FLAGS = base64Decode('%{flags}', FLAGS) +COMPILE_FLAGS = base64Decode('%{compile_flags}', COMPILE_FLAGS) +LINK_FLAGS = base64Decode('%{link_flags}', LINK_FLAGS) +EXEC = base64Decode('%{exec}', EXEC) + class SetupConfigs(unittest.TestCase): """ Base class for the tests below -- it creates a fake TestingConfig. @@ -69,13 +80,12 @@ 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)), - ('%{flags}', base64Decode(FLAGS)), - ('%{compile_flags}', base64Decode(COMPILE_FLAGS)), - ('%{link_flags}', base64Decode(LINK_FLAGS)), - ('%{exec}', base64Decode(EXEC)) + ('%{cxx}', CXX), + ('%{flags}', FLAGS), + ('%{compile_flags}', COMPILE_FLAGS), + ('%{link_flags}', LINK_FLAGS), + ('%{exec}', EXEC) ] def getSubstitution(self, substitution):