Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

12345678910111213141516171819202122
  1. import subprocess
  2. import pytest
  3. import time
  4. from dds_ci.testing import Project
  5. def test_simple_compile_file(tmp_project: Project) -> None:
  6. """
  7. Check that changing a source file will update the resulting application.
  8. """
  9. with pytest.raises(subprocess.CalledProcessError):
  10. tmp_project.compile_file('src/answer.cpp')
  11. tmp_project.write('src/answer.cpp', 'int get_answer() { return 42; }')
  12. # No error:
  13. tmp_project.compile_file('src/answer.cpp')
  14. # Fail:
  15. time.sleep(1) # Sleep long enough to register a file change
  16. tmp_project.write('src/answer.cpp', 'int get_answer() { return "How many roads must a man walk down?"; }')
  17. with pytest.raises(subprocess.CalledProcessError):
  18. tmp_project.compile_file('src/answer.cpp')