~ubuntu-branches/ubuntu/vivid/kmod/vivid

« back to all changes in this revision

Viewing changes to testsuite/test-alias.c

  • Committer: Package Import Robot
  • Author(s): Adam Conrad
  • Date: 2012-09-21 16:05:32 UTC
  • mfrom: (4.1.7 sid)
  • Revision ID: package-import@ubuntu.com-20120921160532-bdsxhmpj5og2ru5h
Tags: 9-2ubuntu1
* Sync with Debian unstable; remaining Ubuntu changes:
  - Ubuntu-specific depmod.d and modprobe.d contents.
  - Mark module-init-tools Multi-Arch: foreign.
  - Don't install Debian's extra/aliases.conf file.
  - Install upstart job instead of the sysvinit script.

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
 
57
57
        return EXIT_SUCCESS;
58
58
}
59
 
static const struct test salias_1 = {
60
 
        .name = "alias_1",
 
59
static DEFINE_TEST(alias_1,
61
60
        .description = "check if alias_normalize does the right thing",
62
 
        .func = alias_1,
63
61
        .config = {
64
62
                [TC_ROOTFS] = TESTSUITE_ROOTFS "test-alias/",
65
63
        },
66
64
        .need_spawn = true,
67
65
        .output = {
68
66
                .stdout = TESTSUITE_ROOTFS "test-alias/correct.txt",
69
 
        },
70
 
};
 
67
        });
71
68
 
72
69
static const struct test *tests[] = {
73
70
        &salias_1,
74
71
        NULL,
75
72
};
76
73
 
77
 
int main(int argc, char *argv[])
78
 
{
79
 
        const struct test *t;
80
 
        int arg;
81
 
        size_t i;
82
 
 
83
 
        arg = test_init(argc, argv, tests);
84
 
        if (arg == 0)
85
 
                return 0;
86
 
 
87
 
        if (arg < argc) {
88
 
                t = test_find(tests, argv[arg]);
89
 
                if (t == NULL) {
90
 
                        fprintf(stderr, "could not find test %s\n", argv[arg]);
91
 
                        exit(EXIT_FAILURE);
92
 
                }
93
 
 
94
 
                return test_run(t);
95
 
        }
96
 
 
97
 
        for (i = 0; tests[i] != NULL; i++) {
98
 
                if (test_run(tests[i]) != 0)
99
 
                        exit(EXIT_FAILURE);
100
 
        }
101
 
 
102
 
        exit(EXIT_SUCCESS);
103
 
}
 
74
TESTSUITE_MAIN(tests);