serg/mtr-bash-completion enhancement#63
Open
grooverdan wants to merge 1 commit into
Open
Conversation
Handle out of tree builds Handle mysql-test/mtr completions where mtr isn't the current directory Order "suite" before "storage,plugins" _mtr_complete_testnames so that "rpl" picks up rpl suite rather than the tokudb rpl suite.
Member
Why do you need completion "where mtr isn't the current directory" ? |
Member
Author
This works on out of tree builds starting from the top level build directory. Out of tree builds can start from anywhere: |
vuvova
reviewed
Aug 8, 2021
| dir="$1" | ||
| [ -d "$dir"/t ] && dir="$dir"/t | ||
| testnames=$( cd "$dir" && echo *.test | sed -e 's/\.test\>//g' ) | ||
| } |
Member
There was a problem hiding this comment.
did you actually test it with a path that contains spaces? Or you've quoted paths just in case, without testing?
| _mtr_all_suites () | ||
| { | ||
| suites=$(find suite ../{storage,plugin}/*/mysql-test -type d -exec find '{}' -maxdepth 1 -name '*.test' -print -quit \; | sed -E 's@/(t/)?[^/]+$@@; s@^(suite|.*/mysql-test)/@@'|sort -u) | ||
| suites=$(find "$sourcetestdir"/suite "$sourcetestdir"/../{storage,plugin}/*/mysql-test -type d -exec find '{}' -maxdepth 1 -name '*.test' -print -quit \; | sed -E "s@^$sourcetestdir/(suite|\.\./storage|\.\./plugin)/@@"'; s@/mysql-test@@; s@(/t)?/[^/]+\.test$@@'|sort -u) |
Member
There was a problem hiding this comment.
this sed line looks suspicious. I'd expect something like
sed -E "s@^$sourcetestdir/(suite|\.\./(storage|plugin)/mysql-test)/@@"'; s@(/t)?/[^/]+\.test$@@'| { | ||
| [ -x ./mtr ] || return | ||
| [ -d main ] && main=main || main=. | ||
| sourcetestdir=$(sed -n -e "/^chdir/s/[^']*'\(.*\)');$/\1/p" < "$1") |
Member
There was a problem hiding this comment.
that works only for out-of-source mtr, right? what about "normal" in-source mysql-test-run.pl ?
77b6092 to
ed394b7
Compare
7c3b2ca to
cd5321a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Handle out of tree builds
Handle mysql-test/mtr completions where mtr isn't the current directory
Order "suite" before "storage,plugins" _mtr_complete_testnames so that
"rpl" picks up rpl suite rather than the tokudb rpl suite.