Skip to content

Commit

Permalink
Merge 64646c5 into 2dc0a16
Browse files Browse the repository at this point in the history
  • Loading branch information
hassanctech authored Dec 15, 2023
2 parents 2dc0a16 + 64646c5 commit cf1a2b5
Show file tree
Hide file tree
Showing 135 changed files with 433 additions and 298 deletions.
141 changes: 124 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,22 @@ jobs:
- name: Build repository
run: |
mkdir build && cd build
sh -c 'cmake .. -DBUILD_TEST=TRUE;cmake .. -DBUILD_TEST=TRUE'
cmake .. -DBUILD_TEST=TRUE
make
- name: Run tests
run: |
cd build
./tst/kvspic_test --gtest_filter="-TimerQueueFunctionalityTest.*:HeapPerfTest.*"
- name: Build With ALIGNED_MEMORY_MODEL and FIXUP_ANNEX_B_TRAILING_NALU_ZERO definitions TRUE
run: |
rm -rf build
mkdir build && cd build
cmake .. -DBUILD_TEST=TRUE -DALIGNED_MEMORY_MODEL=TRUE -DFIXUP_ANNEX_B_TRAILING_NALU_ZERO=TRUE
make
./kvspic_test --gtest_filter="-TimerQueueFunctionalityTest.*:HeapPerfTest.*"
- name: Run tests
run: |
cd build
./tst/kvspic_test --gtest_filter="-TimerQueueFunctionalityTest.*:HeapPerfTest.*"
mac-os-build-clang:
runs-on: macos-latest
env:
Expand All @@ -47,9 +60,22 @@ jobs:
- name: Build repository
run: |
mkdir build && cd build
sh -c 'cmake .. -DBUILD_TEST=TRUE -DCOMPILER_WARNINGS=TRUE;cmake .. -DBUILD_TEST=TRUE -DCOMPILER_WARNINGS=TRUE'
cmake .. -DBUILD_TEST=TRUE -DCOMPILER_WARNINGS=TRUE
make
./kvspic_test --gtest_filter="-TimerQueueFunctionalityTest.*:HeapPerfTest.*"
- name: Run tests
run: |
cd build
./tst/kvspic_test --gtest_filter="-TimerQueueFunctionalityTest.*:HeapPerfTest.*"
- name: Build With ALIGNED_MEMORY_MODEL and FIXUP_ANNEX_B_TRAILING_NALU_ZERO definitions TRUE
run: |
rm -rf build
mkdir build && cd build
cmake .. -DBUILD_TEST=TRUE -DALIGNED_MEMORY_MODEL=TRUE -DFIXUP_ANNEX_B_TRAILING_NALU_ZERO=TRUE
make
- name: Run tests
run: |
cd build
./tst/kvspic_test --gtest_filter="-TimerQueueFunctionalityTest.*:HeapPerfTest.*"
mac-os-m1-build-clang:
runs-on: macos-13-xlarge
env:
Expand All @@ -61,9 +87,22 @@ jobs:
run: |
brew unlink openssl
mkdir build && cd build
sh -c 'cmake .. -DBUILD_TEST=TRUE -DCMAKE_C_COMPILER=$(brew --prefix llvm@15)/bin/clang -DCMAKE_CXX_COMPILER=$(brew --prefix llvm@15)/bin/clang++;cmake .. -DBUILD_TEST=TRUE -DCMAKE_C_COMPILER=$(brew --prefix llvm@15)/bin/clang -DCMAKE_CXX_COMPILER=$(brew --prefix llvm@15)/bin/clang++'
cmake .. -DBUILD_TEST=TRUE -DCMAKE_C_COMPILER=$(brew --prefix llvm@15)/bin/clang -DCMAKE_CXX_COMPILER=$(brew --prefix llvm@15)/bin/clang++
make
./kvspic_test --gtest_filter="-TimerQueueFunctionalityTest.*:HeapPerfTest.*"
- name: Run tests
run: |
cd build
./tst/kvspic_test --gtest_filter="-TimerQueueFunctionalityTest.*:HeapPerfTest.*"
- name: Build With ALIGNED_MEMORY_MODEL and FIXUP_ANNEX_B_TRAILING_NALU_ZERO definitions TRUE
run: |
rm -rf build
mkdir build && cd build
cmake .. -DBUILD_TEST=TRUE -DALIGNED_MEMORY_MODEL=TRUE -DFIXUP_ANNEX_B_TRAILING_NALU_ZERO=TRUE -DCMAKE_C_COMPILER=$(brew --prefix llvm@15)/bin/clang -DCMAKE_CXX_COMPILER=$(brew --prefix llvm@15)/bin/clang++
make
- name: Run tests
run: |
cd build
./tst/kvspic_test --gtest_filter="-TimerQueueFunctionalityTest.*:HeapPerfTest.*"
mac-os-m1-build-gcc:
runs-on: macos-13-xlarge
env:
Expand All @@ -77,9 +116,22 @@ jobs:
run: |
brew unlink openssl
mkdir build && cd build
sh -c 'cmake .. -DBUILD_TEST=TRUE;cmake .. -DBUILD_TEST=TRUE'
cmake .. -DBUILD_TEST=TRUE
make
./kvspic_test --gtest_filter="-TimerQueueFunctionalityTest.*:HeapPerfTest.*"
- name: Run tests
run: |
cd build
./tst/kvspic_test --gtest_filter="-TimerQueueFunctionalityTest.*:HeapPerfTest.*"
- name: Build With ALIGNED_MEMORY_MODEL and FIXUP_ANNEX_B_TRAILING_NALU_ZERO definitions TRUE
run: |
rm -rf build
mkdir build && cd build
cmake .. -DBUILD_TEST=TRUE -DALIGNED_MEMORY_MODEL=TRUE -DFIXUP_ANNEX_B_TRAILING_NALU_ZERO=TRUE
make
- name: Run tests
run: |
cd build
./tst/kvspic_test --gtest_filter="-TimerQueueFunctionalityTest.*:HeapPerfTest.*"
linux-gcc-code-coverage:
runs-on: ubuntu-latest
env:
Expand All @@ -92,8 +144,22 @@ jobs:
mkdir build && cd build
cmake .. -DCODE_COVERAGE=TRUE -DBUILD_TEST=TRUE
make
- name: Run tests
run: |
cd build
ulimit -c unlimited -S
timeout --signal=SIGABRT 40m ./tst/kvspic_test --gtest_filter="-TimerQueueFunctionalityTest.*:HeapPerfTest.*"
- name: Build With ALIGNED_MEMORY_MODEL and FIXUP_ANNEX_B_TRAILING_NALU_ZERO definitions TRUE
run: |
rm -rf build
mkdir build && cd build
cmake .. -DCODE_COVERAGE=TRUE -DBUILD_TEST=TRUE -DALIGNED_MEMORY_MODEL=TRUE -DFIXUP_ANNEX_B_TRAILING_NALU_ZERO=TRUE
make
- name: Run tests
run: |
cd build
ulimit -c unlimited -S
timeout --signal=SIGABRT 40m ./kvspic_test --gtest_filter="-TimerQueueFunctionalityTest.*:HeapPerfTest.*"
timeout --signal=SIGABRT 40m ./tst/kvspic_test --gtest_filter="-TimerQueueFunctionalityTest.*:HeapPerfTest.*"
- name: Code coverage
run: |
for test_file in $(find CMakeFiles/kvspic.dir CMakeFiles/kvspicClient.dir CMakeFiles/kvspicState.dir CMakeFiles/kvspicUtils.dir -name '*.gcno'); do gcov $test_file; done
Expand All @@ -110,14 +176,27 @@ jobs:
mkdir build && cd build
cmake .. -DBUILD_TEST=TRUE -DADDRESS_SANITIZER=TRUE
make
- name: Run tests
run: |
cd build
ulimit -c unlimited -S
timeout --signal=SIGABRT 40m ./kvspic_test --gtest_filter="-TimerQueueFunctionalityTest.*:HeapPerfTest.*"
timeout --signal=SIGABRT 40m ./tst/kvspic_test --gtest_filter="-TimerQueueFunctionalityTest.*:HeapPerfTest.*"
- name: Build With ALIGNED_MEMORY_MODEL and FIXUP_ANNEX_B_TRAILING_NALU_ZERO definitions TRUE
run: |
rm -rf build
mkdir build && cd build
cmake .. -DBUILD_TEST=TRUE -DADDRESS_SANITIZER=TRUE -DALIGNED_MEMORY_MODEL=TRUE -DFIXUP_ANNEX_B_TRAILING_NALU_ZERO=TRUE
make
- name: Run tests
run: |
cd build
timeout --signal=SIGABRT 40m ./tst/kvspic_test --gtest_filter="-TimerQueueFunctionalityTest.*:HeapPerfTest.*"
undefined-behavior-sanitizer:
runs-on: ubuntu-latest
env:
CC: clang
CXX: clang++
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1:suppressions=../src/utils/tst/suppressions/UBSAN.supp
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1:suppressions=../../tst/suppressions/UBSAN.supp
AWS_KVS_LOG_LEVEL: 2
steps:
- name: Clone repository
Expand All @@ -131,8 +210,21 @@ jobs:
mkdir build && cd build
cmake .. -DBUILD_TEST=TRUE -DUNDEFINED_BEHAVIOR_SANITIZER=TRUE
make
- name: Run tests
run: |
cd build
ulimit -c unlimited -S
timeout --signal=SIGABRT 40m ./kvspic_test --gtest_filter="-TimerQueueFunctionalityTest.*:HeapPerfTest.*"
timeout --signal=SIGABRT 40m ./tst/kvspic_test --gtest_filter="-TimerQueueFunctionalityTest.*:HeapPerfTest.*"
- name: Build With ALIGNED_MEMORY_MODEL and FIXUP_ANNEX_B_TRAILING_NALU_ZERO definitions TRUE
run: |
rm -rf build
mkdir build && cd build
cmake .. -DBUILD_TEST=TRUE -DUNDEFINED_BEHAVIOR_SANITIZER=TRUE -DALIGNED_MEMORY_MODEL=TRUE -DFIXUP_ANNEX_B_TRAILING_NALU_ZERO=TRUE
make
- name: Run tests
run: |
cd build
timeout --signal=SIGABRT 40m ./tst/kvspic_test --gtest_filter="-TimerQueueFunctionalityTest.*:HeapPerfTest.*"
linux-gcc-4_4:
runs-on: ubuntu-20.04
env:
Expand All @@ -155,8 +247,21 @@ jobs:
mkdir build && cd build
cmake .. -DBUILD_TEST=TRUE
make
- name: Run tests
run: |
cd build
ulimit -c unlimited -S
timeout --signal=SIGABRT 40m ./kvspic_test --gtest_filter="-TimerQueueFunctionalityTest.*:HeapPerfTest.*"
timeout --signal=SIGABRT 40m ./tst/kvspic_test --gtest_filter="-TimerQueueFunctionalityTest.*:HeapPerfTest.*"
- name: Build With ALIGNED_MEMORY_MODEL and FIXUP_ANNEX_B_TRAILING_NALU_ZERO definitions TRUE
run: |
rm -rf build
mkdir build && cd build
cmake .. -DBUILD_TEST=TRUE -DALIGNED_MEMORY_MODEL=TRUE -DFIXUP_ANNEX_B_TRAILING_NALU_ZERO=TRUE
make
- name: Run tests
run: |
cd build
timeout --signal=SIGABRT 40m ./tst/kvspic_test --gtest_filter="-TimerQueueFunctionalityTest.*:HeapPerfTest.*"
# memory-sanitizer:
# runs-on: ubuntu-18.04
# env:
Expand All @@ -176,14 +281,14 @@ jobs:
# cmake .. -DBUILD_TEST=TRUE -DMEMORY_SANITIZER=TRUE
# make
# ulimit -c unlimited -S
# timeout --signal=SIGABRT 40m ./kvspic_test --gtest_filter="-TimerQueueFunctionalityTest.*:HeapPerfTest.*"
# timeout --signal=SIGABRT 40m ./tst/kvspic_test --gtest_filter="-TimerQueueFunctionalityTest.*:HeapPerfTest.*"
# thread-sanitizer:
# runs-on: ubuntu-18.04
# env:
# CC: clang-7
# CXX: clang++-7
# AWS_KVS_LOG_LEVEL: 2
# TSAN_OPTIONS: halt_on_error=1:suppressions=../src/utils/tst/suppressions/TSAN.supp
# TSAN_OPTIONS: halt_on_error=1:suppressions=../../tst/suppressions/TSAN.supp
# steps:
# - name: Clone repository
# uses: actions/checkout@v2
Expand All @@ -196,7 +301,7 @@ jobs:
# mkdir build && cd build
# cmake .. -DBUILD_TEST=TRUE -DTHREAD_SANITIZER=TRUE
# make
# ./kvspic_test --gtest_break_on_failure --gtest_filter="-TimerQueueFunctionalityTest.*:HeapPerfTest.*:ThreadFunctionalityTest.ThreadCreateAndCancel"
# ./tst/kvspic_test --gtest_break_on_failure --gtest_filter="-TimerQueueFunctionalityTest.*:HeapPerfTest.*:ThreadFunctionalityTest.ThreadCreateAndCancel"
windows-msvc:
runs-on: windows-2022
env:
Expand All @@ -207,7 +312,9 @@ jobs:
- name: Build and run
run: |
.github/build_windows.bat
D:\a\amazon-kinesis-video-streams-pic\amazon-kinesis-video-streams-pic\build\kvspic_test.exe --gtest_filter="-TimerQueueFunctionalityTest.*:HeapPerfTest.*:PermutatedStreamInfo/StateTransitionFunctionalityTest.ControlPlaneServiceCallExhaustRetry*:PermutatedStreamInfo/IntermittentProducerAutomaticStreamingTest.ValidateTimerInvokedBeforeTime*:PermutatedStreamInfo/IntermittentProducerAutomaticStreamingTest.ValidateTimerInvokedAfterFirstPeriod*:PermutatedStreamInfo/IntermittentProducerAutomaticStreamingTest.ValidateLastUpdateTimeOfStreamUpdated*:PermutatedStreamInfo/IntermittentProducerAutomaticStreamingTest.MultiTrackVerifyNoInvocationsWithSingleTrackProducer*:PermutatedStreamInfo/IntermittentProducerAutomaticStreamingTest.ValidateNoConsecutiveEOFR*:PermutatedStreamInfo/IntermittentProducerAutomaticStreamingTest.ValidateErrorOnForceConsecutiveEOFR*:*StreamStateTransitionsTest*:*PermutatedStreamInfo/StateTransitionFunctionalityTest.StreamTerminatedAndGoToGetEndpointState*:*PermutatedStreamInfo/StateTransitionFunctionalityTest.StreamTerminatedAndGoToDescribeState*:*PermutatedStreamInfo/StateTransitionFunctionalityTest*"
- name: Run tests
run: |
D:\a\amazon-kinesis-video-streams-pic\amazon-kinesis-video-streams-pic\build\tst\kvspic_test.exe --gtest_filter="-TimerQueueFunctionalityTest.*:HeapPerfTest.*:PermutatedStreamInfo/StateTransitionFunctionalityTest.ControlPlaneServiceCallExhaustRetry*:PermutatedStreamInfo/IntermittentProducerAutomaticStreamingTest.ValidateTimerInvokedBeforeTime*:PermutatedStreamInfo/IntermittentProducerAutomaticStreamingTest.ValidateTimerInvokedAfterFirstPeriod*:PermutatedStreamInfo/IntermittentProducerAutomaticStreamingTest.ValidateLastUpdateTimeOfStreamUpdated*:PermutatedStreamInfo/IntermittentProducerAutomaticStreamingTest.MultiTrackVerifyNoInvocationsWithSingleTrackProducer*:PermutatedStreamInfo/IntermittentProducerAutomaticStreamingTest.ValidateNoConsecutiveEOFR*:PermutatedStreamInfo/IntermittentProducerAutomaticStreamingTest.ValidateErrorOnForceConsecutiveEOFR*:*StreamStateTransitionsTest*:*PermutatedStreamInfo/StateTransitionFunctionalityTest.StreamTerminatedAndGoToGetEndpointState*:*PermutatedStreamInfo/StateTransitionFunctionalityTest.StreamTerminatedAndGoToDescribeState*:*PermutatedStreamInfo/StateTransitionFunctionalityTest*"
arm64-cross-compilation:
runs-on: ubuntu-latest
env:
Expand Down
33 changes: 2 additions & 31 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.6.3)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake;${CMAKE_MODULE_PATH}")
include(Utilities)
project(pic_project)
project(pic_project LANGUAGES C)

