end = value.find_first_of(", ", start);
std::string token =
util::strip_whitespace(value.substr(start, end - start));
- if (token == "file_stat_matches") {
+ if (token == "clang_index_store") {
+ result.enable(core::Sloppy::clang_index_store);
+ } else if (token == "file_stat_matches") {
result.enable(core::Sloppy::file_stat_matches);
} else if (token == "file_stat_matches_ctime") {
result.enable(core::Sloppy::file_stat_matches_ctime);
result.enable(core::Sloppy::include_file_ctime);
} else if (token == "include_file_mtime") {
result.enable(core::Sloppy::include_file_mtime);
- } else if (token == "system_headers" || token == "no_system_headers") {
- result.enable(core::Sloppy::system_headers);
- } else if (token == "pch_defines") {
- result.enable(core::Sloppy::pch_defines);
- } else if (token == "time_macros") {
- result.enable(core::Sloppy::time_macros);
- } else if (token == "clang_index_store") {
- result.enable(core::Sloppy::clang_index_store);
+ } else if (token == "ivfsoverlay") {
+ result.enable(core::Sloppy::ivfsoverlay);
} else if (token == "locale") {
result.enable(core::Sloppy::locale);
} else if (token == "modules") {
result.enable(core::Sloppy::modules);
- } else if (token == "ivfsoverlay") {
- result.enable(core::Sloppy::ivfsoverlay);
+ } else if (token == "pch_defines") {
+ result.enable(core::Sloppy::pch_defines);
+ } else if (token == "system_headers" || token == "no_system_headers") {
+ result.enable(core::Sloppy::system_headers);
+ } else if (token == "time_macros") {
+ result.enable(core::Sloppy::time_macros);
} // else: ignore unknown value for forward compatibility
start = value.find_first_not_of(", ", end);
}
format_sloppiness(core::Sloppiness sloppiness)
{
std::string result;
- if (sloppiness.is_enabled(core::Sloppy::include_file_mtime)) {
- result += "include_file_mtime, ";
- }
- if (sloppiness.is_enabled(core::Sloppy::include_file_ctime)) {
- result += "include_file_ctime, ";
- }
- if (sloppiness.is_enabled(core::Sloppy::time_macros)) {
- result += "time_macros, ";
- }
- if (sloppiness.is_enabled(core::Sloppy::pch_defines)) {
- result += "pch_defines, ";
+ if (sloppiness.is_enabled(core::Sloppy::clang_index_store)) {
+ result += "clang_index_store, ";
}
if (sloppiness.is_enabled(core::Sloppy::file_stat_matches)) {
result += "file_stat_matches, ";
if (sloppiness.is_enabled(core::Sloppy::file_stat_matches_ctime)) {
result += "file_stat_matches_ctime, ";
}
- if (sloppiness.is_enabled(core::Sloppy::system_headers)) {
- result += "system_headers, ";
+ if (sloppiness.is_enabled(core::Sloppy::include_file_ctime)) {
+ result += "include_file_ctime, ";
}
- if (sloppiness.is_enabled(core::Sloppy::clang_index_store)) {
- result += "clang_index_store, ";
+ if (sloppiness.is_enabled(core::Sloppy::include_file_mtime)) {
+ result += "include_file_mtime, ";
+ }
+ if (sloppiness.is_enabled(core::Sloppy::ivfsoverlay)) {
+ result += "ivfsoverlay, ";
}
if (sloppiness.is_enabled(core::Sloppy::locale)) {
result += "locale, ";
if (sloppiness.is_enabled(core::Sloppy::modules)) {
result += "modules, ";
}
- if (sloppiness.is_enabled(core::Sloppy::ivfsoverlay)) {
- result += "ivfsoverlay, ";
+ if (sloppiness.is_enabled(core::Sloppy::pch_defines)) {
+ result += "pch_defines, ";
+ }
+ if (sloppiness.is_enabled(core::Sloppy::system_headers)) {
+ result += "system_headers, ";
+ }
+ if (sloppiness.is_enabled(core::Sloppy::time_macros)) {
+ result += "time_macros, ";
}
if (!result.empty()) {
// Strip last ", ".
-// Copyright (C) 2011-2021 Joel Rosdahl and other contributors
+// Copyright (C) 2011-2022 Joel Rosdahl and other contributors
//
// See doc/AUTHORS.adoc for a complete list of contributors.
//
CHECK(config.reshare());
CHECK_FALSE(config.run_second_cpp());
CHECK(config.sloppiness().to_bitmask()
- == (static_cast<uint32_t>(core::Sloppy::include_file_mtime)
- | static_cast<uint32_t>(core::Sloppy::include_file_ctime)
- | static_cast<uint32_t>(core::Sloppy::time_macros)
+ == (static_cast<uint32_t>(core::Sloppy::clang_index_store)
| static_cast<uint32_t>(core::Sloppy::file_stat_matches)
| static_cast<uint32_t>(core::Sloppy::file_stat_matches_ctime)
- | static_cast<uint32_t>(core::Sloppy::system_headers)
+ | static_cast<uint32_t>(core::Sloppy::include_file_ctime)
+ | static_cast<uint32_t>(core::Sloppy::include_file_mtime)
+ | static_cast<uint32_t>(core::Sloppy::ivfsoverlay)
| static_cast<uint32_t>(core::Sloppy::pch_defines)
- | static_cast<uint32_t>(core::Sloppy::clang_index_store)
- | static_cast<uint32_t>(core::Sloppy::ivfsoverlay)));
+ | static_cast<uint32_t>(core::Sloppy::system_headers)
+ | static_cast<uint32_t>(core::Sloppy::time_macros)));
CHECK_FALSE(config.stats());
CHECK(config.temporary_dir() == FMT("{}_foo", user));
CHECK(config.umask() == 0777u);
"(test.conf) reshare = true",
"(test.conf) run_second_cpp = false",
"(test.conf) secondary_storage = ss",
- "(test.conf) sloppiness = include_file_mtime, include_file_ctime,"
- " time_macros, pch_defines, file_stat_matches, file_stat_matches_ctime,"
- " system_headers, clang_index_store, ivfsoverlay",
+ "(test.conf) sloppiness = clang_index_store, file_stat_matches,"
+ " file_stat_matches_ctime, include_file_ctime, include_file_mtime,"
+ " ivfsoverlay, pch_defines, system_headers, time_macros",
"(test.conf) stats = false",
"(test.conf) stats_log = sl",
"(test.conf) temporary_dir = td",