X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=tools%2Fccanlint%2Fhas_tests.c;h=0866869570c2e71b1f21a3d7eff5574fec33db51;hb=914fa0bf6ec0bbe165ddf917e73a1e207743ba1d;hp=44ef64abc95cce5719a4010825ba397f50250042;hpb=7eb00644b848b551b2db5d9de40893e488c2790d;p=ccan diff --git a/tools/ccanlint/has_tests.c b/tools/ccanlint/has_tests.c index 44ef64ab..08668695 100644 --- a/tools/ccanlint/has_tests.c +++ b/tools/ccanlint/has_tests.c @@ -43,18 +43,26 @@ static const char *describe_has_tests(struct manifest *m, void *check_result) "There are four kinds of tests: api, run, compile_ok and compile_fail:\n" "you can tell which type of test a C file is by its name, eg 'run.c'\n" "and 'run-simple.c' are both run tests.\n\n" + "The simplest kind of test is a run test, which must compile with no\n" "warnings, and then run: it is expected to use libtap to report its\n" - "results in a simple and portable format.\n" + "results in a simple and portable format. It should #include the C\n" + "files from the module directly (so it can probe the internals): the\n" + "module will not be linked in.\n\n" + + "api tests are just like a run test, except it is a guarantee of API\n" + "stability: this test should pass on all future versions of the\n" + "module. They *are* linked to the module, since they should only\n" + "test the API, not the internal state.\n\n" + "compile_ok tests are a subset of run tests: they must compile and\n" - "link, but aren't run.\n" + "link, but aren't run.\n\n" + "compile_fail tests are tests which should fail to compile (or emit\n" "warnings) or link when FAIL is defined, but should compile and link\n" "when it's not defined: this helps ensure unrelated errors don't make\n" - "compilation fail.\n" - "api tests are just like a run test, except it is a guarantee of API\n" - "stability: this test should pass on all future versions of the\n" - "module.\n\n" + "compilation fail.\n\n" + "Note that the tests are not linked against the files in the\n" "above: you should directly #include those C files you want. This\n" "allows access to static functions and use special effects inside\n" @@ -72,7 +80,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", 0600) != 0) { + if (mkdir("test", 0700) != 0) { if (errno != EEXIST) err(1, "Creating test/ directory"); }