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
16254c32
Commit
16254c32
authored
Jun 05, 2011
by
Markus Kauppila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small fixes to previous commit.
parent
d4b779a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
12 deletions
+41
-12
runner.c
test/test-automation/runner.c
+41
-12
No files found.
test/test-automation/runner.c
View file @
16254c32
...
@@ -256,10 +256,13 @@ ExecuteTest(void *suite, TestCaseReference *testReference) {
...
@@ -256,10 +256,13 @@ ExecuteTest(void *suite, TestCaseReference *testReference) {
* Prints usage information
* Prints usage information
*/
*/
void
printUsage
()
{
void
printUsage
()
{
printf
(
"Usage: ./runner [--in-proc] [--help]
\n
"
);
printf
(
"Usage: ./runner [--in-proc] [--
suite SUITE] [--test TEST] [--
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
(
" --help Print this help
\n
"
);
printf
(
" -t --test TEST Executes only tests with given name
\n
"
);
printf
(
" -s --suite SUITE Executes only the given test suite
\n
"
);
printf
(
" -h --help Print this help
\n
"
);
}
}
...
@@ -285,17 +288,35 @@ ParseOptions(int argc, char *argv[])
...
@@ -285,17 +288,35 @@ ParseOptions(int argc, char *argv[])
}
}
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
;
char
*
testName
=
argv
[
++
i
];
//!< \todo fixme what if i == argc? segfault?
char
*
testName
=
NULL
;
if
(
(
i
+
1
)
<
argc
)
{
testName
=
argv
[
++
i
];
}
else
{
printf
(
"runner: test name is missing
\n
"
);
printUsage
();
exit
(
1
);
}
memset
(
selected_test_name
,
0
,
NAME_BUFFER_SIZE
);
// unnecessary?
memset
(
selected_test_name
,
0
,
NAME_BUFFER_SIZE
);
strcpy
(
selected_test_name
,
testName
);
strcpy
(
selected_test_name
,
testName
);
}
}
else
if
(
SDL_strcmp
(
arg
,
"--suite"
)
==
0
||
SDL_strcmp
(
arg
,
"-s"
)
==
0
)
{
else
if
(
SDL_strcmp
(
arg
,
"--suite"
)
==
0
||
SDL_strcmp
(
arg
,
"-s"
)
==
0
)
{
only_selected_suite
=
1
;
only_selected_suite
=
1
;
char
*
suiteName
=
argv
[
++
i
];
//!< \todo fixme what if i == argc? segfault?
memset
(
selected_suite_name
,
0
,
NAME_BUFFER_SIZE
);
// unnecessary?
char
*
suiteName
=
NULL
;
if
(
(
i
+
1
)
<
argc
)
{
suiteName
=
argv
[
++
i
];
}
else
{
printf
(
"runner: suite name is missing
\n
"
);
printUsage
();
exit
(
1
);
}
memset
(
selected_suite_name
,
0
,
NAME_BUFFER_SIZE
);
strcpy
(
selected_suite_name
,
suiteName
);
strcpy
(
selected_suite_name
,
suiteName
);
printf
(
"%s
\n
"
,
selected_suite_name
);
}
}
else
{
else
{
printf
(
"runner: unknown command '%s'
\n
"
,
arg
);
printf
(
"runner: unknown command '%s'
\n
"
,
arg
);
...
@@ -331,12 +352,20 @@ main(int argc, char *argv[])
...
@@ -331,12 +352,20 @@ main(int argc, char *argv[])
if
(
only_selected_suite
)
{
if
(
only_selected_suite
)
{
// extract the suite name. Rips the tests/ and file suffix from the suite name
// extract the suite name. Rips the tests/ and file suffix from the suite name
char
buffer
[
32
];
char
buffer
[
NAME_BUFFER_SIZE
];
int
len
=
strlen
(
testSuiteName
);
int
len
=
strlen
(
testSuiteName
);
int
copy
=
len
-
6
-
6
;
memcpy
(
buffer
,
testSuiteName
+
6
,
copy
);
//! \todo Fix this, it's rather horrible way to do it
//printf("%s\n", buffer);
#define DIR_NAME_LENGTH 6
//char *name = strndup(testSuiteName[5], 32);
#if defined(linux) || defined( __linux)
#define FILE_EXT_LENGTH 3
#else
#define FILE_EXT_LENGTH 6
#endif
int
length
=
len
-
DIR_NAME_LENGTH
-
FILE_EXT_LENGTH
;
memset
(
buffer
,
0
,
NAME_BUFFER_SIZE
);
memcpy
(
buffer
,
testSuiteName
+
6
,
length
);
if
(
SDL_strncmp
(
selected_suite_name
,
buffer
,
NAME_BUFFER_SIZE
)
!=
0
)
{
if
(
SDL_strncmp
(
selected_suite_name
,
buffer
,
NAME_BUFFER_SIZE
)
!=
0
)
{
continue
;
continue
;
...
...
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