Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

23 lines
729B

  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(0.5)
  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')