From 0e60e6fefabce35dcb38c1b682dbdae912063a54 Mon Sep 17 00:00:00 2001 From: Cosmin Stejerean Date: Wed, 3 Apr 2024 15:04:57 -0700 Subject: [PATCH] propagate build type through ctest and go back to stripping the strip_parameter_set_nalus test if shared, for now --- packager/CMakeLists.txt | 5 +++++ packager/app/test/packager_app.py | 2 +- packager/app/test/packager_test.py | 4 ++-- packager/app/test/test_env.py | 6 ++---- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/packager/CMakeLists.txt b/packager/CMakeLists.txt index e9ce76f24e..8dce355371 100644 --- a/packager/CMakeLists.txt +++ b/packager/CMakeLists.txt @@ -239,6 +239,11 @@ if(NOT SKIP_INTEGRATION_TESTS) set(test_environment_vars "PACKAGER_SRC_DIR=${CMAKE_SOURCE_DIR}") list(APPEND test_environment_vars "PACKAGER_BIN=$") list(APPEND test_environment_vars "MPD_GENERATOR_BIN=$") + if(BUILD_SHARED_LIBS) + list(APPEND test_environment_vars "BUILD_TYPE=shared") + else() + list(APPEND test_environment_vars "BUILD_TYPE=static") + endif() set_tests_properties(packager_test_py PROPERTIES ENVIRONMENT "${test_environment_vars}" diff --git a/packager/app/test/packager_app.py b/packager/app/test/packager_app.py index 6a9c580013..c736749c3d 100644 --- a/packager/app/test/packager_app.py +++ b/packager/app/test/packager_app.py @@ -29,7 +29,7 @@ def __init__(self): def GetEnv(self): env = os.environ.copy() if (platform.system() == 'Darwin' and - test_env.options.libpackager_type == 'shared_library'): + test_env.BUILD_TYPE == 'shared'): env['DYLD_FALLBACK_LIBRARY_PATH'] = test_env.SCRIPT_DIR return env diff --git a/packager/app/test/packager_test.py b/packager/app/test/packager_test.py index e3cf795760..6df148c753 100755 --- a/packager/app/test/packager_test.py +++ b/packager/app/test/packager_test.py @@ -1514,8 +1514,8 @@ def testWvmInput(self): # TODO(kqyang): Fix shared_library not supporting strip_parameter_set_nalus # problem. - @unittest.skipUnless( - test_env.options.libpackager_type == 'static_library', + @unittest.skipIf( + test_env.BUILD_TYPE == 'shared', 'libpackager shared_library does not support ' '--strip_parameter_set_nalus flag.' ) diff --git a/packager/app/test/test_env.py b/packager/app/test/test_env.py index 34e2a0d733..f26a46523f 100644 --- a/packager/app/test/test_env.py +++ b/packager/app/test/test_env.py @@ -40,14 +40,12 @@ def GetBinaryName(name): MPD_GENERATOR_BIN = os.path.join(SCRIPT_DIR, GetBinaryName('mpd_generator')) +BUILD_TYPE = os.environ.get('BUILD_TYPE', 'static') + # Parse arguments and calculate dynamic global objects and attributes. parser = argparse.ArgumentParser() - parser.add_argument('--test_update_golden_files', action='store_true') -parser.add_argument('--libpackager_type', default='static_library', - choices=['static_library', 'shared_library']) - parser.add_argument('--v') parser.add_argument('--vmodule') # Overwrite the test to encryption key/iv specified in the command line.