shaka-packager/packager/media/test
Joey Parrish 899f763dd7
test: Fix data directory computation (#1239)
The `__FILE__` macro does not always get you an absolute path, so our
assumptions about it in test_data_util.cc were flawed.

If `foo.c` references `__FILE__`, something like `gcc -c foo.c`, will
define `__FILE__` as `"foo.c"`. If you use `gcc -c /path/to/foo.c`, then
`__FILE__` will be `"/path/to/foo.c"`.

The Ninja generator for CMake only generates absolute paths for source
files in certain CMake versions. (Exact range unknown.) Rather than
require newer CMake versions and depend on CMake's Ninja generator
maintaining the latest behavior forever, set the macro TEST_DATA_DIR to
point to the test data folder. This is consistent and never depends on
unspecified behavior.

This change will allow the use of the Ninja generator with older
versions of CMake, as found in most of our Docker builds.
2023-07-17 10:06:10 -07:00
..
data Merge branch 'main' into cmake 2022-11-03 07:58:47 -07:00
CMakeLists.txt test: Fix data directory computation (#1239) 2023-07-17 10:06:10 -07:00
test_data_util.cc test: Fix data directory computation (#1239) 2023-07-17 10:06:10 -07:00
test_data_util.h feat: port media/test (#1116) 2022-10-25 09:15:54 -07:00
test_web_server.cc test: Add Mongoose embedded HTTP server (#1231) 2023-07-13 16:36:42 -07:00
test_web_server.h fix: Fix compilation on Arch Linux (#1233) 2023-07-14 12:40:12 -07:00