Commit 59f47252 authored by vaclav's avatar vaclav
Browse files

- Merge remote-tracking branch 'remotes/origin/main' into...

- Merge remote-tracking branch 'remotes/origin/main' into 911-crend-binaural-external-renderer-function
parents 56736268 0f77ad0e
Loading
Loading
Loading
Loading
+51 −64
Original line number Diff line number Diff line
@@ -93,16 +93,19 @@ stages:
  # needed when depth is lower than the number of commits in the branch
  - git fetch origin $CI_MERGE_REQUEST_TARGET_BRANCH_NAME:$CI_MERGE_REQUEST_TARGET_BRANCH_NAME

.mr-get-target-commit:
  &mr-get-target-commit # compare to last target branch commit before pipeline was created
.mr-get-target-commit: &mr-get-target-commit # compare to last target branch commit before pipeline was created
  - target_commit=$(git log $CI_MERGE_REQUEST_TARGET_BRANCH_NAME -1 --oneline --before=${CI_PIPELINE_CREATED_AT} --format=%H)

.check-for-testvectors:
  &check-for-testvectors # check if the testvector files specified in scripts/config/ci_linux*.json are present
.check-for-testvectors: &check-for-testvectors # check if the testvector files specified in scripts/config/ci_linux*.json are present
  - python3 -m pytest ci/test_vectors_available.py

.merge-request-comparison-setup-codec:
  &merge-request-comparison-setup-codec ### build test binaries, initial clean for paranoia reasons
.disable-debugging-macro: &disable-debugging-macro
# automatically disable #DEBUGGING macro in options.h using /**/-comment
  - sed -i.bak -e "s/^[[:space:]]*\(#define[[:space:]]*DEBUGGING\)/\/\*\1\*\//g" lib_com/options.h

.merge-request-comparison-setup-codec: &merge-request-comparison-setup-codec 
  ### build test binaries, initial clean for paranoia reasons
  - *disable-debugging-macro
  - make clean
  - mkdir build
  - cd build
