diff options
Diffstat (limited to 'gfx/wr/ci-scripts')
-rw-r--r-- | gfx/wr/ci-scripts/docker-image/Dockerfile | 9 | ||||
-rwxr-xr-x | gfx/wr/ci-scripts/docker-image/setup.sh | 41 | ||||
-rw-r--r-- | gfx/wr/ci-scripts/etc/wr-darwin.meson | 8 | ||||
-rwxr-xr-x | gfx/wr/ci-scripts/install-meson.sh | 22 | ||||
-rwxr-xr-x | gfx/wr/ci-scripts/linux-debug-tests.sh | 38 | ||||
-rwxr-xr-x | gfx/wr/ci-scripts/linux-release-tests.sh | 31 | ||||
-rwxr-xr-x | gfx/wr/ci-scripts/macos-debug-tests.sh | 44 | ||||
-rwxr-xr-x | gfx/wr/ci-scripts/macos-release-tests.sh | 38 | ||||
-rw-r--r-- | gfx/wr/ci-scripts/requirements.txt | 2 | ||||
-rw-r--r-- | gfx/wr/ci-scripts/set-screenresolution.ps1 | 124 | ||||
-rwxr-xr-x | gfx/wr/ci-scripts/windows-tests.cmd | 43 |
11 files changed, 400 insertions, 0 deletions
diff --git a/gfx/wr/ci-scripts/docker-image/Dockerfile b/gfx/wr/ci-scripts/docker-image/Dockerfile new file mode 100644 index 0000000000..3b7805195d --- /dev/null +++ b/gfx/wr/ci-scripts/docker-image/Dockerfile @@ -0,0 +1,9 @@ +FROM debian:bullseye-20221205 + +COPY setup.sh /root +RUN cd /root && ./setup.sh + +RUN useradd -d /home/worker -s /bin/bash -m worker +USER worker +WORKDIR /home/worker +CMD /bin/bash diff --git a/gfx/wr/ci-scripts/docker-image/setup.sh b/gfx/wr/ci-scripts/docker-image/setup.sh new file mode 100755 index 0000000000..309e2e9ad8 --- /dev/null +++ b/gfx/wr/ci-scripts/docker-image/setup.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +set -o errexit +set -o nounset +set -o pipefail +set -o xtrace + +test "$(whoami)" == 'root' + +# Install stuff we need +apt-get -y update +apt-get install -y \ + bison \ + bzip2 \ + cmake \ + curl \ + flex \ + gcc \ + git \ + g++ \ + libfontconfig1-dev \ + libgl1-mesa-dev \ + libx11-dev \ + llvm-dev \ + ninja-build \ + pkg-config \ + software-properties-common \ + clang + +# some reftests fail with freetype >= 2.10, so downgrade to the version in +# Debian buster. See bug 1804782. +apt-get -y remove libfreetype-dev +curl -LO http://snapshot.debian.org/archive/debian/20220718T031307Z/pool/main/f/freetype/libfreetype6_2.9.1-3%2Bdeb10u3_amd64.deb +curl -LO http://snapshot.debian.org/archive/debian/20220718T031307Z/pool/main/f/freetype/libfreetype6-dev_2.9.1-3%2Bdeb10u3_amd64.deb + +dpkg -i libfreetype6*.deb +rm libfreetype6*.deb diff --git a/gfx/wr/ci-scripts/etc/wr-darwin.meson b/gfx/wr/ci-scripts/etc/wr-darwin.meson new file mode 100644 index 0000000000..e6efc7deb1 --- /dev/null +++ b/gfx/wr/ci-scripts/etc/wr-darwin.meson @@ -0,0 +1,8 @@ +[binaries] +llvm-config = '/builds/worker/fetches/clang-mac/clang/bin/llvm-config' + +[host_machine] +system = 'darwin' +cpu_family = 'x86_64' +cpu = 'i686' +endian = 'little' diff --git a/gfx/wr/ci-scripts/install-meson.sh b/gfx/wr/ci-scripts/install-meson.sh new file mode 100755 index 0000000000..35fb3970e8 --- /dev/null +++ b/gfx/wr/ci-scripts/install-meson.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +# This file downloads and installs meson which is required for building +# osmesa-src, a dependency of wrench. + +set -o errexit +set -o nounset +set -o pipefail +set -o xtrace + +MESON_VER=1.1.0 +MESON_BASE_URL="https://github.com/mesonbuild/meson/releases/download" + +curl -L ${MESON_BASE_URL}/${MESON_VER}/meson-${MESON_VER}.tar.gz -o meson.tar.gz +tar -xf meson.tar.gz +mv meson-${MESON_VER} meson +cd meson +ln -s meson.py meson diff --git a/gfx/wr/ci-scripts/linux-debug-tests.sh b/gfx/wr/ci-scripts/linux-debug-tests.sh new file mode 100755 index 0000000000..86cad9d669 --- /dev/null +++ b/gfx/wr/ci-scripts/linux-debug-tests.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +# This must be run from the root webrender directory! +# Users may set the CARGOFLAGS environment variable to pass +# additional flags to cargo if desired. + +set -o errexit +set -o nounset +set -o pipefail +set -o xtrace + +CARGOFLAGS=${CARGOFLAGS:-"--verbose"} # default to --verbose if not set + +python3 -m pip install -r $(dirname ${0})/requirements.txt + +pushd webrender +cargo build ${CARGOFLAGS} --no-default-features +cargo build ${CARGOFLAGS} --no-default-features --features capture +cargo build ${CARGOFLAGS} --features capture,profiler +cargo build ${CARGOFLAGS} --features replay +popd + +pushd wrench +cargo build ${CARGOFLAGS} --features env_logger +OPTIMIZED=0 python3 script/headless.py reftest +popd + +pushd examples +cargo build ${CARGOFLAGS} +popd + +cargo test ${CARGOFLAGS} \ + --all --exclude compositor --exclude compositor-wayland \ + --exclude compositor-windows --exclude glsl-to-cxx --exclude swgl diff --git a/gfx/wr/ci-scripts/linux-release-tests.sh b/gfx/wr/ci-scripts/linux-release-tests.sh new file mode 100755 index 0000000000..03c6873b6f --- /dev/null +++ b/gfx/wr/ci-scripts/linux-release-tests.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +# This must be run from the root webrender directory! +# Users may set the CARGOFLAGS environment variable to pass +# additional flags to cargo if desired. + +set -o errexit +set -o nounset +set -o pipefail +set -o xtrace + +CARGOFLAGS=${CARGOFLAGS:-""} # default to empty if not set + +python3 -m pip install -r $(dirname ${0})/requirements.txt + +pushd wrench +# Test that all shaders compile successfully and pass tests. +python3 script/headless.py --precache test_init +python3 script/headless.py --precache --use-unoptimized-shaders test_init +python3 script/headless.py test_shaders + +python3 script/headless.py reftest +python3 script/headless.py rawtest +python3 script/headless.py test_invalidation +CXX=clang++ cargo run ${CARGOFLAGS} --release --features=software -- \ + --software --headless reftest +popd diff --git a/gfx/wr/ci-scripts/macos-debug-tests.sh b/gfx/wr/ci-scripts/macos-debug-tests.sh new file mode 100755 index 0000000000..6c809a3b98 --- /dev/null +++ b/gfx/wr/ci-scripts/macos-debug-tests.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash + +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +# This must be run from the root webrender directory! +# Users may set the CARGOFLAGS environment variable to pass +# additional flags to cargo if desired. + +# Note that this script is run in a special cross-compiling configuration, +# where CARGOTESTFLAGS includes `--no-run`, and the binaries produced by +# `cargo test` are run on a different machine. When making changes to this +# file, please ensure any such binaries produced by `cargo test` are not +# deleted, or they may not get run as expected. + +set -o errexit +set -o nounset +set -o pipefail +set -o xtrace + +CARGOFLAGS=${CARGOFLAGS:-"--verbose"} # default to --verbose if not set +CARGOTESTFLAGS=${CARGOTESTFLAGS:-""} + +python3 -m pip install -r $(dirname ${0})/requirements.txt + +pushd webrender +cargo check ${CARGOFLAGS} --no-default-features +cargo check ${CARGOFLAGS} --no-default-features --features capture +cargo check ${CARGOFLAGS} --features capture,profiler +cargo check ${CARGOFLAGS} --features replay +popd + +pushd wrench +cargo check ${CARGOFLAGS} --features env_logger +popd + +pushd examples +cargo check ${CARGOFLAGS} +popd + +cargo test ${CARGOFLAGS} ${CARGOTESTFLAGS} \ + --all --exclude compositor --exclude compositor-wayland \ + --exclude compositor-windows --exclude glsl-to-cxx --exclude swgl diff --git a/gfx/wr/ci-scripts/macos-release-tests.sh b/gfx/wr/ci-scripts/macos-release-tests.sh new file mode 100755 index 0000000000..0ad50345e1 --- /dev/null +++ b/gfx/wr/ci-scripts/macos-release-tests.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +# This must be run from the root webrender directory! +# Users may set the CARGOFLAGS environment variable to pass +# additional flags to cargo if desired. +# The WRENCH_BINARY environment variable, if set, is used to run +# the precached reftest. + +set -o errexit +set -o nounset +set -o pipefail +set -o xtrace + +CARGOFLAGS=${CARGOFLAGS:-""} # default to empty if not set +WRENCH_BINARY=${WRENCH_BINARY:-""} + +python3 -m pip install -r $(dirname ${0})/requirements.txt + +pushd wrench + +# Test that all shaders compile successfully and pass tests. +python3 script/headless.py --precache test_init +python3 script/headless.py --precache --use-unoptimized-shaders test_init +python3 script/headless.py test_shaders + +python3 script/headless.py reftest +python3 script/headless.py test_invalidation +if [[ -z "${WRENCH_BINARY}" ]]; then + cargo build ${CARGOFLAGS} --release + WRENCH_BINARY="../target/release/wrench" +fi +"${WRENCH_BINARY}" --precache \ + reftest reftests/clip/fixed-position-clipping.yaml +popd diff --git a/gfx/wr/ci-scripts/requirements.txt b/gfx/wr/ci-scripts/requirements.txt new file mode 100644 index 0000000000..143b399107 --- /dev/null +++ b/gfx/wr/ci-scripts/requirements.txt @@ -0,0 +1,2 @@ +mako==1.2.4 +six diff --git a/gfx/wr/ci-scripts/set-screenresolution.ps1 b/gfx/wr/ci-scripts/set-screenresolution.ps1 new file mode 100644 index 0000000000..2f58443417 --- /dev/null +++ b/gfx/wr/ci-scripts/set-screenresolution.ps1 @@ -0,0 +1,124 @@ +# http://blogs.technet.com/b/heyscriptingguy/archive/2010/07/07/hey-scripting-guy-how-can-i-change-my-desktop-monitor-resolution-via-windows-powershell.aspx + +Function Set-ScreenResolution { +param ( +[Parameter(Mandatory=$true, + Position = 0)] +[int] +$Width, +[Parameter(Mandatory=$true, + Position = 1)] +[int] +$Height +) +$pinvokeCode = @" +using System; +using System.Runtime.InteropServices; +namespace Resolution +{ + [StructLayout(LayoutKind.Sequential)] + public struct DEVMODE1 + { + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string dmDeviceName; + public short dmSpecVersion; + public short dmDriverVersion; + public short dmSize; + public short dmDriverExtra; + public int dmFields; + public short dmOrientation; + public short dmPaperSize; + public short dmPaperLength; + public short dmPaperWidth; + public short dmScale; + public short dmCopies; + public short dmDefaultSource; + public short dmPrintQuality; + public short dmColor; + public short dmDuplex; + public short dmYResolution; + public short dmTTOption; + public short dmCollate; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string dmFormName; + public short dmLogPixels; + public short dmBitsPerPel; + public int dmPelsWidth; + public int dmPelsHeight; + public int dmDisplayFlags; + public int dmDisplayFrequency; + public int dmICMMethod; + public int dmICMIntent; + public int dmMediaType; + public int dmDitherType; + public int dmReserved1; + public int dmReserved2; + public int dmPanningWidth; + public int dmPanningHeight; + }; + class User_32 + { + [DllImport("user32.dll")] + public static extern int EnumDisplaySettings(string deviceName, int modeNum, ref DEVMODE1 devMode); + [DllImport("user32.dll")] + public static extern int ChangeDisplaySettings(ref DEVMODE1 devMode, int flags); + public const int ENUM_CURRENT_SETTINGS = -1; + public const int CDS_UPDATEREGISTRY = 0x01; + public const int CDS_TEST = 0x02; + public const int DISP_CHANGE_SUCCESSFUL = 0; + public const int DISP_CHANGE_RESTART = 1; + public const int DISP_CHANGE_FAILED = -1; + } + public class PrmaryScreenResolution + { + static public string ChangeResolution(int width, int height) + { + DEVMODE1 dm = GetDevMode1(); + if (0 != User_32.EnumDisplaySettings(null, User_32.ENUM_CURRENT_SETTINGS, ref dm)) + { + dm.dmPelsWidth = width; + dm.dmPelsHeight = height; + int iRet = User_32.ChangeDisplaySettings(ref dm, User_32.CDS_TEST); + if (iRet == User_32.DISP_CHANGE_FAILED) + { + return "Unable To Process Your Request. Sorry For This Inconvenience."; + } + else + { + iRet = User_32.ChangeDisplaySettings(ref dm, User_32.CDS_UPDATEREGISTRY); + switch (iRet) + { + case User_32.DISP_CHANGE_SUCCESSFUL: + { + return "Success"; + } + case User_32.DISP_CHANGE_RESTART: + { + return "You Need To Reboot For The Change To Happen.\n If You Feel Any Problem After Rebooting Your Machine\nThen Try To Change Resolution In Safe Mode."; + } + default: + { + return "Failed To Change The Resolution"; + } + } + } + } + else + { + return "Failed To Change The Resolution."; + } + } + private static DEVMODE1 GetDevMode1() + { + DEVMODE1 dm = new DEVMODE1(); + dm.dmDeviceName = new String(new char[32]); + dm.dmFormName = new String(new char[32]); + dm.dmSize = (short)Marshal.SizeOf(dm); + return dm; + } + } +} +"@ +Add-Type $pinvokeCode -ErrorAction SilentlyContinue +[Resolution.PrmaryScreenResolution]::ChangeResolution($width,$height) +} diff --git a/gfx/wr/ci-scripts/windows-tests.cmd b/gfx/wr/ci-scripts/windows-tests.cmd new file mode 100755 index 0000000000..313661a4ff --- /dev/null +++ b/gfx/wr/ci-scripts/windows-tests.cmd @@ -0,0 +1,43 @@ +:: This Source Code Form is subject to the terms of the Mozilla Public +:: License, v. 2.0. If a copy of the MPL was not distributed with this +:: file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +:: This must be run from the root webrender directory! +:: Users may set the CARGOFLAGS environment variable to pass +:: additional flags to cargo if desired. + +if NOT DEFINED CARGOFLAGS SET CARGOFLAGS=--verbose + +python3 -m pip install -r %0\\..\\requirements.txt + +pushd webrender_api +cargo test %CARGOFLAGS% +if %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL% +popd + +pushd webrender +cargo test %CARGOFLAGS% +if %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL% +popd + +pushd wrench +cargo test --verbose +if %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL% +:: Test that all shaders compile successfully and pass tests. +:: --precache compiles all shaders during initialization, therefore if init +:: is successful then the shaders compile. +cargo run --release -- --angle --precache test_init +if %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL% +cargo run --release -- --angle --precache --use-unoptimized-shaders test_init +if %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL% +cargo run --release -- --angle test_shaders +if %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL% + +cargo run --release -- --angle reftest +if %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL% +popd + +pushd examples +cargo check --verbose +if %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL% +popd |