Skip to content

Commit 8dc8be0

Browse files
committed
[test] Pin deadcode.DeadStores in tests that assumed default
These tests analyse with the default profile and hard-code the resulting report counts and hashes, so dropping deadcode.DeadStores from default broke 41 of them across the analyzer and web suites. Enabling the checker explicitly reproduces the previous report sets exactly and makes the expectations independent of profile membership, which is evaluation-driven data that moves every release. multi_error.en1 already pins it the other way, with an explicit --disable. multi_error_suppress and multi_error_suppress_cstyle kept passing, but the only report their suppress comment covers is the dead store, so without the checker they assert nothing. Pinned for the same reason.
1 parent 060c324 commit 8dc8be0

15 files changed

Lines changed: 50 additions & 34 deletions

analyzer/tests/functional/analyze_and_parse/test_files/context_free_hash_clangsa.output

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
NORMAL#CodeChecker log --output $LOGFILE$ --build "make context_hash" --quiet
2-
NORMAL#CodeChecker analyze $LOGFILE$ --output $OUTPUT$ --report-hash=context-free --analyzers clangsa
2+
NORMAL#CodeChecker analyze $LOGFILE$ --output $OUTPUT$ --report-hash=context-free --analyzers clangsa --enable deadcode.DeadStores
33
NORMAL#CodeChecker parse $OUTPUT$ --print-steps
4-
CHECK#CodeChecker check --build "make context_hash" --output $OUTPUT$ --quiet --print-steps --report-hash=context-free --analyzers clangsa
4+
CHECK#CodeChecker check --build "make context_hash" --output $OUTPUT$ --quiet --print-steps --report-hash=context-free --analyzers clangsa --enable deadcode.DeadStores
55
--------------------------------------------------------------------------------
66
[] - Starting build...
77
[] - Using CodeChecker ld-logger.

analyzer/tests/functional/analyze_and_parse/test_files/context_free_hash_v2_clangsa.output

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
NORMAL#CodeChecker log --output $LOGFILE$ --build "make context_hash" --quiet
2-
NORMAL#CodeChecker analyze $LOGFILE$ --output $OUTPUT$ --report-hash=context-free-v2 --analyzers clangsa
2+
NORMAL#CodeChecker analyze $LOGFILE$ --output $OUTPUT$ --report-hash=context-free-v2 --analyzers clangsa --enable deadcode.DeadStores
33
NORMAL#CodeChecker parse $OUTPUT$ --print-steps
4-
CHECK#CodeChecker check --build "make context_hash" --output $OUTPUT$ --quiet --print-steps --report-hash=context-free-v2 --analyzers clangsa
4+
CHECK#CodeChecker check --build "make context_hash" --output $OUTPUT$ --quiet --print-steps --report-hash=context-free-v2 --analyzers clangsa --enable deadcode.DeadStores
55
--------------------------------------------------------------------------------
66
[] - Starting build...
77
[] - Using CodeChecker ld-logger.

analyzer/tests/functional/analyze_and_parse/test_files/context_sensitive_hash_clang.output

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
NORMAL#CodeChecker log --output $LOGFILE$ --build "make context_hash" --quiet
2-
NORMAL#CodeChecker analyze $LOGFILE$ --output $OUTPUT$ --analyzers clangsa
2+
NORMAL#CodeChecker analyze $LOGFILE$ --output $OUTPUT$ --analyzers clangsa --enable deadcode.DeadStores
33
NORMAL#CodeChecker parse $OUTPUT$ --print-steps
4-
CHECK#CodeChecker check --build "make context_hash" --output $OUTPUT$ --quiet --print-steps --analyzers clangsa
4+
CHECK#CodeChecker check --build "make context_hash" --output $OUTPUT$ --quiet --print-steps --analyzers clangsa --enable deadcode.DeadStores
55
--------------------------------------------------------------------------------
66
[] - Starting build...
77
[] - Using CodeChecker ld-logger.

analyzer/tests/functional/analyze_and_parse/test_files/diagnostic_message_hash_clangsa.output

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
NORMAL#CodeChecker log --output $LOGFILE$ --build "make context_hash" --quiet
2-
NORMAL#CodeChecker analyze $LOGFILE$ --output $OUTPUT$ --report-hash=diagnostic-message --analyzers clangsa
2+
NORMAL#CodeChecker analyze $LOGFILE$ --output $OUTPUT$ --report-hash=diagnostic-message --analyzers clangsa --enable deadcode.DeadStores
33
NORMAL#CodeChecker parse $OUTPUT$ --print-steps
4-
CHECK#CodeChecker check --build "make context_hash" --output $OUTPUT$ --quiet --print-steps --report-hash=diagnostic-message --analyzers clangsa
4+
CHECK#CodeChecker check --build "make context_hash" --output $OUTPUT$ --quiet --print-steps --report-hash=diagnostic-message --analyzers clangsa --enable deadcode.DeadStores
55
--------------------------------------------------------------------------------
66
[] - Starting build...
77
[] - Using CodeChecker ld-logger.

analyzer/tests/functional/analyze_and_parse/test_files/multi_error.output

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
NORMAL#CodeChecker log --output $LOGFILE$ --build "make multi_error" --quiet
2-
NORMAL#CodeChecker analyze $LOGFILE$ --output $OUTPUT$ --analyzers clangsa
2+
NORMAL#CodeChecker analyze $LOGFILE$ --output $OUTPUT$ --analyzers clangsa --enable deadcode.DeadStores
33
NORMAL#CodeChecker parse $OUTPUT$
4-
CHECK#CodeChecker check --build "make multi_error" --output $OUTPUT$ --quiet --analyzers clangsa
4+
CHECK#CodeChecker check --build "make multi_error" --output $OUTPUT$ --quiet --analyzers clangsa --enable deadcode.DeadStores
55
-----------------------------------------------
66
[] - Starting build...
77
[] - Using CodeChecker ld-logger.

