From 961c8014ada037712e8c72f23430362e9f14c1ec Mon Sep 17 00:00:00 2001 From: jacqueline Date: Fri, 12 May 2023 10:30:07 +1000 Subject: Add some basic tests for the database --- test/fixtures/CMakeLists.txt | 1 + test/fixtures/i2c_fixture.hpp | 10 ++++++++++ test/fixtures/spi_fixture.hpp | 10 ++++++++++ 3 files changed, 21 insertions(+) create mode 100644 test/fixtures/CMakeLists.txt create mode 100644 test/fixtures/i2c_fixture.hpp create mode 100644 test/fixtures/spi_fixture.hpp (limited to 'test/fixtures') diff --git a/test/fixtures/CMakeLists.txt b/test/fixtures/CMakeLists.txt new file mode 100644 index 00000000..fd98a7cd --- /dev/null +++ b/test/fixtures/CMakeLists.txt @@ -0,0 +1 @@ +idf_component_register(INCLUDE_DIRS "." REQUIRES drivers) diff --git a/test/fixtures/i2c_fixture.hpp b/test/fixtures/i2c_fixture.hpp new file mode 100644 index 00000000..54794591 --- /dev/null +++ b/test/fixtures/i2c_fixture.hpp @@ -0,0 +1,10 @@ +#pragma once + +#include "catch2/catch.hpp" +#include "i2c.hpp" + +class I2CFixture { + public: + I2CFixture() { REQUIRE(drivers::init_i2c() == ESP_OK); } + ~I2CFixture() { drivers::deinit_i2c(); } +}; diff --git a/test/fixtures/spi_fixture.hpp b/test/fixtures/spi_fixture.hpp new file mode 100644 index 00000000..c2db484c --- /dev/null +++ b/test/fixtures/spi_fixture.hpp @@ -0,0 +1,10 @@ +#pragma once + +#include "catch2/catch.hpp" +#include "spi.hpp" + +class SpiFixture { + public: + SpiFixture() { REQUIRE(drivers::init_spi() == ESP_OK); } + ~SpiFixture() { drivers::deinit_spi(); } +}; -- cgit v1.2.3