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.

34 satır
861B

  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.json5',
  13. b'''{
  14. name: 'TestLibrary',
  15. }''',
  16. ))
  17. scope.enter_context(
  18. dds.set_contents(
  19. 'package.json5',
  20. b'''{
  21. name: 'TestProject',
  22. version: '0.0.0',
  23. namespace: 'test',
  24. }''',
  25. ))
  26. dds.build(tests=True, apps=False, warnings=False)
  27. assert (dds.build_dir / 'compile_commands.json').is_file()
  28. assert list(dds.build_dir.glob('libTestLibrary*')) != []