On Sun, Oct 3, 2010 at 20:00, Elijah Newren <newren@xxxxxxxxx> wrote: > Reviewed-by: Jonathan Nieder <jrnieder@xxxxxxxxx> > Signed-off-by: Elijah Newren <newren@xxxxxxxxx> > --- > Ât/README     Â|  13 +++++-------- > Ât/t0001-init.sh  |  28 ++++++++++++++-------------- > Ât/t7006-pager.sh Â|  10 +++++----- > Ât/t7502-commit.sh |  Â4 ++-- > Ât/test-lib.sh   |  11 +++++++++++ > Â5 files changed, 37 insertions(+), 29 deletions(-) > > diff --git a/t/README b/t/README > index ee4c0cf..e10c0ce 100644 > --- a/t/README > +++ b/t/README > @@ -259,14 +259,11 @@ Do: >    Âtest ... > >  ÂThat way all of the commands in your tests will succeed or fail. If > -  you must ignore the return value of something (e.g., the return > -  after unsetting a variable that was already unset is unportable) it's > -  best to indicate so explicitly with a semicolon: > - > -    unset HLAGH; > -    git merge hla && > -    git push gh && > -    test ... > +  you must ignore the return value of something, consider using a > +  helper function (e.g. use portable_unset instead of unset, in order > +  to avoid unportable return value for unsetting a variable that was > +  already unset), or prepending the command with test_might_fail or > +  test_must_fail. This should be: diff --git a/t/README b/t/README index a1eb7c8..dc4b9d1 100644 --- a/t/README +++ b/t/README @@ -259,11 +259,10 @@ Do: test ... That way all of the commands in your tests will succeed or fail. If - you must ignore the return value of something (e.g., the return - after unsetting a variable that was already unset is unportable) it's - best to indicate so explicitly with a semicolon: + you must ignore the return value of something it's best to indicate + so explicitly with a test_might_fail: - unset HLAGH; + test_might_fail some-command && git merge hla && git push gh && test ... @@ -522,6 +521,10 @@ library for your script to use. ... ' + - portable_unset <variable> + + ..... + Prerequisites ------------- Or something like that. I don't know if we came to an agreement on using test_might_fail for non-builtins, but the docs on do's & dont's should mention how to do that, and portable_unset should be documented in a new section in "Test harness library". -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html