2022-12-14 11:28:25 +03:00
|
|
|
#!/bin/bash
|
2022-12-14 11:28:25 +03:00
|
|
|
set -Eeuo pipefail
|
2023-04-05 12:07:50 +03:00
|
|
|
set -x
|
2022-07-30 05:49:56 +03:00
|
|
|
|
|
|
|
echo "----- integration tests -----"
|
2022-10-04 16:31:38 +03:00
|
|
|
|
|
|
|
# hurl infos
|
2023-04-05 12:07:50 +03:00
|
|
|
command -v hurl || (echo "ERROR - hurl not found" ; exit 1)
|
|
|
|
command -v hurlfmt || (echo "ERROR - hurlfmt not found" ; exit 1)
|
2022-10-04 16:31:38 +03:00
|
|
|
hurl --version
|
|
|
|
hurlfmt --version
|
|
|
|
|
2023-08-14 10:09:02 +03:00
|
|
|
# Check that hurl is dynamically linked with libcurl
|
|
|
|
# if libcurl-dev is not installed, Hurl is built implicitly with an old static libcurl
|
|
|
|
# https://github.com/alexcrichton/curl-rust/issues/523
|
|
|
|
# TODO: Add MacOS
|
|
|
|
if [[ "$(uname -s)" = "Linux*" ]]; then
|
|
|
|
libcurl_lib=$(ldd "$(which hurl)" | grep libcurl || test $? = 1)
|
|
|
|
if [ -z "$libcurl_lib" ]; then
|
|
|
|
echo "hurl has not been built with libcurl dynamically"
|
|
|
|
echo "you are probably missing the libcurl-dev package"
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
echo "Using libcurl library"
|
|
|
|
echo "$libcurl_lib"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2022-10-04 16:31:38 +03:00
|
|
|
# integration tests
|
2023-04-05 12:07:50 +03:00
|
|
|
cd integration
|
2023-06-18 15:35:03 +03:00
|
|
|
./hurlfmt_check.sh tests_ok/*.hurl tests_failed/*.hurl
|
2022-07-30 05:49:56 +03:00
|
|
|
./integration.py
|
2022-10-17 17:22:42 +03:00
|
|
|
./test_curl_commands.sh
|
2022-07-30 05:49:56 +03:00
|
|
|
./test_html_output.py tests_ok/*.html tests_failed/*.html
|
2022-12-14 11:28:25 +03:00
|
|
|
|