[PATCH] test:Improve test behaviors when --root is used

Pieter Praet pieter at praet.org
Mon Jun 27 23:36:20 PDT 2011


On Mon, 27 Jun 2011 16:50:47 -0400, Austin Clements <amdragon at mit.edu> wrote:
> This looks great (modulo one bug, below).  I've wanted to run the
> tests on tmpfs before, but was too lazy to actually fix the tests.
> 
> Given how easy it is to accidentally use "..", I wonder if there's a
> way to force people to use $TEST_DIRECTORY?

Something like this? Mind you, my grep-fu is non-existent.

#+BEGIN_SRC sh
  dotdot=$(rgrep -nH -e "\.\.\/" . | grep -v -e "\$TEST_DIRECTORY")
  if [ -n "${dotdot}" ] ; then
    echo -e "Don't dot dot me! Use \$TEST_DIRECTORY as prefix instead.\n\nOffending lines:\n ${dotdot}"
  fi
#+END_SRC

> On Mon, Jun 27, 2011 at 12:09 PM, Mark Anderson <ma.skies at gmail.com> wrote:
> > --- a/test/symbol-hiding
> > +++ b/test/symbol-hiding
> > @@ -12,13 +12,13 @@ test_description='exception symbol hiding'
> >  . ./test-lib.sh
> >
> >  run_test(){
> > -    result=$(LD_LIBRARY_PATH=../../lib ./symbol-test 2>&1)
> > +    result=$(LD_LIBRARY_PATH=$TEST_DIRECTORY/../../lib ./symbol-test 2>&1)
> 
> Did you mean $TEST_DIRECTORY/../lib?
> _______________________________________________
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

Peace

-- 
Pieter


More information about the notmuch mailing list