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

« back to all changes in this revision

Viewing changes to testsuite/test-modinfo.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:
25
25
 
26
26
#include "testsuite.h"
27
27
 
28
 
static int modinfo_jonsmodules(const struct test *t)
 
28
static __noreturn int modinfo_jonsmodules(const struct test *t)
29
29
{
30
30
        const char *progname = ABS_TOP_BUILDDIR "/tools/modinfo";
31
31
        const char *const args[] = {
38
38
        test_spawn_prog(progname, args);
39
39
        exit(EXIT_FAILURE);
40
40
}
41
 
static const struct test smodinfo_jonsmodules = {
42
 
        .name = "modinfo_jonsmodules",
 
41
static DEFINE_TEST(modinfo_jonsmodules,
43
42
        .description = "check if output for modinfo is correct for i686, ppc64, s390x and x86_64",
44
 
        .func = modinfo_jonsmodules,
45
43
        .config = {
46
44
                [TC_ROOTFS] = TESTSUITE_ROOTFS "test-modinfo/",
47
45
        },
48
46
        .output = {
49
47
                .stdout = TESTSUITE_ROOTFS "test-modinfo/correct.txt",
50
 
        },
51
 
};
 
48
        });
52
49
 
53
50
static const struct test *tests[] = {
54
51
        &smodinfo_jonsmodules,
55
52
        NULL,
56
53
};
57
54
 
58
 
int main(int argc, char *argv[])
59
 
{
60
 
        const struct test *t;
61
 
        int arg;
62
 
        size_t i;
63
 
 
64
 
        arg = test_init(argc, argv, tests);
65
 
        if (arg == 0)
66
 
                return 0;
67
 
 
68
 
        if (arg < argc) {
69
 
                t = test_find(tests, argv[arg]);
70
 
                if (t == NULL) {
71
 
                        fprintf(stderr, "could not find test %s\n", argv[arg]);
72
 
                        exit(EXIT_FAILURE);
73
 
                }
74
 
 
75
 
                return test_run(t);
76
 
        }
77
 
 
78
 
        for (i = 0; tests[i] != NULL; i++) {
79
 
                if (test_run(tests[i]) != 0)
80
 
                        exit(EXIT_FAILURE);
81
 
        }
82
 
 
83
 
        exit(EXIT_SUCCESS);
84
 
}
 
55
TESTSUITE_MAIN(tests);