resolv: tst-p_secstodate can be a regular test

Message ID 874khpg3ml.fsf@oldenburg.str.redhat.com
State Committed
Commit cfaf53672393c95c47602520cb2b6afd04230215
Headers
Series resolv: tst-p_secstodate can be a regular test |

Commit Message

Florian Weimer March 5, 2021, 12:57 p.m. UTC
  Now that compat_symbol_reference works for non-internal tests, too.
Also do not build and run the tests on architectures which lack the
__p_secstodate compatibility symbol.

---
 resolv/Makefile           |  4 +++-
 resolv/tst-p_secstodate.c | 12 ------------
 2 files changed, 3 insertions(+), 13 deletions(-)
  

Comments

Adhemerval Zanella Netto March 8, 2021, 1:46 p.m. UTC | #1
On 05/03/2021 09:57, Florian Weimer via Libc-alpha wrote:
> Now that compat_symbol_reference works for non-internal tests, too.
> Also do not build and run the tests on architectures which lack the
> __p_secstodate compatibility symbol.

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> 
> ---
>  resolv/Makefile           |  4 +++-
>  resolv/tst-p_secstodate.c | 12 ------------
>  2 files changed, 3 insertions(+), 13 deletions(-)
> 
> diff --git a/resolv/Makefile b/resolv/Makefile
> index 1047bb6ae5..fb19c93026 100644
> --- a/resolv/Makefile
> +++ b/resolv/Makefile
> @@ -94,7 +94,9 @@ endif # $(build-shared)
>  tests-internal += tst-inet_pton
>  
>  # This test accesses the __p_secstodate compat symbol.
> -tests-internal += tst-p_secstodate
> +ifeq ($(have-GLIBC_2.26)$(build-shared),yesyes)
> +tests += tst-p_secstodate
> +endif
>  
>  # This test sends millions of packets and is rather slow.
>  xtests += tst-resolv-qtypes

Ok.

> diff --git a/resolv/tst-p_secstodate.c b/resolv/tst-p_secstodate.c
> index 78b3aa1d6f..f45c908025 100644
> --- a/resolv/tst-p_secstodate.c
> +++ b/resolv/tst-p_secstodate.c
> @@ -25,8 +25,6 @@
>  
>  #include <shlib-compat.h>
>  
> -#if TEST_COMPAT (libresolv, GLIBC_2_0, GLIBC_2_27)
> -
>  char *__p_secstodate (unsigned long int);
>  compat_symbol_reference (libresolv, __p_secstodate, __p_secstodate, GLIBC_2_0);
>  
> @@ -71,14 +69,4 @@ do_test (void)
>    return ret;
>  }
>  
> -#else
> -
> -static int
> -do_test (void)
> -{
> -  return 77;
> -}
> -
> -#endif
> -
>  #include <support/test-driver.c>
> 

Ok.
  

Patch

diff --git a/resolv/Makefile b/resolv/Makefile
index 1047bb6ae5..fb19c93026 100644
--- a/resolv/Makefile
+++ b/resolv/Makefile
@@ -94,7 +94,9 @@  endif # $(build-shared)
 tests-internal += tst-inet_pton
 
 # This test accesses the __p_secstodate compat symbol.
-tests-internal += tst-p_secstodate
+ifeq ($(have-GLIBC_2.26)$(build-shared),yesyes)
+tests += tst-p_secstodate
+endif
 
 # This test sends millions of packets and is rather slow.
 xtests += tst-resolv-qtypes
diff --git a/resolv/tst-p_secstodate.c b/resolv/tst-p_secstodate.c
index 78b3aa1d6f..f45c908025 100644
--- a/resolv/tst-p_secstodate.c
+++ b/resolv/tst-p_secstodate.c
@@ -25,8 +25,6 @@ 
 
 #include <shlib-compat.h>
 
-#if TEST_COMPAT (libresolv, GLIBC_2_0, GLIBC_2_27)
-
 char *__p_secstodate (unsigned long int);
 compat_symbol_reference (libresolv, __p_secstodate, __p_secstodate, GLIBC_2_0);
 
@@ -71,14 +69,4 @@  do_test (void)
   return ret;
 }
 
-#else
-
-static int
-do_test (void)
-{
-  return 77;
-}
-
-#endif
-
 #include <support/test-driver.c>