mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
test: start preparing to run ourselfs in the harness
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,5 +2,6 @@
|
|||||||
zig-cache/
|
zig-cache/
|
||||||
zig-out/
|
zig-out/
|
||||||
/result*
|
/result*
|
||||||
|
test/ghostty
|
||||||
|
|
||||||
glad.zip
|
glad.zip
|
||||||
|
41
test/README.md
Normal file
41
test/README.md
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
# Acceptance Testing
|
||||||
|
|
||||||
|
This directory contains an acceptance test suite for ghostty. This works
|
||||||
|
by running the terminal emulator within a windowing environment, capturing a
|
||||||
|
screenshot, and comparing results. We use this to visually verify that
|
||||||
|
all rendering conforms to what we expect.
|
||||||
|
|
||||||
|
This test suite can also execute alternate terminal emulators so that we
|
||||||
|
can easily compare outputs between them.
|
||||||
|
|
||||||
|
## Running a Single Test
|
||||||
|
|
||||||
|
To run a single test, use the `run-host.sh` script. This must be executed
|
||||||
|
from this directory. Example:
|
||||||
|
|
||||||
|
```shell-session
|
||||||
|
$ ./run-host.sh --exec xterm --case /src/cases/vttest/launch.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
The `--case` flag uses `/src` as the root for this directory.
|
||||||
|
|
||||||
|
The `--update` flag can be used to update the screenshot in place. This
|
||||||
|
should be used to gather a new screenshot. If you want to compare to the old
|
||||||
|
screenshot, copy the old one or use git to revert.
|
||||||
|
|
||||||
|
## Running the Full Suite
|
||||||
|
|
||||||
|
**Warning:** This can take a long time and isn't recommended. The CI
|
||||||
|
environment automatically runs the full test suite and is the recommended
|
||||||
|
approach.
|
||||||
|
|
||||||
|
To run the full test suite against all terminal emulators, use the
|
||||||
|
`run-all.sh` script. This optionally takes an `--exec` parameter to run
|
||||||
|
the full test suite against only a single terminal emulator.
|
||||||
|
|
||||||
|
## Modifying the `ghostty` Binary
|
||||||
|
|
||||||
|
This test suite expects the `ghostty` binary to be in _this directory_.
|
||||||
|
You can manually copy it into place. By default, if the binary doesn't exist,
|
||||||
|
the various host-side shell scripts will try to copy from
|
||||||
|
`../zig-out/bin/ghostty` (resulting from `zig build`).
|
@ -3,6 +3,10 @@
|
|||||||
# This runs a single test case from the host (not from Docker itself). The
|
# This runs a single test case from the host (not from Docker itself). The
|
||||||
# arguments are the same as run.sh but this wraps it in docker.
|
# arguments are the same as run.sh but this wraps it in docker.
|
||||||
|
|
||||||
|
if [ ! -f "ghostty" ]; then
|
||||||
|
cp ../zig-out/bin/ghostty .
|
||||||
|
fi
|
||||||
|
|
||||||
docker run \
|
docker run \
|
||||||
--init \
|
--init \
|
||||||
--rm \
|
--rm \
|
||||||
|
@ -55,6 +55,10 @@ fi
|
|||||||
echo "Term: ${ARG_EXEC}"
|
echo "Term: ${ARG_EXEC}"
|
||||||
echo "Case: ${ARG_CASE}"
|
echo "Case: ${ARG_CASE}"
|
||||||
|
|
||||||
|
if [ "$ARG_EXEC" = "ghostty" ]; then
|
||||||
|
ARG_EXEC="/src/ghostty";
|
||||||
|
fi
|
||||||
|
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
# Some terminals require XDG be properly setup. We create a new
|
# Some terminals require XDG be properly setup. We create a new
|
||||||
# set of XDG directories for this.
|
# set of XDG directories for this.
|
||||||
|
Reference in New Issue
Block a user