Mercurial > sdl-ios-xcode
annotate test/automated/testsdl.c @ 3756:427f059bc814 gsoc2009_unit_tests
Added simple audio test.
author | Edgar Simo <bobbens@gmail.com> |
---|---|
date | Mon, 17 Aug 2009 17:52:42 +0000 |
parents | 5b48a529fd8a |
children |
rev | line source |
---|---|
3740
e451d5d288e9
Merged into one big app, while keeping modular applications also.
Edgar Simo <bobbens@gmail.com>
parents:
diff
changeset
|
1 /* |
e451d5d288e9
Merged into one big app, while keeping modular applications also.
Edgar Simo <bobbens@gmail.com>
parents:
diff
changeset
|
2 * SDL test suite framework code. |
e451d5d288e9
Merged into one big app, while keeping modular applications also.
Edgar Simo <bobbens@gmail.com>
parents:
diff
changeset
|
3 * |
e451d5d288e9
Merged into one big app, while keeping modular applications also.
Edgar Simo <bobbens@gmail.com>
parents:
diff
changeset
|
4 * Written by Edgar Simo "bobbens" |
e451d5d288e9
Merged into one big app, while keeping modular applications also.
Edgar Simo <bobbens@gmail.com>
parents:
diff
changeset
|
5 * |
e451d5d288e9
Merged into one big app, while keeping modular applications also.
Edgar Simo <bobbens@gmail.com>
parents:
diff
changeset
|
6 * Released under Public Domain. |
e451d5d288e9
Merged into one big app, while keeping modular applications also.
Edgar Simo <bobbens@gmail.com>
parents:
diff
changeset
|
7 */ |
e451d5d288e9
Merged into one big app, while keeping modular applications also.
Edgar Simo <bobbens@gmail.com>
parents:
diff
changeset
|
8 |
e451d5d288e9
Merged into one big app, while keeping modular applications also.
Edgar Simo <bobbens@gmail.com>
parents:
diff
changeset
|
9 |
3753
5b48a529fd8a
More debugging information when test fails.
Edgar Simo <bobbens@gmail.com>
parents:
3750
diff
changeset
|
10 #include "SDL.h" |
3741
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
11 #include "SDL_at.h" |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
12 |
3740
e451d5d288e9
Merged into one big app, while keeping modular applications also.
Edgar Simo <bobbens@gmail.com>
parents:
diff
changeset
|
13 #include "platform/platform.h" |
e451d5d288e9
Merged into one big app, while keeping modular applications also.
Edgar Simo <bobbens@gmail.com>
parents:
diff
changeset
|
14 #include "rwops/rwops.h" |
e451d5d288e9
Merged into one big app, while keeping modular applications also.
Edgar Simo <bobbens@gmail.com>
parents:
diff
changeset
|
15 #include "surface/surface.h" |
e451d5d288e9
Merged into one big app, while keeping modular applications also.
Edgar Simo <bobbens@gmail.com>
parents:
diff
changeset
|
16 #include "render/render.h" |
3756 | 17 #include "audio/audio.h" |
3740
e451d5d288e9
Merged into one big app, while keeping modular applications also.
Edgar Simo <bobbens@gmail.com>
parents:
diff
changeset
|
18 |
3741
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
19 #include <stdio.h> /* printf */ |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
20 #include <stdlib.h> /* exit */ |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
21 #include <unistd.h> /* getopt */ |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
22 #include <getopt.h> /* getopt_long */ |
3745
f0b89cf4bffc
You can now disable any of the testsuites.
Edgar Simo <bobbens@gmail.com>
parents:
3741
diff
changeset
|
23 #include <string.h> /* strcmp */ |
3740
e451d5d288e9
Merged into one big app, while keeping modular applications also.
Edgar Simo <bobbens@gmail.com>
parents:
diff
changeset
|
24 |
3741
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
25 |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
26 /* |
3745
f0b89cf4bffc
You can now disable any of the testsuites.
Edgar Simo <bobbens@gmail.com>
parents:
3741
diff
changeset
|
27 * Tests to run. |
f0b89cf4bffc
You can now disable any of the testsuites.
Edgar Simo <bobbens@gmail.com>
parents:
3741
diff
changeset
|
28 */ |
3749
1e277c40babe
Added placeholder for manual tests.
Edgar Simo <bobbens@gmail.com>
parents:
3745
diff
changeset
|
29 static int run_manual = 0; /**< Run manual tests. */ |
1e277c40babe
Added placeholder for manual tests.
Edgar Simo <bobbens@gmail.com>
parents:
3745
diff
changeset
|
30 /* Manual. */ |
1e277c40babe
Added placeholder for manual tests.
Edgar Simo <bobbens@gmail.com>
parents:
3745
diff
changeset
|
31 /* Automatic. */ |
1e277c40babe
Added placeholder for manual tests.
Edgar Simo <bobbens@gmail.com>
parents:
3745
diff
changeset
|
32 static int run_platform = 1; /**< Run platform tests. */ |
1e277c40babe
Added placeholder for manual tests.
Edgar Simo <bobbens@gmail.com>
parents:
3745
diff
changeset
|
33 static int run_rwops = 1; /**< Run RWops tests. */ |
1e277c40babe
Added placeholder for manual tests.
Edgar Simo <bobbens@gmail.com>
parents:
3745
diff
changeset
|
34 static int run_surface = 1; /**< Run surface tests. */ |
1e277c40babe
Added placeholder for manual tests.
Edgar Simo <bobbens@gmail.com>
parents:
3745
diff
changeset
|
35 static int run_render = 1; /**< Run render tests. */ |
3756 | 36 static int run_audio = 1; /**< Run audio tests. */ |
3745
f0b89cf4bffc
You can now disable any of the testsuites.
Edgar Simo <bobbens@gmail.com>
parents:
3741
diff
changeset
|
37 |
f0b89cf4bffc
You can now disable any of the testsuites.
Edgar Simo <bobbens@gmail.com>
parents:
3741
diff
changeset
|
38 /* |
3741
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
39 * Prototypes. |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
40 */ |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
41 static void print_usage( const char *name ); |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
42 static void parse_options( int argc, char *argv[] ); |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
43 |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
44 |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
45 /** |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
46 * @brief Displays program usage. |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
47 */ |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
48 static void print_usage( const char *name ) |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
49 { |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
50 printf("Usage: %s [OPTIONS]\n", name); |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
51 printf("Options are:\n"); |
3750
cb75359d29bb
Missed a few things in the last patch.
Edgar Simo <bobbens@gmail.com>
parents:
3749
diff
changeset
|
52 printf(" -m, --manual enables tests that require user interaction\n"); |
3745
f0b89cf4bffc
You can now disable any of the testsuites.
Edgar Simo <bobbens@gmail.com>
parents:
3741
diff
changeset
|
53 printf(" --noplatform do not run the platform tests\n"); |
f0b89cf4bffc
You can now disable any of the testsuites.
Edgar Simo <bobbens@gmail.com>
parents:
3741
diff
changeset
|
54 printf(" --norwops do not run the rwops tests\n"); |
f0b89cf4bffc
You can now disable any of the testsuites.
Edgar Simo <bobbens@gmail.com>
parents:
3741
diff
changeset
|
55 printf(" --nosurface do not run the surface tests\n"); |
f0b89cf4bffc
You can now disable any of the testsuites.
Edgar Simo <bobbens@gmail.com>
parents:
3741
diff
changeset
|
56 printf(" --norender do not run the render tests\n"); |
3756 | 57 printf(" --noaudio do not run the audio tests\n"); |
3741
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
58 printf(" -v, --verbose increases verbosity level by 1 for each -v\n"); |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
59 printf(" -q, --quiet only displays errors\n"); |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
60 printf(" -h, --help display this message and exit\n"); |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
61 } |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
62 |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
63 |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
64 /** |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
65 * @brief Handles the options. |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
66 */ |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
67 static void parse_options( int argc, char *argv[] ) |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
68 { |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
69 static struct option long_options[] = { |
3750
cb75359d29bb
Missed a few things in the last patch.
Edgar Simo <bobbens@gmail.com>
parents:
3749
diff
changeset
|
70 { "manual", no_argument, 0, 'm' }, |
3745
f0b89cf4bffc
You can now disable any of the testsuites.
Edgar Simo <bobbens@gmail.com>
parents:
3741
diff
changeset
|
71 { "noplatform", no_argument, 0, 0 }, |
f0b89cf4bffc
You can now disable any of the testsuites.
Edgar Simo <bobbens@gmail.com>
parents:
3741
diff
changeset
|
72 { "norwops", no_argument, 0, 0 }, |
f0b89cf4bffc
You can now disable any of the testsuites.
Edgar Simo <bobbens@gmail.com>
parents:
3741
diff
changeset
|
73 { "nosurface", no_argument, 0, 0 }, |
f0b89cf4bffc
You can now disable any of the testsuites.
Edgar Simo <bobbens@gmail.com>
parents:
3741
diff
changeset
|
74 { "norender", no_argument, 0, 0 }, |
3756 | 75 { "noaudio", no_argument, 0, 0 }, |
3741
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
76 { "verbose", no_argument, 0, 'v' }, |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
77 { "quiet", no_argument, 0, 'q' }, |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
78 { "help", no_argument, 0, 'h' }, |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
79 {NULL,0,0,0} |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
80 }; |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
81 int option_index = 0; |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
82 int c = 0; |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
83 int i; |
3745
f0b89cf4bffc
You can now disable any of the testsuites.
Edgar Simo <bobbens@gmail.com>
parents:
3741
diff
changeset
|
84 const char *str; |
3741
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
85 |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
86 /* Iterate over options. */ |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
87 while ((c = getopt_long( argc, argv, |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
88 "vqh", |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
89 long_options, &option_index)) != -1) { |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
90 |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
91 /* Handle options. */ |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
92 switch (c) { |
3745
f0b89cf4bffc
You can now disable any of the testsuites.
Edgar Simo <bobbens@gmail.com>
parents:
3741
diff
changeset
|
93 case 0: |
f0b89cf4bffc
You can now disable any of the testsuites.
Edgar Simo <bobbens@gmail.com>
parents:
3741
diff
changeset
|
94 str = long_options[option_index].name; |
f0b89cf4bffc
You can now disable any of the testsuites.
Edgar Simo <bobbens@gmail.com>
parents:
3741
diff
changeset
|
95 if (strcmp(str,"noplatform")==0) |
f0b89cf4bffc
You can now disable any of the testsuites.
Edgar Simo <bobbens@gmail.com>
parents:
3741
diff
changeset
|
96 run_platform = 0; |
f0b89cf4bffc
You can now disable any of the testsuites.
Edgar Simo <bobbens@gmail.com>
parents:
3741
diff
changeset
|
97 else if (strcmp(str,"norwops")==0) |
f0b89cf4bffc
You can now disable any of the testsuites.
Edgar Simo <bobbens@gmail.com>
parents:
3741
diff
changeset
|
98 run_rwops = 0; |
f0b89cf4bffc
You can now disable any of the testsuites.
Edgar Simo <bobbens@gmail.com>
parents:
3741
diff
changeset
|
99 else if (strcmp(str,"nosurface")==0) |
f0b89cf4bffc
You can now disable any of the testsuites.
Edgar Simo <bobbens@gmail.com>
parents:
3741
diff
changeset
|
100 run_surface = 0; |
f0b89cf4bffc
You can now disable any of the testsuites.
Edgar Simo <bobbens@gmail.com>
parents:
3741
diff
changeset
|
101 else if (strcmp(str,"norender")==0) |
f0b89cf4bffc
You can now disable any of the testsuites.
Edgar Simo <bobbens@gmail.com>
parents:
3741
diff
changeset
|
102 run_render = 0; |
3756 | 103 else if (strcmp(str,"noaudio")==0) |
104 run_audio = 0; | |
3745
f0b89cf4bffc
You can now disable any of the testsuites.
Edgar Simo <bobbens@gmail.com>
parents:
3741
diff
changeset
|
105 break; |
f0b89cf4bffc
You can now disable any of the testsuites.
Edgar Simo <bobbens@gmail.com>
parents:
3741
diff
changeset
|
106 |
3750
cb75359d29bb
Missed a few things in the last patch.
Edgar Simo <bobbens@gmail.com>
parents:
3749
diff
changeset
|
107 /* Manual. */ |
cb75359d29bb
Missed a few things in the last patch.
Edgar Simo <bobbens@gmail.com>
parents:
3749
diff
changeset
|
108 case 'm': |
cb75359d29bb
Missed a few things in the last patch.
Edgar Simo <bobbens@gmail.com>
parents:
3749
diff
changeset
|
109 run_manual = 1; |
cb75359d29bb
Missed a few things in the last patch.
Edgar Simo <bobbens@gmail.com>
parents:
3749
diff
changeset
|
110 break; |
3741
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
111 |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
112 /* Verbosity. */ |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
113 case 'v': |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
114 SDL_ATgeti( SDL_AT_VERBOSE, &i ); |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
115 SDL_ATseti( SDL_AT_VERBOSE, i+1 ); |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
116 break; |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
117 |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
118 /* Quiet. */ |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
119 case 'q': |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
120 SDL_ATseti( SDL_AT_QUIET, 1 ); |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
121 break; |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
122 |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
123 /* Help. */ |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
124 case 'h': |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
125 print_usage( argv[0] ); |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
126 exit(EXIT_SUCCESS); |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
127 } |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
128 } |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
129 |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
130 } |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
131 |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
132 |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
133 /** |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
134 * @brief Main entry point. |
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
135 */ |
3740
e451d5d288e9
Merged into one big app, while keeping modular applications also.
Edgar Simo <bobbens@gmail.com>
parents:
diff
changeset
|
136 int main( int argc, char *argv[] ) |
e451d5d288e9
Merged into one big app, while keeping modular applications also.
Edgar Simo <bobbens@gmail.com>
parents:
diff
changeset
|
137 { |
3753
5b48a529fd8a
More debugging information when test fails.
Edgar Simo <bobbens@gmail.com>
parents:
3750
diff
changeset
|
138 int failed; |
5b48a529fd8a
More debugging information when test fails.
Edgar Simo <bobbens@gmail.com>
parents:
3750
diff
changeset
|
139 int rev; |
5b48a529fd8a
More debugging information when test fails.
Edgar Simo <bobbens@gmail.com>
parents:
3750
diff
changeset
|
140 SDL_version ver; |
5b48a529fd8a
More debugging information when test fails.
Edgar Simo <bobbens@gmail.com>
parents:
3750
diff
changeset
|
141 |
5b48a529fd8a
More debugging information when test fails.
Edgar Simo <bobbens@gmail.com>
parents:
3750
diff
changeset
|
142 /* Get options. */ |
3741
808fad5fb593
Added command line options.
Edgar Simo <bobbens@gmail.com>
parents:
3740
diff
changeset
|
143 parse_options( argc, argv ); |
3740
e451d5d288e9
Merged into one big app, while keeping modular applications also.
Edgar Simo <bobbens@gmail.com>
parents:
diff
changeset
|
144 |
3753
5b48a529fd8a
More debugging information when test fails.
Edgar Simo <bobbens@gmail.com>
parents:
3750
diff
changeset
|
145 /* Defaults. */ |
5b48a529fd8a
More debugging information when test fails.
Edgar Simo <bobbens@gmail.com>
parents:
3750
diff
changeset
|
146 failed = 0; |
5b48a529fd8a
More debugging information when test fails.
Edgar Simo <bobbens@gmail.com>
parents:
3750
diff
changeset
|
147 |
5b48a529fd8a
More debugging information when test fails.
Edgar Simo <bobbens@gmail.com>
parents:
3750
diff
changeset
|
148 /* Print some text if verbose. */ |
5b48a529fd8a
More debugging information when test fails.
Edgar Simo <bobbens@gmail.com>
parents:
3750
diff
changeset
|
149 SDL_GetVersion( &ver ); |
5b48a529fd8a
More debugging information when test fails.
Edgar Simo <bobbens@gmail.com>
parents:
3750
diff
changeset
|
150 rev = SDL_GetRevision(); |
5b48a529fd8a
More debugging information when test fails.
Edgar Simo <bobbens@gmail.com>
parents:
3750
diff
changeset
|
151 SDL_ATprintVerbose( 1, "Running tests with SDL %d.%d.%d revision %d\n", |
5b48a529fd8a
More debugging information when test fails.
Edgar Simo <bobbens@gmail.com>
parents:
3750
diff
changeset
|
152 ver.major, ver.minor, ver.patch, rev ); |
5b48a529fd8a
More debugging information when test fails.
Edgar Simo <bobbens@gmail.com>
parents:
3750
diff
changeset
|
153 |
3749
1e277c40babe
Added placeholder for manual tests.
Edgar Simo <bobbens@gmail.com>
parents:
3745
diff
changeset
|
154 /* Automatic tests. */ |
3745
f0b89cf4bffc
You can now disable any of the testsuites.
Edgar Simo <bobbens@gmail.com>
parents:
3741
diff
changeset
|
155 if (run_platform) |
3753
5b48a529fd8a
More debugging information when test fails.
Edgar Simo <bobbens@gmail.com>
parents:
3750
diff
changeset
|
156 failed += test_platform(); |
3745
f0b89cf4bffc
You can now disable any of the testsuites.
Edgar Simo <bobbens@gmail.com>
parents:
3741
diff
changeset
|
157 if (run_rwops) |
3753
5b48a529fd8a
More debugging information when test fails.
Edgar Simo <bobbens@gmail.com>
parents:
3750
diff
changeset
|
158 failed += test_rwops(); |
3745
f0b89cf4bffc
You can now disable any of the testsuites.
Edgar Simo <bobbens@gmail.com>
parents:
3741
diff
changeset
|
159 if (run_surface) |
3753
5b48a529fd8a
More debugging information when test fails.
Edgar Simo <bobbens@gmail.com>
parents:
3750
diff
changeset
|
160 failed += test_surface(); |
3745
f0b89cf4bffc
You can now disable any of the testsuites.
Edgar Simo <bobbens@gmail.com>
parents:
3741
diff
changeset
|
161 if (run_render) |
3753
5b48a529fd8a
More debugging information when test fails.
Edgar Simo <bobbens@gmail.com>
parents:
3750
diff
changeset
|
162 failed += test_render(); |
3756 | 163 if (run_audio) |
164 failed += test_audio(); | |
3740
e451d5d288e9
Merged into one big app, while keeping modular applications also.
Edgar Simo <bobbens@gmail.com>
parents:
diff
changeset
|
165 |
3749
1e277c40babe
Added placeholder for manual tests.
Edgar Simo <bobbens@gmail.com>
parents:
3745
diff
changeset
|
166 /* Manual tests. */ |
1e277c40babe
Added placeholder for manual tests.
Edgar Simo <bobbens@gmail.com>
parents:
3745
diff
changeset
|
167 if (run_manual) { |
1e277c40babe
Added placeholder for manual tests.
Edgar Simo <bobbens@gmail.com>
parents:
3745
diff
changeset
|
168 } |
1e277c40babe
Added placeholder for manual tests.
Edgar Simo <bobbens@gmail.com>
parents:
3745
diff
changeset
|
169 |
3753
5b48a529fd8a
More debugging information when test fails.
Edgar Simo <bobbens@gmail.com>
parents:
3750
diff
changeset
|
170 /* Display more information if failed. */ |
5b48a529fd8a
More debugging information when test fails.
Edgar Simo <bobbens@gmail.com>
parents:
3750
diff
changeset
|
171 if (failed > 0) { |
5b48a529fd8a
More debugging information when test fails.
Edgar Simo <bobbens@gmail.com>
parents:
3750
diff
changeset
|
172 SDL_ATprintErr( "Tests run with SDL %d.%d.%d revision %d\n", |
5b48a529fd8a
More debugging information when test fails.
Edgar Simo <bobbens@gmail.com>
parents:
3750
diff
changeset
|
173 ver.major, ver.minor, ver.patch, rev ); |
5b48a529fd8a
More debugging information when test fails.
Edgar Simo <bobbens@gmail.com>
parents:
3750
diff
changeset
|
174 SDL_ATprintErr( "System is running %s and is %s endian\n", |
5b48a529fd8a
More debugging information when test fails.
Edgar Simo <bobbens@gmail.com>
parents:
3750
diff
changeset
|
175 platform_getPlatform(), |
5b48a529fd8a
More debugging information when test fails.
Edgar Simo <bobbens@gmail.com>
parents:
3750
diff
changeset
|
176 #ifdef SDL_LIL_ENDIAN |
5b48a529fd8a
More debugging information when test fails.
Edgar Simo <bobbens@gmail.com>
parents:
3750
diff
changeset
|
177 "little" |
5b48a529fd8a
More debugging information when test fails.
Edgar Simo <bobbens@gmail.com>
parents:
3750
diff
changeset
|
178 #else |
5b48a529fd8a
More debugging information when test fails.
Edgar Simo <bobbens@gmail.com>
parents:
3750
diff
changeset
|
179 "big" |
5b48a529fd8a
More debugging information when test fails.
Edgar Simo <bobbens@gmail.com>
parents:
3750
diff
changeset
|
180 #endif |
5b48a529fd8a
More debugging information when test fails.
Edgar Simo <bobbens@gmail.com>
parents:
3750
diff
changeset
|
181 ); |
5b48a529fd8a
More debugging information when test fails.
Edgar Simo <bobbens@gmail.com>
parents:
3750
diff
changeset
|
182 } |
5b48a529fd8a
More debugging information when test fails.
Edgar Simo <bobbens@gmail.com>
parents:
3750
diff
changeset
|
183 |
5b48a529fd8a
More debugging information when test fails.
Edgar Simo <bobbens@gmail.com>
parents:
3750
diff
changeset
|
184 return failed; |
3740
e451d5d288e9
Merged into one big app, while keeping modular applications also.
Edgar Simo <bobbens@gmail.com>
parents:
diff
changeset
|
185 } |
e451d5d288e9
Merged into one big app, while keeping modular applications also.
Edgar Simo <bobbens@gmail.com>
parents:
diff
changeset
|
186 |