def test_simple_lib(tmp_project: Project) -> None: """ Test that dds can build a simple library withsome actual content, and that the manifest files will affect the output name. """ tmp_project.write('src/foo.cpp', 'int the_answer() { return 42; }') tmp_project.package_json = { 'name': 'TestProject', 'version': '0.0.0', 'namespace': 'test', } tmp_project.library_json = {'name': 'TestLibrary'} tmp_project.build() assert (tmp_project.build_root / 'compile_commands.json').is_file() assert list(tmp_project.build_root.glob('libTestLibrary.*')) != []
def test_get_build_use_cryptopp(test_parent_dir: Path, tmp_project: Project, http_repo: RepoServer) -> None: http_repo.import_json_data(CRYPTOPP_JSON) tmp_project.dds.repo_add(http_repo.url) tmp_project.package_json = { 'name': 'usr-cryptopp', 'version': '1.0.0', 'namespace': 'test', 'depends': ['[email protected]'], } tmp_project.library_json = { 'name': 'use-cryptopp', 'uses': ['cryptopp/cryptopp'], } tc_fname = 'gcc.tc.jsonc' if 'gcc' in toolchain.get_default_test_toolchain( ).name else 'msvc.tc.jsonc' tmp_project.write('src/use-cryptopp.main.cpp', APP_CPP) tmp_project.build(toolchain=test_parent_dir / tc_fname, timeout=60 * 10) proc.check_run([ (tmp_project.build_root / 'use-cryptopp').with_suffix(paths.EXE_SUFFIX) ])