aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Baylis <charles.baylis@linaro.org>2017-07-06 11:25:53 +0000
committerCharles Baylis <charles.baylis@linaro.org>2017-07-06 11:39:52 +0000
commita1d7b1df75381bb21db69b7ffc502b8683844a7d (patch)
tree7b43d908444f3dc683b4edffe2bf72b8bc2644ca
parent33d63b110ae6f59eb987e2eff50186344da908e3 (diff)
test-checkout.sh: Improve commit message tag detection.
Scan the whole history between the selected previous Abe version and the version under test. This ensures that the tags are detected if the HEAD of the Abe branch is not the one where the manifest format is changed (eg if testing with --prev-abe-revision origin/tested) Also, don't require the tags to be placed at the start of a line in the commit message. Change-Id: Iab46c9fdbf4a0f6d1f3967f88a03bca36a6d029b
-rwxr-xr-xtest-checkout.sh28
1 files changed, 18 insertions, 10 deletions
diff --git a/test-checkout.sh b/test-checkout.sh
index fb6876e..7ac901b 100755
--- a/test-checkout.sh
+++ b/test-checkout.sh
@@ -358,6 +358,22 @@ do_test()
fi
}
+scan_for_skip_tag()
+{
+ local start=$1
+ local end=$2
+ local regexp=$3
+ local i
+
+ for i in $(git -C "$ABE_PATH" rev-list "$start..$end"); do
+ if git -C "$ABE_PATH" show --format=%B --no-patch "$i" | grep -q "$regexp"; then
+ echo true
+ return
+ fi
+ done
+ echo false
+}
+
NUM_FAIL=0
NUM_PASS=0
NUM_TESTS=0
@@ -383,16 +399,8 @@ mkdir -p "$PREV_TEST_SNAPSHOTS"
# do tests for comparison of manifests with previous version.
for configs in gcc4_9 gcc5 gcc6 gcc7; do
CONFDIR=$ABE_PATH/config/$configs
- if git -C "$ABE_PATH" show --format=%B --no-patch | grep -q "^\[ABE_PREV_MANIFEST_\(${configs^^}\|ALL\)\]"; then
- SKIP_PREV_MANI=true
- else
- SKIP_PREV_MANI=false
- fi
- if git -C "$ABE_PATH" show --format=%B --no-patch | grep -q "^\[ABE_PREV_CMD_\(${configs^^}\|ALL\)\]"; then
- SKIP_PREV_CMD=true
- else
- SKIP_PREV_CMD=false
- fi
+ SKIP_PREV_MANI=$(scan_for_skip_tag "$PREV_ABE_REVISION" HEAD "\[ABE_PREV_MANIFEST_\(${configs^^}\|ALL\)\]")
+ SKIP_PREV_CMD=$(scan_for_skip_tag "$PREV_ABE_REVISION" HEAD "\[ABE_PREV_CMD_\(${configs^^}\|ALL\)\]")
do_test previous_abe_manifest_$configs test_previous_abe_manifest "$SKIP_PREV_MANI" --extraconfigdir "$CONFDIR" --snapshots "$PREV_TEST_SNAPSHOTS"
do_test previous_abe_cmd_line_$configs test_previous_abe_cmd_line "$SKIP_PREV_CMD" --extraconfigdir "$CONFDIR" --snapshots "$PREV_TEST_SNAPSHOTS"
done