diff --git a/CI/travis/before_install_linux b/CI/travis/before_install_linux index 07af66d..643d508 100755 --- a/CI/travis/before_install_linux +++ b/CI/travis/before_install_linux @@ -2,6 +2,37 @@ . CI/travis/lib.sh +install_libiio_from_source() { + git clone https://github.com/analogdevicesinc/libiio.git + cd libiio + mkdir build && cd build + cmake .. + make + sudo make install + sudo ldconfig + cd ../.. +} + +install_iioemu() { + git clone https://github.com/analogdevicesinc/libtinyiiod.git + cd libtinyiiod + mkdir build && cd build + cmake -DBUILD_EXAMPLES=OFF .. + make + sudo make install + sudo ldconfig + cd ../.. + + git clone -b v0.1.0 https://github.com/analogdevicesinc/iio-emu.git + cd iio-emu + mkdir build && cd build + cmake .. + make + sudo make install + sudo ldconfig + cd ../.. +} + install_sphinx() { $PYTHON --version @@ -45,7 +76,7 @@ handle_centos() { yum -y install libzstd yum -y install libxml2-devel libusb1-devel doxygen libaio-devel \ - avahi-devel bzip2 gzip rpm rpm-build + avahi-devel bzip2 gzip rpm rpm-build git if [ -n "$PACKAGE_TO_INSTALL" ] ; then sudo yum localinstall -y $PACKAGE_TO_INSTALL @@ -55,6 +86,7 @@ handle_centos() { fi $PYTHON -m pip install pylibiio --no-binary :all: + install_iioemu } handle_generic_docker() { @@ -66,17 +98,22 @@ handle_default() { sudo DEBIAN_FRONTEND=noninteractive apt-get install -y cmake doxygen graphviz \ libaio-dev libavahi-client-dev libavahi-common-dev libusb-1.0-0-dev \ libxml2-dev rpm tar bzip2 gzip flex bison libserialport-dev \ - python3 python3-pip python3-setuptools + python3 python3-pip python3-setuptools git wget if [ -n "$PACKAGE_TO_INSTALL" ] ; then sudo dpkg -i $PACKAGE_TO_INSTALL elif [ "$INSTALL_FROM_SW_DOWNLOADS" = "1" ] ; then - wget http://swdownloads.analog.com/cse/travis_builds/${LIBIIO_BRANCH}_latest_libiio${LDIST}.deb - sudo dpkg -i ./${LIBIIO_BRANCH}_latest_libiio${LDIST}.deb + wget http://swdownloads.analog.com/cse/travis_builds/${LIBIIO_BRANCH}_latest_libiio${LDIST}.deb || true + if [ -f "${LIBIIO_BRANCH}_latest_libiio${LDIST}.deb" ] + sudo dpkg -i ./${LIBIIO_BRANCH}_latest_libiio${LDIST}.deb + else + install_libiio_from_source + fi fi $PYTHON -m pip install pylibiio --no-binary :all: install_sphinx + install_iioemu } handle_ubuntu() { diff --git a/CI/travis/make_linux b/CI/travis/make_linux index 7935d2e..58e3f8f 100755 --- a/CI/travis/make_linux +++ b/CI/travis/make_linux @@ -14,7 +14,7 @@ handle_default() { cd .. cd bindings/python pip3 install -r requirements_dev.txt - python3 -m pytest -vs --skip-scan + python3 -m pytest -vs --skip-scan --adi-hw-map } handle_centos() { @@ -28,7 +28,7 @@ handle_centos() { cd bindings/python pip3 install -r requirements_dev.txt export LD_LIBRARY_PATH=/usr/local/lib/ - python3 -m pytest -vs --skip-scan + python3 -m pytest -vs ---skip-scan --adi-hw-map } handle_ubuntu() { diff --git a/bindings/python/test/test_ad9361.py b/bindings/python/test/test_ad9361.py index 1a88de7..db6a59f 100644 --- a/bindings/python/test/test_ad9361.py +++ b/bindings/python/test/test_ad9361.py @@ -10,7 +10,7 @@ filterfile_name = os.path.join(path, "LTE15_MHz.ftr") -@pytest.mark.iio_hardware(ad9361_all) +@pytest.mark.iio_hardware(ad9361_all, True) @pytest.mark.parametrize("rate_msps", [*(range(1, 30))]) def test_bb_rate(iio_uri, rate_msps): rate = rate_msps * 1e6 @@ -21,7 +21,7 @@ def test_bb_rate(iio_uri, rate_msps): assert abs(rate - hw) < 3 -@pytest.mark.iio_hardware(ad9361_all) +@pytest.mark.iio_hardware(ad9361_all, True) @pytest.mark.parametrize("rate_msps", [*(range(1, 30))]) def test_bb_rate_custom_filter_manual(iio_uri, rate_msps): rate = rate_msps * 1e6 @@ -37,7 +37,7 @@ def test_bb_rate_custom_filter_manual(iio_uri, rate_msps): assert abs(rate - hw) < 3 -@pytest.mark.iio_hardware(ad9361_all) +@pytest.mark.iio_hardware(ad9361_all, True) @pytest.mark.parametrize("rate_msps", [*(range(1, 30))]) def test_bb_rate_custom_filter(iio_uri, rate_msps): rate = rate_msps * 1e6 @@ -48,7 +48,7 @@ def test_bb_rate_custom_filter(iio_uri, rate_msps): assert abs(rate - hw) < 3 -@pytest.mark.iio_hardware("fmcomms5") +@pytest.mark.iio_hardware("fmcomms5", True) def test_mcs(iio_uri): ctx = iio.Context(iio_uri) main = ctx.find_device("ad9361-phy") @@ -59,14 +59,14 @@ def test_mcs(iio_uri): assert ret == 0 -@pytest.mark.iio_hardware("fmcomms5") +@pytest.mark.iio_hardware("fmcomms5", True) def test_fmc5_mcs(iio_uri): ctx = iio.Context(iio_uri) ret = ad9361.fmcomms5_multichip_sync(ctx, 3) assert ret == 0 -@pytest.mark.iio_hardware(ad9361_all) +@pytest.mark.iio_hardware(ad9361_all, True) def test_trx_fir_enable(iio_uri): ctx = iio.Context(iio_uri) dev = ctx.find_device("ad9361-phy") @@ -97,7 +97,7 @@ def test_trx_fir_enable(iio_uri): assert dev.find_channel("voltage0", True).attrs["filter_fir_en"].value == "0" -@pytest.mark.iio_hardware("fmcomms5") +@pytest.mark.iio_hardware("fmcomms5", True) def test_fmc5_phase_sync(iio_uri): ctx = iio.Context(iio_uri) ret = ad9361.fmcomms5_phase_sync(ctx, 1e9)