Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
aom-rav1e
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiph.Org
aom-rav1e
Commits
00adebd1
Commit
00adebd1
authored
Nov 06, 2013
by
Joshua Litt
Committed by
Gerrit Code Review
Nov 06, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge "Allow test data path to be set by preprocessor symbol"
parents
e52d3efe
ab9160de
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
8 deletions
+27
-8
test/video_source.h
test/video_source.h
+27
-8
No files found.
test/video_source.h
View file @
00adebd1
...
...
@@ -18,16 +18,35 @@
namespace
libvpx_test
{
static
FILE
*
OpenTestDataFile
(
const
std
::
string
&
file_name
)
{
std
::
string
path_to_source
=
file_name
;
const
char
*
kDataPath
=
getenv
(
"LIBVPX_TEST_DATA_PATH"
);
if
(
kDataPath
)
{
path_to_source
=
kDataPath
;
path_to_source
+=
"/"
;
path_to_source
+=
file_name
;
// Helper macros to ensure LIBVPX_TEST_DATA_PATH is a quoted string.
// These are undefined right below GetDataPath
// NOTE: LIBVPX_TEST_DATA_PATH MUST NOT be a quoted string before
// Stringification or the GetDataPath will fail at runtime
#define TO_STRING(S) #S
#define STRINGIFY(S) TO_STRING(S)
// A simple function to encapsulate cross platform retrieval of test data path
static
std
::
string
GetDataPath
()
{
const
char
*
const
data_path
=
getenv
(
"LIBVPX_TEST_DATA_PATH"
);
if
(
data_path
==
NULL
)
{
#ifdef LIBVPX_TEST_DATA_PATH
// In some environments, we cannot set environment variables
// Instead, we set the data path by using a preprocessor symbol
// which can be set from make files
return
STRINGIFY
(
LIBVPX_TEST_DATA_PATH
);
#else
return
"."
;
#endif
}
return
data_path
;
}
// Undefining stringification macros because they are not used elsewhere
#undef TO_STRING
#undef STRINGIFY
static
FILE
*
OpenTestDataFile
(
const
std
::
string
&
file_name
)
{
const
std
::
string
path_to_source
=
GetDataPath
()
+
"/"
+
file_name
;
return
fopen
(
path_to_source
.
c_str
(),
"rb"
);
}
...
...
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