Skip to content

Commit 155a3bb

Browse files
authored
Merge pull request #50 from mathisloge/ml/docs
Refactor cmake & add first docs to setup quite
2 parents a07fb63 + 9e3b13c commit 155a3bb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+433
-1043
lines changed

CMakeLists.txt

Lines changed: 55 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ include(GenerateExportHeader)
2828
include(FeatureSummary)
2929
include(GNUInstallDirs)
3030
include(GetGitRevisionDescription)
31+
include(CMakeDependentOption)
3132

3233
set(CMAKE_CXX_SCAN_FOR_MODULES OFF)
3334
set(CMAKE_CXX_EXTENSIONS OFF)
@@ -36,13 +37,35 @@ set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
3637
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
3738
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/runtime")
3839

39-
option(QUITE_BUILD_PROBES "Decides if the probes should be build" ON)
40+
option(QUITE_BUILD_PROBE_QT "Decides if the probes should be build" ON)
41+
option(QUITE_BUILD_TEST_API "Decides if the testing API should be build" ON)
42+
cmake_dependent_option(
43+
QUITE_BUILD_PYTHON_TEST_API
44+
"Decides if the python testing API should be build"
45+
ON
46+
QUITE_BUILD_TEST_API
47+
OFF
48+
)
49+
option(
50+
QUITE_BUILD_REMOTE_MANAGER
51+
"Decides if the remote manager should be build"
52+
ON
53+
)
54+
55+
add_feature_info(QtProbe QUITE_BUILD_PROBE_QT "Build probeqt")
56+
add_feature_info(TestingApi QUITE_BUILD_TEST_API "Build testing API")
4057
add_feature_info(
41-
Studio
42-
QUITE_BUILD_STUDIO
43-
"The studio provides a way to interactively explore the objects in the app."
58+
TestingPythonApi
59+
QUITE_BUILD_PYTHON_TEST_API
60+
"Build testing API"
4461
)
45-
add_feature_info(Testing BUILD_TESTING "Build all tests.")
62+
add_feature_info(
63+
RemoteManager
64+
QUITE_BUILD_REMOTE_MANAGER
65+
"Build remote manager"
66+
)
67+
68+
add_feature_info(Testing BUILD_TESTING "Build all tests")
4669
add_feature_info(
4770
SharedLibraries
4871
BUILD_SHARED_LIBS
@@ -56,55 +79,61 @@ message(STATUS "git_branch: ${git_branch}")
5679
find_package(Sanitizers REQUIRED)
5780
### NOTE: Set CPM_USE_LOCAL_PACKAGES or CPM_LOCAL_PACKAGES_ONLY to true if you want to use system packages or a package manager like vcpkg.
5881
include(get_cpm)
59-
set(BOOST_VERSION "1.88.0")
82+
set(BOOST_VERSION "1.89.0")
6083
list(APPEND BOOST_INCLUDE_LIBRARIES asio process)
6184
cpmaddpackage(
6285
NAME Boost
6386
VERSION "${BOOST_VERSION}"
6487
URL https://github.com/boostorg/boost/releases/download/boost-${BOOST_VERSION}/boost-${BOOST_VERSION}-cmake.tar.xz
65-
URL_HASH SHA256=f48b48390380cfb94a629872346e3a81370dc498896f16019ade727ab72eb1ec
88+
URL_HASH SHA256=67acec02d0d118b5de9eb441f5fb707b3a1cdd884be00ca24b9a73c995511f74
6689
EXCLUDE_FROM_ALL ON
6790
SYSTEM ON
6891
FIND_PACKAGE_ARGUMENTS "CONFIG"
6992
OPTIONS "BOOST_ENABLE_CMAKE ON" "BOOST_PROCESS_USE_STD_FS ON" "BOOST_SKIP_INSTALL_RULES ${CMAKE_SKIP_INSTALL_RULES}"
7093
)
7194
cpmaddpackage("gh:fmtlib/fmt#11.2.0")
72-
cpmaddpackage("gh:odygrd/quill@10.0.1")
95+
cpmaddpackage("gh:odygrd/quill@10.1.0")
7396
cpmaddpackage(URI "gh:skypjack/[email protected]" NAME "EnTT" FIND_PACKAGE_ARGUMENTS "CONFIG")
74-
cpmaddpackage(URI "gh:CLIUtils/[email protected]" OPTIONS "CLI11_PRECOMPILED ON")
75-
cpmaddpackage(URI "gh:NVIDIA/stdexec#0d0a15c669cbd2571248536a7e70524d8b7071aa" NAME "stdexec" VERSION 0.11 FIND_PACKAGE_ARGUMENTS "CONFIG" OPTIONS "STDEXEC_BUILD_TESTS OFF" "STDEXEC_BUILD_EXAMPLES OFF" "STDEXEC_ENABLE_ASIO ON"
97+
cpmaddpackage(URI "gh:NVIDIA/stdexec#daf12bcc46438f88b3c78212363f7b6531338780" NAME "stdexec" VERSION 0.11 FIND_PACKAGE_ARGUMENTS "CONFIG" OPTIONS "STDEXEC_BUILD_TESTS OFF" "STDEXEC_BUILD_EXAMPLES OFF" "STDEXEC_ENABLE_ASIO ON"
7698
)
7799
cpmaddpackage(URI "gh:Tradias/[email protected]" FIND_PACKAGE_ARGUMENTS "CONFIG" VERSION 3.4.0)
78100
cpmaddpackage(URI "gh:nlohmann/[email protected]" FIND_PACKAGE_ARGUMENTS "CONFIG" NAME "nlohmann_json")
79101
cpmaddpackage(URI "gh:nothings/stb#f0569113c93ad095470c54bf34a17b36646bbbb5" NAME Stb
80102
)
103+
find_package(gRPC CONFIG REQUIRED)
81104
set(Stb_INCLUDE_DIR "$<BUILD_INTERFACE:${Stb_SOURCE_DIR}>")
82-
cpmaddpackage(URI "gh:pybind/[email protected]" FIND_PACKAGE_ARGUMENTS "CONFIG" VERSION 3.0.0)
105+
if(QUITE_BUILD_REMOTE_MANAGER OR BUILD_TESTING)
106+
cpmaddpackage(URI "gh:CLIUtils/[email protected]" OPTIONS "CLI11_PRECOMPILED ON")
107+
endif()
83108
if(BUILD_TESTING)
84109
cpmaddpackage("gh:vector-of-bool/cmrc#952ffddba731fc110bd50409e8d2b8a06abbd237"
85110
)
86-
cpmaddpackage("gh:catchorg/[email protected]")
87111
cpmaddpackage("gh:boost-ext/[email protected]")
88112
endif()
89113

90-
find_package(
91-
Qt6
92-
REQUIRED
93-
COMPONENTS Core Gui Qml Quick Widgets
94-
REQUIRED
95-
)
96-
find_package(gRPC CONFIG REQUIRED)
114+
if(QUITE_BUILD_PROBE_QT)
115+
find_package(
116+
Qt6
117+
REQUIRED
118+
COMPONENTS Core Gui Qml Quick Widgets
119+
REQUIRED
120+
)
121+
endif()
122+
add_subdirectory(libs)
97123
if(BUILD_TESTING)
98-
list(APPEND CMAKE_MODULE_PATH "${Catch2_SOURCE_DIR}/extras")
99-
include(Catch)
124+
add_subdirectory(simple_tester)
100125
endif()
101126

102-
add_subdirectory(libs)
103-
add_subdirectory(python)
104-
add_subdirectory(remote-manager)
127+
if(QUITE_BUILD_PYTHON_TEST_API)
128+
cpmaddpackage(URI "gh:pybind/[email protected]" FIND_PACKAGE_ARGUMENTS "CONFIG" VERSION 3.0.0)
129+
add_subdirectory(python)
130+
endif()
131+
132+
if(QUITE_BUILD_REMOTE_MANAGER)
133+
add_subdirectory(remote-manager)
134+
endif()
105135
if(BUILD_TESTING)
106-
add_subdirectory(integration_test)
107-
add_subdirectory(test)
136+
add_subdirectory(example)
108137
endif()
109138

110139
feature_summary(WHAT ENABLED_FEATURES DISABLED_FEATURES DESCRIPTION "Features:")

CMakePresets.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,13 @@
1313
"generator": "Ninja",
1414
"installDir": "${sourceDir}/dist",
1515
"cacheVariables": {
16-
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
16+
"CMAKE_EXPORT_COMPILE_COMMANDS": true,
1717
"Python3_FIND_VIRTUALENV": "FIRST",
1818
"Python3_EXECUTABLE": "${sourceDir}/venv",
19-
"BUILD_SHARED_LIBS": "ON"
19+
"BUILD_SHARED_LIBS": true,
20+
"QUITE_BUILD_PROBE_QT": true,
21+
"QUITE_BUILD_TEST_API": true,
22+
"QUITE_BUILD_PYTHON_TEST_API": true
2023
}
2124
},
2225
{
@@ -83,8 +86,6 @@
8386
],
8487
"cacheVariables": {
8588
"BUILD_SHARED_LIBS": false,
86-
"QUITE_BUILD_STUDIO": false,
87-
"QUITE_BUILD_PROBES": true,
8889
"QUITE_EXAMPLES": false
8990
}
9091
},

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
</div
44
55
quite is a new UI testing framework specifically designed for applications built on the Qt framework.
6-
It aims to provide developers and testers with an efficient way to automate the testing of Qt application user interfaces.
6+
It aims to provide developers and testers with an efficient way to automate the testing of Qt user interfaces.
77
88
I welcome any feedback, suggestions, and contributions that can help make quite a robust and reliable native UI testing framework!
99
@@ -13,6 +13,15 @@ I welcome any feedback, suggestions, and contributions that can help make quite
1313
> Changes may occur without notice, and existing code may become incompatible with future versions.
1414
> Until v2 I will not mark any change as breaking change.
1515
16+
# Documentation
17+
18+
Full documentation is available at [quite.rocks](https://quite.rocks).
19+
20+
Some useful starting points:
21+
22+
- [Getting Started](https://quite.rocks/getting-started) – install quite and run your first test
23+
- [Building from Source](https://quite.rocks/building) – instructions for compiling
24+
1625
# Release and branch strategy
1726

1827
All PRs should be target the develop branch.

docs/building.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Building
2+
3+
## Build against system packages
4+
5+
By default, most dependencies are fetched with [CPM.cmake](https://github.com/cpm-cmake/CPM.cmake).
6+
7+
If you prefer to use **system-installed packages** instead of downloading them directly, configure CPM with one of these options:
8+
9+
- `CPM_USE_LOCAL_PACKAGES=ON`
10+
- `CPM_LOCAL_PACKAGES_ONLY=ON`
11+
12+
See the [CPM reference](https://github.com/cpm-cmake/CPM.cmake?tab=readme-ov-file#cpm_use_local_packages) for details.
13+
14+
!!! tip
15+
Use `CPM_LOCAL_PACKAGES_ONLY=ON` when integrating with package managers such as **Conan** or **vcpkg**.
16+
This ensures CPM won’t try to fetch sources remotely.
17+
18+
---
19+
20+
## General dependencies
21+
22+
* [Boost](https://www.boost.org/) >= `1.83.0`
23+
* [gRPC](https://grpc.io/) >= `1.51.1`
24+
* [fmt](https://fmt.dev) >= `11.0.0`
25+
* [Quill](https://github.com/odygrd/quill) >= `10.0.0`
26+
* [EnTT](https://github.com/skypjack/entt) >= `3.15.0`
27+
* [stdexec](https://github.com/NVIDIA/stdexec) >= `daf12bcc46438f88b3c78212363f7b6531338780`
28+
* [asio-grpc](https://github.com/Tradias/asio-grpc) >= `3.3.0`
29+
* [JSON for Modern C++](https://json.nlohmann.me/) >= `3.11.0`
30+
* [stb](https://github.com/nothings/stb) >= `f0569113c93ad095470c54bf34a17b36646bbbb5`
31+
32+
---
33+
34+
## CMake options
35+
36+
The build can be customized with several **CMake options**:
37+
38+
### `QUITE_BUILD_REMOTE_MANAGER`
39+
40+
- **Default:** `ON`
41+
- **Description:** Builds the remote-manager application.
42+
- **Introduced dependencies:**
43+
- [CLI11](https://cliutils.github.io/CLI11/book/)`2.4.0`
44+
45+
---
46+
47+
### `QUITE_BUILD_TEST_API`
48+
49+
- **Default:** `ON`
50+
- **Description:** Builds the C++ testing API.
51+
52+
---
53+
54+
### `QUITE_BUILD_PYTHON_TEST_API`
55+
56+
- **Default:** `ON`
57+
- **Description:** Builds the Python testing API module.
58+
- **Dependencies:** Requires `QUITE_BUILD_TEST_API=ON`.
59+
- **Introduced dependencies:**
60+
- [pybind11](https://pybind11.readthedocs.io/en/stable/)`3.0.0`
61+
62+
See [Python Usage](python-usage.md) for details.
63+
64+
---
65+
66+
### `QUITE_BUILD_PROBE_QT`
67+
68+
- **Default:** `ON`
69+
- **Description:** Builds the Qt probe.
70+
- **Introduced dependencies:**
71+
- [Qt](https://www.qt.io/)`6.5.0`
72+
73+
---

docs/getting-started.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Getting Started
2+
3+
## Introduction
4+
5+
**quite** is an end-to-end testing framework for Qt applications.
6+
7+
It provides a simple API that you can use from **C++** or **Python**, while still letting you choose your preferred test framework (e.g. GoogleTest, pytest, Catch2, etc.).
8+
9+
With quite, you can:
10+
11+
- Stimulate your application (e.g. trigger UI actions).
12+
- Capture screenshots of controls.
13+
- Query properties from your application.
14+
15+
To use quite, you’ll need to install two parts:
16+
17+
1. **The Probe** – code injected into your Application Under Test (AUT).
18+
2. **The Test API** – the library you use in your test code to talk to the AUT.
19+
20+
[:material-arrow-right: Probe Installation](#probe)
21+
[:material-arrow-right: Test API Installation](#test-api)
22+
23+
!!! info "Minimum language and Qt version"
24+
* Only **Qt 6.5** and onward is supported.
25+
* **C++23** required to compile the project.
26+
* **C++17** required to consume the testing API.
27+
* **gcc-13** required to compile the project.
28+
* currently only tested with gcc and linux.
29+
30+
---
31+
32+
## Installation
33+
34+
### Probe
35+
36+
The probe runs **inside your AUT** and sets up a gRPC server that quite uses to communicate with your application.
37+
38+
You’ll need to add the probe to your application during build time.
39+
40+
#### Install with vcpkg
41+
42+
```bash
43+
vcpkg install quite[probeqt]
44+
```
45+
46+
### Install with CPM.cmake
47+
48+
```cmake
49+
cpmaddpackage(
50+
NAME quite
51+
URI "gh:mathisloge/[email protected]"
52+
OPTIONS "QUITE_BUILD_PROBE_QT ON"
53+
)
54+
```
55+
56+
## Test API
57+
58+
The test API is what your test code uses to talk to the AUT’s probe.
59+
60+
You can install it for C++ or Python.
61+
62+
### vcpkg
63+
64+
```bash
65+
vcpkg install quite[testapi]
66+
```
67+
68+
### CPM.cmake
69+
70+
```cmake
71+
cpmaddpackage(
72+
NAME quite
73+
URI "gh:mathisloge/[email protected]"
74+
OPTIONS "QUITE_BUILD_TEST_API ON"
75+
)
76+
77+
```
78+
79+
### Python
80+
81+
```bash
82+
pip3 install https://github.com/mathisloge/quite/archive/refs/tags/v1.3.0.zip
83+
```

docs/index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# Home
2+
**quite** enables reliable end-to-end testing for qt applications.
23

3-
For full documentation visit [github.com/mathisloge/quite](https://github.com/mathisloge/quite).
4+
[GET STARTED](getting-started.md){ .md-button .md-button--primary }
5+
[Github](https://github.com/mathisloge/quite){ .md-button target="_blank" rel="noopener" }

docs/probe-setup.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Probe setup
2+
3+
Currently only a compile time link setup is supported.
4+
However in the future a `LD_PRELOAD` step is supported.
5+
See [#51](https://github.com/mathisloge/quite/issues/51).
6+
7+
## C++
8+
9+
```cmake
10+
11+
find_package(quite CONFIG REQUIRED)
12+
13+
add_executable(myApp)
14+
15+
target_link_libraries(myApp PRIVATE
16+
quite::probe_qt
17+
)
18+
```
19+
20+
```cpp
21+
#include <quite/probe_qt/probe_qt.hpp>
22+
23+
int main()
24+
{
25+
auto& probe = quite::probe::setup_qt_probe(quite::GrpcServer{.server_address = "unix:///tmp/grpc_probe.sock"});
26+
27+
// normal application setup
28+
// no more to do
29+
}
30+
31+
```

0 commit comments

Comments
 (0)