Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libSDL
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PocketInsanity
libSDL
Commits
de0a31c8
Commit
de0a31c8
authored
May 31, 2011
by
Markus Kauppila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes to doxygen comments.
Changed some printf() to fprints(stderr).
parent
7fff64a1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
13 deletions
+18
-13
runner.c
test/test-automation/runner.c
+18
-13
No files found.
test/test-automation/runner.c
View file @
de0a31c8
...
@@ -33,7 +33,7 @@ typedef int (*TestCase)(void *arg);
...
@@ -33,7 +33,7 @@ typedef int (*TestCase)(void *arg);
/*!
/*!
* Loads test suite which is implemented as dynamic library.
* Loads test suite which is implemented as dynamic library.
*
*
* \return
Loaded test suite
* \return
Pointer to loaded test suite, or NULL if library could not be loaded
*/
*/
void
*
void
*
LoadTestSuite
()
LoadTestSuite
()
...
@@ -46,8 +46,8 @@ LoadTestSuite()
...
@@ -46,8 +46,8 @@ LoadTestSuite()
void
*
library
=
SDL_LoadObject
(
libName
);
void
*
library
=
SDL_LoadObject
(
libName
);
if
(
library
==
NULL
)
{
if
(
library
==
NULL
)
{
printf
(
"Loading %s failed
\n
"
,
libName
);
fprintf
(
stderr
,
"Loading %s failed
\n
"
,
libName
);
printf
(
"%s
\n
"
,
SDL_GetError
());
fprintf
(
stderr
,
"%s
\n
"
,
SDL_GetError
());
}
}
return
library
;
return
library
;
...
@@ -57,7 +57,7 @@ LoadTestSuite()
...
@@ -57,7 +57,7 @@ LoadTestSuite()
* Loads the test case references from the given test suite.
* Loads the test case references from the given test suite.
* \param library Previously loaded dynamic library AKA test suite
* \param library Previously loaded dynamic library AKA test suite
* \return
Loaded TestCaseReferences
* \return
Pointer to array of TestCaseReferences or NULL if function failed
*/
*/
TestCaseReference
**
TestCaseReference
**
QueryTestCases
(
void
*
library
)
QueryTestCases
(
void
*
library
)
...
@@ -66,14 +66,14 @@ QueryTestCases(void *library)
...
@@ -66,14 +66,14 @@ QueryTestCases(void *library)
suite
=
(
TestCaseReference
**
(
*
)(
void
))
SDL_LoadFunction
(
library
,
"QueryTestSuite"
);
suite
=
(
TestCaseReference
**
(
*
)(
void
))
SDL_LoadFunction
(
library
,
"QueryTestSuite"
);
if
(
suite
==
NULL
)
{
if
(
suite
==
NULL
)
{
printf
(
"Loading QueryTestCaseReferences() failed.
\n
"
);
fprintf
(
stderr
,
"Loading QueryTestCaseReferences() failed.
\n
"
);
printf
(
"%s
\n
"
,
SDL_GetError
());
fprintf
(
stderr
,
"%s
\n
"
,
SDL_GetError
());
}
}
TestCaseReference
**
tests
=
suite
();
TestCaseReference
**
tests
=
suite
();
if
(
tests
==
NULL
)
{
if
(
tests
==
NULL
)
{
printf
(
"Failed to load test references.
\n
"
);
fprintf
(
stderr
,
"Failed to load test references.
\n
"
);
printf
(
"%s
\n
"
,
SDL_GetError
());
fprintf
(
stderr
,
"%s
\n
"
,
SDL_GetError
());
}
}
return
tests
;
return
tests
;
...
@@ -85,15 +85,15 @@ QueryTestCases(void *library)
...
@@ -85,15 +85,15 @@ QueryTestCases(void *library)
* \param suite a test suite
* \param suite a test suite
* \param testName Name of the test that is going to be loaded
* \param testName Name of the test that is going to be loaded
*
*
* \return
loaded test
* \return
Function Pointer (TestCase) to loaded test case, NULL if function failed
*/
*/
TestCase
TestCase
LoadTestCase
(
void
*
suite
,
char
*
testName
)
LoadTestCase
(
void
*
suite
,
char
*
testName
)
{
{
TestCase
test
=
(
int
(
*
)(
void
*
))
SDL_LoadFunction
(
suite
,
testName
);
TestCase
test
=
(
int
(
*
)(
void
*
))
SDL_LoadFunction
(
suite
,
testName
);
if
(
test
==
NULL
)
{
if
(
test
==
NULL
)
{
printf
(
"Loading test failed, tests == NULL
\n
"
);
fprintf
(
stderr
,
"Loading test failed, tests == NULL
\n
"
);
printf
(
"%s
\n
"
,
SDL_GetError
());
fprintf
(
stderr
,
"%s
\n
"
,
SDL_GetError
());
}
}
return
test
;
return
test
;
...
@@ -120,9 +120,8 @@ HandleTestReturnValue(int stat_lock)
...
@@ -120,9 +120,8 @@ HandleTestReturnValue(int stat_lock)
returnValue
=
WEXITSTATUS
(
stat_lock
);
returnValue
=
WEXITSTATUS
(
stat_lock
);
}
else
if
(
WIFSIGNALED
(
stat_lock
))
{
}
else
if
(
WIFSIGNALED
(
stat_lock
))
{
int
signal
=
WTERMSIG
(
stat_lock
);
int
signal
=
WTERMSIG
(
stat_lock
);
printf
(
"FAILURE: test was aborted due to signal nr
o %d
\n
"
,
signal
);
fprintf
(
stderr
,
"FAILURE: test was aborted due to signal n
o %d
\n
"
,
signal
);
returnValue
=
1
;
returnValue
=
1
;
}
else
if
(
WIFSTOPPED
(
stat_lock
))
{
}
}
return
returnValue
;
return
returnValue
;
...
@@ -147,6 +146,12 @@ ParseOptions(int argc, char *argv[])
...
@@ -147,6 +146,12 @@ ParseOptions(int argc, char *argv[])
}
}
}
}
/*!
* Entry point for test runner
*
* \param argc Count of command line arguments
* \param argv Array of commond lines arguments
*/
int
int
main
(
int
argc
,
char
*
argv
[])
main
(
int
argc
,
char
*
argv
[])
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment