mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-07-01 22:25:26 +02:00
misc: improve vscode integration
- adds a task to toggle testing configuration - removes the test run launch configuration (now a task) - adds macOS support and fixes gtest CMake integration - removes the IPC launch configuration as it doesn't work correctly without delaying the client Change-Id: I89e1f3abd0e050e0bcf205f1331596c660dd0d34
This commit is contained in:
parent
92341b27b6
commit
6105f4f7ce
3 changed files with 91 additions and 66 deletions
83
.vscode/launch.json
vendored
83
.vscode/launch.json
vendored
|
@ -2,77 +2,48 @@
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"configurations": [
|
"configurations": [
|
||||||
{
|
{
|
||||||
"name": "Jami-Tests-Run",
|
"name": "Jami-Client-Debug",
|
||||||
"type": "cppdbg",
|
|
||||||
"request": "launch",
|
|
||||||
"program": "/usr/bin/ctest",
|
|
||||||
"args": ["-V", "-R"],
|
|
||||||
"cwd": "${workspaceFolder}/build/tests",
|
|
||||||
"externalConsole": false,
|
|
||||||
"environment": [
|
|
||||||
{
|
|
||||||
"name": "HOME",
|
|
||||||
"value": "/tmp"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Jami-Client",
|
|
||||||
"type": "cppdbg",
|
"type": "cppdbg",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
|
"program": "",
|
||||||
|
"linux":{
|
||||||
|
"MIMode": "gdb",
|
||||||
"program": "${workspaceFolder}/build/jami",
|
"program": "${workspaceFolder}/build/jami",
|
||||||
"args": [
|
"args": [
|
||||||
"-d",
|
"-d",
|
||||||
],
|
],
|
||||||
"stopAtEntry": false,
|
|
||||||
"cwd": "${workspaceFolder}",
|
|
||||||
"environment": [],
|
|
||||||
"externalConsole": false,
|
|
||||||
"MIMode": "gdb",
|
|
||||||
"setupCommands": [
|
|
||||||
{
|
|
||||||
"description": "Enable pretty-printing for gdb",
|
|
||||||
"text": "-enable-pretty-printing",
|
|
||||||
"ignoreFailures": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"preLaunchTask": "cmake-build",
|
|
||||||
"miDebuggerPath": "/usr/bin/gdb",
|
|
||||||
},
|
},
|
||||||
|
"osx": {
|
||||||
|
"MIMode": "lldb",
|
||||||
|
"program": "${workspaceFolder}/build/Jami.app/Contents/MacOS/Jami",
|
||||||
|
"environment": [
|
||||||
{
|
{
|
||||||
"name": "Jami-Daemon-Debug",
|
"name": "NO_COLOR",
|
||||||
"type": "cppdbg",
|
"value": "true",
|
||||||
"request": "launch",
|
}
|
||||||
"program": "${workspaceFolder}/daemon/bin/dbus/jamid",
|
|
||||||
"args": [
|
|
||||||
"-cdp",
|
|
||||||
],
|
],
|
||||||
"stopAtEntry": false,
|
},
|
||||||
"cwd": "${workspaceFolder}",
|
"cwd": "${workspaceFolder}",
|
||||||
"environment": [],
|
|
||||||
"externalConsole": false,
|
|
||||||
"MIMode": "gdb",
|
|
||||||
"setupCommands": [
|
|
||||||
{
|
|
||||||
"description": "Enable pretty-printing for gdb",
|
|
||||||
"text": "-enable-pretty-printing",
|
|
||||||
"ignoreFailures": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"preLaunchTask": "cmake-build",
|
"preLaunchTask": "cmake-build",
|
||||||
"miDebuggerPath": "/usr/bin/gdb",
|
"externalConsole": false, // A macOS dev may want to set this to true.
|
||||||
}
|
},
|
||||||
],
|
|
||||||
"compounds": [
|
|
||||||
{
|
{
|
||||||
// Using this configuration will require manually reconfiguring the project using
|
// Using this configuration will require manually reconfiguring the project using
|
||||||
// build.py --no-libwrap, otherwise the daemon executable will not be built and the
|
// build.py --no-libwrap, otherwise the daemon executable will not be built and the
|
||||||
// client will not be built with ENABLE_LIBWRAP=False.
|
// client will not be built with ENABLE_LIBWRAP=False.
|
||||||
"name": "Jami-Client-IPC",
|
"name": "Jami-Daemon-Debug",
|
||||||
"configurations": [
|
"type": "cppdbg",
|
||||||
"Jami-Daemon-Debug",
|
"request": "launch",
|
||||||
"Jami-Client",
|
"linux": {
|
||||||
]
|
"MIMode": "gdb",
|
||||||
|
"program": "${workspaceFolder}/daemon/bin/dbus/jamid",
|
||||||
|
},
|
||||||
|
"program": "",
|
||||||
|
"args": [
|
||||||
|
"-cdp",
|
||||||
|
],
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
|
"preLaunchTask": "cmake-build",
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
43
.vscode/tasks.json
vendored
43
.vscode/tasks.json
vendored
|
@ -1,6 +1,27 @@
|
||||||
{
|
{
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"tasks": [
|
"tasks": [
|
||||||
|
{
|
||||||
|
"label": "run-tests",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "ctest",
|
||||||
|
"options": {
|
||||||
|
"cwd": "${workspaceFolder}/build/tests",
|
||||||
|
"env": {
|
||||||
|
"HOME": "/tmp"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"args": [
|
||||||
|
"-V",
|
||||||
|
"-R"
|
||||||
|
],
|
||||||
|
"group": {
|
||||||
|
"kind": "test",
|
||||||
|
"isDefault": true
|
||||||
|
},
|
||||||
|
"problemMatcher": [],
|
||||||
|
"detail": "Run the tests using CTest."
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"label": "cmake-configure",
|
"label": "cmake-configure",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
|
@ -10,7 +31,19 @@
|
||||||
"-B", "build",
|
"-B", "build",
|
||||||
"-DCMAKE_BUILD_TYPE=Debug",
|
"-DCMAKE_BUILD_TYPE=Debug",
|
||||||
"-DCMAKE_PREFIX_PATH=\"/usr/lib64/qt-jami;/usr/lib/libqt-jami\"",
|
"-DCMAKE_PREFIX_PATH=\"/usr/lib64/qt-jami;/usr/lib/libqt-jami\"",
|
||||||
"-DBUILD_TESTING=True"
|
],
|
||||||
|
"group": "build",
|
||||||
|
"problemMatcher": [],
|
||||||
|
"detail": "Generate the build system files with CMake."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "cmake-configure-tests",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "cmake",
|
||||||
|
"args": [
|
||||||
|
"-S", ".",
|
||||||
|
"-B", "build",
|
||||||
|
"-DBUILD_TESTING=${input:buildTestingInput}"
|
||||||
],
|
],
|
||||||
"group": "build",
|
"group": "build",
|
||||||
"problemMatcher": [],
|
"problemMatcher": [],
|
||||||
|
@ -48,5 +81,13 @@
|
||||||
"problemMatcher": [],
|
"problemMatcher": [],
|
||||||
"detail": "Clean the build directory."
|
"detail": "Clean the build directory."
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"id": "buildTestingInput",
|
||||||
|
"type": "pickString",
|
||||||
|
"description": "Do you want to enable testing?",
|
||||||
|
"options": ["True", "False"],
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -22,15 +22,28 @@ if(MSVC)
|
||||||
googletest
|
googletest
|
||||||
URL https://github.com/google/googletest/archive/refs/tags/release-1.11.0.zip
|
URL https://github.com/google/googletest/archive/refs/tags/release-1.11.0.zip
|
||||||
)
|
)
|
||||||
|
if(MSVC)
|
||||||
# for Windows: Prevent overriding the parent project's compiler/linker settings
|
# for Windows: Prevent overriding the parent project's compiler/linker settings
|
||||||
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
||||||
|
endif()
|
||||||
FetchContent_MakeAvailable(googletest)
|
FetchContent_MakeAvailable(googletest)
|
||||||
|
elseif(APPLE)
|
||||||
|
# Use pkg-config to find gtest on macOS
|
||||||
|
find_package(PkgConfig REQUIRED)
|
||||||
|
pkg_search_module(GTEST REQUIRED gtest)
|
||||||
|
list(APPEND EXTRA_TEST_LIBS ${GTEST_LIBRARIES})
|
||||||
|
list(APPEND EXTRA_TEST_LIB_DIRS ${GTEST_LIBRARY_DIRS})
|
||||||
|
# Add the link directories to the target
|
||||||
|
link_directories(${EXTRA_TEST_LIB_DIRS})
|
||||||
|
list(APPEND EXTRA_TEST_INCLUDES ${GTEST_INCLUDE_DIRS})
|
||||||
else()
|
else()
|
||||||
find_package(GTest REQUIRED)
|
find_package(GTest REQUIRED)
|
||||||
|
list(APPEND EXTRA_TEST_LIBS gtest)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(QML_TEST_LIBS ${QT_LIBS} ${LIBCLIENT_NAME} ${QT_TEST_LIBS})
|
set(QML_TEST_LIBS ${QT_LIBS} ${LIBCLIENT_NAME} ${QT_TEST_LIBS})
|
||||||
set(TESTS_INCLUDES
|
set(TESTS_INCLUDES
|
||||||
|
${EXTRA_TEST_INCLUDES}
|
||||||
${CMAKE_SOURCE_DIR}/src
|
${CMAKE_SOURCE_DIR}/src
|
||||||
${CMAKE_SOURCE_DIR}/tests/qml
|
${CMAKE_SOURCE_DIR}/tests/qml
|
||||||
${CMAKE_SOURCE_DIR}/tests/unittests)
|
${CMAKE_SOURCE_DIR}/tests/unittests)
|
||||||
|
@ -91,7 +104,7 @@ set(UNIT_TESTS_SOURCE_FILES
|
||||||
|
|
||||||
set(ALL_TESTS_LIBS
|
set(ALL_TESTS_LIBS
|
||||||
${QML_TEST_LIBS}
|
${QML_TEST_LIBS}
|
||||||
gtest
|
${EXTRA_TEST_LIBS}
|
||||||
${CLIENT_LIBS})
|
${CLIENT_LIBS})
|
||||||
|
|
||||||
set(ALL_TESTS_INCLUDES
|
set(ALL_TESTS_INCLUDES
|
||||||
|
|
Loading…
Add table
Reference in a new issue