From aea1673452056c43a0b5cd4a3f71010307a1f3ff Mon Sep 17 00:00:00 2001 From: mdraw Date: Sun, 15 Oct 2023 22:45:23 +0200 Subject: [PATCH] Add black-box tests with tox --- test_examples.sh | 16 ++++++++++++++++ tox.ini | 19 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100755 test_examples.sh create mode 100644 tox.ini diff --git a/test_examples.sh b/test_examples.sh new file mode 100755 index 0000000..4fe4814 --- /dev/null +++ b/test_examples.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# Script that tests black-box tests deface with examples. +# Before running, install deface and cd to the repo root + + +# Show help, checking if the main script runs without errors +deface --help + +# Create a temporary directory for outputs +tmpdir=$(mktemp -d -t deface-XXXXXXXXXX) + +# Test deface with the example image, write output to temporary directory +deface ./examples/city.jpg -o ${tmpdir}/city_anonymized.jpg + +# TODO: Add more tests (video I/O, different EPs) diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..5c794c8 --- /dev/null +++ b/tox.ini @@ -0,0 +1,19 @@ +[tox] +env_list = + py310, py311, py312 +minversion = 4.11.3 + +[gh-actions] +python = + 3.10: py310 + 3.11: py311 + 3.12: py312 + +[testenv] +description = Run executable with example data +package = wheel +wheel_build_env = .pkg +allowlist_externals = + bash +commands = + bash ./test_examples.sh