-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
serg/mtr-bash-completion enhancement #63
base: master
Are you sure you want to change the base?
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.
Why do you need completion "where mtr isn't the current directory" ? |
This works on out of tree builds starting from the top level build directory. Out of tree builds can start from anywhere:
|
testnames=$( cd $dir && echo *.test | sed -e 's/\.test\>//g' ) | ||
dir="$1" | ||
[ -d "$dir"/t ] && dir="$dir"/t | ||
testnames=$( cd "$dir" && echo *.test | sed -e 's/\.test\>//g' ) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this sed
line looks suspicious. I'd expect something like
sed -E "s@^$sourcetestdir/(suite|\.\./(storage|plugin)/mysql-test)/@@"'; s@(/t)?/[^/]+\.test$@@'
} | ||
_mtr_complete() | ||
{ | ||
[ -x ./mtr ] || return | ||
[ -d main ] && main=main || main=. | ||
sourcetestdir=$(sed -n -e "/^chdir/s/[^']*'\(.*\)');$/\1/p" < "$1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
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.