]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
add bats test sanity check
authorBastian Dehn <hhaalo@arcor.de>
Thu, 16 Jul 2026 13:29:06 +0000 (15:29 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Thu, 16 Jul 2026 13:32:36 +0000 (15:32 +0200)
builder/Containerfile.template
tests/CMakeLists.txt
tests/postinst.bats [new file with mode: 0755]

index d1ad6ce4ca1067654e00a990db879b436b6e4f01..32f8274e9ab398e902693a88bd65cc29bfb34d89 100644 (file)
@@ -23,6 +23,9 @@ RUN apt-get update \
        imagemagick \
        libmagickcore-dev \
        libcmocka-dev \
+       bats \
+       bats-assert \
+       bats-support \
        && apt-get clean \
        && rm --recursive --force /var/lib/apt/lists/*
 COPY run /app/run
index 82226beab15364e93c251bab05224484100b4023..d1bf2d773e9a7152c1d478946b8ab59123c5a962 100644 (file)
@@ -33,6 +33,9 @@ add_custom_target(runningtests
        ALL ./tests
        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
        DEPENDS tests)
+add_custom_target(runningbatstests
+       ALL ./postinst.bats
+       WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
 add_custom_command(TARGET runningtests
        POST_BUILD
        COMMAND gcov ${CMAKE_BINARY_DIR}/src/CMakeFiles/sane-kds_s2000w_net-static.dir/*.c.o
diff --git a/tests/postinst.bats b/tests/postinst.bats
new file mode 100755 (executable)
index 0000000..14cc794
--- /dev/null
@@ -0,0 +1,10 @@
+#!/usr/bin/bats
+
+setup() {
+       bats_load_library bats-support
+       bats_load_library bats-assert
+}
+
+@test "sanity" {
+       assert_equal 1 1
+}