<commit_before>if (BUILDSWIGJAVA)
    add_test (NAME check_clean COMMAND ${PYTHON_EXECUTABLE}
        ${CMAKE_CURRENT_SOURCE_DIR}/check_clean.py
        WORKING_DIRECTORY ${CMAKE_BINARY_DIR})

    add_test (NAME check_samplenames COMMAND ${PYTHON_EXECUTABLE}
        ${CMAKE_CURRENT_SOURCE_DIR}/check_samplenames.py
        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endif()

if (BUILDSWIGPYTHON)
    if (PYTHON2INTERP_FOUND)
        set (PYTHON_DEFAULT_PYTHONPATH "${CMAKE_BINARY_DIR}/src/python/python2")
    elseif (PYTHON3INTERP_FOUND)
        set (PYTHON_DEFAULT_PYTHONPATH "${CMAKE_BINARY_DIR}/src/python/python3")
    endif ()
    if (MOCKPLAT)
        add_subdirectory (mock)
    else()
        add_test (NAME py_general COMMAND ${PYTHON_DEFAULT_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/general_checks.py)
        set_tests_properties(py_general PROPERTIES ENVIRONMENT "PYTHONPATH=${PYTHON_DEFAULT_PYTHONPATH}")

        add_test (NAME py_platform COMMAND ${PYTHON_DEFAULT_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/platform_checks.py)
        set_tests_properties(py_platform PROPERTIES ENVIRONMENT "PYTHONPATH=${PYTHON_DEFAULT_PYTHONPATH}")

        add_test (NAME py_gpio COMMAND ${PYTHON_DEFAULT_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/gpio_checks.py)
        set_tests_properties(py_gpio PROPERTIES ENVIRONMENT "PYTHONPATH=${PYTHON_DEFAULT_PYTHONPATH}")
    endif()
endif()<commit_msg>tests/CMakeLists.txt: Clean up cmake tests to work with python 2&3<commit_after>if (PYTHON2INTERP_FOUND AND BUILDSWIGJAVA)
    add_test (NAME check_clean COMMAND ${PYTHON_EXECUTABLE}
        ${CMAKE_CURRENT_SOURCE_DIR}/check_clean.py
        WORKING_DIRECTORY ${CMAKE_BINARY_DIR})

    add_test (NAME check_samplenames COMMAND ${PYTHON_EXECUTABLE}
        ${CMAKE_CURRENT_SOURCE_DIR}/check_samplenames.py
        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endif ()

if (BUILDSWIGPYTHON)
    if (PYTHON2INTERP_FOUND AND EXISTS "${CMAKE_BINARY_DIR}/src/python/python2/mraa.py")
        set (PYTHON_DEFAULT_PYTHONPATH "${CMAKE_BINARY_DIR}/src/python/python2")
        set (PYTHON_DEFAULT_INTERP "${PYTHON2_EXECUTABLE}")
    elseif (PYTHON3INTERP_FOUND AND EXISTS "${CMAKE_BINARY_DIR}/src/python/python3/mraa.py")
        set (PYTHON_DEFAULT_PYTHONPATH "${CMAKE_BINARY_DIR}/src/python/python3")
    set (PYTHON_DEFAULT_INTERP "${PYTHON3_EXECUTABLE}")
    else ()
        message (STATUS "Could not run tests since python interpreter or python bindings not built")
    endif ()

    if (MOCKPLAT)
        add_subdirectory (mock)
    else ()
        add_test (NAME py_general COMMAND ${PYTHON_DEFAULT_INTERP} ${CMAKE_CURRENT_SOURCE_DIR}/general_checks.py)
        set_tests_properties(py_general PROPERTIES ENVIRONMENT "PYTHONPATH=${PYTHON_DEFAULT_PYTHONPATH}")

        add_test (NAME py_platform COMMAND ${PYTHON_DEFAULT_INTERP} ${CMAKE_CURRENT_SOURCE_DIR}/platform_checks.py)
        set_tests_properties(py_platform PROPERTIES ENVIRONMENT "PYTHONPATH=${PYTHON_DEFAULT_PYTHONPATH}")

        add_test (NAME py_gpio COMMAND ${PYTHON_DEFAULT_INTERP} ${CMAKE_CURRENT_SOURCE_DIR}/gpio_checks.py)
        set_tests_properties(py_gpio PROPERTIES ENVIRONMENT "PYTHONPATH=${PYTHON_DEFAULT_PYTHONPATH}")
    endif ()
endif ()
{'fraction_non_alphanumeric': 0.09144634525660965, 'fraction_numerical': 0.004665629860031105, 'mean_word_length': 5.056497175141243, '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': '618919', 'n_tokens_mistral': 1191, 'n_tokens_neox': 1131, 'n_words': 175}