llvm-project/lldb/test/Shell/Settings/TestDefaultModuleCachePath.test
Raphael Isemann 208e3f5d9b [lldb] Fix that symbols.clang-modules-cache-path is never initialized
LLDB is supposed to ask the Clang Driver what the default module cache path is
and then use that value as the default for the
`symbols.clang-modules-cache-path` setting. However, we use the property type
`String` to change `symbols.clang-modules-cache-path` even though the type of
that setting is `FileSpec`, so the setter will simply do nothing and return
`false`. We also don't check the return value of the setter, so this whole code
ends up not doing anything at all.

This changes the setter to use the correct property type and adds an assert that
we actually successfully set the default path. Also adds a test that checks that
the default value for this setting is never unset/empty path as this would
effectively disable the import-std-module feature from working by default.

Reviewed By: JDevlieghere, shafik

Differential Revision: https://reviews.llvm.org/D92772
2020-12-10 13:37:40 +01:00

10 lines
455 B
Plaintext

# RUN: %lldb-noinit -x -s %s | FileCheck %s
settings show symbols.clang-modules-cache-path
q
# This test checks that we get *any* clang modules cache path by default. The
# actual path depends on the operating system.
# CHECK: symbols.clang-modules-cache-path (file) = "
# Clang treats an empty path in the same way as 'no path', so explicitly check
# that we never have an empty path by default.
# CHECK-NOT: symbols.clang-modules-cache-path (file) = ""