Skip to content

Commit

Permalink
Detect adding and updating .result files
Browse files Browse the repository at this point in the history
Part of #23
Related to tarantool/tarantool#5000
  • Loading branch information
ligurio authored and locker committed Sep 2, 2022
1 parent 7bdef04 commit 8cf949f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2140,6 +2140,7 @@ sub process {

my %commit_log_tags = ();
my $has_changelog = 0;
my $warned_about_test_result_file = 0;
my $has_doc = 0;
my $has_test = 0;
my $is_test = 0;
Expand Down Expand Up @@ -2823,6 +2824,14 @@ sub process {
"please, use spaces instead of tabs\n" . $herevet);
}

if (!$warned_about_test_result_file &&
$realfile =~ /^test\/.*\.result$/ &&
$line =~ /^\+/) {
$warned_about_test_result_file = 1;
ERROR("TEST_RESULT_FILE",
"Please avoid tests with .result files\n");
}

# check we are in a valid C source file if not then ignore this hunk
next if ($realfile !~ /\.(h|c|cc)$/);

Expand Down
5 changes: 5 additions & 0 deletions doc/checkpatch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,11 @@ Others
**PRINTF_0XDECIMAL**
Prefixing 0x with decimal output is defective and should be corrected.

**TEST_RESULT_FILE**
For regression tests, there are .result files. Tests with .result files
should be avoided. It is recommended to use Luatest or TAP for Tarantool
regression tests.

**TYPO_SPELLING**
Some words may have been misspelled. Consider reviewing them.

Expand Down

0 comments on commit 8cf949f

Please sign in to comment.