From 83d2351490ab75c729d4196a4d7576487a7a8cdc Mon Sep 17 00:00:00 2001 From: Lukas Rothenberger Date: Thu, 20 Jun 2024 13:26:16 +0200 Subject: [PATCH 1/2] CI: add execution of C++ unit tests --- .github/workflows/ci.yml | 43 ++++++++++++++++++++++++++++++++++++++++ CMakeLists.txt | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff72cd47e..244af8e2d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,6 +65,49 @@ jobs: - name: "Check formatting of DiscoPoP Wizard - DEPRECATED" run: python -m black -l 120 --check DEPRECATED_discopop_wizard + execute_c++_unit_tests: + runs-on: ubuntu-20.04 + name: Execute C++ unit tests + needs: execute_code_checks + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: 3.8 + cache: 'pip' # uses requirements.txt + + - name: Install Python dependencies + run: pip install -r requirements.txt + + - name: Setup DiscoPoP Profiler - Install Dependencies + run: | + sudo apt-get update + sudo apt-get remove clang-8 clang-9 clang-10 clang-11 clang-12 + wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - + sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-11 main" + sudo apt-get update + sudo apt-get install -y cmake libclang-11-dev clang-11 llvm-11 + sudo ln -s /usr/bin/clang-11 /usr/bin/clang || true + sudo ln -s /usr/bin/clang++-11 /usr/bin/clang++ || true + sudo ln -s /usr/bin/llvm-link-11 /usr/bin/llvm-link || true + sudo ln -s /usr/bin/opt-11 /usr/bin/opt || true + sudo apt-get install -y python3-tk + + - name: "Setup DiscoPoP Profiler - Build" + run: | + rm -rf build + mkdir build + cd build + cmake -DCMAKE_BUILD_TYPE=Debug .. + make -j3 + + - name: C++ unit tests + run: | + build/test/unit_tests/DiscoPoP_UT + execute_end_to_end_tests: runs-on: ubuntu-20.04 name: Execute end-to-end tests diff --git a/CMakeLists.txt b/CMakeLists.txt index 3cfe4a648..cb87fc99c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,7 +66,7 @@ add_subdirectory(rtlib) add_subdirectory(scripts) -#add_subdirectory(test/unit_tests) +add_subdirectory(test/unit_tests) #add_subdirectory(benchmark) From b2aa9513d8ca8ce4f1d0bf6c63b79c1bfa36cc0c Mon Sep 17 00:00:00 2001 From: Lukas Rothenberger Date: Thu, 20 Jun 2024 13:29:26 +0200 Subject: [PATCH 2/2] fix: minor --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 244af8e2d..a50c85227 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,7 +65,7 @@ jobs: - name: "Check formatting of DiscoPoP Wizard - DEPRECATED" run: python -m black -l 120 --check DEPRECATED_discopop_wizard - execute_c++_unit_tests: + execute_cxx_unit_tests: runs-on: ubuntu-20.04 name: Execute C++ unit tests needs: execute_code_checks