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.

преди 5 години
преди 5 години
преди 5 години
123456789101112131415161718192021222324252627282930
  1. from contextlib import ExitStack
  2. from tests import DDS
  3. from tests.fileutil import set_contents
  4. def test_simple_lib(dds: DDS, scope: ExitStack):
  5. scope.enter_context(
  6. dds.set_contents(
  7. 'src/foo.cpp',
  8. b'int the_answer() { return 42; }',
  9. ))
  10. scope.enter_context(
  11. dds.set_contents(
  12. 'library.dds',
  13. b'Name: TestLibrary',
  14. ))
  15. scope.enter_context(
  16. dds.set_contents(
  17. 'package.dds',
  18. b'''
  19. Name: TestProject
  20. Version: 0.0.0
  21. ''',
  22. ))
  23. dds.build(tests=True, apps=False, warnings=False)
  24. assert (dds.build_dir / 'compile_commands.json').is_file()
  25. assert list(dds.build_dir.glob('libTestLibrary*')) != []