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.

31 line
787B

  1. from contextlib import ExitStack
  2. from tests import DDS
  3. def test_simple_lib(dds: DDS, scope: ExitStack) -> None:
  4. scope.enter_context(dds.set_contents(
  5. 'src/foo.cpp',
  6. b'int the_answer() { return 42; }',
  7. ))
  8. scope.enter_context(dds.set_contents(
  9. 'library.json5',
  10. b'''{
  11. name: 'TestLibrary',
  12. }''',
  13. ))
  14. scope.enter_context(
  15. dds.set_contents(
  16. 'package.json5',
  17. b'''{
  18. name: 'TestProject',
  19. version: '0.0.0',
  20. namespace: 'test',
  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*')) != []