include(GNUInstallDirs)

Expand Down Expand Up @@ -111,8 +111,6 @@ file(GLOB PIC_UTILS_SOURCE_FILES "src/utils/src/*.c")

file(GLOB PIC_VIEW_SOURCE_FILES "src/view/src/*.c")

file(GLOB PIC_TEST_SOURCE_FILES "src/*/tst/*.cpp")

file(GLOB PIC_HEADERS "${KINESIS_VIDEO_PIC_SRC}/src/*/include")

include_directories(${PIC_HEADERS})
Expand Down Expand Up @@ -194,32 +192,5 @@ install(
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")

if(BUILD_TEST)
set(CMAKE_CXX_STANDARD 11)

if (OPEN_SRC_INSTALL_PREFIX)
find_package(GTest REQUIRED PATHS ${OPEN_SRC_INSTALL_PREFIX})
else()
find_package(GTest REQUIRED)
endif()

SET(GTEST_LIBNAME GTest::gtest)
if (TARGET GTest::GTest)
SET(GTEST_LIBNAME GTest::GTest)
endif()

add_executable(kvspic_test ${PIC_TEST_SOURCE_FILES}
${PIC_CLIENT_SOURCE_FILES}
${PIC_DURATION_SOURCE_FILES}
${PIC_HEAP_SOURCE_FILES}
${PIC_MKVGEN_SOURCE_FILES}
${PIC_STATE_SOURCE_FILES}
${PIC_TRACE_SOURCE_FILES}
${PIC_UTILS_SOURCE_FILES}
${PIC_VIEW_SOURCE_FILES})
target_compile_definitions(kvspic_test PRIVATE ALIGNED_MEMORY_MODEL=TRUE FIXUP_ANNEX_B_TRAILING_NALU_ZERO=TRUE)
target_link_libraries(kvspic_test ${GTEST_LIBNAME} ${CMAKE_DL_LIBS} Threads::Threads)
if(UNIX AND NOT APPLE)
# rt needed for clock_gettime
target_link_libraries(kvspic_test rt)
endif()
add_subdirectory(tst)
endif()
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ If you wish to cross-compile `CC` and `CXX` are respected when building the libr
You can pass the following options to `cmake ..`

* `-DBUILD_DEPENDENCIES` -- Whether or not to build depending libraries from source
* `-DBUILD_TEST=TRUE` -- Build unit/integration tests, may be useful for confirm support for your device. `./kvspic_test`
* `-DBUILD_TEST=TRUE` -- Build unit/integration tests, may be useful for confirm support for your device. `./tst/kvspic_test`
* `-DCODE_COVERAGE` -- Enable coverage reporting
* `-DCOMPILER_WARNINGS` -- Enable all compiler warnings
* `-DADDRESS_SANITIZER` -- Build with AddressSanitizer
Expand Down
2 changes: 1 addition & 1 deletion src/client/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.6.3)

