stdlib: Move tst-system to tests-container

Fix some issues with different shell and error messages.

Checked on x86_64-linux-gnu and i686-linux-gnu.
This commit is contained in:
Adhemerval Zanella 2020-03-24 15:48:34 -03:00
parent 1c17100c43
commit 4eda036f5b
2 changed files with 8 additions and 5 deletions

View File

@ -70,7 +70,7 @@ tests := tst-strtol tst-strtod testmb testrand testsort testdiv \
test-canon test-canon2 tst-strtoll tst-environ \ test-canon test-canon2 tst-strtoll tst-environ \
tst-xpg-basename tst-random tst-random2 tst-bsearch \ tst-xpg-basename tst-random tst-random2 tst-bsearch \
tst-limits tst-rand48 bug-strtod tst-setcontext \ tst-limits tst-rand48 bug-strtod tst-setcontext \
tst-setcontext2 test-a64l tst-qsort tst-system testmb2 \ tst-setcontext2 test-a64l tst-qsort testmb2 \
bug-strtod2 tst-atof1 tst-atof2 tst-strtod2 \ bug-strtod2 tst-atof1 tst-atof2 tst-strtod2 \
tst-rand48-2 tst-makecontext tst-strtod5 \ tst-rand48-2 tst-makecontext tst-strtod5 \
tst-qsort2 tst-makecontext2 tst-strtod6 tst-unsetenv1 \ tst-qsort2 tst-makecontext2 tst-strtod6 tst-unsetenv1 \
@ -92,6 +92,7 @@ tests := tst-strtol tst-strtod testmb testrand testsort testdiv \
tests-internal := tst-strtod1i tst-strtod3 tst-strtod4 tst-strtod5i \ tests-internal := tst-strtod1i tst-strtod3 tst-strtod4 tst-strtod5i \
tst-tls-atexit tst-tls-atexit-nodelete tst-tls-atexit tst-tls-atexit-nodelete
tests-static := tst-secure-getenv tests-static := tst-secure-getenv
tests-container := tst-system
ifeq ($(build-hardcoded-path-in-tests),yes) ifeq ($(build-hardcoded-path-in-tests),yes)
tests += tst-empty-env tests += tst-empty-env

View File

@ -88,7 +88,8 @@ do_test (void)
}); });
support_capture_subprocess_check (&result, "system", 0, sc_allow_stderr); support_capture_subprocess_check (&result, "system", 0, sc_allow_stderr);
char *returnerr = xasprintf ("%s: 1: %s: not found\n", char *returnerr = xasprintf ("%s: execing %s failed: "
"No such file or directory",
basename(_PATH_BSHELL), cmd); basename(_PATH_BSHELL), cmd);
TEST_COMPARE_STRING (result.err.buffer, returnerr); TEST_COMPARE_STRING (result.err.buffer, returnerr);
free (returnerr); free (returnerr);
@ -106,7 +107,8 @@ do_test (void)
}); });
support_capture_subprocess_check (&result, "system", 0, sc_allow_stderr); support_capture_subprocess_check (&result, "system", 0, sc_allow_stderr);
char *returnerr = xasprintf ("%s: 1: %s: File name too long\n", char *returnerr = xasprintf ("%s: execing %s failed: "
"File name too long",
basename(_PATH_BSHELL), cmd); basename(_PATH_BSHELL), cmd);
TEST_COMPARE_STRING (result.err.buffer, returnerr); TEST_COMPARE_STRING (result.err.buffer, returnerr);
free (returnerr); free (returnerr);
@ -116,7 +118,7 @@ do_test (void)
struct support_capture_subprocess result; struct support_capture_subprocess result;
result = support_capture_subprocess (call_system, result = support_capture_subprocess (call_system,
&(struct args) { &(struct args) {
"kill -USR1 $$", 0, SIGUSR1 "kill $$", 0, SIGTERM
}); });
support_capture_subprocess_check (&result, "system", 0, sc_allow_none); support_capture_subprocess_check (&result, "system", 0, sc_allow_none);
} }
@ -136,7 +138,7 @@ do_test (void)
support_capture_subprocess_check (&result, "system", 0, sc_allow_none); support_capture_subprocess_check (&result, "system", 0, sc_allow_none);
} }
TEST_COMPARE (system (":"), 0); TEST_COMPARE (system (""), 0);
return 0; return 0;
} }