選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

23 行
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')