analyzer/tests/functional/analyze_and_parse/test_files/multi_error.steps.output

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
NORMAL#CodeChecker log --output $LOGFILE$ --build "make multi_error" --quiet
2-
NORMAL#CodeChecker analyze $LOGFILE$ --output $OUTPUT$ --analyzers clangsa
2+
NORMAL#CodeChecker analyze $LOGFILE$ --output $OUTPUT$ --analyzers clangsa --enable deadcode.DeadStores
33
NORMAL#CodeChecker parse $OUTPUT$ --print-steps
4-
CHECK#CodeChecker check --build "make multi_error" --output $OUTPUT$ --quiet --analyzers clangsa --print-steps
4+
CHECK#CodeChecker check --build "make multi_error" --output $OUTPUT$ --quiet --analyzers clangsa --enable deadcode.DeadStores --print-steps
55
-------------------------------------------------------
66
[] - Starting build...
77
[] - Using CodeChecker ld-logger.

analyzer/tests/functional/analyze_and_parse/test_files/multi_error_suppress.output

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
NORMAL#CodeChecker log --output $LOGFILE$ --build "make multi_error_suppress" --quiet
2-
NORMAL#CodeChecker analyze $LOGFILE$ --output $OUTPUT$ --analyzers clangsa
2+
NORMAL#CodeChecker analyze $LOGFILE$ --output $OUTPUT$ --analyzers clangsa --enable deadcode.DeadStores
33
NORMAL#CodeChecker parse $OUTPUT$
4-
CHECK#CodeChecker check --build "make multi_error_suppress" --output $OUTPUT$ --quiet --analyzers clangsa
4+
CHECK#CodeChecker check --build "make multi_error_suppress" --output $OUTPUT$ --quiet --analyzers clangsa --enable deadcode.DeadStores
55
-----------------------------------------------
66
[] - Starting build...
77
[] - Using CodeChecker ld-logger.

analyzer/tests/functional/analyze_and_parse/test_files/multi_error_suppress_cstyle.output

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
NORMAL#CodeChecker log --output $LOGFILE$ --build "make multi_error_suppress_cstyle" --quiet
2-
NORMAL#CodeChecker analyze $LOGFILE$ --output $OUTPUT$ --analyzers clangsa
2+
NORMAL#CodeChecker analyze $LOGFILE$ --output $OUTPUT$ --analyzers clangsa --enable deadcode.DeadStores
33
NORMAL#CodeChecker parse $OUTPUT$
4-
CHECK#CodeChecker check --build "make multi_error_suppress_cstyle" --output $OUTPUT$ --quiet --analyzers clangsa
4+
CHECK#CodeChecker check --build "make multi_error_suppress_cstyle" --output $OUTPUT$ --quiet --analyzers clangsa --enable deadcode.DeadStores
55
-----------------------------------------------
66
[] - Starting build...
77
[] - Using CodeChecker ld-logger.

analyzer/tests/functional/analyze_and_parse/test_files/multi_error_suppress_typo.output

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
NORMAL#CodeChecker log --output $LOGFILE$ --build "make multi_error_suppress_typo" --quiet
2-
NORMAL#CodeChecker analyze $LOGFILE$ --output $OUTPUT$ --analyzers clangsa
2+
NORMAL#CodeChecker analyze $LOGFILE$ --output $OUTPUT$ --analyzers clangsa --enable deadcode.DeadStores
33
NORMAL#CodeChecker parse $OUTPUT$
4-
CHECK#CodeChecker check --build "make multi_error_suppress_typo" --output $OUTPUT$ --quiet --analyzers clangsa
4+
CHECK#CodeChecker check --build "make multi_error_suppress_typo" --output $OUTPUT$ --quiet --analyzers clangsa --enable deadcode.DeadStores
55
-----------------------------------------------
66
[] - Starting build...
77
[] - Using CodeChecker ld-logger.

web/tests/functional/detection_status/test_detection_status.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ def setup_class(self):
3838
'skip_list_file': None,
3939
'check_env': env.test_env(TEST_WORKSPACE),
4040
'workspace': TEST_WORKSPACE,
41-
'checkers': ['-d', 'clang-diagnostic'],
41+
'checkers': ['-d', 'clang-diagnostic',
42+
'-e', 'deadcode.DeadStores'],
4243
'reportdir': os.path.join(TEST_WORKSPACE, 'reports'),
4344
'test_project': 'hello',
4445
'analyzers': ['clangsa', 'clang-tidy']
@@ -398,7 +399,10 @@ def test_detection_status_off(self):
398399
if r.detectionStatus == DetectionStatus.UNAVAILABLE]
399400
self.assertEqual(len(unavail_reports), 0)
400401

401-
cfg['checkers'] = ['-d', 'core.DivideZero']
402+
# Keep deadcode.DeadStores enabled, so core.DivideZero is the only
403+
# checker that goes from on to off between the two analyses.
404+
cfg['checkers'] = ['-d', 'core.DivideZero',
405+
'-e', 'deadcode.DeadStores']
402406

403407
self._create_source_file(1)
404408
self._check_source_file(cfg)

0 commit comments

Comments
 (0)