|
|
c5d972 |
commit 4eda036f5b897fa8bc20ddd2099b5a6ed4239dc9
|
|
|
c5d972 |
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
|
|
|
c5d972 |
Date: Tue Mar 24 15:48:34 2020 -0300
|
|
|
c5d972 |
|
|
|
c5d972 |
stdlib: Move tst-system to tests-container
|
|
|
c5d972 |
|
|
|
c5d972 |
Fix some issues with different shell and error messages.
|
|
|
c5d972 |
|
|
|
c5d972 |
Checked on x86_64-linux-gnu and i686-linux-gnu.
|
|
|
c5d972 |
|
|
|
c5d972 |
diff --git a/stdlib/Makefile b/stdlib/Makefile
|
|
|
c5d972 |
index 01194bbf7cc96851..9d0edcf6a7749b28 100644
|
|
|
c5d972 |
--- a/stdlib/Makefile
|
|
|
c5d972 |
+++ b/stdlib/Makefile
|
|
|
c5d972 |
@@ -70,7 +70,7 @@ tests := tst-strtol tst-strtod testmb testrand testsort testdiv \
|
|
|
c5d972 |
test-canon test-canon2 tst-strtoll tst-environ \
|
|
|
c5d972 |
tst-xpg-basename tst-random tst-random2 tst-bsearch \
|
|
|
c5d972 |
tst-limits tst-rand48 bug-strtod tst-setcontext \
|
|
|
c5d972 |
- tst-setcontext2 test-a64l tst-qsort tst-system testmb2 \
|
|
|
c5d972 |
+ tst-setcontext2 test-a64l tst-qsort testmb2 \
|
|
|
c5d972 |
bug-strtod2 tst-atof1 tst-atof2 tst-strtod2 \
|
|
|
c5d972 |
tst-rand48-2 tst-makecontext tst-strtod5 \
|
|
|
c5d972 |
tst-qsort2 tst-makecontext2 tst-strtod6 tst-unsetenv1 \
|
|
|
c5d972 |
@@ -92,6 +92,7 @@ tests := tst-strtol tst-strtod testmb testrand testsort testdiv \
|
|
|
c5d972 |
tests-internal := tst-strtod1i tst-strtod3 tst-strtod4 tst-strtod5i \
|
|
|
c5d972 |
tst-tls-atexit tst-tls-atexit-nodelete
|
|
|
c5d972 |
tests-static := tst-secure-getenv
|
|
|
c5d972 |
+tests-container := tst-system
|
|
|
c5d972 |
|
|
|
c5d972 |
ifeq ($(build-hardcoded-path-in-tests),yes)
|
|
|
c5d972 |
tests += tst-empty-env
|
|
|
c5d972 |
diff --git a/stdlib/tst-system.c b/stdlib/tst-system.c
|
|
|
c5d972 |
index b61bd347df7ec46a..194e09828dd5c206 100644
|
|
|
c5d972 |
--- a/stdlib/tst-system.c
|
|
|
c5d972 |
+++ b/stdlib/tst-system.c
|
|
|
c5d972 |
@@ -88,7 +88,8 @@ do_test (void)
|
|
|
c5d972 |
});
|
|
|
c5d972 |
support_capture_subprocess_check (&result, "system", 0, sc_allow_stderr);
|
|
|
c5d972 |
|
|
|
c5d972 |
- char *returnerr = xasprintf ("%s: 1: %s: not found\n",
|
|
|
c5d972 |
+ char *returnerr = xasprintf ("%s: execing %s failed: "
|
|
|
c5d972 |
+ "No such file or directory",
|
|
|
c5d972 |
basename(_PATH_BSHELL), cmd);
|
|
|
c5d972 |
TEST_COMPARE_STRING (result.err.buffer, returnerr);
|
|
|
c5d972 |
free (returnerr);
|
|
|
c5d972 |
@@ -106,7 +107,8 @@ do_test (void)
|
|
|
c5d972 |
});
|
|
|
c5d972 |
support_capture_subprocess_check (&result, "system", 0, sc_allow_stderr);
|
|
|
c5d972 |
|
|
|
c5d972 |
- char *returnerr = xasprintf ("%s: 1: %s: File name too long\n",
|
|
|
c5d972 |
+ char *returnerr = xasprintf ("%s: execing %s failed: "
|
|
|
c5d972 |
+ "File name too long",
|
|
|
c5d972 |
basename(_PATH_BSHELL), cmd);
|
|
|
c5d972 |
TEST_COMPARE_STRING (result.err.buffer, returnerr);
|
|
|
c5d972 |
free (returnerr);
|
|
|
c5d972 |
@@ -116,7 +118,7 @@ do_test (void)
|
|
|
c5d972 |
struct support_capture_subprocess result;
|
|
|
c5d972 |
result = support_capture_subprocess (call_system,
|
|
|
c5d972 |
&(struct args) {
|
|
|
c5d972 |
- "kill -USR1 $$", 0, SIGUSR1
|
|
|
c5d972 |
+ "kill $$", 0, SIGTERM
|
|
|
c5d972 |
});
|
|
|
c5d972 |
support_capture_subprocess_check (&result, "system", 0, sc_allow_none);
|
|
|
c5d972 |
}
|
|
|
c5d972 |
@@ -136,7 +138,7 @@ do_test (void)
|
|
|
c5d972 |
support_capture_subprocess_check (&result, "system", 0, sc_allow_none);
|
|
|
c5d972 |
}
|
|
|
c5d972 |
|
|
|
c5d972 |
- TEST_COMPARE (system (":"), 0);
|
|
|
c5d972 |
+ TEST_COMPARE (system (""), 0);
|
|
|
c5d972 |
|
|
|
c5d972 |
return 0;
|
|
|
c5d972 |
}
|