Browse Source

Remove old run-tests, clean up #includes to all be <ccan/...

Rusty Russell 16 years ago
parent
commit
85a3313589
60 changed files with 138 additions and 390 deletions
  1. 2 2
      ccan/alignof/test/run.c
  2. 3 3
      ccan/alloc/test/run-testsize.c
  3. 3 3
      ccan/alloc/test/run.c
  4. 2 2
      ccan/antithread/test/run-lock.c
  5. 2 2
      ccan/antithread/test/run-simple.c
  6. 2 2
      ccan/antithread/test/run-spawn-NULL.c
  7. 2 2
      ccan/antithread/test/run-spawn.c
  8. 2 2
      ccan/antithread/test/run-tell.c
  9. 2 2
      ccan/antithread/test/run-tell_parent.c
  10. 3 3
      ccan/array/test/run.c
  11. 1 1
      ccan/array_size/test/compile_fail.c
  12. 2 2
      ccan/array_size/test/run.c
  13. 3 3
      ccan/block_pool/test/run.c
  14. 1 1
      ccan/build_assert/test/compile_fail-expr.c
  15. 1 1
      ccan/build_assert/test/compile_fail.c
  16. 1 1
      ccan/build_assert/test/compile_ok.c
  17. 2 2
      ccan/build_assert/test/run-EXPR_BUILD_ASSERT.c
  18. 7 7
      ccan/ccan_tokenizer/test/run-simple-token.c
  19. 8 8
      ccan/ccan_tokenizer/test/run.c
  20. 1 1
      ccan/check_type/test/compile_fail-check_type.c
  21. 1 1
      ccan/check_type/test/compile_fail-check_type_unsigned.c
  22. 1 1
      ccan/check_type/test/compile_fail-check_types_match.c
  23. 2 2
      ccan/check_type/test/run.c
  24. 1 1
      ccan/ciniparser/ciniparser.c
  25. 5 5
      ccan/ciniparser/test/run.c
  26. 2 2
      ccan/crc/test/api.c
  27. 2 2
      ccan/endian/test/run.c
  28. 9 9
      ccan/grab_file/test/run-grab.c
  29. 2 2
      ccan/hash/test/api-hash_stable.c
  30. 3 3
      ccan/hash/test/run.c
  31. 3 3
      ccan/ilog/test/run.c
  32. 3 3
      ccan/isaac/test/run.c
  33. 3 3
      ccan/isaac/test/run64.c
  34. 3 3
      ccan/list/test/compile_ok-constant.c
  35. 3 3
      ccan/list/test/run.c
  36. 2 2
      ccan/md4/test/api.c
  37. 3 3
      ccan/noerr/test/run.c
  38. 3 3
      ccan/read_write_all/test/run-read_all.c
  39. 3 3
      ccan/read_write_all/test/run-write_all.c
  40. 2 2
      ccan/short_types/test/run.c
  41. 2 2
      ccan/str/test/run.c
  42. 4 4
      ccan/str_talloc/test/run.c
  43. 1 1
      ccan/stringmap/stringmap.c
  44. 3 3
      ccan/stringmap/test/run.c
  45. 1 1
      ccan/talloc/test/compile_fail-talloc_set.c
  46. 2 2
      ccan/talloc/test/run-external-alloc.c
  47. 2 2
      ccan/talloc/test/run-talloc_set.c
  48. 2 2
      ccan/talloc/test/run.c
  49. 3 3
      ccan/talloc_link/test/run.c
  50. 1 1
      ccan/typesafe_cb/test/compile_fail-cast_if_type.c
  51. 1 1
      ccan/typesafe_cb/test/compile_fail-typesafe_cb-int.c
  52. 1 1
      ccan/typesafe_cb/test/compile_fail-typesafe_cb.c
  53. 1 1
      ccan/typesafe_cb/test/compile_fail-typesafe_cb_postargs.c
  54. 1 1
      ccan/typesafe_cb/test/compile_fail-typesafe_cb_preargs.c
  55. 1 1
      ccan/typesafe_cb/test/compile_ok-typesafe_cb-const.c
  56. 1 1
      ccan/typesafe_cb/test/compile_ok-typesafe_cb-volatile.c
  57. 2 2
      ccan/typesafe_cb/test/run.c
  58. 2 4
      tools/Makefile
  59. 0 249
      tools/run_tests.c
  60. 1 2
      tools/tools.h

+ 2 - 2
ccan/alignof/test/run.c

@@ -1,7 +1,7 @@
+#include <ccan/alignof/alignof.h>
 #include <stdlib.h>
 #include <stddef.h>
