From 696f32c95c96f120ed1dc10193d27b7bc2adaba9 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Tue, 12 Jan 2016 10:37:06 +0100 Subject: [PATCH] Merge missing commit from emacs-25 branch * test/Makefile.in (SELECTOR_DEFAULT, SELECTOR_EXPENSIVE, SELECTOR): New variables. (check-expensive, check-doit): New targets. * Makefile.in (check-expensive): New target. * test/lisp/autorevert-tests.el (auto-revert-test01-auto-revert-several-files): * test/lisp/filenotify-tests.el (file-notify--deftest-remote) (file-notify-test06-many-events): * test/lisp/net/tramp-tests.el (tramp-test26-process-file) (tramp-test27-start-file-process, tramp-test28-shell-command) (tramp-test29-vc-registered) (tramp-test31-special-characters-with-stat) (tramp-test31-special-characters-with-perl) (tramp-test31-special-characters-with-ls) (tramp-test32-utf8-with-stat, tramp-test32-utf8-with-perl) (tramp-test32-utf8-with-ls, tramp-test33-asynchronous-requests) (tramp-test35-unload): Tag the tests as :expensive-test. --- Makefile.in | 4 ++-- test/Makefile.in | 17 +++++++++++++++-- test/lisp/autorevert-tests.el | 3 ++- test/lisp/filenotify-tests.el | 2 ++ test/lisp/net/tramp-tests.el | 12 ++++++++++++ 5 files changed, 33 insertions(+), 5 deletions(-) diff --git a/Makefile.in b/Makefile.in index fdaa63a9ec2..55c75717115 100644 --- a/Makefile.in +++ b/Makefile.in @@ -929,7 +929,7 @@ have-tests: exit 1; \ fi -check check-maybe: have-tests all +check check-maybe check-expensive: have-tests all $(MAKE) -C test $@ dist: @@ -946,7 +946,7 @@ $(DOCS): $(MAKE) -C doc/$(subst -, ,$@) .PHONY: $(DOCS) docs pdf ps -.PHONY: info dvi dist check check-maybe html info-real info-dir check-info +.PHONY: info dvi dist check check-maybe check-expensive html info-real info-dir check-info ## TODO add etc/refcards. docs: $(DOCS) diff --git a/test/Makefile.in b/test/Makefile.in index 62443a195ef..388ea5397f9 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -87,6 +87,9 @@ WRITE_LOG = > $@ 2>&1 || { stat=ERROR; cat $@; }; echo $$stat: $@ ## to change this; bug#17848 - if that gets done, this can be simplified). ## ## Beware: it approximates 'no-byte-compile', so watch out for false-positives! +SELECTOR_DEFAULT=(quote (not (tag :expensive-test))) +SELECTOR_EXPENSIVE=nil +SELECTOR= %.log: %.el @if grep '^;.*no-byte-compile: t' $< > /dev/null; then \ loadfile=$<; \ @@ -98,7 +101,7 @@ WRITE_LOG = > $@ 2>&1 || { stat=ERROR; cat $@; }; echo $$stat: $@ stat=OK ; \ mkdir --parents $(dir $@) ; \ $(emacs) -l ert -l $$loadfile \ - -f ert-run-tests-batch-and-exit ${WRITE_LOG} + --eval "(ert-run-tests-batch-and-exit ${SELECTOR})" ${WRITE_LOG} ELFILES = $(shell find ${srcdir} -path "${srcdir}/manual" -prune -o \ -path "*resources" -prune -o -name "*el" -print) @@ -135,7 +138,17 @@ $(foreach test,${TESTS},$(eval $(call test_template,${test}))) -include make-test-deps.mk ## Rerun default tests. check: - -@for f in $(LOGFILES); do test ! -f $$f || mv $$f $$f~; done + @${MAKE} check-doit SELECTOR="${SELECTOR_DEFAULT}" + +## Rerun also expensive tests. +.PHONY: check-expensive +check-expensive: + @${MAKE} check-doit SELECTOR="${SELECTOR_EXPENSIVE}" + +## Re-run all the tests every time. +.PHONY: check-doit +check-doit: + -@for f in *.log; do test ! -f $$f || mv $$f $$f~; done @${MAKE} check-maybe ## Only re-run tests whose .log is older than the test. diff --git a/test/lisp/autorevert-tests.el b/test/lisp/autorevert-tests.el index b37850054fa..a6f8cb29563 100644 --- a/test/lisp/autorevert-tests.el +++ b/test/lisp/autorevert-tests.el @@ -94,6 +94,7 @@ ;; This is inspired by Bug#21841. (ert-deftest auto-revert-test01-auto-revert-several-files () "Check autorevert for several files at once." + :tags '(:expensive-test) (skip-unless (executable-find "cp")) (let* ((cp (executable-find "cp")) @@ -138,7 +139,7 @@ ;; Strange, that `copy-directory' does not work as expected. ;; The following shell command is not portable on all ;; platforms, unfortunately. - (shell-command (format "%s %s/* %s" cp tmpdir2 tmpdir1)) + (shell-command (format "%s -f %s/* %s" cp tmpdir2 tmpdir1)) ;; Check, that the buffers have been reverted. (dolist (buf (list buf1 buf2)) diff --git a/test/lisp/filenotify-tests.el b/test/lisp/filenotify-tests.el index 4cde86c8eee..de64f5086d2 100644 --- a/test/lisp/filenotify-tests.el +++ b/test/lisp/filenotify-tests.el @@ -152,6 +152,7 @@ remote host, or nil." (declare (indent 1)) `(ert-deftest ,(intern (concat (symbol-name test) "-remote")) () ,docstring + :tags '(:expensive-test) (let* ((temporary-file-directory file-notify-test-remote-temporary-file-directory) (ert-test (ert-get-test ',test))) @@ -783,6 +784,7 @@ longer than timeout seconds for the events to be delivered." (ert-deftest file-notify-test06-many-events () "Check that events are not dropped." + :tags '(:expensive-test) (skip-unless (file-notify--test-local-enabled)) ;; Under cygwin events arrive in random order. Impossible to define a test. (skip-unless (not (eq system-type 'cygwin))) diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 305ca9d6770..a29e42e7343 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -1395,6 +1395,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (ert-deftest tramp-test26-process-file () "Check `process-file'." + :tags '(:expensive-test) (skip-unless (tramp--test-enabled)) (skip-unless (not @@ -1441,6 +1442,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (ert-deftest tramp-test27-start-file-process () "Check `start-file-process'." + :tags '(:expensive-test) (skip-unless (tramp--test-enabled)) (skip-unless (not @@ -1510,6 +1512,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (ert-deftest tramp-test28-shell-command () "Check `shell-command'." + :tags '(:expensive-test) (skip-unless (tramp--test-enabled)) (skip-unless (not @@ -1597,6 +1600,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (ert-deftest tramp-test29-vc-registered () "Check `vc-registered'." + :tags '(:expensive-test) (skip-unless (tramp--test-enabled)) (skip-unless (eq @@ -1967,6 +1971,7 @@ Several special characters do not work properly there." (ert-deftest tramp-test31-special-characters-with-stat () "Check special characters in file names. Use the `stat' command." + :tags '(:expensive-test) (skip-unless (tramp--test-enabled)) (skip-unless (eq @@ -1985,6 +1990,7 @@ Use the `stat' command." (ert-deftest tramp-test31-special-characters-with-perl () "Check special characters in file names. Use the `perl' command." + :tags '(:expensive-test) (skip-unless (tramp--test-enabled)) (skip-unless (eq @@ -2006,6 +2012,7 @@ Use the `perl' command." (ert-deftest tramp-test31-special-characters-with-ls () "Check special characters in file names. Use the `ls' command." + :tags '(:expensive-test) (skip-unless (tramp--test-enabled)) (skip-unless (eq @@ -2045,6 +2052,7 @@ Use the `ls' command." (ert-deftest tramp-test32-utf8-with-stat () "Check UTF8 encoding in file names and file contents. Use the `stat' command." + :tags '(:expensive-test) (skip-unless (tramp--test-enabled)) (skip-unless (eq @@ -2063,6 +2071,7 @@ Use the `stat' command." (ert-deftest tramp-test32-utf8-with-perl () "Check UTF8 encoding in file names and file contents. Use the `perl' command." + :tags '(:expensive-test) (skip-unless (tramp--test-enabled)) (skip-unless (eq @@ -2084,6 +2093,7 @@ Use the `perl' command." (ert-deftest tramp-test32-utf8-with-ls () "Check UTF8 encoding in file names and file contents. Use the `ls' command." + :tags '(:expensive-test) (skip-unless (tramp--test-enabled)) (skip-unless (eq @@ -2109,6 +2119,7 @@ Such requests could arrive from timers, process filters and process sentinels. They shall not disturb each other." ;; Mark as failed until bug has been fixed. :expected-result :failed + :tags '(:expensive-test) (skip-unless (tramp--test-enabled)) (skip-unless (eq @@ -2220,6 +2231,7 @@ process sentinels. They shall not disturb each other." Since it unloads Tramp, it shall be the last test to run." ;; Mark as failed until all symbols are unbound. :expected-result (if (featurep 'tramp) :failed :passed) + :tags '(:expensive-test) (when (featurep 'tramp) (unload-feature 'tramp 'force) ;; No Tramp feature must be left. -- 2.39.5