Skip to content

Commit 8cf949f

Browse files
liguriolocker
authored andcommitted
Detect adding and updating .result files
Part of #23 Related to tarantool/tarantool#5000
1 parent 7bdef04 commit 8cf949f

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

Diff for: checkpatch.pl

+9
Original file line numberDiff line numberDiff line change
@@ -2140,6 +2140,7 @@ sub process {
21402140

21412141
my %commit_log_tags = ();
21422142
my $has_changelog = 0;
2143+
my $warned_about_test_result_file = 0;
21432144
my $has_doc = 0;
21442145
my $has_test = 0;
21452146
my $is_test = 0;
@@ -2823,6 +2824,14 @@ sub process {
28232824
"please, use spaces instead of tabs\n" . $herevet);
28242825
}
28252826

2827+
if (!$warned_about_test_result_file &&
2828+
$realfile =~ /^test\/.*\.result$/ &&
2829+
$line =~ /^\+/) {
2830+
$warned_about_test_result_file = 1;
2831+
ERROR("TEST_RESULT_FILE",
2832+
"Please avoid tests with .result files\n");
2833+
}
2834+
28262835
# check we are in a valid C source file if not then ignore this hunk
28272836
next if ($realfile !~ /\.(h|c|cc)$/);
28282837

Diff for: doc/checkpatch.rst

+5
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,11 @@ Others
774774
**PRINTF_0XDECIMAL**
775775
Prefixing 0x with decimal output is defective and should be corrected.
776776

777+
**TEST_RESULT_FILE**
778+
For regression tests, there are .result files. Tests with .result files
779+
should be avoided. It is recommended to use Luatest or TAP for Tarantool
780+
regression tests.
781+
777782
**TYPO_SPELLING**
778783
Some words may have been misspelled. Consider reviewing them.
779784

0 commit comments

Comments
 (0)