From 1f07e67c03870b77a7a92ee920b7d36ed47f3f99 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Thu, 14 May 2026 17:15:39 -0700 Subject: [PATCH] use catch2 package (#684) --- SConstruct | 2 ++ msgq/msgq_tests.cc | 2 +- msgq/test_runner.cc | 2 +- msgq/visionipc/test_runner.cc | 2 +- msgq/visionipc/visionipc_tests.cc | 2 +- pyproject.toml | 1 + setup.sh | 11 ----------- 7 files changed, 7 insertions(+), 15 deletions(-) diff --git a/SConstruct b/SConstruct index e38e79a..a6034cc 100644 --- a/SConstruct +++ b/SConstruct @@ -3,6 +3,7 @@ import platform import subprocess import sysconfig import numpy as np +import catch2 arch = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip() if platform.system() == "Darwin": @@ -11,6 +12,7 @@ if platform.system() == "Darwin": common = '' cpppath = [ + catch2.INCLUDE_DIR, f"#/", '#msgq/', '/usr/lib/include', diff --git a/msgq/msgq_tests.cc b/msgq/msgq_tests.cc index fc713af..cdb4122 100644 --- a/msgq/msgq_tests.cc +++ b/msgq/msgq_tests.cc @@ -1,4 +1,4 @@ -#include "catch2/catch.hpp" +#include #include "msgq/msgq.h" static void cleanup_test_queue() { diff --git a/msgq/test_runner.cc b/msgq/test_runner.cc index 62bf747..4ed06df 100644 --- a/msgq/test_runner.cc +++ b/msgq/test_runner.cc @@ -1,2 +1,2 @@ #define CATCH_CONFIG_MAIN -#include "catch2/catch.hpp" +#include diff --git a/msgq/visionipc/test_runner.cc b/msgq/visionipc/test_runner.cc index 62bf747..4ed06df 100644 --- a/msgq/visionipc/test_runner.cc +++ b/msgq/visionipc/test_runner.cc @@ -1,2 +1,2 @@ #define CATCH_CONFIG_MAIN -#include "catch2/catch.hpp" +#include diff --git a/msgq/visionipc/visionipc_tests.cc b/msgq/visionipc/visionipc_tests.cc index 6f6b9a9..b84634d 100644 --- a/msgq/visionipc/visionipc_tests.cc +++ b/msgq/visionipc/visionipc_tests.cc @@ -1,4 +1,4 @@ -#include "catch2/catch.hpp" +#include #include "msgq/visionipc/visionipc_server.h" #include "msgq/visionipc/visionipc_client.h" diff --git a/pyproject.toml b/pyproject.toml index efbb89a..966b8c6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,6 +15,7 @@ dependencies = [ "setuptools", # for distutils "Cython", "scons", + "catch2 @ git+https://github.com/commaai/dependencies.git@release-catch2#subdirectory=catch2", "ruff", "parameterized", "coverage", diff --git a/setup.sh b/setup.sh index 78e74d1..09e3af8 100755 --- a/setup.sh +++ b/setup.sh @@ -4,17 +4,6 @@ set -e DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" cd $DIR -PLATFORM=$(uname -s) - -# catch2 -if [ ! -d $DIR/msgq/catch2/ ]; then - rm -rf /tmp/catch2/ $DIR/msgq/catch2/ - git clone -b v2.x --depth 1 https://github.com/catchorg/Catch2.git /tmp/catch2 - pushd /tmp/catch2 - mv single_include/* $DIR/msgq/ - popd -fi - if ! command -v uv &>/dev/null; then echo "'uv' is not installed. Installing 'uv'..." curl -LsSf https://astral.sh/uv/install.sh | sh