rename binary name to gammaray-mcp-bridge
This commit is contained in:
@@ -20,13 +20,18 @@ end-to-end against a real GammaRay probe.
|
||||
| `test_navigation.py` | `listQuickWindows`, `selectQuickWindow`, `listQuickItems`, `listScenegraphNodes` | Yes |
|
||||
| `test_items.py` | `selectQuickItem`, `getItemProperties`, position, visual properties, groups | Yes |
|
||||
| `test_scenegraph.py` | `selectScenegraphNode`, `getNodeVertices`, `getNodeAdjacency`, `getMaterialShaders`, `getMaterialProperties`, `setRenderMode`, `setSlowMode` | Yes |
|
||||
| `test_widgets.py` | `listWidgets`, `selectWidget`, `getWidgetProperties`, `getWidgetAttributes` | Yes (--widget-app) |
|
||||
|
||||
## Test QML application
|
||||
## Test applications
|
||||
|
||||
`testapp/main.qml` is a simple Qt Quick Controls application that exercises all
|
||||
the tools: buttons, switches, sliders, a list view with delegate items, and
|
||||
the QML tools: buttons, switches, sliders, a list view with delegate items, and
|
||||
visibility/opacity controls.
|
||||
|
||||
`testapp/widget_test_app.cpp` is a simple QWidget application (QLabel, QLineEdit,
|
||||
QCheckBox, QGroupBox, QPushButton) for testing widget inspection tools. Use
|
||||
`run_widget_tests.sh` to run tests against this app.
|
||||
|
||||
## Configuration
|
||||
|
||||
**`run_tests.sh` is the single configuration point.** All paths default to
|
||||
@@ -40,7 +45,7 @@ system package), override these by editing the variables at the top of
|
||||
| `GAMMARAY_LIB_DIR` | `install-prefix/lib` | Runtime library directory for GammaRay |
|
||||
| `QML_RUNNER` | `/usr/lib/qt6/bin/qml` | QML runtime executable |
|
||||
| `TEST_QML` | `testapp/main.qml` | Test QML application |
|
||||
| `BRIDGE_EXE` | `bridge/build/qml-sg-mcp-bridge` | Bridge executable |
|
||||
| `BRIDGE_EXE` | `bridge/build/gammaray-mcp-bridge` | Bridge executable |
|
||||
| `BRIDGE_RUN_SCRIPT` | `bridge/run.sh` | Bridge wrapper script |
|
||||
|
||||
You can also override any of these via environment variables when calling
|
||||
|
||||
@@ -52,7 +52,7 @@ WIDGET_TEST_APP_SRC = Path(os.environ.get(
|
||||
))
|
||||
BRIDGE_EXE = Path(os.environ.get(
|
||||
"BRIDGE_EXE",
|
||||
str(PROJECT_ROOT / "bridge" / "build" / "qml-sg-mcp-bridge"),
|
||||
str(PROJECT_ROOT / "bridge" / "build" / "gammaray-mcp-bridge"),
|
||||
))
|
||||
BRIDGE_RUN_SCRIPT = Path(os.environ.get(
|
||||
"BRIDGE_RUN_SCRIPT",
|
||||
|
||||
@@ -24,7 +24,7 @@ PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
: "${GAMMARAY_LIB_DIR:=$PROJECT_ROOT/install-prefix/lib}"
|
||||
: "${QML_RUNNER:=/usr/lib/qt6/bin/qml}"
|
||||
: "${TEST_QML:=$SCRIPT_DIR/testapp/main.qml}"
|
||||
: "${BRIDGE_EXE:=$PROJECT_ROOT/bridge/build/qml-sg-mcp-bridge}"
|
||||
: "${BRIDGE_EXE:=$PROJECT_ROOT/bridge/build/gammaray-mcp-bridge}"
|
||||
: "${BRIDGE_RUN_SCRIPT:=$PROJECT_ROOT/bridge/run.sh}"
|
||||
|
||||
# Export so conftest.py can read them
|
||||
|
||||
@@ -20,9 +20,32 @@ PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
: "${GAMMARAY_LIB_DIR:=$PROJECT_ROOT/install-prefix/lib}"
|
||||
: "${WIDGET_TEST_APP_BIN:=$SCRIPT_DIR/testapp/widget_test_app}"
|
||||
: "${WIDGET_TEST_APP_SRC:=$SCRIPT_DIR/testapp/widget_test_app.cpp}"
|
||||
: "${BRIDGE_EXE:=$PROJECT_ROOT/bridge/build/qml-sg-mcp-bridge}"
|
||||
: "${BRIDGE_EXE:=$PROJECT_ROOT/bridge/build/gammaray-mcp-bridge}"
|
||||
: "${BRIDGE_RUN_SCRIPT:=$PROJECT_ROOT/bridge/run.sh}"
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Ensure the widget test app is compiled
|
||||
# ---------------------------------------------------------------------------
|
||||
_compile_widget_app() {
|
||||
echo "Compiling widget test app..."
|
||||
local cflags
|
||||
cflags=$(pkg-config --cflags Qt6Core Qt6Gui Qt6Widgets 2>/dev/null) || {
|
||||
echo "Error: pkg-config for Qt6 not found. Install qt6-base-dev or set WIDGET_TEST_APP_BIN to a pre-built binary."
|
||||
exit 1
|
||||
}
|
||||
local libs
|
||||
libs=$(pkg-config --libs Qt6Core Qt6Gui Qt6Widgets 2>/dev/null) || {
|
||||
echo "Error: pkg-config for Qt6 libs not found."
|
||||
exit 1
|
||||
}
|
||||
g++ -std=c++17 -fPIC "$WIDGET_TEST_APP_SRC" -o "$WIDGET_TEST_APP_BIN" \
|
||||
$cflags $libs
|
||||
echo "Widget test app compiled: $WIDGET_TEST_APP_BIN"
|
||||
}
|
||||
|
||||
if [ ! -f "$WIDGET_TEST_APP_BIN" ]; then
|
||||
_compile_widget_app
|
||||
fi
|
||||
export GAMMARAY_BIN
|
||||
export GAMMARAY_LIB_DIR
|
||||
export WIDGET_TEST_APP_BIN
|
||||
|
||||
Reference in New Issue
Block a user