Skip to content

Commit b253ab1

Browse files
committed
Merge branch 'dev-better-test'
2 parents 5df114c + ff81189 commit b253ab1

File tree

6 files changed

+32
-8
lines changed

6 files changed

+32
-8
lines changed

.github/workflows/_build-emacs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,13 @@ jobs:
9494
- name: Test in ubuntu 20.04 container
9595
if: ${{ inputs.do_test }}
9696
run: |
97-
docker run -v ./dist:/dist -v ./scripts:/scripts tester-image_ubuntu2004:latest \
97+
docker run -v ./dist:/dist tester-image_ubuntu2004:latest \
9898
/scripts/test_emacs_in_docker.sh /dist/Emacs.AppImage
9999
100100
- name: Test in archlinux container
101101
if: ${{ inputs.do_test }}
102102
run: |
103-
docker run -v ./dist:/dist -v ./scripts:/scripts tester-image_archlinux:latest \
103+
docker run -v ./dist:/dist tester-image_archlinux:latest \
104104
/scripts/test_emacs_in_docker.sh /dist/Emacs.AppImage
105105
106106
- name: Upload binary as artifact

.github/workflows/_prepare-docker.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ jobs:
5252
- name: Build and export
5353
uses: docker/build-push-action@v5
5454
with:
55+
context: tests/
5556
file: tests/Dockerfile.ubuntu2004
5657
# cache-from: type=gha
5758
# cache-to: type=gha,mode=max
@@ -79,6 +80,7 @@ jobs:
7980
- name: Build and export
8081
uses: docker/build-push-action@v5
8182
with:
83+
context: tests/
8284
file: tests/Dockerfile.archlinux
8385
# cache-from: type=gha
8486
# cache-to: type=gha,mode=max

tests/Dockerfile.archlinux

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ FROM archlinux:latest
33
RUN pacman-key --init \
44
&& pacman -Syu --noconfirm \
55
&& pacman -S --noconfirm xfce4
6+
7+
ADD scripts /scripts

tests/Dockerfile.ubuntu2004

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ FROM ubuntu:20.04
33
ENV DEBIAN_FRONTEND=noninteractive
44

55
RUN apt-get update && apt-get install -y ubuntu-desktop
6+
7+
ADD scripts /scripts

tests/scripts/test.el

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
;;; test.el --- -*- lexical-binding: t; -*-
2+
3+
;;; Commentary:
4+
5+
;;; Code:
6+
7+
(require 'cl-macs)
8+
9+
(message "hello world!")
10+
11+
(cl-assert (native-comp-available-p))
12+
(cl-assert (native-compile '(lambda (x) (* x 2))))
13+
14+
(cl-assert (executable-find "emacsclient"))
15+
(cl-assert (executable-find "emacs"))
16+
(cl-assert (executable-find "hexl"))
17+
18+
(cl-assert (file-exists-p (file-name-concat doc-directory "NEWS")))
19+
(cl-assert (file-exists-p (file-name-concat data-directory "charsets/GBK.map")))
20+
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
#!/bin/bash -ex
22

3+
SCRIPTS_DIR="$(realpath "$(dirname "$0")")"
34
EMACS_APPIMAGE="$(realpath "$1")"
45

56
cd "$(mktemp -d)"
67

78
cp "$EMACS_APPIMAGE" ./Emacs.AppImage
89
chmod +x ./Emacs.AppImage
910

10-
cat <<-EOF > test.el
11-
(native-compile '(lambda (x) (* x 2)))
12-
(message "hello world!")
13-
EOF
14-
1511
./Emacs.AppImage --appimage-extract
1612
cd squashfs-root
17-
./AppRun --batch -l ../test.el
13+
14+
./AppRun --batch -l "$SCRIPTS_DIR/test.el"
15+
[[ "$(./AppRun --emacs-appimage-run-as emacsclient --version)" =~ emacsclient* ]]

0 commit comments

Comments
 (0)