public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: testsuite: Also check direct call in systemcall
@ 2023-07-14 15:28 Jon Turney
  0 siblings, 0 replies; 2+ messages in thread
From: Jon Turney @ 2023-07-14 15:28 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=79a9288434aaa15407727474f26504214b027306

commit 79a9288434aaa15407727474f26504214b027306
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Sun Jul 9 12:12:23 2023 +0100

    Cygwin: testsuite: Also check direct call in systemcall
    
    Check direct call to system(), as well as one in a subprocess.
    
    (This is a lot easier to debug when it's completely broken by the
    environment the test is running in)
    
    Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>

Diff:
---
 winsup/testsuite/winsup.api/systemcall.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/winsup/testsuite/winsup.api/systemcall.c b/winsup/testsuite/winsup.api/systemcall.c
index d10c9825c..74bd6f870 100644
--- a/winsup/testsuite/winsup.api/systemcall.c
+++ b/winsup/testsuite/winsup.api/systemcall.c
@@ -26,6 +26,14 @@ main (int argc, char **argv)
       fprintf (stderr, "couldn't redirect stdout to /dev/null, fd %d - %s\n", fd, strerror (errno));
       exit (1);
     }
+
+  n = system ("ls");
+  if (n != 0)
+    {
+      fprintf (stderr, "system() (in parent) call returned %x\n", n);
+      exit (1);
+    }
+
   if (pipe (fds))
     {
       fprintf (stderr, "pipe call failed - %s\n", strerror (errno));
@@ -61,7 +69,7 @@ main (int argc, char **argv)
     }
   if (n != 0)
     {
-      fprintf (stderr, "system() call returned %x\n", n);
+      fprintf (stderr, "system() (in child) call returned %x\n", n);
       exit (1);
     }
   exit (0);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [newlib-cygwin] Cygwin: testsuite: also check direct call in systemcall
@ 2023-07-09 16:01 Jon Turney
  0 siblings, 0 replies; 2+ messages in thread
From: Jon Turney @ 2023-07-09 16:01 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=f5940dc449177a3b6216515855964b0c8815954f

commit f5940dc449177a3b6216515855964b0c8815954f
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Sun Jul 9 12:12:23 2023 +0100

    Cygwin: testsuite: also check direct call in systemcall
    
    Check direct call to system(), as well as one in a subprocess.
    (This is a lot easier to debug when it's completely broken by environment)

Diff:
---
 winsup/testsuite/winsup.api/systemcall.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/winsup/testsuite/winsup.api/systemcall.c b/winsup/testsuite/winsup.api/systemcall.c
index d10c9825c..a47586fdb 100644
--- a/winsup/testsuite/winsup.api/systemcall.c
+++ b/winsup/testsuite/winsup.api/systemcall.c
@@ -26,6 +26,14 @@ main (int argc, char **argv)
       fprintf (stderr, "couldn't redirect stdout to /dev/null, fd %d - %s\n", fd, strerror (errno));
       exit (1);
     }
+
+  n = system ("ls");
+  if (n != 0)
+    {
+      fprintf (stderr, "system() call returned %x\n", n);
+      exit (1);
+    }
+
   if (pipe (fds))
     {
       fprintf (stderr, "pipe call failed - %s\n", strerror (errno));
@@ -61,7 +69,7 @@ main (int argc, char **argv)
     }
   if (n != 0)
     {
-      fprintf (stderr, "system() call returned %x\n", n);
+      fprintf (stderr, "system() call in child process returned %x\n", n);
       exit (1);
     }
   exit (0);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-14 15:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-14 15:28 [newlib-cygwin] Cygwin: testsuite: Also check direct call in systemcall Jon Turney
  -- strict thread matches above, loose matches on Subject: below --
2023-07-09 16:01 [newlib-cygwin] Cygwin: testsuite: also " Jon Turney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).