Skip to content

Commit

Permalink
test: Re-enable some tests on windows.
Browse files Browse the repository at this point in the history
Some of these aren't working still, mainly because they can't find Qt
plugin DLLs.
  • Loading branch information
iphydf committed Dec 9, 2024
1 parent c1b3069 commit 1707ade
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions windows/cross-compile/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ if [[ "$BUILD_TYPE" == "Release" ]]; then
-DSTRICT_OPTIONS=ON \
-DTEST_CROSSCOMPILING_EMULATOR=wine \
-GNinja \
-B_build \
"$QTOX_SRC_DIR"
elif [[ "$BUILD_TYPE" == "Debug" ]]; then
cmake -DCMAKE_TOOLCHAIN_FILE=/build/windows-toolchain.cmake \
Expand All @@ -94,23 +95,31 @@ elif [[ "$BUILD_TYPE" == "Debug" ]]; then
-DTEST_CROSSCOMPILING_EMULATOR=wine \
-GNinja \
-DCMAKE_EXE_LINKER_FLAGS="-mconsole" \
-B_build \
"$QTOX_SRC_DIR"
fi

cmake --build .
cmake --build _build

mkdir -p "$QTOX_PREFIX_DIR"
cp qtox.exe "$QTOX_PREFIX_DIR"
cp _build/qtox.exe "$QTOX_PREFIX_DIR"
cp -r /export/* "$QTOX_PREFIX_DIR"

export WINEQT_QPA_PLATFORM='offscreen'
export WINEPREFIX="$PWD/_build/.wine"

# Check if our main binary runs (just to see if any DLL errors happen early on).
# This also initialises the wine directory for tests (avoiding race conditions).
wine "$QTOX_PREFIX_DIR/qtox.exe" --help

# Run tests
set +u
if [[ $RUN_TESTS -ne 0 ]]; then
export WINEPATH='/export;/windows/bin'
export CTEST_OUTPUT_ON_FAILURE=1
export PATH="$PATH:/opt/wine-stable/bin"
# TODO(iphydf): Fix tests on windows.
# ctest -j$(nproc)
# Set up the environment for the tests (not needed for the main binary, where
# we want to see if the prefix dir has everything we need).
export WINEQT_PLUGIN_PATH='z:\export'
export WINEPATH='z:\export;z:\windows\bin'
ctest --test-dir _build --parallel "$(nproc)" --output-on-failure
fi
set -u

Expand Down

0 comments on commit 1707ade

Please sign in to comment.