[Libosinfo] [osinfo-db PATCH v2 0/7] Fix out-of-tree builds

Guido Günther agx at sigxcpu.org
Mon Apr 29 07:14:31 UTC 2019


Hi,
On Tue, Apr 23, 2019 at 05:20:33PM +0200, Fabiano Fidêncio wrote:
> In order to fix out-of-tree builds we need to:
> - do not consider source (.xml.in) and generated (.xml) files are in the same
>   directory;
>   - with this, some changes have to be done in order to properly run
>     _check_uncommended_devices() test
> - set the proper environmnet variables for INTERNAL_OSINFO_DB_DATA_DIR and
>   OSINFO_DB_DATA_SRC_DIR when calling pytest.
> - call pytest pointint to the tests directory
> 
> As we don't rely on autoconf, ABS_TOPDIR has been added to our Makefile.
> 
> Guido, would you mind to give it a try? It did fix the issue for me, but
> I'd like to be sure it also fixes the issue for you.

Works nicely:

  $ make -C build -f ../Makefile VPATH=.. ARCHIVE=osinfo-db.tar.xz check
  make: Entering directory '/var/scratch/src/libosinfo/upstream/osinfo-db/build'
  I18N      data/datamap/microsoft.com/win-8-l10n-language.xml
  I18N      data/datamap/microsoft.com/win-8-l10n-language-reverse.xml
  I18N      data/datamap/microsoft.com/win-7-l10n-language.xml
  ...
  I18N      data/device/usb.org/usb-80ee-0021.d/class.xml
  GEN       data/schema/osinfo.rng
   INTERNAL_OSINFO_DB_DATA_DIR=data INTERNAL_OSINFO_DB_DATA_SRC_DIR=/var/scratch/src/libosinfo/upstream/osinfo-db/data python3 -m pytest /var/scratch/src/libosinfo/upstream/osinfo-db/tests
  =============================================================================================== test session starts ===============================================================================================
  platform linux -- Python 3.7.3rc1, pytest-3.10.1, py-1.7.0, pluggy-0.8.0
  hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/var/scratch/src/libosinfo/upstream/osinfo-db/build/.hypothesis/examples')
  rootdir: /var/scratch/src/libosinfo/upstream/osinfo-db, inifile:
  plugins: hypothesis-3.71.11, celery-4.2.1
  collected 1310 items                                                                                                                                                                                              
  
  ../tests/test_devices.py ....................................................................................................................................                                               [ 10%]
  ../tests/test_isoinfo.py .................................................................................................................................................................................. [ 23%]
  ..............................................................                                                                                                                                              [ 28%]
  ../tests/test_resources.py ................................................................................................................................................................................ [ 41%]
  ...................................................                                                                                                                                                         [ 45%]
  ../tests/test_schema.py ................................................................................................................................................................................... [ 59%]
  ........................................................................................................................................................................................................... [ 74%]
  ........................................................................................................................................................................................................... [ 90%]
  ..............................................................................................................................                                                                              [100%]
  
  ========================================================================================== 1310 passed in 10.12 seconds ===========================================================================================
  make: Leaving directory '/var/scratch/src/libosinfo/upstream/osinfo-db/build'

Thanks!
 -- Guido

> 
> Please, mind that you'll need to have python3, python3-pytest, python3-lxml,
> and python3-request installed.
> 
> Fabiano Fidêncio (7):
>   tests: Add _Files() base class
>   tests: Move ids_cb() out of os_parametrize()
>   tests: Add _SourceFiles() class
>   tests: Move _check_uncommended_devices() to its own test
>   tests: Add INTERNAL_OSINFO_DB_DATA_SRC_DIR to conftest
>   makefile: Fix out-of-tree build
>   makefile: Remove unused "TEE" variable
> 
>  Makefile              |  6 ++---
>  tests/conftest.py     |  5 ++++
>  tests/test_devices.py | 10 ++++---
>  tests/util.py         | 62 ++++++++++++++++++++++++++++++++-----------
>  4 files changed, 62 insertions(+), 21 deletions(-)
> 
> -- 
> 2.21.0
> 




More information about the Libosinfo mailing list