-#include <tap/tap.h>
-#include "alignof/alignof.h"
+#include <ccan/tap/tap.h>
 
 /* Alignment is remarkably difficult to test.  The rules may be more
  * complex than ALIGNOF() can know: eg. on i386 __alignof__(double) == 8, but

+ 3 - 3
ccan/alloc/test/run-testsize.c

@@ -1,6 +1,6 @@
-#include "alloc/alloc.h"
-#include "tap/tap.h"
-#include "alloc/alloc.c"
+#include <ccan/alloc/alloc.h>
+#include <ccan/tap/tap.h>
+#include <ccan/alloc/alloc.c>
 #include <stdlib.h>
 #include <stdbool.h>
 #include <err.h>

+ 3 - 3
ccan/alloc/test/run.c

@@ -1,6 +1,6 @@
-#include "alloc/alloc.h"
-#include "tap/tap.h"
-#include "alloc/alloc.c"
+#include <ccan/alloc/alloc.h>
+#include <ccan/tap/tap.h>
+#include <ccan/alloc/alloc.c>
 #include <stdlib.h>
 #include <err.h>
 

+ 2 - 2
ccan/antithread/test/run-lock.c

@@ -1,7 +1,7 @@
-#include "antithread/antithread.c"
+#include <ccan/antithread/antithread.c>
 #include <assert.h>
 #include <unistd.h>
-#include "tap/tap.h"
+#include <ccan/tap/tap.h>
 
 #define NUM_RUNS 100
 

+ 2 - 2
ccan/antithread/test/run-simple.c

@@ -1,6 +1,6 @@
-#include "antithread/antithread.c"
+#include <ccan/antithread/antithread.c>
 #include <assert.h>
-#include "tap/tap.h"
+#include <ccan/tap/tap.h>
 
 static void *test(struct at_pool *atp, int *pid)
 {

+ 2 - 2
ccan/antithread/test/run-spawn-NULL.c

@@ -1,6 +1,6 @@
-#include "antithread/antithread.c"
+#include <ccan/antithread/antithread.c>
 #include <assert.h>
-#include "tap/tap.h"
+#include <ccan/tap/tap.h>
 
 int main(int argc, char *argv[])
 {

+ 2 - 2
ccan/antithread/test/run-spawn.c

@@ -1,6 +1,6 @@
-#include "antithread/antithread.c"
+#include <ccan/antithread/antithread.c>
 #include <assert.h>
-#include "tap/tap.h"
+#include <ccan/tap/tap.h>
 
 int main(int argc, char *argv[])
 {

+ 2 - 2
ccan/antithread/test/run-tell.c

@@ -1,6 +1,6 @@
-#include "antithread/antithread.c"
+#include <ccan/antithread/antithread.c>
 #include <assert.h>
-#include "tap/tap.h"
+#include <ccan/tap/tap.h>
 
 static void *test(struct at_pool *atp, void *unused)
 {

+ 2 - 2
ccan/antithread/test/run-tell_parent.c

@@ -1,6 +1,6 @@
-#include "antithread/antithread.c"
+#include <ccan/antithread/antithread.c>
 #include <assert.h>
-#include "tap/tap.h"
+#include <ccan/tap/tap.h>
 
 static void *test(struct at_pool *atp, int *pid)
 {

+ 3 - 3
ccan/array/test/run.c

@@ -1,7 +1,7 @@
 #include <stdio.h>
-#include <tap/tap.h>
-#include "array/array.h"
-#include "array/array.c"
+#include <ccan/tap/tap.h>
+#include <ccan/array/array.h>
+#include <ccan/array/array.c>
 
 #define countof(array...) (sizeof(array)/sizeof(*(array)))
 #include "lotsOfNumbers.h"

+ 1 - 1
ccan/array_size/test/compile_fail.c

@@ -1,4 +1,4 @@
-#include "array_size/array_size.h"
+#include <ccan/array_size/array_size.h>
 
 int main(int argc, char *argv[8])
 {

+ 2 - 2
ccan/array_size/test/run.c

@@ -1,5 +1,5 @@
-#include "array_size/array_size.h"
-#include "tap/tap.h"
+#include <ccan/array_size/array_size.h>
+#include <ccan/tap/tap.h>
 
 static char array1[1];
 static int array2[2];

+ 3 - 3
ccan/block_pool/test/run.c

@@ -1,6 +1,6 @@
-#include "block_pool/block_pool.h"
-#include "block_pool/block_pool.c"
-#include "tap/tap.h"
+#include <ccan/block_pool/block_pool.h>
+#include <ccan/block_pool/block_pool.c>
+#include <ccan/tap/tap.h>
 
 struct alloc_record {
 	size_t size;

+ 1 - 1
ccan/build_assert/test/compile_fail-expr.c

@@ -1,4 +1,4 @@
-#include "build_assert/build_assert.h"
+#include <ccan/build_assert/build_assert.h>
 
 int main(int argc, char *argv[])
 {

+ 1 - 1
ccan/build_assert/test/compile_fail.c

@@ -1,4 +1,4 @@
-#include "build_assert/build_assert.h"
+#include <ccan/build_assert/build_assert.h>
 
 int main(int argc, char *argv[])
 {

+ 1 - 1
ccan/build_assert/test/compile_ok.c

@@ -1,4 +1,4 @@
-#include "build_assert/build_assert.h"
+#include <ccan/build_assert/build_assert.h>
 
 int main(int argc, char *argv[])
 {

+ 2 - 2
ccan/build_assert/test/run-EXPR_BUILD_ASSERT.c

@@ -1,5 +1,5 @@
-#include "build_assert/build_assert.h"
-#include "tap/tap.h"
+#include <ccan/build_assert/build_assert.h>
+#include <ccan/tap/tap.h>
 
 int main(int argc, char *argv[])
 {

+ 7 - 7
ccan/ccan_tokenizer/test/run-simple-token.c

@@ -1,10 +1,10 @@
-#include "ccan_tokenizer/read_cnumber.c"
-#include "ccan_tokenizer/read_cstring.c"
-#include "ccan_tokenizer/dict.c"
-#include "ccan_tokenizer/ccan_tokenizer.c"
-#include "ccan_tokenizer/queue.c"
-#include "ccan_tokenizer/charflag.c"
-#include "tap/tap.h"
+#include <ccan/ccan_tokenizer/read_cnumber.c>
+#include <ccan/ccan_tokenizer/read_cstring.c>
+#include <ccan/ccan_tokenizer/dict.c>
+#include <ccan/ccan_tokenizer/ccan_tokenizer.c>
+#include <ccan/ccan_tokenizer/queue.c>
+#include <ccan/ccan_tokenizer/charflag.c>
+#include <ccan/tap/tap.h>
 
 #define item(num) (toks->first[num])
 //sed 's/toks->array\.item\[\([^]]*\)\]/item(\1)/g'

+ 8 - 8
ccan/ccan_tokenizer/test/run.c

@@ -25,16 +25,16 @@
         THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
-#include "ccan_tokenizer/read_cnumber.c"
-#include "ccan_tokenizer/read_cstring.c"
-#include "ccan_tokenizer/dict.c"
-#include "ccan_tokenizer/ccan_tokenizer.c"
-#include "ccan_tokenizer/queue.c"
-#include "ccan_tokenizer/charflag.c"
+#include <ccan/ccan_tokenizer/read_cnumber.c>
+#include <ccan/ccan_tokenizer/read_cstring.c>
+#include <ccan/ccan_tokenizer/dict.c>
+#include <ccan/ccan_tokenizer/ccan_tokenizer.c>
+#include <ccan/ccan_tokenizer/queue.c>
+#include <ccan/ccan_tokenizer/charflag.c>
 
-#include "ccan_tokenizer/ccan_tokenizer.h"
+#include <ccan/ccan_tokenizer/ccan_tokenizer.h>
 
-#include "tap/tap.h"
+#include <ccan/tap/tap.h>
 
 #include <math.h>
 

+ 1 - 1
ccan/check_type/test/compile_fail-check_type.c

@@ -1,4 +1,4 @@
-#include "check_type/check_type.h"
+#include <ccan/check_type/check_type.h>
 
 int main(int argc, char *argv[])
 {

+ 1 - 1
ccan/check_type/test/compile_fail-check_type_unsigned.c

@@ -1,4 +1,4 @@
-#include "check_type/check_type.h"
+#include <ccan/check_type/check_type.h>
 
 int main(int argc, char *argv[])
 {

+ 1 - 1
ccan/check_type/test/compile_fail-check_types_match.c

@@ -1,4 +1,4 @@
-#include "check_type/check_type.h"
+#include <ccan/check_type/check_type.h>
 
 int main(int argc, char *argv[])
 {

+ 2 - 2
ccan/check_type/test/run.c

@@ -1,5 +1,5 @@
-#include "check_type/check_type.h"
-#include "tap/tap.h"
+#include <ccan/check_type/check_type.h>
+#include <ccan/tap/tap.h>
 
 int main(int argc, char *argv[])
 {

+ 1 - 1
ccan/ciniparser/ciniparser.c

@@ -33,7 +33,7 @@
  */
 
 #include <ctype.h>
