* Author: Joey Adams <joeyadams3.14159@gmail.com>
* License: MIT
* Version: 0.1
- * Ccanlint:
- * // We actually depend on the LGPL talloc
- * license_depends_compat FAIL
*/
int main(int argc, char *argv[])
{
return 0;
}
+ if (strcmp(argv[1], "ccanlint") == 0) {
+ /* We actually depend on the LGPL talloc */
+ printf("license_depends_compat FAIL\n");
+ return 0;
+ }
+
return 1;
}
* }
*
* License: BSD (3 clause)
- *
- * Ccanlint:
- * // We actually depend on the LGPL dependencies
- * license_depends_compat FAIL
- * // We don't put the license line in all files.
- * license_comment FAIL
*/
int main(int argc, char *argv[])
{
return 0;
}
+ if (strcmp(argv[1], "ccanlint") == 0) {
+ /* We actually depend on the LGPL dependencies */
+ printf("license_depends_compat FAIL\n");
+ /* We don't put the license line in all files. */
+ printf("license_comment FAIL\n");
+ return 0;
+ }
+
return 1;
}
*
* Author: David Gibson <david@gibson.dropbear.id.au>
* License: LGPL (v2.1 or any later version)
- *
- * Ccanlint:
- * // Context switching really confuses valgrind
- * tests_pass_valgrind FAIL
*/
int main(int argc, char *argv[])
{
return 0;
}
+ if (strcmp(argv[1], "ccanlint") == 0) {
+ /* Context switching really confuses valgrind */
+ printf("tests_pass_valgrind FAIL\n");
+ return 0;
+ }
+
return 1;
}
*
* License: LGPL (v2.1 or any later version)
* Author: Rusty Russell <rusty@rustcorp.com.au>
- * Ccanlint:
- * // We actually depend on the GPL crc routines, so not really LGPL :(
- * license_depends_compat FAIL
*/
int main(int argc, char *argv[])
{
printf("ccan/array_size\n");
return 0;
}
+ if (strcmp(argv[1], "ccanlint") == 0) {
+ /* We actually depend on the GPL crc routines, so not really LGPL :( */
+ printf("license_depends_compat FAIL\n");
+ return 0;
+ }
return 1;
}
*
* License: APACHE-2
* Author: Dan Good <dan@dancancode.com>
- *
- * Ccanlint:
- * // uses statement expressions
- * // supported by gcc, clang, icc, and some others, but not msvc
- * // (see https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html)
- * objects_build_without_features FAIL
*/
int main(int argc, char *argv[])
{
return 0;
}
+ if (strcmp(argv[1], "ccanlint") == 0) {
+ /* uses statement expressions
+ * supported by gcc, clang, icc, and some others, but not msvc
+ * (see https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html) */
+ printf("objects_build_without_features FAIL\n");
+ return 0;
+ }
+
return 1;
}
*
* Author: David Gibson <david@gibson.dropbear.id.au>
* License: LGPL (v2.1 or any later version)
- *
- * Ccanlint:
- * // We need several gcc extensions
- * objects_build_without_features FAIL
- * tests_compile_without_features FAIL
- * tests_helpers_compile_without_features FAIL
*/
int main(int argc, char *argv[])
{
return 0;
}
+ if (strcmp(argv[1], "ccanlint") == 0) {
+ /* We need several gcc extensions */
+ printf("objects_build_without_features FAIL\n");
+ printf("tests_compile_without_features FAIL\n");
+ printf("tests_helpers_compile_without_features FAIL\n");
+ return 0;
+ }
+
return 1;
}
*
* Author: David Gibson <david@gibson.dropbear.id.au>
* License: CC0 (Public domain)
- *
- * Ccanlint:
- * // We need several gcc extensions
- * tests_compile_without_features FAIL
*/
int main(int argc, char *argv[])
{
return 0;
}
+ if (strcmp(argv[1], "ccanlint") == 0) {
+ /* We need several gcc extensions */
+ printf("tests_compile_without_features FAIL\n");
+ return 0;
+ }
+
return 1;
}
* // $ tail -c +29 /dev/shm/rszshm_LAsEvt/0 | sed 's/./&\n/g' | sort | uniq -c | tr '\n' '\t'; echo
* // 515532 A 527251 B 512930 C 513062 D 544326 E 545876 F 512936 G 522363 H
*
- * Ccanlint: tests_pass_valgrind FAIL
* License: APACHE-2
* Author: Dan Good <dan@dancancode.com>
- *
- * Ccanlint:
- * // tests use optional macros containing statement expressions
- * tests_compile_without_features FAIL
*/
int main(int argc, char *argv[])
{
if (strcmp(argv[1], "depends") == 0)
return 0;
+ if (strcmp(argv[1], "ccanlint") == 0) {
+ printf("tests_pass_valgrind FAIL\n");
+ /* tests use optional macros containing statement expressions */
+ printf("tests_compile_without_features FAIL\n");
+ return 0;
+ }
+
return 1;
}
* Authors: Joey Adams, Anders Magnusson
* License: BSD (3 clause)
* Version: 0.2
- * Ccanlint:
- * // We actually depend (indirectly) on the LGPL talloc
- * license_depends_compat FAIL
*/
int main(int argc, char *argv[])
{
return 0;
}
+ if (strcmp(argv[1], "ccanlint") == 0) {
+ /* We actually depend (indirectly) on the LGPL talloc */
+ printf("license_depends_compat FAIL\n");
+ return 0;
+ }
+
return 1;
}
memcpy(&test->options[num], options, (num_options + 1)*sizeof(char *));
}
-void add_info_options(struct ccan_file *info)
+void add_info_options(struct manifest *m)
{
- struct doc_section *d;
unsigned int i;
- struct ccanlint *test;
+ char **info_options = get_ccanlint(m, m->dir, get_or_compile_info);
- list_for_each(get_ccan_file_docs(info), d, list) {
- if (!streq(d->type, "ccanlint"))
+ for (i = 0; info_options[i]; i++) {
+ char **words = tal_strsplit(m, info_options[i], " \t",
+ STR_NO_EMPTY);
+ struct ccanlint *test;
+
+ if (!words[0])
+ continue;
+
+ test = find_test(words[0]);
+ if (!test) {
+ warnx("%s: unknown ccanlint test '%s'",
+ m->info_file->fullname, words[0]);
continue;
+ }
+
+ if (!words[1]) {
+ warnx("%s: no argument to test '%s'",
+ m->info_file->fullname, words[0]);
+ continue;
+ }
- for (i = 0; i < d->num_lines; i++) {
- char **words = tal_strsplit(d, d->lines[i], " \t",
- STR_NO_EMPTY);
- if (!words[0])
- continue;
-
- if (strncmp(words[0], "//", 2) == 0)
- continue;
-
- test = find_test(words[0]);
- if (!test) {
- warnx("%s: unknown ccanlint test '%s'",
- info->fullname, words[0]);
- continue;
- }
-
- if (!words[1]) {
- warnx("%s: no argument to test '%s'",
- info->fullname, words[0]);
- continue;
- }
-
- /* Known failure? */
- if (strcasecmp(words[1], "FAIL") == 0) {
- if (!targeting)
- skip_test_and_deps(test,
- "excluded in _info"
- " file");
- } else {
- if (!test->takes_options)
- warnx("%s: %s doesn't take options",
- info->fullname, words[0]);
- add_options(test, words+1, tal_count(words)-1);
- }
+ /* Known failure? */
+ if (strcasecmp(words[1], "FAIL") == 0) {
+ if (!targeting)
+ skip_test_and_deps(test,
+ "excluded in _info"
+ " file");
+ } else {
+ if (!test->takes_options)
+ warnx("%s: %s doesn't take options",
+ m->info_file->fullname, words[0]);
+ add_options(test, words+1, tal_count(words)-1);
}
}
}
bool is_excluded(const char *name);
/* Called to add options from _info, once it's located. */
-void add_info_options(struct ccan_file *info);
+void add_info_options(struct manifest *m);
/* Are we happy to compile stuff, or just non-intrusive tests? */
extern bool safe_mode;
if (m->info_file) {
score->pass = true;
score->score = score->total;
- add_info_options(m->info_file);
+ add_info_options(m);
} else {
score->error = tal_strdup(score,
"You have no _info file.\n\n"
return get_one_prop(ctx, dir, "cflags", get_info);
}
+static char **get_one_ccanlint(const void *ctx, const char *dir,
+ char *(*get_info)(const void *ctx, const char *dir))
+{
+ return get_one_prop(ctx, dir, "ccanlint", get_info);
+}
+
/* O(n^2) but n is small. */
static char **add_deps(char **deps1, char **deps2)
{
return flags;
}
+char **get_ccanlint(const void *ctx, const char *dir,
+ char *(*get_info)(const void *ctx, const char *dir))
+{
+ char **ccanlint;
+ unsigned int len;
+ ccanlint = get_one_ccanlint(ctx, dir, get_info);
+ len = tal_count(ccanlint);
+ tal_resize(&ccanlint, len + 1);
+ ccanlint[len] = NULL;
+ return ccanlint;
+}
+
static char *get_one_ported(const void *ctx, const char *dir,
char *(*get_info)(const void *ctx, const char *dir))
{
char **get_cflags(const void *ctx, const char *dir,
char *(*get_info)(const void *ctx, const char *dir));
+char **get_ccanlint(const void *ctx, const char *dir,
+ char *(*get_info)(const void *ctx, const char *dir));
+
char *get_ported(const void *ctx, const char *dir, bool recurse,
char *(*get_info)(const void *ctx, const char *dir));