aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorPo Lu2023-03-28 09:41:22 +0800
committerPo Lu2023-03-28 09:41:22 +0800
commit64206ee3af9b59da9591aae400439bdea2cda09f (patch)
tree88c333f058f0afac551daca0d8cf2f2e9d8012ea /test
parent05f3f9c1c09c3e7a4d9c1d9ac16a34742a4124c1 (diff)
parent66b4394461589d0db8690b7971000f687bd3ad57 (diff)
downloademacs-64206ee3af9b59da9591aae400439bdea2cda09f.tar.gz
emacs-64206ee3af9b59da9591aae400439bdea2cda09f.zip
Merge remote-tracking branch 'origin/master' into feature/android
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.in9
-rw-r--r--test/infra/Dockerfile.emba8
-rw-r--r--test/infra/gitlab-ci.yml32
-rw-r--r--test/lisp/emacs-lisp/benchmark-tests.el4
-rw-r--r--test/lisp/progmodes/python-tests.el38
-rw-r--r--test/lisp/progmodes/ruby-ts-mode-tests.el25
-rw-r--r--test/src/fns-tests.el2
7 files changed, 95 insertions, 23 deletions
diff --git a/test/Makefile.in b/test/Makefile.in
index f4b85e7dfe5..e2a14c4dd92 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -124,7 +124,14 @@ test_module_dir := src/emacs-module-resources
124 124
125all: check 125all: check
126 126
127ifeq ($(HAVE_NATIVE_COMP),yes) 127SYSTEM_TYPE = @SYSTEM_TYPE@
128TEST_NATIVE_COMP = $(HAVE_NATIVE_COMP)
129# Avoid fork failures on Cygwin. See bug#62450 and etc/PROBLEMS
130# ("Fork failures in a build with native compilation").
131ifeq ($(SYSTEM_TYPE),cygwin)
132TEST_NATIVE_COMP = no
133endif
134ifeq ($(TEST_NATIVE_COMP),yes)
128SELECTOR_DEFAULT = (not (or (tag :expensive-test) (tag :unstable))) 135SELECTOR_DEFAULT = (not (or (tag :expensive-test) (tag :unstable)))
129SELECTOR_EXPENSIVE = (not (tag :unstable)) 136SELECTOR_EXPENSIVE = (not (tag :unstable))
130SELECTOR_ALL = t 137SELECTOR_ALL = t
diff --git a/test/infra/Dockerfile.emba b/test/infra/Dockerfile.emba
index 163fc582e6f..9377a3b5f87 100644
--- a/test/infra/Dockerfile.emba
+++ b/test/infra/Dockerfile.emba
@@ -64,7 +64,7 @@ FROM emacs-base as emacs-eglot
64 64
65RUN apt-get update && \ 65RUN apt-get update && \
66 apt-get install -y --no-install-recommends -o=Dpkg::Use-Pty=0 \ 66 apt-get install -y --no-install-recommends -o=Dpkg::Use-Pty=0 \
67 snapd wget lsb_release add-apt-repository gpg \ 67 snapd wget lsb-release software-properties-common gpg \
68 && rm -rf /var/lib/apt/lists/* 68 && rm -rf /var/lib/apt/lists/*
69 69
70# A recent clangd. It must be at least clangd 14, which is in Debian 70# A recent clangd. It must be at least clangd 14, which is in Debian
@@ -73,8 +73,8 @@ RUN bash -c "$(wget --no-check-certificate -O - https://apt.llvm.org/llvm.sh)"
73 73
74# A recent pylsp. Since Debian bookworm there is the package 74# A recent pylsp. Since Debian bookworm there is the package
75# python3-pylsp. 75# python3-pylsp.
76RUN snap install core 76# RUN snap install core
77RUN snap install pylsp 77# RUN snap install pylsp
78 78
79COPY . /checkout 79COPY . /checkout
80WORKDIR /checkout 80WORKDIR /checkout
@@ -100,7 +100,7 @@ FROM emacs-base as emacs-native-comp
100# The libgccjit version must correspond to the gcc version. 100# The libgccjit version must correspond to the gcc version.
101RUN apt-get update && \ 101RUN apt-get update && \
102 apt-get install -y --no-install-recommends -o=Dpkg::Use-Pty=0 \ 102 apt-get install -y --no-install-recommends -o=Dpkg::Use-Pty=0 \
103 libgccjit-10-dev \ 103 libgccjit-10-dev zlib1g-dev \
104 && rm -rf /var/lib/apt/lists/* 104 && rm -rf /var/lib/apt/lists/*
105 105
106FROM emacs-native-comp as emacs-native-comp-speed0 106FROM emacs-native-comp as emacs-native-comp-speed0
diff --git a/test/infra/gitlab-ci.yml b/test/infra/gitlab-ci.yml
index b000f128278..d1fef0187d4 100644
--- a/test/infra/gitlab-ci.yml
+++ b/test/infra/gitlab-ci.yml
@@ -256,24 +256,22 @@ test-eglot:
256 # This is needed in order to get a JUnit test report. 256 # This is needed in order to get a JUnit test report.
257 make_params: '-k -C test check-expensive LOGFILES="lisp/progmodes/eglot-tests.log"' 257 make_params: '-k -C test check-expensive LOGFILES="lisp/progmodes/eglot-tests.log"'
258 258
259# The next two jobs are commented out due to bug#62210. 259build-image-gnustep:
260 260 stage: platform-images
261# build-image-gnustep: 261 extends: [.job-template, .build-template, .gnustep-template]
262# stage: platform-images 262 variables:
263# extends: [.job-template, .build-template, .gnustep-template] 263 target: emacs-gnustep
264# variables:
265# target: emacs-gnustep
266 264
267# test-gnustep: 265test-gnustep:
268# # This tests the GNUstep build process. 266 # This tests the GNUstep build process.
269# stage: platforms 267 stage: platforms
270# extends: [.job-template, .gnustep-template] 268 extends: [.job-template, .gnustep-template]
271# needs: 269 needs:
272# - job: build-image-gnustep 270 - job: build-image-gnustep
273# optional: true 271 optional: true
274# variables: 272 variables:
275# target: emacs-gnustep 273 target: emacs-gnustep
276# make_params: install 274 make_params: install
277 275
278# The next two jobs are commented out due to high workload on 276# The next two jobs are commented out due to high workload on
279# emba.gnu.org. 277# emba.gnu.org.
diff --git a/test/lisp/emacs-lisp/benchmark-tests.el b/test/lisp/emacs-lisp/benchmark-tests.el
index 31357f24a0d..99b5b142c37 100644
--- a/test/lisp/emacs-lisp/benchmark-tests.el
+++ b/test/lisp/emacs-lisp/benchmark-tests.el
@@ -23,6 +23,10 @@
23(require 'ert) 23(require 'ert)
24 24
25(ert-deftest benchmark-tests () 25(ert-deftest benchmark-tests ()
26 ;; Avoid fork failures on Cygwin. See bug#62450 and etc/PROBLEMS
27 ;; ("Fork failures in a build with native compilation").
28 (skip-unless (not (and (eq system-type 'cygwin)
29 (featurep 'native-compile))))
26 (let (str t-long t-short m) 30 (let (str t-long t-short m)
27 (should (consp (benchmark-run nil (setq m (1+ 0))))) 31 (should (consp (benchmark-run nil (setq m (1+ 0)))))
28 (should (consp (benchmark-run 1 (setq m (1+ 0))))) 32 (should (consp (benchmark-run 1 (setq m (1+ 0)))))
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el
index ed4a08da6ab..50153e66da5 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -5940,6 +5940,26 @@ def func():
5940 (equal (list (python-tests-look-at "if (" -1 t)) 5940 (equal (list (python-tests-look-at "if (" -1 t))
5941 (python-info-dedenter-opening-block-positions))))) 5941 (python-info-dedenter-opening-block-positions)))))
5942 5942
5943(ert-deftest python-info-dedenter-opening-block-positions-7 ()
5944 "Test case blocks."
5945 (python-tests-with-temp-buffer
5946 "
5947match a:
5948 case 1:
5949 match b:
5950 case 2:
5951 something()
5952 case 3:
5953"
5954 (python-tests-look-at "case 1:")
5955 (should-not (python-info-dedenter-opening-block-positions))
5956 (python-tests-look-at "case 2:")
5957 (should-not (python-info-dedenter-opening-block-positions))
5958 (python-tests-look-at "case 3:")
5959 (equal (list (python-tests-look-at "case 2:" -1)
5960 (python-tests-look-at "case 1:" -1 t))
5961 (python-info-dedenter-opening-block-positions))))
5962
5943(ert-deftest python-info-dedenter-opening-block-message-1 () 5963(ert-deftest python-info-dedenter-opening-block-message-1 ()
5944 "Test dedenters inside strings are ignored." 5964 "Test dedenters inside strings are ignored."
5945 (python-tests-with-temp-buffer 5965 (python-tests-with-temp-buffer
@@ -6125,6 +6145,24 @@ elif b:
6125 (point)) 6145 (point))
6126 (python-info-dedenter-statement-p))))) 6146 (python-info-dedenter-statement-p)))))
6127 6147
6148(ert-deftest python-info-dedenter-statement-p-6 ()
6149 "Test case keyword."
6150 (python-tests-with-temp-buffer
6151 "
6152match a: # Comment
6153 case 1:
6154 match b:
6155 case 2:
6156 something()
6157 case 3:
6158"
6159 (python-tests-look-at "case 1:")
6160 (should-not (python-info-dedenter-statement-p))
6161 (python-tests-look-at "case 2:")
6162 (should-not (python-info-dedenter-statement-p))
6163 (python-tests-look-at "case 3:")
6164 (should (= (point) (python-info-dedenter-statement-p)))))
6165
6128(ert-deftest python-info-line-ends-backslash-p-1 () 6166(ert-deftest python-info-line-ends-backslash-p-1 ()
6129 (python-tests-with-temp-buffer 6167 (python-tests-with-temp-buffer
6130 " 6168 "
diff --git a/test/lisp/progmodes/ruby-ts-mode-tests.el b/test/lisp/progmodes/ruby-ts-mode-tests.el
index e0d9f1b5c50..11125dc5cd3 100644
--- a/test/lisp/progmodes/ruby-ts-mode-tests.el
+++ b/test/lisp/progmodes/ruby-ts-mode-tests.el
@@ -281,6 +281,31 @@ The whitespace before and including \"|\" on each line is removed."
281 (file-truename 281 (file-truename
282 (expand-file-name (format "ruby-mode-resources/%s" ,file)))))) 282 (expand-file-name (format "ruby-mode-resources/%s" ,file))))))
283 283
284(ert-deftest ruby-ts-imenu-index ()
285 (ruby-ts-with-temp-buffer
286 (ruby-ts-test-string
287 "module Foo
288 | class Blub
289 | def hi
290 | 'Hi!'
291 | end
292 |
293 | def bye
294 | 'Bye!'
295 | end
296 |
297 | private def self.hiding
298 | 'You can't see me'
299 | end
300 | end
301 |end")
302 (should (equal (mapcar #'car (ruby-ts--imenu))
303 '("Foo"
304 "Foo::Blub"
305 "Foo::Blub#hi"
306 "Foo::Blub#bye"
307 "Foo::Blub.hiding")))))
308
284(defmacro ruby-ts-deftest-indent (file) 309(defmacro ruby-ts-deftest-indent (file)
285 `(ert-deftest ,(intern (format "ruby-ts-indent-test/%s" file)) () 310 `(ert-deftest ,(intern (format "ruby-ts-indent-test/%s" file)) ()
286 ;; :tags '(:expensive-test) 311 ;; :tags '(:expensive-test)
diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el
index 0321b92d0bc..6f79d3277a8 100644
--- a/test/src/fns-tests.el
+++ b/test/src/fns-tests.el
@@ -254,7 +254,7 @@
254 (should (string-collate-equalp "xyzzy" "XYZZY" nil t)) 254 (should (string-collate-equalp "xyzzy" "XYZZY" nil t))
255 255
256 ;; Locale must be valid. 256 ;; Locale must be valid.
257 (should-error (string-collate-equalp "xyzzy" "xyzzy" "en_DE.UTF-8"))) 257 (should-error (string-collate-equalp "xyzzy" "xyzzy" "en_XY.UTF-8")))
258 258
259;; There must be a check for valid codepoints. (Check not implemented yet) 259;; There must be a check for valid codepoints. (Check not implemented yet)
260; (should-error 260; (should-error