From: Stefan Sperling Subject: Re: [rfc] regress: add line number to failure output To: Omar Polo Cc: Mark Jamsek , Christian Weisgerber , gameoftrees@openbsd.org Date: Thu, 16 Feb 2023 12:15:35 +0100 On Thu, Feb 16, 2023 at 11:12:55AM +0100, Omar Polo wrote: > On 2023/02/16 10:15:51 +0100, Stefan Sperling wrote: > > I also often comment out tests in the long list at the bottom of > > the file in order to run a single test case. I wish there was a > > better solution but so far as it has not bothered me too much. > > same thing. something like this should do it. Oh yes, please! > % ./cleanup.sh > test_cleanup_unreferenced_loose_objects ok > test_cleanup_redundant_loose_objects ok > test_cleanup_precious_objects ok > test_cleanup_missing_pack_file ok > > % ./cleanup.sh test_cleanup_missing_pack_file test_cleanup_precious_objects > test_cleanup_precious_objects ok > test_cleanup_missing_pack_file ok > > > diff /home/op/w/gotd > commit - 0e0165f13a58bad062d9761626c1b3ba82df671c > path + /home/op/w/gotd > blob - 96339d43615d5d8fad7e4a300f64c7db2dc9cea8 > file + regress/cmdline/common.sh > --- regress/cmdline/common.sh > +++ regress/cmdline/common.sh > @@ -14,6 +14,8 @@ export GIT_AUTHOR_NAME="Flan Hacker" > # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF > # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. > > +regress_run_only="" > + > export GIT_AUTHOR_NAME="Flan Hacker" > export GIT_AUTHOR_EMAIL="flan_hacker@openbsd.org" > export GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME" > @@ -241,11 +243,21 @@ test_parseargs() > ;; > esac > done > + shift $(($OPTIND - 1)) > + regress_run_only="$@" > } >&2 > > run_test() > { > testfunc="$1" > + > + if [ -n "$regress_run_only" ]; then > + case "$regress_run_only" in > + *$testfunc*) ;; > + *) return ;; > + esac > + fi > + > if [ -z "$GOT_TEST_QUIET" ]; then > echo -n "$testfunc " > fi > >