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
f7397f35
Commit
f7397f35
authored
Jun 13, 2011
by
Markus Kauppila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added new command line option: --show-tests
parent
523fa1f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
runner.c
test/test-automation/runner.c
+19
-3
No files found.
test/test-automation/runner.c
View file @
f7397f35
...
@@ -41,6 +41,8 @@ typedef int (*TestCaseQuitFp)(void);
...
@@ -41,6 +41,8 @@ typedef int (*TestCaseQuitFp)(void);
//!< Flag for executing tests in-process
//!< Flag for executing tests in-process
static
int
execute_inproc
=
0
;
static
int
execute_inproc
=
0
;
//!< Flag for only printing out the test names
static
int
only_print_tests
=
0
;
//!< Flag for executing only test with selected name
//!< Flag for executing only test with selected name
static
int
only_selected_test
=
0
;
static
int
only_selected_test
=
0
;
//!< Flag for executing only the selected test suite
//!< Flag for executing only the selected test suite
...
@@ -514,6 +516,7 @@ printUsage() {
...
@@ -514,6 +516,7 @@ printUsage() {
printf
(
" [--name-contains SUBSTR] [--help]
\n
"
);
printf
(
" [--name-contains SUBSTR] [--help]
\n
"
);
printf
(
"Options:
\n
"
);
printf
(
"Options:
\n
"
);
printf
(
" --in-proc Executes tests in-process
\n
"
);
printf
(
" --in-proc Executes tests in-process
\n
"
);
printf
(
" --show-tests Prints out all the executable tests
\n
"
);
printf
(
" -t --test TEST Executes only tests with given name
\n
"
);
printf
(
" -t --test TEST Executes only tests with given name
\n
"
);
printf
(
" -ts --name-contains SUBSTR Executes only tests that have given
\n
"
);
printf
(
" -ts --name-contains SUBSTR Executes only tests that have given
\n
"
);
printf
(
" substring in test name
\n
"
);
printf
(
" substring in test name
\n
"
);
...
@@ -539,9 +542,8 @@ ParseOptions(int argc, char *argv[])
...
@@ -539,9 +542,8 @@ ParseOptions(int argc, char *argv[])
if
(
SDL_strcmp
(
arg
,
"--in-proc"
)
==
0
)
{
if
(
SDL_strcmp
(
arg
,
"--in-proc"
)
==
0
)
{
execute_inproc
=
1
;
execute_inproc
=
1
;
}
}
else
if
(
SDL_strcmp
(
arg
,
"--help"
)
==
0
||
SDL_strcmp
(
arg
,
"-h"
)
==
0
)
{
else
if
(
SDL_strcmp
(
arg
,
"--show-tests"
)
==
0
)
{
printUsage
();
only_print_tests
=
1
;
exit
(
0
);
}
}
else
if
(
SDL_strcmp
(
arg
,
"--test"
)
==
0
||
SDL_strcmp
(
arg
,
"-t"
)
==
0
)
{
else
if
(
SDL_strcmp
(
arg
,
"--test"
)
==
0
||
SDL_strcmp
(
arg
,
"-t"
)
==
0
)
{
only_selected_test
=
1
;
only_selected_test
=
1
;
...
@@ -588,6 +590,10 @@ ParseOptions(int argc, char *argv[])
...
@@ -588,6 +590,10 @@ ParseOptions(int argc, char *argv[])
memset
(
selected_suite_name
,
0
,
NAME_BUFFER_SIZE
);
memset
(
selected_suite_name
,
0
,
NAME_BUFFER_SIZE
);
strcpy
(
selected_suite_name
,
suiteName
);
strcpy
(
selected_suite_name
,
suiteName
);
}
}
else
if
(
SDL_strcmp
(
arg
,
"--help"
)
==
0
||
SDL_strcmp
(
arg
,
"-h"
)
==
0
)
{
printUsage
();
exit
(
0
);
}
else
{
else
{
printf
(
"runner: unknown command '%s'
\n
"
,
arg
);
printf
(
"runner: unknown command '%s'
\n
"
,
arg
);
printUsage
();
printUsage
();
...
@@ -627,6 +633,16 @@ main(int argc, char *argv[])
...
@@ -627,6 +633,16 @@ main(int argc, char *argv[])
TestCase
*
testCases
=
LoadTestCases
(
suites
);
TestCase
*
testCases
=
LoadTestCases
(
suites
);
// if --show-tests option is given, only print tests and exit
if
(
only_print_tests
)
{
TestCase
*
testItem
=
NULL
;
for
(
testItem
=
testCases
;
testItem
;
testItem
=
testItem
->
next
)
{
printf
(
"%s (in %s)
\n
"
,
testItem
->
testName
,
testItem
->
suiteName
);
}
return
0
;
}
TestCase
*
testItem
=
NULL
;
TestCase
*
testItem
=
NULL
;
for
(
testItem
=
testCases
;
testItem
;
testItem
=
testItem
->
next
)
{
for
(
testItem
=
testCases
;
testItem
;
testItem
=
testItem
->
next
)
{
int
retVal
=
ExecuteTest
(
testItem
);
int
retVal
=
ExecuteTest
(
testItem
);
...
...
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