@@ -113,17 +116,18 @@ stages:
  - mv IVAS_rend ../IVAS_rend_test
  - cd ..
  - rm -rf build/*
  - git restore .

  ### store the current commit hash
  - source_branch_commit_sha=$(git rev-parse HEAD)

  ### checkout version to compare against
  - *mr-fetch-target-branch

  - *mr-get-target-commit
  - git checkout $target_commit

  ### build reference binaries
  - *disable-debugging-macro
  - cd build
  - cmake ..
  - make -j
@@ -131,6 +135,7 @@ stages:
  - mv IVAS_dec ../IVAS_dec_ref
  - mv IVAS_rend ../IVAS_rend_ref
  - cd ..
  - git restore .

  # rename test binaries back
  - mv IVAS_cod_test IVAS_cod
@@ -167,6 +172,13 @@ stages:
    - cp "$LTV_DIR"/*.met scripts/testv/
    - cp "$LTV_DIR"/*.csv scripts/testv/

.activate-Werror-linux: &activate-Werror-linux
  - sed -i.bak "s/^# \(CFLAGS += -Werror\)/\1/" Makefile
  - sed -i.bak "s/# \(set(CMAKE_C_FLAGS \"\${CMAKE_C_FLAGS} -Werror\")\)/\1/" CMakeLists.txt

.activate-WX-windows: &activate-WX-windows
  - (Get-Content -Path "CMakeLists.txt") -replace '# \(add_compile_options\("\/WX"\)\)', '$1' | Set-Content -Path "CMakeLists.txt"
  - Get-ChildItem -Path "Workspace_msvc" -Filter "*.vcxproj" | ForEach-Object { (Get-Content -Path $_.FullName) -replace '<TreatWarningAsError>false', '<TreatWarningAsError>true' | Set-Content -Path $_.FullName }

# ---------------------------------------------------------------
# Job templates
@@ -234,21 +246,6 @@ stages:
    - if [ ! -d "$TESTV_DIR" ]; then mkdir -p $TESTV_DIR; fi
    - cp -r scripts/testv/* $TESTV_DIR/

# template for build jobs to include the check for warnings
.build-job-with-check-for-warnings:
  extends: .build-job-linux
  stage: build
  allow_failure:
    exit_codes:
      - 123

.build-job-windows-with-check-for-warnings:
  extends: .build-job-windows
  stage: build
  allow_failure:
    exit_codes:
      - 123

# ---------------------------------------------------------------
# .pre jobs for setting up things
# ---------------------------------------------------------------
@@ -304,27 +301,25 @@ branch-is-up-to-date-with-main-post:

build-codec-linux-make:
  extends:
    - .build-job-with-check-for-warnings
    - .build-job-linux
    - .rules-basis
  script:
    - *print-common-info
    - make -j 2>&1 | tee $BUILD_OUTPUT
    # need to use the "|| exit $?" suffix to get the allowed_failure return code, otherwise the job fails with code 1...<
    - ci/check_for_warnings.py $BUILD_OUTPUT || exit $?
    - *activate-Werror-linux
    - make -j

build-codec-linux-cmake:
  extends:
    - .build-job-with-check-for-warnings
    - .build-job-linux
    - .rules-basis
  script:
    - *print-common-info
    - *activate-Werror-linux
    - mkdir build
    - cd build
    - cmake ..
    - cd ..
    - make -C build -j 2>&1 | tee $BUILD_OUTPUT
    # need to use the "|| exit $?" suffix to get the allowed_failure return code, otherwise the job fails with code 1...<
    - ci/check_for_warnings.py $BUILD_OUTPUT || exit $?
    - make -C build -j

build-codec-instrumented-linux:
  extends:
@@ -333,86 +328,75 @@ build-codec-instrumented-linux:
  timeout: "6 minutes"
  script:
    - *print-common-info
    - *activate-Werror-linux
    - bash ci/build_codec_instrumented_linux.sh

# make sure that the codec builds with msan, asan and usan
build-codec-sanitizers-linux:
  extends:
    - .build-job-with-check-for-warnings
    - .build-job-linux
    - .rules-basis
  script:
    - *print-common-info
    - *activate-Werror-linux
    - bash ci/build_codec_sanitizers_linux.sh
    # need to use the "|| exit $?" suffix to get the allowed_failure return code, otherwise the job fails with code 1...<
    - ci/check_for_warnings.py $BUILD_OUTPUT || exit $?

build-codec-include-split-linux-make:
  extends:
    - .build-job-with-check-for-warnings
    - .build-job-linux
    - .rules-basis
  script:
    - *print-common-info
    - *enable-split-rendering
    - make -j INCLUDE_SPLIT=1 2>&1 | tee $BUILD_OUTPUT
    # need to use the "|| exit $?" suffix to get the allowed_failure return code, otherwise the job fails with code 1...<
    - ci/check_for_warnings.py $BUILD_OUTPUT || exit $?
    - *activate-Werror-linux
    - make -j INCLUDE_SPLIT=1

build-codec-include-split-linux-cmake:
  extends:
    - .build-job-with-check-for-warnings
    - .build-job-linux
    - .rules-basis
  script:
    - *print-common-info
    - *enable-split-rendering
    - *activate-Werror-linux
    - mkdir build
    - cd build
    - cmake .. -DINCLUDE_SPLIT=1
    - cd ..
    - make -C build -j 2>&1 | tee $BUILD_OUTPUT
    # need to use the "|| exit $?" suffix to get the allowed_failure return code, otherwise the job fails with code 1...<
    - ci/check_for_warnings.py $BUILD_OUTPUT || exit $?
    - make -C build -j

build-codec-windows-cmake:
  extends:
    - .build-job-windows-with-check-for-warnings
    - .build-job-windows
    - .rules-basis
  script:
    - *print-common-info-windows
    - $winoutdata = $null
    - *activate-WX-windows
    - cmake -G "Visual Studio 15 2017" . -Bbuild
    - cmake --build build -j | tee -variable winoutdata
    - $winoutdata | Out-File $BUILD_OUTPUT -Encoding Utf8
    - ("& python ci/check_for_warnings.py '$BUILD_OUTPUT'") | Invoke-Expression
    - ("exit $LASTEXITCODE") | Invoke-Expression
    - cmake --build build -j

build-codec-windows-include-split-cmake:
  extends:
    - .build-job-windows-with-check-for-warnings
    - .build-job-windows
    - .rules-basis
  script:
    - *print-common-info-windows
    - $winoutdata = $null
    - *activate-WX-windows
    - get-content .\lib_com\options.h | %{$_ -replace "/\*#define[\s]*SPLIT_REND_WITH_HEAD_ROT[\s]*\*/", "#define SPLIT_REND_WITH_HEAD_ROT"} | set-content -Path ./options_patched.h
    - rm ./lib_com/options.h
    - mv ./options_patched.h ./lib_com/options.h
    - cmake -DINCLUDE_SPLIT=1 -G "Visual Studio 15 2017" . -Bbuild
    - cmake --build build -j | tee -variable winoutdata
    - $winoutdata | Out-File $BUILD_OUTPUT -Encoding Utf8
    - ("& python ci/check_for_warnings.py '$BUILD_OUTPUT'") | Invoke-Expression
    - ("exit $LASTEXITCODE") | Invoke-Expression
    - cmake --build build -j