-#include "ciniparser.h"
+#include <ccan/ccan/ciniparser.h>
 
 #define ASCIILINESZ      (1024)
 #define INI_INVALID_KEY  ((char*) NULL)

+ 5 - 5
ccan/ciniparser/test/run.c

@@ -1,14 +1,14 @@
-#include <ciniparser/ciniparser.h>
-#include <ciniparser/ciniparser.c>
-#include <ciniparser/dictionary.h>
-#include <ciniparser/dictionary.c>
+#include <ccan/ciniparser/ciniparser.h>
+#include <ccan/ciniparser/ciniparser.c>
+#include <ccan/ciniparser/dictionary.h>
+#include <ccan/ciniparser/dictionary.c>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 #include <stdbool.h>
 
-#include <tap/tap.h>
+#include <ccan/tap/tap.h>
 
 #define NUM_TESTS 12
 

+ 2 - 2
ccan/crc/test/api.c

@@ -1,5 +1,5 @@
-#include "crc/crc.h"
-#include "tap/tap.h"
+#include <ccan/crc/crc.h>
+#include <ccan/tap/tap.h>
 #include <string.h>
 
 static const uint32_t crc32c_tab[] = {

+ 2 - 2
ccan/endian/test/run.c

@@ -1,7 +1,7 @@
-#include "endian/endian.h"
+#include <ccan/endian/endian.h>
 #include <stdlib.h>
 #include <stddef.h>
-#include <tap/tap.h>
+#include <ccan/tap/tap.h>
 
 int main(int argc, char *argv[])
 {

+ 9 - 9
ccan/grab_file/test/run-grab.c

@@ -1,14 +1,14 @@
 /* This is test for grab_file() function
  */
-#include 	"grab_file/grab_file.h"
-#include 	<stdlib.h>
-#include 	<stdio.h>
-#include 	<err.h>
-#include 	<sys/stat.h>
-#include 	"grab_file/grab_file.c"
-#include 	"tap/tap.h"
-#include 	"str_talloc/str_talloc.h"
-#include 	"str/str.h"
+#include <ccan/grab_file/grab_file.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <err.h>
+#include <sys/stat.h>
+#include <ccan/grab_file/grab_file.c>
+#include <ccan/tap/tap.h>
+#include <ccan/str_talloc/str_talloc.h>
+#include <ccan/str/str.h>
 
 int 
 main(int argc, char *argv[])

+ 2 - 2
ccan/hash/test/api-hash_stable.c

@@ -1,5 +1,5 @@
-#include "hash/hash.h"
-#include "tap/tap.h"
+#include <ccan/hash/hash.h>
+#include <ccan/tap/tap.h>
 #include <stdbool.h>
 #include <string.h>
 

+ 3 - 3
ccan/hash/test/run.c

@@ -1,6 +1,6 @@
-#include "hash/hash.h"
-#include "tap/tap.h"
-#include "hash/hash.c"
+#include <ccan/hash/hash.h>
+#include <ccan/tap/tap.h>
+#include <ccan/hash/hash.c>
 #include <stdbool.h>
 #include <string.h>
 

+ 3 - 3
ccan/ilog/test/run.c

@@ -1,7 +1,7 @@
-#include "ilog/ilog.h"
-#include "ilog/ilog.c"
+#include <ccan/ilog/ilog.h>
+#include <ccan/ilog/ilog.c>
 #include <stdio.h>
-#include "tap/tap.h"
+#include <ccan/tap/tap.h>
 
 /*Dead simple (but slow) versions to compare against.*/
 

+ 3 - 3
ccan/isaac/test/run.c

@@ -1,6 +1,6 @@
-#include "isaac/isaac.h"
-#include "isaac/isaac.c"
-#include "tap/tap.h"
+#include <ccan/isaac/isaac.h>
+#include <ccan/isaac/isaac.c>
+#include <ccan/tap/tap.h>
 #include <stddef.h>
 
 static const uint32_t STATEVEC[ISAAC_SZ<<1]={

+ 3 - 3
ccan/isaac/test/run64.c

@@ -1,6 +1,6 @@
-#include "isaac/isaac64.h"
-#include "isaac/isaac64.c"
-#include "tap/tap.h"
+#include <ccan/isaac/isaac64.h>
+#include <ccan/isaac/isaac64.c>
+#include <ccan/tap/tap.h>
 #include <stddef.h>
 
 static const uint64_t STATEVEC64[ISAAC64_SZ<<1]={

+ 3 - 3
ccan/list/test/compile_ok-constant.c

@@ -1,6 +1,6 @@
-#include "list/list.h"
-#include "tap/tap.h"
-#include "list/list.c"
+#include <ccan/list/list.h>
+#include <ccan/tap/tap.h>
+#include <ccan/list/list.c>
 #include <stdbool.h>
 #include <stdio.h>
 

+ 3 - 3
ccan/list/test/run.c

@@ -1,6 +1,6 @@
-#include "list/list.h"
-#include "tap/tap.h"
-#include "list/list.c"
+#include <ccan/list/list.h>
+#include <ccan/tap/tap.h>
+#include <ccan/list/list.c>
 
 struct parent {
 	const char *name;

+ 2 - 2
ccan/md4/test/api.c

@@ -1,5 +1,5 @@
-#include "md4/md4.h"
-#include <tap/tap.h>
+#include <ccan/md4/md4.h>
+#include <ccan/tap/tap.h>
 #include <stdio.h>
 #include <string.h>
 

+ 3 - 3
ccan/noerr/test/run.c

@@ -1,6 +1,6 @@
-#include "noerr/noerr.h"
-#include "tap/tap.h"
-#include "noerr/noerr.c"
+#include <ccan/noerr/noerr.h>
+#include <ccan/tap/tap.h>
+#include <ccan/noerr/noerr.c>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>

+ 3 - 3
ccan/read_write_all/test/run-read_all.c

@@ -1,8 +1,8 @@
 /* FIXME: Do something tricky to ensure we really do loop in read_all. */
 
-#include "read_write_all/read_write_all.h"
-#include "read_write_all/read_write_all.c"
-#include "tap/tap.h"
+#include <ccan/read_write_all/read_write_all.h>
+#include <ccan/read_write_all/read_write_all.c>
+#include <ccan/tap/tap.h>
 #include <unistd.h>
 #include <sys/types.h>
 #include <signal.h>

+ 3 - 3
ccan/read_write_all/test/run-write_all.c

@@ -1,8 +1,8 @@
 /* FIXME: Do something tricky to ensure we really do loop in write_all. */
 
-#include "read_write_all/read_write_all.h"
-#include "read_write_all/read_write_all.c"
-#include "tap/tap.h"
+#include <ccan/read_write_all/read_write_all.h>
+#include <ccan/read_write_all/read_write_all.c>
+#include <ccan/tap/tap.h>
 #include <unistd.h>
 #include <sys/types.h>
 #include <signal.h>

+ 2 - 2
ccan/short_types/test/run.c

@@ -1,5 +1,5 @@
-#include "short_types/short_types.h"
-#include "tap/tap.h"
+#include <ccan/short_types/short_types.h>
+#include <ccan/tap/tap.h>
 #include <stdlib.h>
 #include <err.h>
 

+ 2 - 2
ccan/str/test/run.c

@@ -1,7 +1,7 @@
-#include "str/str.h"
+#include <ccan/str/str.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include "tap/tap.h"
+#include <ccan/tap/tap.h>
 
 /* FIXME: ccanize */
 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))

+ 4 - 4
ccan/str_talloc/test/run.c

@@ -1,9 +1,9 @@
-#include "str_talloc/str_talloc.h"
+#include <ccan/str_talloc/str_talloc.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include "str_talloc/str_talloc.c"
-#include "tap/tap.h"
-#include "str/str.h"
+#include <ccan/str_talloc/str_talloc.c>
+#include <ccan/tap/tap.h>
+#include <ccan/str/str.h>
 
 /* FIXME: ccanize */
 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))

+ 1 - 1
ccan/stringmap/stringmap.c

@@ -29,7 +29,7 @@
 /* This is a heavily modified version of the Patricia tree implementation
    in PCC at http://pcc.zentus.com/cgi-bin/cvsweb.cgi/cc/cpp/cpp.c?rev=1.96 */
 
-#include "stringmap.h"
+#include <ccan/stringmap/stringmap.h>
 
 //#define CONSISTENCY_CHECK
 

+ 3 - 3
ccan/stringmap/test/run.c

@@ -1,7 +1,7 @@
-#include "stringmap/stringmap.h"
-#include "stringmap/stringmap.c"
+#include <ccan/stringmap/stringmap.h>
+#include <ccan/stringmap/stringmap.c>
 
-#include "tap/tap.h"
+#include <ccan/tap/tap.h>
 
 static void test_trivial(void) {
 	stringmap(int) map = stringmap_new(NULL);

+ 1 - 1
ccan/talloc/test/compile_fail-talloc_set.c

@@ -1,4 +1,4 @@
-#include "talloc/talloc.c"
+#include <ccan/talloc/talloc.c>
 
 int main(void)
 {

+ 2 - 2
ccan/talloc/test/run-external-alloc.c

@@ -1,5 +1,5 @@
-#include "talloc/talloc.c"
-#include "tap/tap.h"
+#include <ccan/talloc/talloc.c>
+#include <ccan/tap/tap.h>
 #include <assert.h>
 
 /* Much testing already done in run.c */

+ 2 - 2
ccan/talloc/test/run-talloc_set.c

@@ -1,5 +1,5 @@
-#include "talloc/talloc.c"
-#include "tap/tap.h"
+#include <ccan/talloc/talloc.c>
+#include <ccan/tap/tap.h>
 #include <assert.h>
 
 int main(void)

+ 2 - 2
ccan/talloc/test/run.c

@@ -25,9 +25,9 @@
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
-#include "talloc/talloc.c"
+#include <ccan/talloc/talloc.c>
 #include <stdbool.h>
-#include "tap/tap.h"
+#include <ccan/tap/tap.h>
 
 #define torture_assert(test, expr, str)					\
 	ok(expr, "%s [\n%s: Expression %s failed: %s\n]\n",		\

+ 3 - 3
ccan/talloc_link/test/run.c

@@ -1,6 +1,6 @@
-#include "talloc_link/talloc_link.h"
-#include "tap/tap.h"
-#include "talloc_link/talloc_link.c"
+#include <ccan/talloc_link/talloc_link.h>
+#include <ccan/tap/tap.h>
+#include <ccan/talloc_link/talloc_link.c>
 #include <stdlib.h>
 #include <err.h>
 

+ 1 - 1
ccan/typesafe_cb/test/compile_fail-cast_if_type.c

@@ -1,4 +1,4 @@
-#include "typesafe_cb/typesafe_cb.h"
+#include <ccan/typesafe_cb/typesafe_cb.h>
 
 void _set_some_value(void *val);
 

+ 1 - 1
ccan/typesafe_cb/test/compile_fail-typesafe_cb-int.c

@@ -1,4 +1,4 @@
-#include "typesafe_cb/typesafe_cb.h"
+#include <ccan/typesafe_cb/typesafe_cb.h>
 #include <stdlib.h>
 
 void _callback(void (*fn)(void *arg), void *arg);

+ 1 - 1
ccan/typesafe_cb/test/compile_fail-typesafe_cb.c

@@ -1,4 +1,4 @@
-#include "typesafe_cb/typesafe_cb.h"
+#include <ccan/typesafe_cb/typesafe_cb.h>
 #include <stdlib.h>
 
 static void _register_callback(void (*cb)(void *arg), void *arg)

+ 1 - 1
ccan/typesafe_cb/test/compile_fail-typesafe_cb_postargs.c

@@ -1,4 +1,4 @@
-#include "typesafe_cb/typesafe_cb.h"
+#include <ccan/typesafe_cb/typesafe_cb.h>
 #include <stdlib.h>
 
 static void _register_callback(void (*cb)(void *arg, int x), void *arg)

+ 1 - 1
ccan/typesafe_cb/test/compile_fail-typesafe_cb_preargs.c

@@ -1,4 +1,4 @@
-#include "typesafe_cb/typesafe_cb.h"
+#include <ccan/typesafe_cb/typesafe_cb.h>
 #include <stdlib.h>
 
 static void _register_callback(void (*cb)(int x, void *arg), void *arg)

+ 1 - 1
ccan/typesafe_cb/test/compile_ok-typesafe_cb-const.c

@@ -1,4 +1,4 @@
-#include "typesafe_cb/typesafe_cb.h"
+#include <ccan/typesafe_cb/typesafe_cb.h>
 #include <stdlib.h>
 
 /* const args in callbacks should be OK. */

+ 1 - 1
ccan/typesafe_cb/test/compile_ok-typesafe_cb-volatile.c

@@ -1,4 +1,4 @@
-#include "typesafe_cb/typesafe_cb.h"
+#include <ccan/typesafe_cb/typesafe_cb.h>
 #include <stdlib.h>
 
 /* volatile args in callbacks should be OK. */

+ 2 - 2
ccan/typesafe_cb/test/run.c

@@ -1,6 +1,6 @@
-#include "typesafe_cb/typesafe_cb.h"
+#include <ccan/typesafe_cb/typesafe_cb.h>
 #include <string.h>
-#include "tap/tap.h"
+#include <ccan/tap/tap.h>
 
 static char dummy = 0;
 

+ 2 - 4
tools/Makefile

@@ -1,4 +1,4 @@
-ALL_TOOLS = tools/ccan_depends tools/run_tests tools/doc_extract tools/namespacize tools/ccanlint/ccanlint
+ALL_TOOLS = tools/ccan_depends tools/doc_extract tools/namespacize tools/ccanlint/ccanlint
 
 DEP_OBJS = tools/depends.o tools/compile.o tools/tools.o ccan/str_talloc/str_talloc.o ccan/grab_file/grab_file.o ccan/talloc/talloc.o ccan/noerr/noerr.o ccan/read_write_all/read_write_all.o
 
@@ -7,13 +7,11 @@ tools: $(ALL_TOOLS)
 
 tools/ccan_depends: tools/ccan_depends.o $(DEP_OBJS)
 
-tools/run_tests: tools/run_tests.o ccan/tap/tap.o $(DEP_OBJS)
-
 tools/doc_extract: tools/doc_extract.o tools/doc_extract-core.o $(DEP_OBJS)
 
 tools/namespacize: tools/namespacize.o $(DEP_OBJS)
 
-tools/run_tests.o tools/namespacize.o tools/depends.o: tools/tools.h
+tools/namespacize.o tools/depends.o: tools/tools.h
 
 tools-clean: ccanlint-clean
 	$(RM) $(ALL_TOOLS)

+ 0 - 249
tools/run_tests.c

@@ -1,249 +0,0 @@
-#include <err.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <dirent.h>
-#include <assert.h>
-#include <unistd.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include "ccan/tap/tap.h"
-#include "ccan/talloc/talloc.h"
-#include "ccan/str/str.h"
-#include "ccan/array_size/array_size.h"
-#include "tools.h"
-
-static struct test *tests = NULL;
-static struct obj *objs = NULL;
-static int verbose;
-
-struct test_type {
-	const char *name;
-	void (*buildfn)(const char *dir, struct test_type *t, const char *name,
-			const char *apiobj, const char *libs);
-	void (*runfn)(const char *name);
-};
-
-struct test {
-	struct test *next;
-	struct test_type *type;
-	char *name;
-};
-
-struct obj {
-	struct obj *next;
-	bool generate;
-	char *name;
-};
-
-static char *output_name(const char *name)
-{
-	char *ret;
-
-	assert(strends(name, ".c"));
-
-	ret = talloc_strdup(name, name);
-	ret[strlen(ret) - 2] = '\0';
-	return ret;
-}
-
-static char *obj_list(const char *dir)
-{
-	char *list = talloc_strdup(objs, "");
-	struct obj *i;
-
-	for (i = objs; i; i = i->next)
-		list = talloc_asprintf_append(list, "%s ", i->name);
-
-	/* FIXME */
-	if (!streq(dir, "tap") && !strends(dir, "/tap"))
-		list = talloc_asprintf_append(list, "ccan/tap/tap.o");
-	return list;
-}
-
-static void compile_objs(void)
-{
-	struct obj *i;
-
-	for (i = objs; i; i = i->next) {
-		char *cmd = talloc_asprintf(i, "gcc " CFLAGS " -o %s.o -c %s%s",
-					    output_name(i->name), i->name,
-					    verbose ? "" : "> /dev/null 2>&1");
-		ok(system(cmd) == 0, "%s", cmd);
-	}
-}
-
-static void cleanup_objs(void)
-{
-	struct obj *i;
-
-	for (i = objs; i; i = i->next) {
-		if (!i->generate)
-			continue;
-		unlink(talloc_asprintf(i, "%s.o", output_name(i->name)));
-	}
-}
-
-static void add_test(const char *testdir, const char *name, struct test_type *t)
-{
-	struct test *test = talloc(testdir, struct test);
-
-	test->next = tests;
-	test->type = t;
-	test->name = talloc_asprintf(test, "%s/%s", testdir, name);
-	tests = test;
-}
-
-static void add_obj(const char *testdir, const char *name, bool generate)
-{
-	struct obj *obj = talloc(testdir, struct obj);
-
-	obj->next = objs;
-	obj->name = talloc_asprintf(obj, "%s/%s", testdir, name);
-	obj->generate = generate;
-	objs = obj;
-}
-
-static int build(const char *dir, const char *name, const char *apiobj,
-		 const char *libs, int fail)
-{
-	const char *cmd;
-	int ret;
-
-	cmd = talloc_asprintf(name, "gcc " CFLAGS " %s -o %s %s %s %s%s %s",
-			      fail ? "-DFAIL" : "",
-			      output_name(name), name, apiobj, obj_list(dir),
-			      libs, verbose ? "" : "> /dev/null 2>&1");
-
-	if (verbose)
-		fprintf(stderr, "Running %s\n", cmd);
-
-	ret = system(cmd);
-	if (ret == -1)
-		diag("cmd '%s' failed to execute", cmd);
-
-	return ret;
-}
-
-static void compile_ok(const char *dir, struct test_type *t, const char *name,
-		       const char *apiobj, const char *libs)
-{
-	ok(build(dir, name, "", libs, 0) == 0, "%s %s", t->name, name);
-}
-
-/* api tests get the API obj linked in as well. */
-static void compile_api_ok(const char *dir, struct test_type *t,
-			   const char *name, const char *apiobj,
-			   const char *libs)
-{
-	ok(build(dir, name, apiobj, libs, 0) == 0, "%s %s", t->name, name);
-}
-
-static void compile_fail(const char *dir, struct test_type *t, const char *name,
-			 const char *apiobj, const char *libs)
-{
-	if (build(dir, name, "", libs, 0) != 0)
-		fail("non-FAIL build %s", name);
-	else
-		ok(build(dir, name, "", libs, 1) > 0, "%s %s", t->name, name);
-}
-
-static void no_run(const char *name)
-{
-}
-
-static void run(const char *name)
-{
-	if (system(output_name(name)) != 0)
-		fail("running %s had error", name);
-}
-
-static void cleanup(const char *name)
-{
-	unlink(output_name(name));
-}
-
-static struct test_type test_types[] = {
-	{ "compile_ok", compile_ok, no_run },
-	{ "compile_fail", compile_fail, no_run },
-	{ "run", compile_ok, run },
-	{ "api", compile_api_ok, run },
-};
-
-int main(int argc, char *argv[])
-{
-	DIR *dir;
-	struct dirent *d;
-	char *testdir, *cwd;
-	const char *apiobj = "";
-	char *libs = talloc_strdup(NULL, "");
-	struct test *test;
-	unsigned int num_tests = 0, num_objs = 0, i;
-
-	if (argc > 1 && streq(argv[1], "--verbose")) {
-		verbose = 1;
-		argc--;
-		argv++;
-	}
-
-	while (argc > 1 && strstarts(argv[1], "--lib=")) {
-		libs = talloc_asprintf_append(libs, " -l%s",
-					      argv[1] + strlen("--lib="));
-		argc--;
-		argv++;
-	}
-
-	if (argc > 1 && strstarts(argv[1], "--apiobj=")) {
-		apiobj = argv[1] + strlen("--apiobj=");
-		argc--;
-		argv++;
-	}
-
-	if (argc < 2)
-		errx(1, "Usage: run_tests [--verbose] [--apiobj=<obj>] <dir> [<extra-objs>...]");
-
-	testdir = talloc_asprintf(NULL, "%s/test", argv[1]);
-	dir = opendir(testdir);
-	if (!dir)
-		err(1, "Opening '%s'", testdir);
-
-	while ((d = readdir(dir)) != NULL) {
-		if (d->d_name[0] == '.' || !strends(d->d_name, ".c"))
-			continue;
-
-		for (i = 0; i < ARRAY_SIZE(test_types); i++) {
-			if (strstarts(d->d_name, test_types[i].name)) {
-				add_test(testdir, d->d_name, &test_types[i]);
-				num_tests++;
-				break;
-			}
-		}
-		if (i == ARRAY_SIZE(test_types)) {
-			add_obj(testdir, d->d_name, true);
-			num_objs++;
-		}
-	}
-
-	plan_tests(num_tests + num_objs + (num_objs ? 1 : 0));
-	/* First all the extra object compilations. */
-	compile_objs();
-
-	/* Now add any object files from the command line */
-	cwd = talloc_strdup(testdir, ".");
-	for (i = 2; i < argc; i++)
-		add_obj(cwd, argv[i], false);
-
-	/* Do all the test compilations. */
-	for (test = tests; test; test = test->next)
-		test->type->buildfn(argv[1], test->type, test->name,
-				    apiobj, libs);
-
-	cleanup_objs();
-
-	/* Now run all the ones which wanted to run. */
-	for (test = tests; test; test = test->next) {
-		test->type->runfn(test->name);
-		cleanup(test->name);
-	}
-
-	exit(exit_status());
-}

+ 1 - 2
tools/tools.h

@@ -8,9 +8,8 @@
 
 #define SPACE_CHARS	" \f\n\r\t\v"
 
-/* FIXME: Remove some -I */
 /* FIXME: Nested functions break with -Wmissing-prototypes -Wmissing-declarations */
-#define CFLAGS "-g -Wall -Wundef -Wstrict-prototypes -Wold-style-definition -Werror -Iccan/ -I. -I.. -I../.."
+#define CFLAGS "-g -Wall -Wundef -Wstrict-prototypes -Wold-style-definition -Werror -I../.."
 
 /* This actually compiles and runs the info file to get dependencies. */
 char **get_deps(const void *ctx, const char *dir, const char *name,