Skip to content

Commit ac402ff

Browse files
committed
cmake executable path in test, and clang-tidy fixes
1 parent 88854d4 commit ac402ff

1 file changed

Lines changed: 14 additions & 12 deletions

File tree

test/testsarif.cpp

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,8 @@ int main() {
282282
"./cppcheck",
283283
"../bin/cppcheck",
284284
"../../bin/cppcheck",
285+
"./cmake.output/bin/cppcheck", // CMake build from project root
286+
"../cmake.output/bin/cppcheck", // CMake build from test directory
285287
"cppcheck" // fallback to PATH
286288
};
287289

@@ -516,26 +518,27 @@ int main() {
516518

517519
ASSERT(!rules.empty());
518520

519-
// Check rule structure
521+
// Verify that ALL rule descriptions are empty so GitHub uses instance-specific messages
520522
for (const auto& rule : rules)
521523
{
522524
const picojson::object& r = rule.get<picojson::object>();
525+
const std::string name = r.at("name").get<std::string>();
523526

524-
ASSERT(r.find("id") != r.end());
525-
ASSERT(r.find("name") != r.end());
527+
// Verify we have proper rule structure
526528
ASSERT(r.find("shortDescription") != r.end());
527529
ASSERT(r.find("fullDescription") != r.end());
528-
ASSERT(r.find("help") != r.end());
529-
ASSERT(r.find("defaultConfiguration") != r.end());
530-
531-
const std::string name = r.at("name").get<std::string>();
532-
533-
// Check that generic descriptions don't contain empty quotes
534-
ASSERT_EQUALS(std::string::npos, name.find("''"));
535530

536531
const picojson::object& shortDesc = r.at("shortDescription").get<picojson::object>();
537532
const std::string shortText = shortDesc.at("text").get<std::string>();
538-
ASSERT_EQUALS(std::string::npos, shortText.find("''"));
533+
534+
const picojson::object& fullDesc = r.at("fullDescription").get<picojson::object>();
535+
const std::string fullText = fullDesc.at("text").get<std::string>();
536+
537+
// The key test: ALL rule descriptions should be empty
538+
// This allows GitHub to automatically use instance-specific messages
539+
ASSERT_EQUALS("", name);
540+
ASSERT_EQUALS("", shortText);
541+
ASSERT_EQUALS("", fullText);
539542
}
540543
}
541544

@@ -865,7 +868,6 @@ int main() {
865868
{
866869
hasCweTag = true;
867870
foundAnyCweTag = true;
868-
std::string cweTag = tagStr;
869871

870872
// Validate CWE tag format: external/cwe/cwe-<number>
871873
ASSERT_EQUALS(0, tagStr.find("external/cwe/cwe-"));

0 commit comments

Comments
 (0)