File tree 2 files changed +17
-0
lines changed
2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -2140,6 +2140,8 @@ sub process {
2140
2140
2141
2141
my %commit_log_tags = ();
2142
2142
my $has_changelog = 0;
2143
+ my $has_test_result_file = 0;
2144
+ my $warned_about_result_file = 0;
2143
2145
my $has_doc = 0;
2144
2146
my $has_test = 0;
2145
2147
my $is_test = 0;
@@ -2731,6 +2733,9 @@ sub process {
2731
2733
if ($realfile =~ / ^(?:static-build\/ )?test\/ .*\/ / ) {
2732
2734
$has_test = 1;
2733
2735
}
2736
+ if ($realfile =~ / ^test\/ .*\. result$ / ) {
2737
+ $has_test_result_file = 1;
2738
+ }
2734
2739
2735
2740
# check for repeated words separated by a single space
2736
2741
# avoid false positive from list command eg, '-rw-r--r-- 1 root root'
@@ -2823,6 +2828,14 @@ sub process {
2823
2828
" please, use spaces instead of tabs\n " . $herevet );
2824
2829
}
2825
2830
2831
+ if (!$warned_about_result_file &&
2832
+ $has_test_result_file &&
2833
+ $line =~ / ^\+ / ) {
2834
+ $warned_about_result_file = 1;
2835
+ ERROR(" TEST_DIFF_FILE" ,
2836
+ " Please avoid tests with .result files\n " );
2837
+ }
2838
+
2826
2839
# check we are in a valid C source file if not then ignore this hunk
2827
2840
next if ($realfile !~ / \. (h|c|cc)$ / );
2828
2841
Original file line number Diff line number Diff line change @@ -742,6 +742,10 @@ Others
742
742
For DOS-formatted patches, there are extra ^M symbols at the end of
743
743
the line. These should be removed.
744
744
745
+ **TEST_DIFF_FILE **
746
+ For regression tests, there are .result files. Tests with .result files
747
+ should be avoided.
748
+
745
749
**MEMSET **
746
750
The memset use appears to be incorrect. This may be caused due to
747
751
badly ordered parameters. Please recheck the usage.
You can’t perform that action at this time.
0 commit comments