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
2926cafb
Commit
2926cafb
authored
Jan 07, 2011
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ccanlint: rename structures to match keys
parent
016a19d2
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
49 additions
and
49 deletions
+49
-49
tools/ccanlint/compulsory_tests/build.c
tools/ccanlint/compulsory_tests/build.c
+2
-2
tools/ccanlint/compulsory_tests/build_objs.c
tools/ccanlint/compulsory_tests/build_objs.c
+2
-2
tools/ccanlint/compulsory_tests/check_build.c
tools/ccanlint/compulsory_tests/check_build.c
+2
-2
tools/ccanlint/compulsory_tests/check_depends_built.c
tools/ccanlint/compulsory_tests/check_depends_built.c
+2
-2
tools/ccanlint/compulsory_tests/check_includes_build.c
tools/ccanlint/compulsory_tests/check_includes_build.c
+2
-2
tools/ccanlint/compulsory_tests/has_info.c
tools/ccanlint/compulsory_tests/has_info.c
+2
-2
tools/ccanlint/compulsory_tests/has_main_header.c
tools/ccanlint/compulsory_tests/has_main_header.c
+2
-2
tools/ccanlint/tests/build-coverage.c
tools/ccanlint/tests/build-coverage.c
+2
-2
tools/ccanlint/tests/compile_test_helpers.c
tools/ccanlint/tests/compile_test_helpers.c
+2
-2
tools/ccanlint/tests/compile_tests.c
tools/ccanlint/tests/compile_tests.c
+2
-2
tools/ccanlint/tests/has_examples.c
tools/ccanlint/tests/has_examples.c
+2
-2
tools/ccanlint/tests/has_info_documentation.c
tools/ccanlint/tests/has_info_documentation.c
+6
-6
tools/ccanlint/tests/has_tests.c
tools/ccanlint/tests/has_tests.c
+7
-7
tools/ccanlint/tests/idempotent.c
tools/ccanlint/tests/idempotent.c
+2
-2
tools/ccanlint/tests/license.c
tools/ccanlint/tests/license.c
+2
-2
tools/ccanlint/tests/run-coverage.c
tools/ccanlint/tests/run-coverage.c
+2
-2
tools/ccanlint/tests/run_tests.c
tools/ccanlint/tests/run_tests.c
+2
-2
tools/ccanlint/tests/run_tests_valgrind.c
tools/ccanlint/tests/run_tests_valgrind.c
+4
-4
tools/ccanlint/tests/trailing_whitespace.c
tools/ccanlint/tests/trailing_whitespace.c
+2
-2
No files found.
tools/ccanlint/compulsory_tests/build.c
View file @
2926cafb
...
...
@@ -73,7 +73,7 @@ static void do_build(struct manifest *m,
score
->
score
=
score
->
total
;
}
struct
ccanlint
build
=
{
struct
ccanlint
module_builds
=
{
.
key
=
"module_builds"
,
.
name
=
"Module can be built from object files"
,
.
check
=
do_build
,
...
...
@@ -81,4 +81,4 @@ struct ccanlint build = {
.
needs
=
"objects_build"
};
REGISTER_TEST
(
build
);
REGISTER_TEST
(
module_builds
);
tools/ccanlint/compulsory_tests/build_objs.c
View file @
2926cafb
...
...
@@ -57,7 +57,7 @@ static void check_objs_build(struct manifest *m,
}
}
struct
ccanlint
build_objs
=
{
struct
ccanlint
objects_build
=
{
.
key
=
"objects_build"
,
.
name
=
"Module object files can be built"
,
.
check
=
check_objs_build
,
...
...
@@ -65,4 +65,4 @@ struct ccanlint build_objs = {
.
needs
=
"depends_exist"
};
REGISTER_TEST
(
build_objs
);
REGISTER_TEST
(
objects_build
);
tools/ccanlint/compulsory_tests/check_build.c
View file @
2926cafb
...
...
@@ -83,7 +83,7 @@ static void check_use_build(struct manifest *m,
}
}
struct
ccanlint
check_build
=
{
struct
ccanlint
module_links
=
{
.
key
=
"module_links"
,
.
name
=
"Module can be linked against trivial program"
,
.
check
=
check_use_build
,
...
...
@@ -91,4 +91,4 @@ struct ccanlint check_build = {
.
needs
=
"module_builds depends_build"
};
REGISTER_TEST
(
check_build
);
REGISTER_TEST
(
module_links
);
tools/ccanlint/compulsory_tests/check_depends_built.c
View file @
2926cafb
...
...
@@ -100,7 +100,7 @@ static void check_depends_built(struct manifest *m,
score
->
score
=
score
->
total
;
}
struct
ccanlint
depends_buil
t
=
{
struct
ccanlint
depends_buil
d
=
{
.
key
=
"depends_build"
,
.
name
=
"Module's CCAN dependencies can be found or built"
,
.
check
=
check_depends_built
,
...
...
@@ -108,4 +108,4 @@ struct ccanlint depends_built = {
.
needs
=
"depends_exist"
};
REGISTER_TEST
(
depends_buil
t
);
REGISTER_TEST
(
depends_buil
d
);
tools/ccanlint/compulsory_tests/check_includes_build.c
View file @
2926cafb
...
...
@@ -67,7 +67,7 @@ static void check_includes_build(struct manifest *m,
}
}
struct
ccanlint
includes_build
=
{
struct
ccanlint
main_header_compiles
=
{
.
key
=
"main_header_compiles"
,
.
name
=
"Modules main header compiles"
,
.
check
=
check_includes_build
,
...
...
@@ -75,4 +75,4 @@ struct ccanlint includes_build = {
.
needs
=
"depends_exist main_header_exists"
};
REGISTER_TEST
(
includes_build
);
REGISTER_TEST
(
main_header_compiles
);
tools/ccanlint/compulsory_tests/has_info.c
View file @
2926cafb
...
...
@@ -74,7 +74,7 @@ static void create_info_template(struct manifest *m, struct score *score)
fclose
(
info
);
}
struct
ccanlint
has_info
=
{
struct
ccanlint
info_exists
=
{
.
key
=
"info_exists"
,
.
name
=
"Module has _info file"
,
.
check
=
check_has_info
,
...
...
@@ -82,4 +82,4 @@ struct ccanlint has_info = {
.
needs
=
""
};
REGISTER_TEST
(
has_info
);
REGISTER_TEST
(
info_exists
);
tools/ccanlint/compulsory_tests/has_main_header.c
View file @
2926cafb
...
...
@@ -33,11 +33,11 @@ static void check_has_main_header(struct manifest *m,
m
->
basename
,
m
->
basename
);
}
struct
ccanlint
has_main_header
=
{
struct
ccanlint
main_header_exists
=
{
.
key
=
"main_header_exists"
,
.
name
=
"Module has main header file"
,
.
check
=
check_has_main_header
,
.
needs
=
""
};
REGISTER_TEST
(
has_main_header
);
REGISTER_TEST
(
main_header_exists
);
tools/ccanlint/tests/build-coverage.c
View file @
2926cafb
...
...
@@ -142,7 +142,7 @@ static void do_compile_coverage_tests(struct manifest *m,
}
}
struct
ccanlint
compile_coverage_tests
=
{
struct
ccanlint
tests_compile_coverage
=
{
.
key
=
"tests_compile_coverage"
,
.
name
=
"Module tests compile with "
COVERAGE_CFLAGS
,
.
check
=
do_compile_coverage_tests
,
...
...
@@ -150,4 +150,4 @@ struct ccanlint compile_coverage_tests = {
.
needs
=
"tests_compile"
};
REGISTER_TEST
(
compile_coverage_tests
);
REGISTER_TEST
(
tests_compile_coverage
);
tools/ccanlint/tests/compile_test_helpers.c
View file @
2926cafb
...
...
@@ -64,7 +64,7 @@ static void do_compile_test_helpers(struct manifest *m,
}
}
struct
ccanlint
compile_test_helpers
=
{
struct
ccanlint
tests_helpers_compile
=
{
.
key
=
"tests_helpers_compile"
,
.
name
=
"Module test helper objects compile"
,
.
check
=
do_compile_test_helpers
,
...
...
@@ -72,4 +72,4 @@ struct ccanlint compile_test_helpers = {
.
needs
=
"depends_build tests_exist"
};
REGISTER_TEST
(
compile_test_helpers
);
REGISTER_TEST
(
tests_helpers_compile
);
tools/ccanlint/tests/compile_tests.c
View file @
2926cafb
...
...
@@ -130,7 +130,7 @@ static void do_compile_tests(struct manifest *m,
score
->
score
=
1
+
!
warnings
;
}
struct
ccanlint
compile_tests
=
{
struct
ccanlint
tests_compile
=
{
.
key
=
"tests_compile"
,
.
name
=
"Module tests compile"
,
.
check
=
do_compile_tests
,
...
...
@@ -138,4 +138,4 @@ struct ccanlint compile_tests = {
.
needs
=
"tests_helpers_compile objects_build"
};
REGISTER_TEST
(
compile_tests
);
REGISTER_TEST
(
tests_compile
);
tools/ccanlint/tests/has_examples.c
View file @
2926cafb
...
...
@@ -109,11 +109,11 @@ static void extract_examples(struct manifest *m,
score
->
pass
=
score
->
score
!=
0
;
}
struct
ccanlint
has_examples
=
{
struct
ccanlint
examples_exist
=
{
.
key
=
"examples_exist"
,
.
name
=
"_info and main header file have Example: sections"
,
.
check
=
extract_examples
,
.
needs
=
"info_exists"
};
REGISTER_TEST
(
has_examples
);
REGISTER_TEST
(
examples_exist
);
tools/ccanlint/tests/has_info_documentation.c
View file @
2926cafb
...
...
@@ -15,7 +15,7 @@
#include <ccan/noerr/noerr.h>
#include <ccan/grab_file/grab_file.h>
extern
struct
ccanlint
has_info_documentation
;
extern
struct
ccanlint
info_documentation_exists
;
static
void
create_info_template_doc
(
struct
manifest
*
m
,
struct
score
*
score
)
{
...
...
@@ -58,7 +58,7 @@ static void create_info_template_doc(struct manifest *m, struct score *score)
}
}
static
void
check_
has_info_documentation
(
struct
manifest
*
m
,
static
void
check_
info_documentation_exists
(
struct
manifest
*
m
,
bool
keep
,
unsigned
int
*
timeleft
,
struct
score
*
score
)
...
...
@@ -83,7 +83,7 @@ static void check_has_info_documentation(struct manifest *m,
score
->
error
=
"_info file has no module documentation.
\n\n
"
"CCAN modules use /**-style comments for documentation: the
\n
"
"overall documentation belongs in the _info metafile.
\n
"
;
has_info_documentation
.
handle
=
create_info_template_doc
;
info_documentation_exists
.
handle
=
create_info_template_doc
;
}
else
if
(
!
description
)
{
score
->
error
=
"_info file has no module description.
\n\n
"
"The lines after the first summary line in the _info file
\n
"
...
...
@@ -92,11 +92,11 @@ static void check_has_info_documentation(struct manifest *m,
}
}
struct
ccanlint
has_info_documentation
=
{
struct
ccanlint
info_documentation_exists
=
{
.
key
=
"info_documentation_exists"
,
.
name
=
"Module has documentation in _info"
,
.
check
=
check_
has_info_documentation
,
.
check
=
check_
info_documentation_exists
,
.
needs
=
"info_exists"
};
REGISTER_TEST
(
has_info_documentation
);
REGISTER_TEST
(
info_documentation_exists
);
tools/ccanlint/tests/has_tests.c
View file @
2926cafb
...
...
@@ -10,7 +10,7 @@
#include <err.h>
#include <ccan/talloc/talloc.h>
extern
struct
ccanlint
has_tests
;
extern
struct
ccanlint
tests_exist
;
static
void
handle_no_tests
(
struct
manifest
*
m
,
struct
score
*
score
)
{
...
...
@@ -92,7 +92,7 @@ static void handle_no_tests(struct manifest *m, struct score *score)
fclose
(
run
);
}
static
void
check_
has_tests
(
struct
manifest
*
m
,
static
void
check_
tests_exist
(
struct
manifest
*
m
,
bool
keep
,
unsigned
int
*
timeleft
,
struct
score
*
score
)
{
...
...
@@ -103,7 +103,7 @@ static void check_has_tests(struct manifest *m,
score
->
error
=
"No test directory"
;
if
(
errno
!=
ENOENT
)
err
(
1
,
"statting %s"
,
test_dir
);
has_tests
.
handle
=
handle_no_tests
;
tests_exist
.
handle
=
handle_no_tests
;
return
;
}
...
...
@@ -117,7 +117,7 @@ static void check_has_tests(struct manifest *m,
&&
list_empty
(
&
m
->
compile_ok_tests
))
{
if
(
list_empty
(
&
m
->
compile_fail_tests
))
{
score
->
error
=
"No tests in test directory"
;
has_tests
.
handle
=
handle_no_tests
;
tests_exist
.
handle
=
handle_no_tests
;
}
else
score
->
error
=
"No positive tests in test directory"
;
return
;
...
...
@@ -126,11 +126,11 @@ static void check_has_tests(struct manifest *m,
score
->
score
=
score
->
total
;
}
struct
ccanlint
has_tests
=
{
struct
ccanlint
tests_exist
=
{
.
key
=
"tests_exist"
,
.
name
=
"Module has test directory with tests in it"
,
.
check
=
check_
has_tests
,
.
check
=
check_
tests_exist
,
.
needs
=
""
};
REGISTER_TEST
(
has_tests
);
REGISTER_TEST
(
tests_exist
);
tools/ccanlint/tests/idempotent.c
View file @
2926cafb
...
...
@@ -193,7 +193,7 @@ static void check_idempotent(struct manifest *m,
}
}
struct
ccanlint
idempotent
=
{
struct
ccanlint
headers_
idempotent
=
{
.
key
=
"headers_idempotent"
,
.
name
=
"Module headers are #ifndef/#define wrapped"
,
.
check
=
check_idempotent
,
...
...
@@ -201,4 +201,4 @@ struct ccanlint idempotent = {
.
needs
=
""
};
REGISTER_TEST
(
idempotent
);
REGISTER_TEST
(
headers_
idempotent
);
tools/ccanlint/tests/license.c
View file @
2926cafb
...
...
@@ -149,11 +149,11 @@ static void check_has_license(struct manifest *m,
score
->
score
=
score
->
total
;
}
struct
ccanlint
has_license
=
{
struct
ccanlint
license_exists
=
{
.
key
=
"license_exists"
,
.
name
=
"Module has License: entry in _info, and LICENSE symlink/file"
,
.
check
=
check_has_license
,
.
needs
=
"info_exists"
};
REGISTER_TEST
(
has_license
);
REGISTER_TEST
(
license_exists
);
tools/ccanlint/tests/run-coverage.c
View file @
2926cafb
...
...
@@ -162,11 +162,11 @@ static void do_run_coverage_tests(struct manifest *m,
analyze_coverage
(
m
,
full_gcov
,
cmdout
,
score
);
}
struct
ccanlint
run_coverage_tests
=
{
struct
ccanlint
tests_coverage
=
{
.
key
=
"tests_coverage"
,
.
name
=
"Module's tests cover all the code"
,
.
check
=
do_run_coverage_tests
,
.
needs
=
"tests_compile_coverage tests_pass"
};
REGISTER_TEST
(
run_coverage_tests
);
REGISTER_TEST
(
tests_coverage
);
tools/ccanlint/tests/run_tests.c
View file @
2926cafb
...
...
@@ -65,7 +65,7 @@ static void run_under_debugger(struct manifest *m, struct score *score)
doesnt_matter
();
}
struct
ccanlint
run_test
s
=
{
struct
ccanlint
tests_pas
s
=
{
.
key
=
"tests_pass"
,
.
name
=
"Module's run and api tests pass"
,
.
check
=
do_run_tests
,
...
...
@@ -74,4 +74,4 @@ struct ccanlint run_tests = {
.
needs
=
"tests_compile"
};
REGISTER_TEST
(
run_test
s
);
REGISTER_TEST
(
tests_pas
s
);
tools/ccanlint/tests/run_tests_valgrind.c
View file @
2926cafb
...
...
@@ -179,7 +179,7 @@ static void run_under_debugger_vg(struct manifest *m, struct score *score)
doesnt_matter
();
}
struct
ccanlint
run_tests_vg
=
{
struct
ccanlint
tests_pass_valgrind
=
{
.
key
=
"tests_pass_valgrind"
,
.
name
=
"Module's run and api tests succeed under valgrind"
,
.
can_run
=
can_run_vg
,
...
...
@@ -189,13 +189,13 @@ struct ccanlint run_tests_vg = {
.
needs
=
"tests_pass"
};
REGISTER_TEST
(
run_tests_vg
);
REGISTER_TEST
(
tests_pass_valgrind
);
struct
ccanlint
run_tests_vg_leak
=
{
struct
ccanlint
tests_pass_valgrind_noleaks
=
{
.
key
=
"tests_pass_valgrind_noleaks"
,
.
name
=
"Module's run and api tests leak memory"
,
.
check
=
do_leakcheck_vg
,
.
needs
=
"tests_pass_valgrind"
};
REGISTER_TEST
(
run_tests_vg_leak
);
REGISTER_TEST
(
tests_pass_valgrind_noleaks
);
tools/ccanlint/tests/trailing_whitespace.c
View file @
2926cafb
...
...
@@ -49,7 +49,7 @@ static void check_trailing_whitespace(struct manifest *m,
}
}
struct
ccanlint
trailing_whitespace
=
{
struct
ccanlint
no_
trailing_whitespace
=
{
.
key
=
"no_trailing_whitespace"
,
.
name
=
"Module's source code has no trailing whitespace"
,
.
check
=
check_trailing_whitespace
,
...
...
@@ -57,4 +57,4 @@ struct ccanlint trailing_whitespace = {
};
REGISTER_TEST
(
trailing_whitespace
);
REGISTER_TEST
(
no_
trailing_whitespace
);
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