mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 13:51:26 +02:00
`make unit-tests` would run shell scripts from tests/unit/ The run-unittests.sh script will look for any .sh in tests/unit/ and will call it twice: - first with the 'check' argument in order to decide if we should skip the test or not - second to run the check A simple test could be written this way: #!/bin/sh check() { ${HAPROXY_PROGRAM} -cc 'feature(OPENSSL)' command -v socat } run() { ${HAPROXY_PROGRAM} -dI -f ${ROOTDIR}/examples/quick-test.cfg -c } case "$1" in "check") check ;; "run") run ;; esac The tests *MUST* be written in POSIX shell in order to be portable, and any special commands should be tested with `command -v` before using it. Tests are run with `sh -e` so everything must be tested.