]> git.ozlabs.org Git - ccan/commitdiff
Fix "make check": this is temporary until we use ccanlint for it.
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 28 Sep 2009 04:20:25 +0000 (13:50 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 28 Sep 2009 04:20:25 +0000 (13:50 +0930)
ccan/grab_file/test/run-grab.c
tools/run_tests.c
tools/tools.h

index 357a88b328d39d2fd59d5698886cfafb94f0f1cf..3c44ce055c498e2041209484ad930a7356a2e836 100644 (file)
@@ -19,6 +19,9 @@ main(int argc, char *argv[])
        struct          stat st;
 
        str = grab_file(NULL, "test/run-grab.c", NULL);
+       /* FIXME: run_tests runs us from top level dir.  Kill this */
+       if (!str)
+               str = grab_file(NULL, "ccan/grab_file/test/run-grab.c", NULL);
        split = strsplit(NULL, str, "\n", NULL);
        length = strlen(split[0]);
        ok1(streq(split[0], "/* This is test for grab_file() function"));
@@ -26,7 +29,9 @@ main(int argc, char *argv[])
                length += strlen(split[i]);
        ok1(streq(split[i-1], "/* End of grab_file() test */"));
        if (stat("test/run-grab.c", &st) != 0) 
-               err(1, "Could not stat self");
+               /* FIXME: ditto */
+               if (stat("ccan/grab_file/test/run-grab.c", &st) != 0) 
+                       err(1, "Could not stat self");
        ok1(st.st_size == length + i);
        
        return 0;
index e50d1910a210596f09832a691c36267b492d33a2..5ba276fe4dbf7fdf517e0cb7859e9e1061218af3 100644 (file)
@@ -46,7 +46,7 @@ static char *output_name(const char *name)
        return ret;
 }
 
-static char *obj_list(void)
+static char *obj_list(const char *dir)
 {
        char *list = talloc_strdup(objs, "");
        struct obj *i;
@@ -55,7 +55,8 @@ static char *obj_list(void)
                list = talloc_asprintf_append(list, "%s ", i->name);
 
        /* FIXME */
-       list = talloc_asprintf_append(list, "ccan/tap/tap.o");
+       if (!streq(dir, "tap") && !strends(dir, "/tap"))
+               list = talloc_asprintf_append(list, "ccan/tap/tap.o");
        return list;
 }
 
@@ -110,8 +111,8 @@ static int build(const char *dir, const char *name, const char *apiobj,
 
        cmd = talloc_asprintf(name, "gcc " CFLAGS " %s -o %s %s %s %s%s %s",
                              fail ? "-DFAIL" : "",
-                             output_name(name), name, apiobj, obj_list(), libs,
-                             verbose ? "" : "> /dev/null 2>&1");
+                             output_name(name), name, apiobj, obj_list(dir),
+                             libs, verbose ? "" : "> /dev/null 2>&1");
 
        if (verbose)
                fprintf(stderr, "Running %s\n", cmd);
index 6f732378d331d51bae5e2820934df6cc728acb95..cc004036ded41db878b01639e85a5ae1d6143686 100644 (file)
@@ -9,7 +9,7 @@
 #define SPACE_CHARS    " \f\n\r\t\v"
 
 /* FIXME: Remove some -I */
-#define CFLAGS "-O -Wall -Wundef -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Werror -Iccan/ -I.. -I../.."
+#define CFLAGS "-O -Wall -Wundef -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Werror -Iccan/ -I. -I.. -I../.."
 
 /* This actually compiles and runs the info file to get dependencies. */
 char **get_deps(const void *ctx, const char *dir, const char *name,