<commit_before>set(SWIG_EXECUTABLE "swig3.0")
find_package(SWIG 3.0 REQUIRED)
include(${SWIG_USE_FILE})

include_directories(${LIBDRM_INCLUDE_DIRS})
link_directories(${LIBDRM_LIBRARY_DIRS})

pkg_check_modules(PYTHON python-3.4 REQUIRED)
include_directories(${PYTHON_INCLUDE_DIRS})

# XXX how to add these inc dirs in a proper way?
include_directories(../libkms++ ../libkmstest)

#set(CMAKE_SWIG_FLAGS "-I../../libkms")
set(CMAKE_SWIG_FLAGS "-builtin")

set_source_files_properties(pykms.i PROPERTIES CPLUSPLUS ON)
swig_add_module(pykms python pykms.i)
swig_link_libraries(pykms kms++ kmstest ${LIBDRM_LIBRARIES} ${PYTHON_LIBRARIES})

# We get some "maybe-uninitialized" warnings from the generated code. I hope they are harmless.
set_source_files_properties(${swig_generated_file_fullname} PROPERTIES COMPILE_FLAGS "-Wno-maybe-uninitialized")

add_custom_target(pyextras SOURCES test.py functest.py db.py iact.py)

add_test(NAME pytest COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/functest.py")
set_property(TEST pytest PROPERTY
        ENVIRONMENT "PYTHONPATH=." "LD_LIBRARY_PATH=."
)<commit_msg>Use globbing to add .py test files<commit_after>set(SWIG_EXECUTABLE "swig3.0")
find_package(SWIG 3.0 REQUIRED)
include(${SWIG_USE_FILE})

include_directories(${LIBDRM_INCLUDE_DIRS})
link_directories(${LIBDRM_LIBRARY_DIRS})

pkg_check_modules(PYTHON python-3.4 REQUIRED)
include_directories(${PYTHON_INCLUDE_DIRS})

# XXX how to add these inc dirs in a proper way?
include_directories(../libkms++ ../libkmstest)

#set(CMAKE_SWIG_FLAGS "-I../../libkms")
set(CMAKE_SWIG_FLAGS "-builtin")

set_source_files_properties(pykms.i PROPERTIES CPLUSPLUS ON)
swig_add_module(pykms python pykms.i)
swig_link_libraries(pykms kms++ kmstest ${LIBDRM_LIBRARIES} ${PYTHON_LIBRARIES})

# We get some "maybe-uninitialized" warnings from the generated code. I hope they are harmless.
set_source_files_properties(${swig_generated_file_fullname} PROPERTIES COMPILE_FLAGS "-Wno-maybe-uninitialized")

file(GLOB PY_SRCS "*.py")
add_custom_target(pyextras SOURCES ${PY_SRCS})

add_test(NAME pytest COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/functest.py")
set_property(TEST pytest PROPERTY
        ENVIRONMENT "PYTHONPATH=." "LD_LIBRARY_PATH=."
)
{'fraction_non_alphanumeric': 0.11262488646684832, 'fraction_numerical': 0.005449591280653951, 'mean_word_length': 7.505791505791506, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3901755', 'n_tokens_mistral': 878, 'n_tokens_neox': 844, 'n_words': 156}