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.

26 lines
804B

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