Add a way to run a patchcheck test on the commits that are in one branch but not in another. This uses git cherry to find a list of commits to test each one with.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
···194194195195my $patchcheck_type;196196my $patchcheck_start;197197+my $patchcheck_cherry;197198my $patchcheck_end;198199199200# set when a test is something other that just building or install···321320322321 "PATCHCHECK_TYPE" => \$patchcheck_type,323322 "PATCHCHECK_START" => \$patchcheck_start,323323+ "PATCHCHECK_CHERRY" => \$patchcheck_cherry,324324 "PATCHCHECK_END" => \$patchcheck_end,325325);326326···3183318131843182 my $start = $patchcheck_start;3185318331843184+ my $cherry = $patchcheck_cherry;31853185+ if (!defined($cherry)) {31863186+ $cherry = 0;31873187+ }31883188+31863189 my $end = "HEAD";31873190 if (defined($patchcheck_end)) {31883191 $end = $patchcheck_end;31923192+ } elsif ($cherry) {31933193+ die "PATCHCHECK_END must be defined with PATCHCHECK_CHERRY\n";31893194 }3190319531913196 # Get the true sha1's since we can use things like HEAD~3···32063197 $type = "boot";32073198 }3208319932093209- open (IN, "git log --pretty=oneline $end|") or32103210- dodie "could not get git list";32003200+ if ($cherry) {32013201+ open (IN, "git cherry -v $start $end|") or32023202+ dodie "could not get git list";32033203+ } else {32043204+ open (IN, "git log --pretty=oneline $end|") or32053205+ dodie "could not get git list";32063206+ }3211320732123208 my @list;3213320932143210 while (<IN>) {32153211 chomp;32123212+ # git cherry adds a '+' we want to remove32133213+ s/^\+ //;32163214 $list[$#list+1] = $_;32173215 last if (/^$start/);32183216 }32193217 close(IN);3220321832213221- if ($list[$#list] !~ /^$start/) {32223222- fail "SHA1 $start not found";32193219+ if (!$cherry) {32203220+ if ($list[$#list] !~ /^$start/) {32213221+ fail "SHA1 $start not found";32223222+ }32233223+32243224+ # go backwards in the list32253225+ @list = reverse @list;32233226 }3224322732253225- # go backwards in the list32263226- @list = reverse @list;32283228+ doprint("Going to test the following commits:\n");32293229+ foreach my $l (@list) {32303230+ doprint "$l\n";32313231+ }3227323232283233 my $save_clean = $noclean;32293234 my %ignored_warnings;
+10
tools/testing/ktest/sample.conf
···906906#907907# PATCHCHECK_END is the last patch to check (default HEAD)908908#909909+# PATCHCHECK_CHERRY if set to non zero, then git cherry will be910910+# performed against PATCHCHECK_START and PATCHCHECK_END. That is911911+#912912+# git cherry ${PATCHCHECK_START} ${PATCHCHECK_END}913913+#914914+# Then the changes found will be tested.915915+#916916+# Note, PATCHCHECK_CHERRY requires PATCHCHECK_END to be defined.917917+# (default 0)918918+#909919# PATCHCHECK_TYPE is required and is the type of test to run:910920# build, boot, test.911921#