File tree 5 files changed +524
-29
lines changed
5 files changed +524
-29
lines changed Original file line number Diff line number Diff line change
1
+ # $NetBSD: Makefile,v 1.2 2012/02/14 00:13:54 martin Exp $
2
+
3
+ NOMAN = # defined
4
+ WARNS=4
5
+
6
+ .include <bsd.own.mk>
7
+
8
+ TESTSDIR = ${TESTSBASE}/lib/libc/gen/posix_spawn
9
+
10
+ TESTS_C = t_spawn
11
+ TESTS_C+ = t_fileactions
12
+ TESTS_C+ = t_spawnattr
13
+
14
+ BINDIR = ${TESTSDIR}
15
+ SCRIPTSDIR = ${TESTSDIR}
16
+
17
+ PROGS = h_fileactions
18
+ PROGS+ = h_spawn
19
+ PROGS+ = h_spawnattr
20
+ PROGS+ = h_fa-spawn
21
+ SCRIPTS = h_nonexec h_zero
22
+
23
+ h_zero :
24
+ dd if=/dev/zero of=h_zero bs=1k count=2
25
+ chmod a+x h_zero
26
+
27
+ CLEANFILES+ = h_nonexec h_zero
28
+
29
+ .include <bsd.test.mk>
Original file line number Diff line number Diff line change
1
+ #include "h_fa-spawn.h"
2
+
3
+ off_t
4
+ filesize (const char * restrict fname )
5
+ {
6
+ struct stat st ;
7
+ int err ;
8
+
9
+ err = stat (fname , & st );
10
+ ATF_REQUIRE (err == 0 );
11
+ return st .st_size ;
12
+ }
13
+
14
+ void
15
+ empty_outfile (const char * restrict filename )
16
+ {
17
+ FILE * f ;
18
+
19
+ f = fopen (filename , "w" );
20
+ ATF_REQUIRE (f != NULL );
21
+ fclose (f );
22
+ }
Original file line number Diff line number Diff line change
1
+ #include <atf-c.h>
2
+
3
+ #include <sys/stat.h>
4
+
5
+ #include <stdio.h>
6
+ #include <string.h>
7
+
8
+ off_t filesize (const char * restrict fname );
9
+ void empty_outfile (const char * restrict filename );
Original file line number Diff line number Diff line change 31
31
*/
32
32
33
33
34
- #include <atf-c.h>
35
-
36
34
#include <sys/wait.h>
37
- #include <sys/stat.h>
38
35
39
- #include <stdio.h>
40
36
#include <stdlib.h>
41
- #include <string.h>
42
37
#include <errno.h>
43
38
#include <fcntl.h>
44
39
#include <spawn.h>
45
40
#include <unistd.h>
46
41
42
+ #include "h_fa-spawn.h"
43
+
47
44
48
45
ATF_TC (t_spawn_openmode );
49
46
@@ -54,17 +51,6 @@ ATF_TC_HEAD(t_spawn_openmode, tc)
54
51
atf_tc_set_md_var (tc , "require.progs" , "/bin/cat" );
55
52
}
56
53
57
- static off_t
58
- filesize (const char * restrict fname )
59
- {
60
- struct stat st ;
61
- int err ;
62
-
63
- err = stat (fname , & st );
64
- ATF_REQUIRE (err == 0 );
65
- return st .st_size ;
66
- }
67
-
68
54
#define TESTFILE "./the_input_data"
69
55
#define CHECKFILE "./the_output_data"
70
56
#define TESTCONTENT "marry has a little lamb"
@@ -82,16 +68,6 @@ make_testfile(const char *restrict file)
82
68
ATF_REQUIRE (written == strlen (TESTCONTENT ));
83
69
}
84
70
85
- static void
86
- empty_outfile (const char * restrict filename )
87
- {
88
- FILE * f ;
89
-
90
- f = fopen (filename , "w" );
91
- ATF_REQUIRE (f != NULL );
92
- fclose (f );
93
- }
94
-
95
71
ATF_TC_BODY (t_spawn_openmode , tc )
96
72
{
97
73
int status , err ;
You can’t perform that action at this time.
0 commit comments