From 6dc4c3133f8493d6e00b692ea871fb279e14d51b Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Fri, 21 Aug 2020 21:07:39 +0100 Subject: [PATCH] Import cmake unit test to restc-cpp --- subprojects/restc-cpp/meson.build | 3 +- subprojects/restc-cpp/tests/meson.build | 1 + subprojects/restc-cpp/tests/unit/meson.build | 42 ++++++++++++++++++++ 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 subprojects/restc-cpp/tests/meson.build create mode 100644 subprojects/restc-cpp/tests/unit/meson.build diff --git a/subprojects/restc-cpp/meson.build b/subprojects/restc-cpp/meson.build index a04e61e..0a63f95 100644 --- a/subprojects/restc-cpp/meson.build +++ b/subprojects/restc-cpp/meson.build @@ -74,5 +74,6 @@ restc_cpp_dep = declare_dependency( ) if get_option('restc_cpp_with_unit_tests') - #subdir('tests') + lest_inc = include_directories('subprojects/lest/include') + subdir('tests') endif diff --git a/subprojects/restc-cpp/tests/meson.build b/subprojects/restc-cpp/tests/meson.build new file mode 100644 index 0000000..082b746 --- /dev/null +++ b/subprojects/restc-cpp/tests/meson.build @@ -0,0 +1 @@ +subdir('unit') diff --git a/subprojects/restc-cpp/tests/unit/meson.build b/subprojects/restc-cpp/tests/unit/meson.build new file mode 100644 index 0000000..eebb4ef --- /dev/null +++ b/subprojects/restc-cpp/tests/unit/meson.build @@ -0,0 +1,42 @@ +url_tests = executable('url_tests', + '../../restc-cpp/tests/unit/UrlTests.cpp', + dependencies: [restc_cpp_dep], + include_directories: [lest_inc], +) + +json_serialize_tests = executable('json_serialize_tests', + '../../restc-cpp/tests/unit/JsonSerializeTests.cpp', + dependencies: [restc_cpp_dep], + include_directories: [lest_inc], +) + +json_iostream_tests = executable('json_iostream_tests', + '../../restc-cpp/tests/unit/Iostream2JsonTests.cpp', + dependencies: [restc_cpp_dep], + include_directories: [lest_inc], +) + +http_reply_tests = executable('http_reply_tests', + '../../restc-cpp/tests/unit/HttpReplyTests.cpp', + dependencies: [restc_cpp_dep], + include_directories: [lest_inc], +) + +async_sleep_tests = executable('async_sleep_tests', + '../../restc-cpp/tests/unit/AsyncSleepTests.cpp', + dependencies: [restc_cpp_dep], + include_directories: [lest_inc], +) + +request_builder_tests = executable('request_builder_tests', + '../../restc-cpp/tests/unit/RequestBuilder.cpp', + dependencies: [restc_cpp_dep], + include_directories: [lest_inc], +) + +test('url_tests', url_tests) +test('json_serialize_tests', json_serialize_tests) +test('json_iostream_tests', json_iostream_tests) +test('http_reply_tests', http_reply_tests) +test('async_sleep_tests', async_sleep_tests) +test('request_builder_tests', request_builder_tests)