project(client)
project(client LANGUAGES C)
kinesis_video_library_setup(${PROJECT_NAME})
target_link_libraries(client mkvgen heap view utils state)
kinesis_video_library_install()
19 changes: 0 additions & 19 deletions src/client/tst/CMakeLists.txt

This file was deleted.

2 changes: 1 addition & 1 deletion src/common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.6.3)

project(common)
project(common LANGUAGES C)
set(LIBRARY_NAME ${PROJECT_NAME})
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/
DESTINATION .
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,10 @@ extern "C" {
#if defined __APPLE__
#define __LLP64__
#else
#ifndef __LP64__
#define __LP64__ // Linux uses LP64 data model
#endif
#endif
#else
#define SIZE_32
#endif
Expand Down Expand Up @@ -232,6 +234,9 @@ typedef UINT64 MUTEX;
#if defined __WINDOWS_BUILD__
typedef PCONDITION_VARIABLE CVAR;
#else
#if defined(__linux__) && !defined(_GNU_SOURCE)
#define _GNU_SOURCE
#endif
#include <pthread.h>
#include <signal.h>
typedef pthread_cond_t* CVAR;
Expand Down
2 changes: 1 addition & 1 deletion src/duration/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.6.3)

project(duration)
project(duration LANGUAGES C)
kinesis_video_library_setup(${PROJECT_NAME})
kinesis_video_library_install()
12 changes: 0 additions & 12 deletions src/duration/tst/CMakeLists.txt

This file was deleted.

2 changes: 1 addition & 1 deletion src/heap/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.6.3)

project(heap)
project(heap LANGUAGES C)
kinesis_video_library_setup(${PROJECT_NAME})
target_link_libraries(heap utils)
kinesis_video_library_install()
Loading

0 comments on commit cf1a2b5

Please sign in to comment.