summaryrefslogtreecommitdiffstats
path: root/gfx/wr/ci-scripts
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
commit2aa4a82499d4becd2284cdb482213d541b8804dd (patch)
treeb80bf8bf13c3766139fbacc530efd0dd9d54394c /gfx/wr/ci-scripts
parentInitial commit. (diff)
downloadfirefox-2aa4a82499d4becd2284cdb482213d541b8804dd.tar.xz
firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.zip
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/wr/ci-scripts')
-rw-r--r--gfx/wr/ci-scripts/docker-image/Dockerfile12
-rwxr-xr-xgfx/wr/ci-scripts/docker-image/setup.sh44
-rw-r--r--gfx/wr/ci-scripts/etc/wr-darwin.meson18
-rwxr-xr-xgfx/wr/ci-scripts/install-meson.sh22
-rwxr-xr-xgfx/wr/ci-scripts/linux-debug-tests.sh36
-rwxr-xr-xgfx/wr/ci-scripts/linux-release-tests.sh24
-rwxr-xr-xgfx/wr/ci-scripts/macos-debug-tests.sh42
-rwxr-xr-xgfx/wr/ci-scripts/macos-release-tests.sh31
-rw-r--r--gfx/wr/ci-scripts/set-screenresolution.ps1124
-rwxr-xr-xgfx/wr/ci-scripts/windows-tests.cmd36
10 files changed, 389 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..c187172f5d
--- /dev/null
+++ b/gfx/wr/ci-scripts/docker-image/Dockerfile
@@ -0,0 +1,12 @@
+FROM debian:buster-20200422
+
+# Debian 10 doesn't have openjdk-8, so add the Debian 9 repository, which contains it.
+RUN sed s/buster/stretch/ /etc/apt/sources.list | tee /etc/apt/sources.list.d/stretch.list
+
+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..11adb1c269
--- /dev/null
+++ b/gfx/wr/ci-scripts/docker-image/setup.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/. */
+
+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 \
+ openjdk-8-jdk \
+ pkg-config \
+ python \
+ python-mako \
+ python-pip \
+ python-setuptools \
+ python-voluptuous \
+ python-yaml \
+ python3-pip \
+ python3-mako \
+ software-properties-common \
+ clang
+
+# Other stuff we need
+pip install servo-tidy==0.3.0
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..5449982225
--- /dev/null
+++ b/gfx/wr/ci-scripts/etc/wr-darwin.meson
@@ -0,0 +1,18 @@
+[binaries]
+llvm-config = '/builds/worker/fetches/clang/bin/llvm-config'
+
+[properties]
+# When linking `libOSMesa.dylib` Meson uses options provided by `llvm-config`.
+# The binary for `llvm-config` in Firefox CI comes from a native Linux clang,
+# which gives the link options for the Linux libLLVM-11.so in the Linux clang.
+# However, we want to link against a native macOS clang's libLLVM.dylib, which
+# we have available in a separate directory.
+# Meson will still have -lLLVM-11 on the command line, but the linker will
+# only warn that it has the wrong format (because it's not for macOS).
+cpp_link_args = ['-L/builds/worker/fetches/clang-mac/clang/lib', '-lLLVM']
+
+[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..a0171d3a8e
--- /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=0.55.1
+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..2c2fc756b6
--- /dev/null
+++ b/gfx/wr/ci-scripts/linux-debug-tests.sh
@@ -0,0 +1,36 @@
+#!/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
+
+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 python script/headless.py reftest
+popd
+
+pushd examples
+cargo build ${CARGOFLAGS}
+popd
+
+cargo test ${CARGOFLAGS} \
+ --all --exclude compositor-windows --exclude compositor \
+ --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..abb2e277d3
--- /dev/null
+++ b/gfx/wr/ci-scripts/linux-release-tests.sh
@@ -0,0 +1,24 @@
+#!/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
+
+pushd wrench
+python script/headless.py reftest
+python script/headless.py rawtest
+python 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..2325475d90
--- /dev/null
+++ b/gfx/wr/ci-scripts/macos-debug-tests.sh
@@ -0,0 +1,42 @@
+#!/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:-""}
+
+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-windows --exclude compositor \
+ --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..f8f065d340
--- /dev/null
+++ b/gfx/wr/ci-scripts/macos-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.
+# 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:-""}
+
+pushd wrench
+
+python script/headless.py reftest
+python 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/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..c3607a9028
--- /dev/null
+++ b/gfx/wr/ci-scripts/windows-tests.cmd
@@ -0,0 +1,36 @@
+:: 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
+
+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%
+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
+
+pushd direct-composition
+cargo check --verbose
+if %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL%
+popd