Add UNSUPPORTED test result to DejaGnu unit test protocol
[dejagnu.git] / testsuite / libdejagnu / unit-c.c
blob1265b70e7db73d1427f42c3d11daf5a21039052b
1 /* Exerciser for DejaGnu C unit test support library
3 * Copyright (C) 2022 Free Software Foundation, Inc.
5 * This file is part of DejaGnu.
7 * DejaGnu is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
12 * DejaGnu is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with DejaGnu; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
21 * This file was written by Jacob Bachmeyer.
24 #include <stdio.h>
25 #include <stdlib.h>
26 #include <string.h>
28 #include "dejagnu.h"
30 int
31 main(int argc, char ** argv)
33 int i;
35 if (argc < 2) {
36 fprintf(stderr,
37 "usage: %s <test name>...\n see source for details\n", argv[0]);
38 return 2;
41 for (i = 1; i < argc; i++) {
42 if (!strcmp("pass", argv[i])) pass("test");
43 else if (!strcmp("xpass", argv[i])) xpass("test");
44 else if (!strcmp("fail", argv[i])) fail("test");
45 else if (!strcmp("xfail", argv[i])) xfail("test");
46 else if (!strcmp("untested", argv[i])) untested("test");
47 else if (!strcmp("unresolved", argv[i])) unresolved("test");
48 else if (!strcmp("unsupported", argv[i])) unsupported("test");
49 else if (!strcmp("note", argv[i])) note("test");
50 else {
51 fprintf(stderr, "%s: unknown test `%s'\n", argv[0], argv[i]);
52 return 2;
56 totals();
58 return 0;
61 /* EOF */