15 #include "comedi_test.h"
17 char *filename="/dev/comedi0";
27 int test_mode0_read(void);
28 int test_insn_read(void);
29 int test_insn_read_time(void);
30 int test_cmd_probe_src_mask(void);
31 int test_cmd_probe_fast_1chan(void);
32 int test_cmd_read_fast_1chan(void);
33 int test_cmd_fifo_depth_check(void);
35 int test_read_select(void);
36 int test_cmd_continuous(void);
37 int test_bufconfig(void);
47 struct test_struct tests[]={
48 { "info", test_info, TEST_STD },
49 { "mode0_read", test_mode0_read, TEST_STD },
50 { "insn_read", test_insn_read, TEST_STD },
51 { "insn_read_time", test_insn_read_time, TEST_STD },
52 { "cmd_probe_src_mask", test_cmd_probe_src_mask, TEST_STD },
53 { "cmd_probe_fast_1chan", test_cmd_probe_fast_1chan, TEST_STD },
54 { "cmd_read_fast_1chan", test_cmd_read_fast_1chan, TEST_STD },
55 { "cmd_fifo_depth_check", test_cmd_fifo_depth_check, TEST_STD },
56 { "mmap", test_mmap, TEST_STD },
57 { "read_select", test_read_select, TEST_STD },
58 { "cmd_continuous", test_cmd_continuous, TEST_NEVER },
59 { "bufconfig", test_bufconfig, TEST_STD },
61 static int n_tests = sizeof(tests)/sizeof(tests[0]);
67 int main(int argc, char *argv[])
73 c = getopt(argc, argv, "f:s:t:v");
82 sscanf(optarg,"%d",&subdevice);
91 printf("bad option\n");
96 device = comedi_open(filename);
98 printf("E: comedi_open(\"%s\"): %s\n",filename,strerror(errno));
101 for(;subdevice<comedi_get_n_subdevices(device);subdevice++){
103 printf("I: subdevice %d\n",subdevice);
105 for(i=0;i<n_tests;i++){
106 if(!strcmp(tests[i].name,only_test)){
107 printf("I: testing %s...\n",tests[i].name);
112 for(i=0;i<n_tests;i++){
113 if(tests[i].flags&TEST_STD){
114 printf("I: testing %s...\n",tests[i].name);
119 if(only_subdevice)break;