(tmpdir, libs, content, libinc_obj=None)
| 19 | from donate_cpu_lib import * |
| 20 | |
| 21 | def _test_library_includes(tmpdir, libs, content, libinc_obj=None): |
| 22 | if libinc_obj is None: |
| 23 | library_includes = LibraryIncludes() |
| 24 | else: |
| 25 | library_includes = libinc_obj |
| 26 | |
| 27 | src_file = os.path.join(str(tmpdir), "file.cpp") |
| 28 | with open(src_file, 'w') as f: |
| 29 | f.write(content) |
| 30 | libs.sort() |
| 31 | libs_found = library_includes.get_libraries(str(tmpdir)) |
| 32 | libs_found.sort() |
| 33 | assert libs == libs_found |
| 34 | |
| 35 | def test_library_includes(tmpdir): |
| 36 | _test_library_includes(tmpdir, ['posix', 'gnu', 'bsd'], '') |
no test coverage detected