]> git.ipfire.org Git - thirdparty/git.git/blame - t/t0061-run-command.sh
revert: free msg in format_todo()
[thirdparty/git.git] / t / t0061-run-command.sh
CommitLineData
2b541bf8
JS
1#!/bin/sh
2#
3# Copyright (c) 2009 Ilari Liusvaara
4#
5
6test_description='Test run command'
7
8. ./test-lib.sh
9
c0f19bf3
JN
10cat >hello-script <<-EOF
11 #!$SHELL_PATH
12 cat hello-script
13EOF
14>empty
15
2b541bf8
JS
16test_expect_success 'start_command reports ENOENT' '
17 test-run-command start-command-ENOENT ./does-not-exist
18'
19
c0f19bf3
JN
20test_expect_success 'run_command can run a command' '
21 cat hello-script >hello.sh &&
22 chmod +x hello.sh &&
23 test-run-command run-command ./hello.sh >actual 2>err &&
24
25 test_cmp hello-script actual &&
26 test_cmp empty err
27'
28
29test_expect_success POSIXPERM 'run_command reports EACCES' '
30 cat hello-script >hello.sh &&
31 chmod -x hello.sh &&
32 test_must_fail test-run-command run-command ./hello.sh 2>err &&
33
34 grep "fatal: cannot exec.*hello.sh" err
35'
36
2b541bf8 37test_done