summaryrefslogtreecommitdiff
path: root/test/misc/popen.c
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@uclibc-ng.org>2016-10-28 20:29:21 +0200
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2016-10-28 20:31:55 +0200
commit99ef2719fb3d703fe38c4113cd7f5adec516dd3a (patch)
tree2c1f77cb41b60ccbf8faa77a3640491a3546b546 /test/misc/popen.c
parent543308f6c46cf2edf8a524bc9c631e472570fe72 (diff)
test: remove test suite
The test suite is now a developed in a separate git repository. See here: http://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng-test.git The test suite should be just like every other software compiled with the cross-toolchain. In the past strange problems where found when the test suite got build in the toolchain creation step.
Diffstat (limited to 'test/misc/popen.c')
-rw-r--r--test/misc/popen.c47
1 files changed, 0 insertions, 47 deletions
diff --git a/test/misc/popen.c b/test/misc/popen.c
deleted file mode 100644
index 868b70eed..000000000
--- a/test/misc/popen.c
+++ /dev/null
@@ -1,47 +0,0 @@
-#include <unistd.h>
-#include <stdio.h>
-#include <errno.h>
-#include <string.h>
-#include <signal.h>
-
-#define TEST(r, f, x, m) ( \
-((r) = (f)) == (x) || \
-(printf(__FILE__ ":%d: %s failed (" m ")\n", __LINE__, #f, r, x), err++, 0) )
-
-#define TEST_E(f) ( (errno = 0), (f) || \
-(printf(__FILE__ ":%d: %s failed (errno = %d)\n", __LINE__, #f, errno), err++, 0) )
-
-#define TEST_S(s, x, m) ( \
-!strcmp((s),(x)) || \
-(printf(__FILE__ ":%d: [%s] != [%s] (%s)\n", __LINE__, s, x, m), err++, 0) )
-
-static sig_atomic_t got_sig;
-
-static void handler(int sig)
-{
- got_sig = 1;
-}
-
-int main(void)
-{
- int i;
- char foo[6];
- char cmd[64];
- int err = 0;
- FILE *f;
-
- TEST_E(f = popen("echo hello", "r"));
- TEST_E(fgets(foo, sizeof foo, f));
- TEST_S(foo, "hello", "child process did not say hello");
- TEST(i, pclose(f), 0, "exit status %04x != %04x");
-
- signal(SIGUSR1, handler);
- snprintf(cmd, sizeof cmd, "read a ; test \"x$a\" = xhello && kill -USR1 %d", getpid());
- TEST_E(f = popen(cmd, "w"));
- TEST_E(fputs("hello", f) >= 0);
- TEST(i, pclose(f), 0, "exit status %04x != %04x");
- signal(SIGUSR1, SIG_DFL);
- TEST(i, got_sig, 1, "child process did not send signal (%i!=%i)");
-
- return err;
-}