diff mbox series

Remove unused DATEMSK file for tst-getdate

Message ID 20230609115804.116702-1-mcoufal@redhat.com
State New
Headers show
Series Remove unused DATEMSK file for tst-getdate | expand

Commit Message

Martin Coufal June 9, 2023, 11:58 a.m. UTC
tst-getdate used to rely on an in-tree datemsk file that was
subsequently replaced by a file created during test execution.  This
commit removes the unused file and corresponding env-var and uses a more
appropriate name for the temp file.
---
 time/Makefile      | 1 -
 time/datemsk       | 2 --
 time/tst-getdate.c | 2 +-
 3 files changed, 1 insertion(+), 4 deletions(-)
 delete mode 100644 time/datemsk

Comments

Carlos O'Donell June 9, 2023, 2:15 p.m. UTC | #1
On 6/9/23 07:58, Martin Coufal via Libc-alpha wrote:
> tst-getdate used to rely on an in-tree datemsk file that was
> subsequently replaced by a file created during test execution.  This
> commit removes the unused file and corresponding env-var and uses a more
> appropriate name for the temp file.

LGTM.

Martin, Thank you for this cleanup!

Please push, or ask for someone to push for you.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>

> ---
>  time/Makefile      | 1 -
>  time/datemsk       | 2 --
>  time/tst-getdate.c | 2 +-
>  3 files changed, 1 insertion(+), 4 deletions(-)
>  delete mode 100644 time/datemsk
> 
> diff --git a/time/Makefile b/time/Makefile
> index 92bc3db315..1d2e667cad 100644
> --- a/time/Makefile
> +++ b/time/Makefile
> @@ -104,7 +104,6 @@ CFLAGS-mktime.c += $(config-cflags-wno-ignored-attributes)
>  # Don't warn about Y2k problem in strftime format string.
>  CFLAGS-test_time.c += -Wno-format
>  
> -tst-getdate-ENV= DATEMSK=datemsk TZDIR=${common-objpfx}timezone/testdata

OK. Test uses it's own DATEMSK temporary file. We no longer use the datemsk file. Likewise
the TZDIR specified was never used because it only contains the XT* variants.

>  test_time-ARGS= EST5EDT CST
>  
>  tst-tzname-ENV = TZDIR=${common-objpfx}timezone/testdata
> diff --git a/time/datemsk b/time/datemsk
> deleted file mode 100644
> index 3dc4d417fe..0000000000
> --- a/time/datemsk
> +++ /dev/null
> @@ -1,2 +0,0 @@
> -%H:%M:%S %F
> -%d-%m-%Y %T

OK. File is no longer used, it is generated as a temporary by the test.

> diff --git a/time/tst-getdate.c b/time/tst-getdate.c
> index cf97e220f7..4c9ed28d58 100644
> --- a/time/tst-getdate.c
> +++ b/time/tst-getdate.c
> @@ -98,7 +98,7 @@ static const char datemskstr[] =
>  static void
>  do_prepare (int argc, char **argv)
>  {
> -  int fd = create_temp_file ("tst-chk1.", &datemsk);
> +  int fd = create_temp_file ("tst-getdate.", &datemsk);

OK. Much better temporary name that matches the string.

>    xwrite (fd, datemskstr, sizeof (datemskstr) - 1);
>  
>    setenv ("DATEMSK", datemsk, 1);
diff mbox series

Patch

diff --git a/time/Makefile b/time/Makefile
index 92bc3db315..1d2e667cad 100644
--- a/time/Makefile
+++ b/time/Makefile
@@ -104,7 +104,6 @@  CFLAGS-mktime.c += $(config-cflags-wno-ignored-attributes)
 # Don't warn about Y2k problem in strftime format string.
 CFLAGS-test_time.c += -Wno-format
 
-tst-getdate-ENV= DATEMSK=datemsk TZDIR=${common-objpfx}timezone/testdata
 test_time-ARGS= EST5EDT CST
 
 tst-tzname-ENV = TZDIR=${common-objpfx}timezone/testdata
diff --git a/time/datemsk b/time/datemsk
deleted file mode 100644
index 3dc4d417fe..0000000000
--- a/time/datemsk
+++ /dev/null
@@ -1,2 +0,0 @@ 
-%H:%M:%S %F
-%d-%m-%Y %T
diff --git a/time/tst-getdate.c b/time/tst-getdate.c
index cf97e220f7..4c9ed28d58 100644
--- a/time/tst-getdate.c
+++ b/time/tst-getdate.c
@@ -98,7 +98,7 @@  static const char datemskstr[] =
 static void
 do_prepare (int argc, char **argv)
 {
-  int fd = create_temp_file ("tst-chk1.", &datemsk);
+  int fd = create_temp_file ("tst-getdate.", &datemsk);
   xwrite (fd, datemskstr, sizeof (datemskstr) - 1);
 
   setenv ("DATEMSK", datemsk, 1);