You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

test_config_template.py 802B

1234567891011121314151617181920212223242526
  1. import pytest
  2. from time import sleep
  3. from tests import DDS, dds_fixture_conf_1
  4. @dds_fixture_conf_1('copy_only')
  5. def test_config_template(dds: DDS):
  6. generated_fpath = dds.build_dir / '__dds/gen/info.hpp'
  7. assert not generated_fpath.is_file()
  8. dds.build()
  9. assert generated_fpath.is_file()
  10. # Check that re-running the build will not update the generated file (the
  11. # file's content has not changed. Re-generating it would invalidate the
  12. # cache and force a false-rebuild.)
  13. start_time = generated_fpath.stat().st_mtime
  14. sleep(0.1) # Wait just long enough to register a new stamp time
  15. dds.build()
  16. new_time = generated_fpath.stat().st_mtime
  17. assert new_time == start_time
  18. @dds_fixture_conf_1('simple')
  19. def test_simple_substitution(dds: DDS):
  20. dds.build()