Skip to content

Commit 7784ccd

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.
1 parent 060c324 commit 7784ccd

13 files changed

Lines changed: 42 additions & 29 deletions

File tree

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_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: 2 additions & 1 deletion
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']

web/tests/functional/diff_local/test_diff_local.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ def setup_class(self):
8686
'reports')
8787
codechecker_cfg['checkers'] = ['-e', 'core.CallAndMessage',
8888
'-d', 'core.NullDereference',
89-
'-d', 'clang-diagnostic']
89+
'-d', 'clang-diagnostic',
90+
'-e', 'deadcode.DeadStores']
9091

9192
ret = codechecker.log_and_analyze(codechecker_cfg, test_proj_path_base)
9293
if ret:
@@ -97,7 +98,8 @@ def setup_class(self):
9798
'reports')
9899
codechecker_cfg['checkers'] = ['-d', 'core.CallAndMessage',
99100
'-e', 'core.NullDereference',
100-
'-d', 'clang-diagnostic']
101+
'-d', 'clang-diagnostic',
102+
'-e', 'deadcode.DeadStores']
101103

102104
ret = codechecker.log_and_analyze(codechecker_cfg, test_proj_path_new)
103105
if ret:

web/tests/functional/diff_local_remote/test_diff_local_remote.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ def setup_class(self):
101101
codechecker_cfg['reportdir'] = os.path.join(test_proj_path_local,
102102
'reports')
103103
codechecker_cfg['checkers'] = ['-e', 'core.CallAndMessage',
104-
'-d', 'core.NullDereference']
104+
'-d', 'core.NullDereference',
105+
'-e', 'deadcode.DeadStores']
105106

106107
ret = codechecker.log_and_analyze(codechecker_cfg,
107108
test_proj_path_local)
@@ -124,7 +125,8 @@ def setup_class(self):
124125
codechecker_cfg['reportdir'] = os.path.join(test_proj_path_remote,
125126
'reports')
126127
codechecker_cfg['checkers'] = ['-d', 'core.CallAndMessage',
127-
'-e', 'core.NullDereference']
128+
'-e', 'core.NullDereference',
129+
'-e', 'deadcode.DeadStores']
128130

129131
ret = codechecker.log_and_analyze(codechecker_cfg,
130132
test_proj_path_remote)

0 commit comments

Comments
 (0)