add_subdirectory(c)
if(WITH_LIB_CPP)
	add_subdirectory(cpp)
endif()

file(GLOB PY_TEST_FILES [0-9][0-9]-*.py)
list(APPEND PY_TEST_FILES "${CMAKE_CURRENT_SOURCE_DIR}/msg_sequence_test.py")

set(EXCLUDE_LIST
    03-publish-c2b-qos1-timeout
    03-publish-c2b-qos2-timeout
)

set(PREFIX "lib-")
file(GLOB PY_TEST_FILES [0-9][0-9]-*.py)
list(APPEND PY_TEST_FILES "${CMAKE_CURRENT_SOURCE_DIR}/msg_sequence_test.py")
get_test_files(PY_TEST_FILES "${EXCLUDE_LIST}" PY_TEST_NAMES)

add_python_test(PY_TEST_NAMES ${PREFIX} 1 "01-con-discon-success-v5.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "01-con-discon-success.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "01-con-discon-will-clear.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "01-con-discon-will-v5.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "01-con-discon-will.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "01-extended-auth-continue.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "01-extended-auth-failure.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "01-keepalive-pingreq.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "01-no-clean-session.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "01-pre-connect-callback.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "01-server-keepalive-pingreq.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "01-unpwd-set.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "01-will-set.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "01-will-unpwd-set.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "02-subscribe-helper-qos2.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "02-subscribe-qos0.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "02-subscribe-qos1.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "02-subscribe-qos2.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "02-unsubscribe-multiple-v5.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "02-unsubscribe-v5.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "02-unsubscribe.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-b2c-qos1-unexpected-puback.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-b2c-qos1.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-b2c-qos2-len.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-b2c-qos2-unexpected-pubcomp.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-b2c-qos2-unexpected-pubrel.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-b2c-qos2.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-c2b-qos1-disconnect.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-c2b-qos1-len.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-c2b-qos1-receive-maximum.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-c2b-qos2-disconnect.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-c2b-qos2-len.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-c2b-qos2-maximum-qos-0.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-c2b-qos2-maximum-qos-1.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-c2b-qos2-pubrec-error.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-c2b-qos2-receive-maximum-1.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-c2b-qos2-receive-maximum-2.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-c2b-qos2.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-loop.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-qos0-no-payload.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-qos0.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-request-response-correlation.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-request-response.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "04-retain-qos0.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "08-ssl-bad-cacert.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "08-ssl-connect-cert-auth-enc.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "08-ssl-connect-cert-auth.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "08-ssl-connect-no-auth.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "08-ssl-connect-san.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "08-ssl-fake-cacert.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-util-topic-tokenise.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "11-prop-oversize-packet.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "11-prop-recv-qos0.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "11-prop-recv-qos1.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "11-prop-recv-qos2.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "11-prop-send-content-type.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "11-prop-send-payload-format.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "msg_sequence_test.py")

check_for_missing_tests(PY_TEST_NAMES)