build-codec-windows-msbuild:
  extends:
    - .build-job-windows-with-check-for-warnings
    - .build-job-windows
    - .rules-basis
  script:
    - *print-common-info-windows
    - $winoutdata = $null
    - *activate-WX-windows
    - py .\scripts\strip_split_rendering.py
    - MSBuild.exe .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug | tee -variable winoutdata
    - $winoutdata | Out-File $BUILD_OUTPUT -Encoding Utf8
    - ("& python ci/check_for_warnings.py '$BUILD_OUTPUT'") | Invoke-Expression
    - ("exit $LASTEXITCODE") | Invoke-Expression
    - MSBuild.exe .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug

# ---------------------------------------------------------------
# Test jobs for merge requests
@@ -424,6 +408,8 @@ codec-smoke-test:
    - .test-job-linux-needs-testv-dir
    - .rules-merge-request
  timeout: "17 minutes"
  tags:
    - ivas-linux-fast
  stage: test
  needs: ["build-codec-linux-cmake", "build-codec-linux-make", "build-codec-instrumented-linux", "build-codec-sanitizers-linux"]
  script:
@@ -1186,9 +1172,6 @@ test-be-to-release:

    - echo "$CI_COMMIT_BRANCH"
    - MSBuild.exe .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug /p:Platform=win32 /m | tee -variable winoutdata
    - $winoutdata | Out-File $BUILD_OUTPUT -Encoding Utf8
    - ("& python ci/check_for_warnings.py '$BUILD_OUTPUT'") | Invoke-Expression
    - ("exit $LASTEXITCODE") | Invoke-Expression

    # path to release candidate refs defined in config.toml

@@ -1819,22 +1802,26 @@ coverage-test-on-main-scheduled:
    - python3 tests/create_short_testvectors.py
    - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v -n auto --update_ref 1 -m create_ref --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec
    - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v -n auto --update_ref 1 -m create_ref_part2 --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec
    - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR/test_param_file.py -v -n auto --update_ref 1 -m create_ref --param_file scripts/config/self_test_evs.prm --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec
    - bash ci/smoke_test.sh coverage
    - python3 -m pytest -q -n auto tests/renderer/test_renderer.py --create_ref
    - python3 -m pytest -q -n auto tests/renderer/test_renderer.py --create_cut    
    - lcov -c -d obj -o coverage_stv.info # extract coverage of short test vectors here
    - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR/test_param_file.py -v -n auto --update_ref 1 -m create_ref --param_file scripts/config/self_test_evs.prm --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec
    - bash ci/smoke_test.sh coverage
    - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR/test_param_file.py -v -n auto --update_ref 1 -m create_ref --param_file scripts/config/self_test_ltv.prm --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec
    - bash ci/ivas_voip_be_test.sh coverage
    - lcov -c -d obj -o coverage.info
    - commit_sha=$(git rev-parse HEAD)
    - genhtml coverage.info -o coverage -t "Coverage on main @ $commit_sha"
    - genhtml coverage_stv.info -o coverage_stv -t "Coverage on main -- short test vectors @ $commit_sha"
  artifacts:
    name: "main-coverage-sha-$CI_COMMIT_SHORT_SHA"
    when: always
    expire_in: 1 week
    paths:
      - coverage.info
      - coverage_stv.info
      - coverage
      - coverage_stv

