automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Add test coverage for deleted header files.


From: Stefano Lattarini
Subject: Re: Add test coverage for deleted header files.
Date: Sun, 9 Jan 2011 14:28:28 +0100
User-agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; )

Hello Ralf.

On Sunday 09 January 2011, Ralf Wildenhues wrote:
> I noticed that we don't even have testsuite coverage for the deleted
> header file bug yet, except for an accidental one.  So here's a patch
> to address that.
> 
> I think it's safe enough for maint; but anyway I will wait a bit for
> comments or review before pushing.
>
See my comments inline below.

> By the way, if you would like me to send patches in 'git am'-suitable
> format, e.g., for testing them, please speak up, I'm all for making
> things equal for all if that helps (I just need to reorder my workflow
> a bit then).
>
Considering that most patches don't need to be tested by the reviewer,
I'd say you should use 'git am'-suitable format only if that's no more
work for you, or for patches you think should be applied and tested
during the review process.

> 
> Thanks,
> Ralf
> 
>     Add test coverage for deleted header files.
>     
>     * tests/depcomp6.test, tests/depcomp7.test: Update tests to
>     also check for the deleted header bug.  If no dependency
>     tracking mechanism could be found, SKIP rather than exit
>     successfully.
> 
> diff --git a/tests/depcomp6.test b/tests/depcomp6.test
> index 7fc651f..5713e7e 100755
> --- a/tests/depcomp6.test
> +++ b/tests/depcomp6.test
> @@ -1,5 +1,5 @@
>  #! /bin/sh
> -# Copyright (C) 2006, 2010 Free Software Foundation, Inc.
> +# Copyright (C) 2006, 2010, 2011 Free Software Foundation, Inc.
>  #
>  # This program is free software; you can redistribute it and/or modify
>  # it under the terms of the GNU General Public License as published by
> @@ -89,7 +89,8 @@ $AUTOMAKE -a
>  $MAKE
>  
>  # check that dependency tracking works
> -if grep 'depmode=none' Makefile; then :
> +if grep 'depmode=none' Makefile; then
> +  Exit 77
>  else
At this point, I'd rather remove the "if" altogether:
  
grep 'depmode=none' Makefile && Exit 77
cd sub 2
...

>    cd sub2
>    $sleep
> @@ -99,6 +100,12 @@ else
>    # flag is active if a command within "&&" fails inside a compound
>    # statement.
>    if $MAKE; then Exit 1; else :; fi
> +
> +  # Ensure the deleted header bug is fixed.
> +  rm -f sub3/ba3.h
> +  sed 1d sub3/ba3.c >sub3/ba3.t
> +  mv -f sub3/ba3.t sub3/ba3.c
> +  $MAKE
>  fi
>  
>  :
> diff --git a/tests/depcomp7.test b/tests/depcomp7.test
> index 695041a..3edbd71 100755
> --- a/tests/depcomp7.test
> +++ b/tests/depcomp7.test
> @@ -1,5 +1,5 @@
>  #! /bin/sh
> -# Copyright (C) 2006, 2007, 2010 Free Software Foundation, Inc.
> +# Copyright (C) 2006, 2007, 2010, 2011 Free Software Foundation, Inc.
>  #
>  # This program is free software; you can redistribute it and/or modify
>  # it under the terms of the GNU General Public License as published by
> @@ -77,7 +77,7 @@ cat >sub2/baz.h <<'END'
>  extern int baz();
>  END
>  
> -cat >sub2/sub3/ba3.c <<'END'
> +cat >sub2/sub3/ba3.in <<'END'
>  #include "ba3.h"
>  int ba3() { return 0; }
>  END
> @@ -87,13 +87,16 @@ $ACLOCAL
>  $AUTOCONF
>  $AUTOMAKE -a
>  
> +st=0
>  for staticshared in --disable-shared "" --disable-static; do
>  
> +  cp sub2/sub3/ba3.in sub2/sub3/ba3.c
>    ./configure --enable-dependency-tracking $staticshared
>    $MAKE
>  
>    # check that dependency tracking works
> -  if grep 'depmode=none' Makefile; then :
> +  if grep 'depmode=none' Makefile; then
> +    st=77
>    else
>      cd sub2
>      $sleep
> @@ -103,6 +106,11 @@ for staticshared in --disable-shared "" 
> --disable-static; do
>      # flag is active if a command within "&&" fails inside a compound
>      # statement.
>      if $MAKE; then Exit 1; else :; fi
> +
> +    # Ensure the deleted header bug is fixed.
> +    rm -f sub3/ba3.h
> +    sed 1d sub3/ba3.in >sub3/ba3.c
> +    $MAKE
>      cd ..
>    fi
>  
> @@ -114,4 +122,4 @@ for staticshared in --disable-shared "" --disable-static; 
> do
>  
>  done
>  
> -:
> +Exit $st
> 
> 
Hmmm... I really dislike having a testcase being marked as "skipped" when
it might indeed have run most of its checks.

BUT looking more carefully, this shouldn't be the case here, because if
I'm not mistaken the 'depmode' value should be the same in all the three
configure runs.  Maybe it would be nice to be more explicit about this
expectation; WDYT?

Thanks,
  Stefano




reply via email to

[Prev in Thread] Current Thread [Next in Thread]