This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] Add time/tst-strptime-static.c
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Mon, 10 Sep 2012 06:30:48 -0700
- Subject: [PATCH] Add time/tst-strptime-static.c
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
Hi,
Parts of tst-strptime.c depend on shared localedata objects. This
patch modifies time/tst-strptime.c and time/tst-strptime-static.c so
that we can run tests time/tst-strptime.c which don't depend on
shared localedata objects when $(build-shared) isn't yes. OK to
install?
Thanks.
H.J.
----
* time/Makefile (tests-static): New. Test tst-strptime-static.
(tests): Add tst-strptime only if $(build-shared) is yes. Add
$(tests-static).
* time/tst-strptime-static.c: New file.
* time/tst-strptime.c (day_tests): Enable parts of ja_JP.EUC-JP
tests only if STATIC_TEST isn't defined.
diff --git a/time/Makefile b/time/Makefile
index ffa3e88..5975bc3 100644
--- a/time/Makefile
+++ b/time/Makefile
@@ -32,10 +32,15 @@ routines := offtime asctime clock ctime ctime_r difftime \
timespec_get
aux := era alt_digit lc-time-cleanup
-tests := test_time clocktest tst-posixtz tst-strptime tst_wcsftime \
+tests := test_time clocktest tst-posixtz tst_wcsftime \
tst-getdate tst-mktime tst-mktime2 tst-ftime_l tst-strftime \
tst-mktime3 tst-strptime2 bug-asctime bug-asctime_r bug-mktime1 \
tst-strptime3 bug-getdate1
+tests-static = tst-strptime-static
+tests += $(tests-static)
+ifeq (yes,$(build-shared))
+tests += tst-strptime
+endif
include ../Rules
diff --git a/time/tst-strptime-static.c b/time/tst-strptime-static.c
new file mode 100644
index 0000000..eab0f33
--- /dev/null
+++ b/time/tst-strptime-static.c
@@ -0,0 +1,2 @@
+#define STATIC_TEST
+#include "tst-strptime.c"
diff --git a/time/tst-strptime.c b/time/tst-strptime.c
index 32001d4..fb75522 100644
--- a/time/tst-strptime.c
+++ b/time/tst-strptime.c
@@ -45,8 +45,10 @@ static const struct
6, 0, 0, 1 },
{ "en_US.ISO-8859-1", "2000-01-01 08:12:21 PM", "%Y-%m-%d %I:%M:%S %p",
6, 0, 0, 1 },
+#ifndef STATIC_TEST
{ "ja_JP.EUC-JP", "2001 20 \xb7\xee", "%Y %U %a", 1, 140, 4, 21 },
{ "ja_JP.EUC-JP", "2001 21 \xb7\xee", "%Y %W %a", 1, 140, 4, 21 },
+#endif
};
--
1.7.11.4