From 0019107fb5ae3fd9b3b7dc0d68b3d9bbafa55e31 Mon Sep 17 00:00:00 2001 From: William Yang Date: Wed, 31 Jan 2024 16:20:09 +1100 Subject: [PATCH] Run tests for punctured decoder and simple decoder in github actions CI --- .github/workflows/arm-linux.yml | 10 +++++++++- .github/workflows/x86-linux.yml | 10 +++++++++- .github/workflows/x86-windows.yml | 17 +++++++++++++---- examples/run_simple.cpp | 6 +++++- 4 files changed, 36 insertions(+), 7 deletions(-) diff --git a/.github/workflows/arm-linux.yml b/.github/workflows/arm-linux.yml index c08c2e4..15a439e 100644 --- a/.github/workflows/arm-linux.yml +++ b/.github/workflows/arm-linux.yml @@ -27,6 +27,14 @@ jobs: working-directory: ./examples run: ninja -C build-arm - - name: Run test + - name: Run simple example + working-directory: ./examples + run: ./toolchains/arm_run.sh ./build-arm/run_simple + + - name: Run punctured decoder example + working-directory: ./examples + run: ./toolchains/arm_run.sh ./build-arm/run_punctured_decoder + + - name: Run tests working-directory: ./examples run: ./toolchains/arm_run.sh ./build-arm/run_tests \ No newline at end of file diff --git a/.github/workflows/x86-linux.yml b/.github/workflows/x86-linux.yml index 20ab92a..9f2ab08 100644 --- a/.github/workflows/x86-linux.yml +++ b/.github/workflows/x86-linux.yml @@ -29,6 +29,14 @@ jobs: working-directory: ./examples run: ninja -C ./build - - name: Run test + - name: Run simple example + working-directory: ./examples + run: ./build/run_simple + + - name: Run punctured decoder example + working-directory: ./examples + run: ./build/run_punctured_decoder + + - name: Run tests working-directory: ./examples run: ./build/run_tests \ No newline at end of file diff --git a/.github/workflows/x86-windows.yml b/.github/workflows/x86-windows.yml index 9c640bf..045cb2a 100644 --- a/.github/workflows/x86-windows.yml +++ b/.github/workflows/x86-windows.yml @@ -17,11 +17,20 @@ jobs: - name: Configure CMake working-directory: ./examples - run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -A"x64" -G"Visual Studio 17 2022" + run: cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} - name: Build working-directory: ./examples - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + run: ninja -C build - - name: Run test - run: ${{github.workspace}}/build/Release/run_tests.exe \ No newline at end of file + - name: Run simple example + working-directory: ./examples + run: ./build/run_simple + + - name: Run punctured decoder example + working-directory: ./examples + run: ./build/run_punctured_decoder + + - name: Run tests + working-directory: ./examples + run: ./build/run_tests \ No newline at end of file diff --git a/examples/run_simple.cpp b/examples/run_simple.cpp index dff1a78..b4c0db3 100644 --- a/examples/run_simple.cpp +++ b/examples/run_simple.cpp @@ -86,6 +86,10 @@ int main(int argc, char** argv) { const float bit_error_rate = (float)total_errors / (float)total_input_bits * 100.0f; printf("bit_error_rate=%.2f%%\n", bit_error_rate); printf("%zu/%zu incorrect bits\n", total_errors, total_input_bits); - + + if (total_errors > 0) { + printf("ERROR: Simple example had decoding errors\n"); + return 1; + } return 0; } \ No newline at end of file