annotate tests/automated/process-tests.el @ 5671:f45338de7caa

Merge in my release prep stuff.
author Stephen J. Turnbull <stephen@xemacs.org>
date Fri, 03 Aug 2012 02:05:08 +0900
parents 11da5b828d10
children 965a9ddc915a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5533
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
1 ;; Copyright (C) 2011 Free Software Foundation, Inc.
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
2
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
3 ;; Author: Mats Lidell <matsl@xemacs.org>
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
4 ;; Maintainer:
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
5 ;; Created: 2011
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
6 ;; Keywords: tests
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
7
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
8 ;; This file is part of XEmacs.
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
9
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
10 ;; XEmacs is free software: you can redistribute it and/or modify it
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
11 ;; under the terms of the GNU General Public License as published by the
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
12 ;; Free Software Foundation, either version 3 of the License, or (at your
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
13 ;; option) any later version.
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
14
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
15 ;; XEmacs is distributed in the hope that it will be useful, but WITHOUT
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
16 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
17 ;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
18 ;; for more details.
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
19
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
20 ;; You should have received a copy of the GNU General Public License
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
21 ;; along with XEmacs. If not, see <http://www.gnu.org/licenses/>.
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
22
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
23 ;;; Synched up with: Not in FSF.
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
24
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
25 ;;; Commentary:
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
26
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
27 ;; Test tag support.
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
28 ;; See test-harness.el for instructions on how to run these tests.
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
29
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
30 (require 'test-harness)
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
31
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
32 (when (equal system-type 'linux)
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
33 (setenv "LANG" "C")
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
34
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
35 ;; One line output
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
36 (Assert (= 0 (shell-command "echo hello")))
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
37 (Assert (equal "hello" (message-displayed-p t)))
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
38 (with-current-buffer " *Echo Area*"
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
39 (goto-char (point-min))
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
40 (Assert (looking-at "hello")))
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
41
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
42 ;; Two lines. No output in echo area. (GNU resizes minibuffer but we
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
43 ;; haven't implemented that.)
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
44 (message "")
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
45 (Assert (= 0 (shell-command "echo -e \"foo\nbar\n\"")))
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
46 (with-current-buffer " *Echo Area*"
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
47 (Assert (= 0 (buffer-size))))
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
48 (with-current-buffer "*Shell Command Output*"
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
49 (goto-char (point-min))
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
50 (Assert (looking-at "foo"))):
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
51
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
52 (Assert (= 127 (shell-command "unknown_command")))
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
53 (Assert (= 2 (shell-command "exit 2")))
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
54 (Assert (equal "(Shell command failed with code 2 and no output)" (message-displayed-p t)))
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
55
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
56 ;; Output to stderr With error buffer
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
57 (Assert (= 0 (shell-command "echo -e \"foo\nbar\n\" 1>&2" "Output buffer" "Error buffer")))
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
58 (Assert (equal "(Shell command succeeded with some error output)" (message-displayed-p t)))
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
59 (with-current-buffer "Error buffer"
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
60 (goto-char (point-min))
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
61 (Assert (looking-at "foo")))
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
62 (with-current-buffer "Output buffer"
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
63 (Assert (= 0 (buffer-size))))
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
64
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
65 ;; Output to stderr but no error buffer
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
66 (Assert (= 0 (shell-command "echo -e \"foobar\nfoobar\n\" 1>&2" "Output buffer")))
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
67 (with-current-buffer "Output buffer"
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
68 (goto-char (point-min))
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
69 (Assert (looking-at "foobar")))
11da5b828d10 shell-command and shell-command-on-region API compliant with FSF 23.3.1
Mats Lidell <mats.lidell@cag.se>
parents:
diff changeset
70 )