# ---------------------------------------------------------------
# Complexity measurement jobs
+10 −5
Original line number Diff line number Diff line
@@ -60,7 +60,10 @@ if(UNIX)
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffp-contract=off")  # disable floating point operation contraction
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wcast-qual -Wall -W -Wextra -Wno-long-long")
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes")
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror-implicit-function-declaration -Wno-unused-parameter")
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-parameter")
  # to be uncommented in CI
  # set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")

  # CLANG
  if(CLANG)
    find_program(clangBin NAMES /home/amm-archiv/soft/Linux/clang/current/bin/clang clang REQUIRED)
@@ -112,8 +115,11 @@ elseif(WIN32)
    -D_CRT_SECURE_NO_WARNINGS
    /MP
  )
  # CMake sets /W3 by default, until CMake version 3.15. Instead of setting /W4 separately, replace in existing settings
  string(REGEX REPLACE "/W3" "/W4" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
  if(NOT INCLUDE_SPLIT)
    add_compile_options("/W4")
    # to be uncommented in CI
    # add_compile_options("/WX")
  endif()
endif()

# configuration options for all platforms
@@ -208,8 +214,7 @@ endif()

if(INCLUDE_SPLIT)
  if(NOT WMOPS)
  file(GLOB unitTestIvasLc3plusSrcs "scripts/split_rendering/lc3plus/*.c")
  add_executable(ivas_lc3plus_unit_test ${unitTestIvasLc3plusSrcs})
  add_executable(ivas_lc3plus_unit_test ${CMAKE_SOURCE_DIR}/scripts/split_rendering/lc3plus/ivas_lc3plus_unit_test.c)
  target_link_libraries(ivas_lc3plus_unit_test lib_rend lib_dec lib_util lib_com lib_debug)
  endif()
endif()
+2 −1
Original line number Diff line number Diff line
@@ -57,8 +57,9 @@ endif
# C compiler flags
CFLAGS   += -std=c99 -pedantic -Wcast-qual -Wall -W -Wextra -Wno-long-long     \
            -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes  \
            -Werror-implicit-function-declaration \
            -Wno-implicit-fallthrough -ffp-contract=off
# to be uncommented in CI
# CFLAGS += -Werror

# libs to link
LDLIBS   += -lm
+2 −0
Original line number Diff line number Diff line
@@ -82,6 +82,7 @@
      <DebugInformationFormat>OldStyle</DebugInformationFormat>
      <CompileAs>Default</CompileAs>
      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
      <TreatWarningAsError>false</TreatWarningAsError>
    </ClCompile>
    <ResourceCompile>
      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -129,6 +130,7 @@
      <DebugInformationFormat />
      <CompileAs>Default</CompileAs>
      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
      <TreatWarningAsError>false</TreatWarningAsError>
    </ClCompile>
    <ResourceCompile>
      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+2 −0
Original line number Diff line number Diff line
@@ -82,6 +82,7 @@
      <DebugInformationFormat>OldStyle</DebugInformationFormat>
      <CompileAs>Default</CompileAs>
      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
      <TreatWarningAsError>false</TreatWarningAsError>
    </ClCompile>
    <ResourceCompile>
      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -137,6 +138,7 @@
      <DebugInformationFormat />
      <CompileAs>Default</CompileAs>
      <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
      <TreatWarningAsError>false</TreatWarningAsError>
    </ClCompile>
    <ResourceCompile>
      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
Loading