export PYTHON=$(command -v "@PYTHON@" || true)
export PYTEST=@PYTEST@
-
-#
-# Determine if we support various optional features.
-#
-export LIBXML2_LIBS="@LIBXML2_LIBS@"
-export HAVEXMLSTATS=${LIBXML2_LIBS:+1}
-export JSON_C_LIBS="@JSON_C_LIBS@"
-export HAVEJSONSTATS=${JSON_C_LIBS:+1}
-export MAXMINDDB_LIBS="@MAXMINDDB_LIBS@"
-export HAVEGEOIP2=${MAXMINDDB_LIBS:+1}
-export ZLIB_LIBS="@ZLIB_LIBS@"
-export HAVEZLIB=${ZLIB_LIBS:+1}
-export LMDB_LIBS="@LMDB_LIBS@"
-export NZD=${LMDB_LIBS:+1}
-export CRYPTO=@CRYPTO@
# information regarding copyright ownership.
import os
+import subprocess
import pytest
long_test = pytest.mark.skipif(
not os.environ.get("CI_ENABLE_ALL_TESTS"), reason="CI_ENABLE_ALL_TESTS not set"
)
+
+
+def feature_test(feature):
+ feature_test_bin = os.environ["FEATURETEST"]
+ try:
+ subprocess.run([feature_test_bin, feature], check=True)
+ except subprocess.CalledProcessError as exc:
+ if exc.returncode != 1:
+ raise
+ return False
+ return True
+
+
+have_libxml2 = pytest.mark.skipif(
+ feature_test("--have-libxml2"), reason="libxml2 support disabled in the build"
+)
+
+have_json_c = pytest.mark.skipif(
+ feature_test("--have-json-c"), reason="json-c support disabled in the build"
+)
from datetime import datetime
-import os
-
import pytest
import generic
+import pytest_custom_markers
-pytestmark = pytest.mark.skipif(
- not os.environ.get("HAVEJSONSTATS"), reason="json-c support disabled in the build"
-)
+pytestmark = pytest_custom_markers.have_json_c
requests = pytest.importorskip("requests")
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
-import xml.etree.ElementTree as ET
from datetime import datetime
-
-import os
+import xml.etree.ElementTree as ET
import pytest
import generic
+import pytest_custom_markers
-pytestmark = pytest.mark.skipif(
- not os.environ.get("HAVEXMLSTATS"), reason="libxml2 support disabled in the build"
-)
+pytestmark = pytest_custom_markers.have_libxml2
requests = pytest.importorskip("requests")