Lines Matching refs:err

81     name ## _format(const atf_error_t err, char *buf, size_t buflen) \
85 PRE(atf_error_is(err, #name)); \
87 data = atf_error_data(err); \
95 atf_error_t err; \
103 err = atf_error_new(#name, &data, sizeof(data), name ## _format); \
105 return err; \
117 print_error(const atf_error_t err)
121 PRE(atf_is_error(err));
123 atf_error_format(err, buf, sizeof(buf));
126 if (atf_error_is(err, "usage"))
155 atf_error_t err;
158 err = atf_fs_path_init_fmt(&temp, "%s", argv0);
159 if (atf_is_error(err))
162 err = atf_fs_path_branch_path(&temp, dir);
166 return err;
173 atf_error_t err;
179 err = argv0_to_dir(argv0, &p->m_srcdir);
180 if (atf_is_error(err))
181 return err;
183 err = atf_fs_path_init_fmt(&p->m_resfile, "/dev/stdout");
184 if (atf_is_error(err)) {
186 return err;
189 err = atf_map_init(&p->m_config);
190 if (atf_is_error(err)) {
193 return err;
196 return err;
214 atf_error_t err;
219 err = usage_error("-v requires an argument of the form var=value");
226 err = atf_map_insert(config, arg, split, false);
229 return err;
236 atf_error_t err;
239 err = atf_fs_path_init_fmt(&temp, "%s", value);
240 if (!atf_is_error(err)) {
245 return err;
298 atf_error_t err;
300 err = atf_no_error();
304 err = atf_no_memory_error();
318 err = usage_error("Invalid test case part `%s'", delim);
324 return err;
331 atf_error_t err;
335 err = params_init(p, argv[0]);
336 if (atf_is_error(err))
341 while (!atf_is_error(err) &&
349 err = replace_path_param(&p->m_resfile, optarg);
353 err = replace_path_param(&p->m_srcdir, optarg);
357 err = parse_vflag(optarg, &p->m_config);
361 err = usage_error("Option -%c requires an argument.", optopt);
366 err = usage_error("Unknown option -%c.", optopt);
379 if (!atf_is_error(err)) {
382 err = usage_error("Cannot provide test case names with -l");
385 err = usage_error("Must provide a test case name");
387 err = handle_tcarg(argv[0], &p->m_tcname, &p->m_tcpart);
389 err = usage_error("Cannot provide more than one test case "
395 if (atf_is_error(err))
399 return err;
406 atf_error_t err;
409 err = atf_fs_path_branch_path(srcdir, &parent);
410 if (atf_is_error(err))
416 INV(!atf_is_error(err));
418 return err;
425 atf_error_t err;
430 err = atf_fs_path_copy(&srcdir, &p->m_srcdir);
431 if (atf_is_error(err))
437 err = atf_fs_path_to_absolute(&srcdir, &srcdirabs);
438 if (atf_is_error(err))
445 err = atf_fs_path_leaf_name(&srcdir, &leafname);
446 if (atf_is_error(err))
453 err = srcdir_strip_libtool(&srcdir);
454 if (atf_is_error(err))
459 err = atf_fs_path_copy(&exe, &srcdir);
460 if (atf_is_error(err))
463 err = atf_fs_path_append_fmt(&exe, "%s", progname);
464 if (atf_is_error(err))
467 err = atf_fs_exists(&exe, &b);
468 if (!atf_is_error(err)) {
470 err = atf_map_insert(&p->m_config, "srcdir",
473 err = user_error("Cannot find the test program in the source "
483 return err;
490 atf_error_t err;
492 err = atf_no_error();
495 err = usage_error("Unknown test case `%s'", p->m_tcname);
509 err = atf_tp_run(tp, p->m_tcname, atf_fs_path_cstring(&p->m_resfile));
510 if (atf_is_error(err)) {
513 atf_error_free(err);
521 err = atf_tp_cleanup(tp, p->m_tcname);
522 if (atf_is_error(err)) {
525 atf_error_free(err);
536 INV(!atf_is_error(err));
538 return err;
547 atf_error_t err;
552 err = process_params(argc, argv, &p);
553 if (atf_is_error(err))
556 err = handle_srcdir(&p);
557 if (atf_is_error(err))
562 err = atf_no_memory_error();
565 err = atf_tp_init(&tp, (const char* const*)raw_config);
567 if (atf_is_error(err))
570 err = add_tcs_hook(&tp);
571 if (atf_is_error(err))
576 INV(!atf_is_error(err));
579 err = run_tc(&tp, &p, exitcode);
587 return err;
593 atf_error_t err;
609 err = controlled_main(argc, argv, add_tcs_hook, &exitcode);
610 if (atf_is_error(err)) {
611 print_error(err);
612 atf_error_free(err);