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
71c95e84
Commit
71c95e84
authored
Nov 09, 2010
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ccanlint: fix up creation of test/run.c
Make test directory correctly, and #include <ccan/...> not #include "".
parent
99809d6e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
tools/ccanlint/tests/has_tests.c
tools/ccanlint/tests/has_tests.c
+10
-7
No files found.
tools/ccanlint/tests/has_tests.c
View file @
71c95e84
...
...
@@ -77,6 +77,7 @@ static void handle_no_tests(struct manifest *m, void *check_result)
{
FILE
*
run
;
struct
ccan_file
*
i
;
char
*
test_dir
=
talloc_asprintf
(
m
,
"%s/test"
,
m
->
dir
);
if
(
check_result
==
test_is_not_dir
)
return
;
...
...
@@ -84,7 +85,7 @@ static void handle_no_tests(struct manifest *m, void *check_result)
if
(
!
ask
(
"Should I create a template test/run.c file for you?"
))
return
;
if
(
mkdir
(
"test"
,
0700
)
!=
0
)
{
if
(
mkdir
(
test_dir
,
0700
)
!=
0
)
{
if
(
errno
!=
EEXIST
)
err
(
1
,
"Creating test/ directory"
);
}
...
...
@@ -93,12 +94,14 @@ static void handle_no_tests(struct manifest *m, void *check_result)
if
(
!
run
)
err
(
1
,
"Trying to create a test/run.c"
);
fputs
(
"/* Include the main header first, to test it works */
\n
"
,
run
);
fprintf
(
run
,
"#include
\"
%s/%s.h
\"\n
"
,
m
->
basename
,
m
->
basename
);
fputs
(
"/* Include the C files directly. */
\n
"
,
run
);
list_for_each
(
&
m
->
c_files
,
i
,
list
)
fprintf
(
run
,
"#include
\"
%s/%s
\"\n
"
,
m
->
basename
,
i
->
name
);
fputs
(
"#include
\"
tap/tap.h
\"\n
"
,
run
);
fprintf
(
run
,
"#include <ccan/%s/%s.h>
\n
"
,
m
->
basename
,
m
->
basename
);
if
(
!
list_empty
(
&
m
->
c_files
))
{
fputs
(
"/* Include the C files directly. */
\n
"
,
run
);
list_for_each
(
&
m
->
c_files
,
i
,
list
)
fprintf
(
run
,
"#include <ccan/%s/%s>
\n
"
,
m
->
basename
,
i
->
name
);
}
fputs
(
"#include <ccan/tap/tap.h>
\n
"
,
run
);
fputs
(
"
\n
"
,
run
);
fputs
(
"int main(void)
\n
"
,
run
);
...
...
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