mirror of
git://sourceware.org/git/glibc.git
synced 2025-01-18 12:16:13 +08:00
Support run bug-setlocale1 directly
This commit is contained in:
parent
4cf8f2098f
commit
c34521ceac
@ -1,5 +1,14 @@
|
|||||||
2013-01-10 H.J. Lu <hongjiu.lu@intel.com>
|
2013-01-10 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
|
* Makefile (tests-static): New variable.
|
||||||
|
(tests): Add $(tests-static).
|
||||||
|
(bug-setlocale1-ARGS): Set to -- $(built-program-cmd).
|
||||||
|
(bug-setlocale1-static-ENV): New variable.
|
||||||
|
(bug-setlocale1-static-ARGS): Likewise.
|
||||||
|
* bug-setlocale1.c (do_test): Support run directly. Check env[1]
|
||||||
|
instead of newargv[0].
|
||||||
|
* bug-setlocale1-static.c: New file.
|
||||||
|
|
||||||
* posix/Makefile (tests-static): New variable.
|
* posix/Makefile (tests-static): New variable.
|
||||||
(tests): Add $(tests-static).
|
(tests): Add $(tests-static).
|
||||||
(tst-exec-static-ARGS): New variable.
|
(tst-exec-static-ARGS): New variable.
|
||||||
|
@ -78,6 +78,8 @@ locale_test_suite := tst_iswalnum tst_iswalpha tst_iswcntrl \
|
|||||||
tests = $(locale_test_suite) tst-digits tst-setlocale bug-iconv-trans \
|
tests = $(locale_test_suite) tst-digits tst-setlocale bug-iconv-trans \
|
||||||
tst-leaks tst-mbswcs6 tst-xlocale1 tst-xlocale2 bug-usesetlocale \
|
tst-leaks tst-mbswcs6 tst-xlocale1 tst-xlocale2 bug-usesetlocale \
|
||||||
tst-strfmon1 tst-sscanf bug-setlocale1 tst-setlocale2
|
tst-strfmon1 tst-sscanf bug-setlocale1 tst-setlocale2
|
||||||
|
tests-static = bug-setlocale1-static
|
||||||
|
tests += $(tests-static)
|
||||||
ifeq (yes,$(build-shared))
|
ifeq (yes,$(build-shared))
|
||||||
ifneq (no,$(PERL))
|
ifneq (no,$(PERL))
|
||||||
tests: $(objpfx)mtrace-tst-leaks
|
tests: $(objpfx)mtrace-tst-leaks
|
||||||
@ -285,7 +287,9 @@ $(objpfx)mtrace-tst-leaks: $(objpfx)tst-leaks.out
|
|||||||
$(common-objpfx)malloc/mtrace $(objpfx)tst-leaks.mtrace > $@
|
$(common-objpfx)malloc/mtrace $(objpfx)tst-leaks.mtrace > $@
|
||||||
|
|
||||||
bug-setlocale1-ENV = LOCPATH=$(common-objpfx)localedata
|
bug-setlocale1-ENV = LOCPATH=$(common-objpfx)localedata
|
||||||
bug-setlocale1-ARGS = $(common-objpfx)
|
bug-setlocale1-ARGS = -- $(built-program-cmd)
|
||||||
|
bug-setlocale1-static-ENV = $(bug-setlocale1-ENV)
|
||||||
|
bug-setlocale1-static-ARGS = $(bug-setlocale1-ARGS)
|
||||||
tst-setlocale2-ENV = LOCPATH=$(common-objpfx)localedata
|
tst-setlocale2-ENV = LOCPATH=$(common-objpfx)localedata
|
||||||
|
|
||||||
$(objdir)/iconvdata/gconv-modules:
|
$(objdir)/iconvdata/gconv-modules:
|
||||||
|
1
localedata/bug-setlocale1-static.c
Normal file
1
localedata/bug-setlocale1-static.c
Normal file
@ -0,0 +1 @@
|
|||||||
|
#include "bug-setlocale1.c"
|
@ -12,16 +12,16 @@ do_test (int argc, char *argv[])
|
|||||||
if (argc > 1)
|
if (argc > 1)
|
||||||
{
|
{
|
||||||
char *newargv[5];
|
char *newargv[5];
|
||||||
asprintf (&newargv[0], "%self/ld.so", argv[1]);
|
int i;
|
||||||
if (newargv[0] == NULL)
|
if (argc != 2 && argc != 5)
|
||||||
{
|
{
|
||||||
puts ("asprintf failed");
|
printf ("wrong number of arguments (%d)\n", argc);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
newargv[1] = (char *) "--library-path";
|
|
||||||
newargv[2] = argv[1];
|
for (i = 0; i < (argc == 5 ? 4 : 1); i++)
|
||||||
newargv[3] = argv[0];
|
newargv[i] = argv[i + 1];
|
||||||
newargv[4] = NULL;
|
newargv[i] = NULL;
|
||||||
|
|
||||||
char *env[3];
|
char *env[3];
|
||||||
env[0] = (char *) "LC_CTYPE=de_DE.UTF-8";
|
env[0] = (char *) "LC_CTYPE=de_DE.UTF-8";
|
||||||
@ -32,9 +32,9 @@ do_test (int argc, char *argv[])
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
asprintf (&env[1], "LOCPATH=%s", loc);
|
asprintf (&env[1], "LOCPATH=%s", loc);
|
||||||
if (newargv[0] == NULL)
|
if (env[1] == NULL)
|
||||||
{
|
{
|
||||||
puts ("second asprintf failed");
|
puts ("asprintf failed");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
env[2] = NULL;
|
env[2] = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user