#include <string.h>
#include <ctype.h>
#include "reduce_features.h"
+#include "tests_compile.h"
static const char *can_build(struct manifest *m)
{
return NULL;
}
-static char *obj_list(const struct manifest *m, bool link_with_module,
- enum compile_type ctype)
+char *test_obj_list(const struct manifest *m, bool link_with_module,
+ enum compile_type ctype, enum compile_type own_ctype)
{
char *list = talloc_strdup(m, "");
struct ccan_file *i;
if (link_with_module)
list_for_each(&m->c_files, i, list)
list = talloc_asprintf_append(list, " %s",
- i->compiled[ctype]);
+ i->compiled[own_ctype]);
/* Other ccan modules. */
list_for_each(&m->deps, subm, list) {
return list;
}
-static char *lib_list(const struct manifest *m, enum compile_type ctype)
+char *lib_list(const struct manifest *m, enum compile_type ctype)
{
unsigned int i, num;
char **libs = get_libs(m, m->dir, &num,
flags = talloc_asprintf(ctx, "%s%s%s",
fail ? "-DFAIL " : "",
cflags,
- ctype == COMPILE_NOFEAT ? " -I." : "");
+ ctype == COMPILE_NOFEAT
+ ? " "REDUCE_FEATURES_FLAGS : "");
fname = maybe_temp_file(ctx, "", keep, file->fullname);
if (!compile_and_link(ctx, file->fullname, ccan_dir,
- obj_list(m, link_with_module, ctype), compiler,
- flags, lib_list(m, ctype), fname, output)) {
+ test_obj_list(m, link_with_module,
+ ctype, ctype),
+ compiler, flags, lib_list(m, ctype), fname,
+ output)) {
talloc_free(fname);
return false;
}
.name = "Module tests compile (without features)",
.check = do_compile_tests_without_features,
.can_run = features_reduced,
- .needs = "tests_helpers_compile_without_features reduce_features"
+ .needs = "tests_helpers_compile_without_features objects_build_without_features"
};
REGISTER_TEST(tests_compile_without_features);