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
1d893107
Commit
1d893107
authored
Jun 07, 2010
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ccanlint: make sure fullname is always full path name.
parent
a4478395
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
23 deletions
+19
-23
tools/ccanlint/ccanlint.h
tools/ccanlint/ccanlint.h
+0
-2
tools/ccanlint/compulsory_tests/check_build.c
tools/ccanlint/compulsory_tests/check_build.c
+4
-3
tools/ccanlint/compulsory_tests/check_depends_built.c
tools/ccanlint/compulsory_tests/check_depends_built.c
+5
-10
tools/ccanlint/compulsory_tests/check_depends_exist.c
tools/ccanlint/compulsory_tests/check_depends_exist.c
+3
-5
tools/ccanlint/compulsory_tests/compile_tests.c
tools/ccanlint/compulsory_tests/compile_tests.c
+4
-2
tools/ccanlint/file_analysis.c
tools/ccanlint/file_analysis.c
+3
-1
No files found.
tools/ccanlint/ccanlint.h
View file @
1d893107
...
@@ -31,8 +31,6 @@ struct manifest {
...
@@ -31,8 +31,6 @@ struct manifest {
/* From tests/check_depends_exist.c */
/* From tests/check_depends_exist.c */
struct
list_head
dep_dirs
;
struct
list_head
dep_dirs
;
/* From tests/check_depends_built.c */
struct
list_head
dep_objs
;
};
};
struct
manifest
*
get_manifest
(
const
void
*
ctx
,
const
char
*
dir
);
struct
manifest
*
get_manifest
(
const
void
*
ctx
,
const
char
*
dir
);
...
...
tools/ccanlint/compulsory_tests/check_build.c
View file @
1d893107
...
@@ -27,9 +27,10 @@ static char *obj_list(const struct manifest *m)
...
@@ -27,9 +27,10 @@ static char *obj_list(const struct manifest *m)
struct
ccan_file
*
i
;
struct
ccan_file
*
i
;
/* Other CCAN deps. */
/* Other CCAN deps. */
list_for_each
(
&
m
->
dep_objs
,
i
,
list
)
list_for_each
(
&
m
->
dep_dirs
,
i
,
list
)
{
list
=
talloc_asprintf_append
(
list
,
"%s "
,
i
->
name
);
if
(
i
->
compiled
)
list
=
talloc_asprintf_append
(
list
,
"%s "
,
i
->
compiled
);
}
return
list
;
return
list
;
}
}
...
...
tools/ccanlint/compulsory_tests/check_depends_built.c
View file @
1d893107
...
@@ -42,21 +42,16 @@ static void *check_depends_built(struct manifest *m, unsigned int *timeleft)
...
@@ -42,21 +42,16 @@ static void *check_depends_built(struct manifest *m, unsigned int *timeleft)
char
*
report
=
NULL
;
char
*
report
=
NULL
;
list_for_each
(
&
m
->
dep_dirs
,
i
,
list
)
{
list_for_each
(
&
m
->
dep_dirs
,
i
,
list
)
{
char
*
objfile
;
if
(
!
expect_obj_file
(
i
->
fullname
))
if
(
!
expect_obj_file
(
i
->
fullname
))
continue
;
continue
;
objfile
=
talloc_asprintf
(
m
,
"%s.o"
,
i
->
fullname
);
i
->
compiled
=
talloc_asprintf
(
i
,
"%s.o"
,
i
->
fullname
);
if
(
stat
(
objfile
,
&
st
)
!=
0
)
{
if
(
stat
(
i
->
compiled
,
&
st
)
!=
0
)
{
report
=
talloc_asprintf_append
(
report
,
report
=
talloc_asprintf_append
(
report
,
"object file %s
\n
"
,
"object file %s
\n
"
,
objfile
);
i
->
compiled
);
}
else
{
i
->
compiled
=
NULL
;
struct
ccan_file
*
f
=
new_ccan_file
(
m
,
""
,
objfile
);
}
list_add_tail
(
&
m
->
dep_objs
,
&
f
->
list
);
}
}
}
/* We may need libtap for testing, unless we're "tap" */
/* We may need libtap for testing, unless we're "tap" */
...
...
tools/ccanlint/compulsory_tests/check_depends_exist.c
View file @
1d893107
...
@@ -16,19 +16,17 @@
...
@@ -16,19 +16,17 @@
static
char
*
add_dep
(
char
*
sofar
,
struct
manifest
*
m
,
const
char
*
dep
)
static
char
*
add_dep
(
char
*
sofar
,
struct
manifest
*
m
,
const
char
*
dep
)
{
{
char
*
dir
;
struct
stat
st
;
struct
stat
st
;
struct
ccan_file
*
f
;
struct
ccan_file
*
f
;
dir
=
talloc_asprintf
(
m
,
"%s/%s"
,
ccan_dir
,
dep
);
f
=
new_ccan_file
(
m
,
ccan_dir
,
talloc_strdup
(
m
,
dep
)
);
if
(
stat
(
dir
,
&
st
)
!=
0
)
{
if
(
stat
(
f
->
fullname
,
&
st
)
!=
0
)
{
return
talloc_asprintf_append
(
sofar
,
return
talloc_asprintf_append
(
sofar
,
"ccan/%s: expected it in"
"ccan/%s: expected it in"
" directory %s
\n
"
,
" directory %s
\n
"
,
dep
,
dir
);
dep
,
f
->
fullname
);
}
}
f
=
new_ccan_file
(
m
,
""
,
dir
);
list_add_tail
(
&
m
->
dep_dirs
,
&
f
->
list
);
list_add_tail
(
&
m
->
dep_dirs
,
&
f
->
list
);
return
sofar
;
return
sofar
;
}
}
...
...
tools/ccanlint/compulsory_tests/compile_tests.c
View file @
1d893107
...
@@ -40,8 +40,10 @@ static char *obj_list(const struct manifest *m, bool link_with_module)
...
@@ -40,8 +40,10 @@ static char *obj_list(const struct manifest *m, bool link_with_module)
list
=
talloc_asprintf_append
(
list
,
" %s.o"
,
m
->
dir
);
list
=
talloc_asprintf_append
(
list
,
" %s.o"
,
m
->
dir
);
/* Other ccan modules. */
/* Other ccan modules. */
list_for_each
(
&
m
->
dep_objs
,
i
,
list
)
list_for_each
(
&
m
->
dep_dirs
,
i
,
list
)
{
list
=
talloc_asprintf_append
(
list
,
" %s"
,
i
->
name
);
if
(
i
->
compiled
)
list
=
talloc_asprintf_append
(
list
,
" %s"
,
i
->
compiled
);
}
return
list
;
return
list
;
}
}
...
...
tools/ccanlint/file_analysis.c
View file @
1d893107
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
#include <dirent.h>
#include <dirent.h>
#include <ctype.h>
#include <ctype.h>
#include <stdarg.h>
#include <stdarg.h>
#include <assert.h>
const
char
*
ccan_dir
;
const
char
*
ccan_dir
;
...
@@ -38,6 +39,8 @@ struct ccan_file *new_ccan_file(const void *ctx, const char *dir, char *name)
...
@@ -38,6 +39,8 @@ struct ccan_file *new_ccan_file(const void *ctx, const char *dir, char *name)
{
{
struct
ccan_file
*
f
;
struct
ccan_file
*
f
;
assert
(
dir
[
0
]
==
'/'
);
f
=
talloc
(
ctx
,
struct
ccan_file
);
f
=
talloc
(
ctx
,
struct
ccan_file
);
f
->
lines
=
NULL
;
f
->
lines
=
NULL
;
f
->
line_info
=
NULL
;
f
->
line_info
=
NULL
;
...
@@ -172,7 +175,6 @@ struct manifest *get_manifest(const void *ctx, const char *dir)
...
@@ -172,7 +175,6 @@ struct manifest *get_manifest(const void *ctx, const char *dir)
list_head_init
(
&
m
->
other_test_files
);
list_head_init
(
&
m
->
other_test_files
);
list_head_init
(
&
m
->
other_files
);
list_head_init
(
&
m
->
other_files
);
list_head_init
(
&
m
->
dep_dirs
);
list_head_init
(
&
m
->
dep_dirs
);
list_head_init
(
&
m
->
dep_objs
);
olddir
=
talloc_getcwd
(
NULL
);
olddir
=
talloc_getcwd
(
NULL
);
if
(
!
olddir
)
if
(
!
olddir
)
...
...
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