Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
ccan
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mirror
ccan
Commits
41df9b37
Commit
41df9b37
authored
Nov 20, 2015
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pipecmd: test can't-exec case.
Signed-off-by:
Rusty Russell
<
rusty@rustcorp.com.au
>
parent
c7e55a16
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
ccan/pipecmd/test/run.c
ccan/pipecmd/test/run.c
+6
-1
No files found.
ccan/pipecmd/test/run.c
View file @
41df9b37
...
@@ -34,7 +34,7 @@ int main(int argc, char *argv[])
...
@@ -34,7 +34,7 @@ int main(int argc, char *argv[])
}
}
/* This is how many tests you plan to run */
/* This is how many tests you plan to run */
plan_tests
(
2
6
);
plan_tests
(
2
8
);
child
=
pipecmd
(
&
outfd
,
&
infd
,
argv
[
0
],
"inout"
,
NULL
);
child
=
pipecmd
(
&
outfd
,
&
infd
,
argv
[
0
],
"inout"
,
NULL
);
if
(
!
ok1
(
child
>
0
))
if
(
!
ok1
(
child
>
0
))
exit
(
1
);
exit
(
1
);
...
@@ -79,6 +79,11 @@ int main(int argc, char *argv[])
...
@@ -79,6 +79,11 @@ int main(int argc, char *argv[])
ok1
(
WIFEXITED
(
status
));
ok1
(
WIFEXITED
(
status
));
ok1
(
WEXITSTATUS
(
status
)
==
1
);
ok1
(
WEXITSTATUS
(
status
)
==
1
);
// Can't run non-existent file, but errno set correctly.
child
=
pipecmd
(
NULL
,
NULL
,
"/doesnotexist"
,
"in"
,
NULL
);
ok1
(
errno
==
ENOENT
);
ok1
(
child
<
0
);
/* This exits depending on whether all tests passed */
/* This exits depending on whether all tests passed */
return
exit_status
();
return
exit_status
();
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment