- Set a default PCM volume so that something can be heard when driver is
[AROS.git] / test / runtests.c
blobe115adc904d114739017eec4f950c81715415a6f
1 #include <aros/debug.h>
2 #include <proto/dos.h>
4 BPTR scripthandle;
5 CONST_STRPTR scriptname;
6 UBYTE command[200];
7 LONG error;
8 LONG failcnt;
9 LONG errorcnt;
10 LONG warncnt;
11 LONG okcnt;
13 int main(int argc, char **argv)
15 if (argc == 1)
17 scriptname = "testscript";
19 else if (argc == 2)
21 scriptname = argv[1];
23 else
25 PutStr("Usage runtest [scriptfile]\n");
28 scripthandle = Open(scriptname, MODE_OLDFILE);
29 if (!scripthandle)
31 PutStr("Can't open file\n");
32 return 0;
35 PutStr("Reading commands from file ");
36 PutStr(scriptname);
37 PutStr("\nOutput will be sent to the debugging console\n\n");
39 while (FGets(scripthandle, command, sizeof command))
41 if (command[0] != '#' && command[0] != '\n')
43 bug("====================================\n");
44 bug("Running command: %s", command);
45 error = SystemTags(command, TAG_DONE);
46 bug("returns: %d\n", error);
48 if (error >= RETURN_FAIL)
49 failcnt++;
50 else if (error >= RETURN_ERROR)
51 errorcnt++;
52 else if (error >= RETURN_WARN)
53 warncnt++;
54 else
55 okcnt++;
58 bug("====================================\n");
59 bug("Summary: ok %d warn %d error %d fail %d\n", okcnt, warncnt, errorcnt, failcnt);
61 Close(scripthandle);
63 return 0;