Skip to content

Commit a7dd34b

Browse files
committed
Add tests for exit status when displaying help message
1 parent 2564bf6 commit a7dd34b

File tree

20 files changed

+567
-3
lines changed

20 files changed

+567
-3
lines changed

Makefile

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,27 +35,64 @@ command-local:
3535
command-analyze:
3636
./test/commands/analyze/dsl/run.sh
3737
./test/commands/analyze/metadata/run.sh
38+
./test/commands/analyze/error/run.sh
39+
40+
command-bump:
41+
./test/commands/bump/run.sh
42+
43+
command-compile:
44+
./test/commands/compile/run.sh
45+
46+
command-concat:
47+
./test/commands/concat/run.sh
3848

3949
command-docker:
4050
./test/commands/docker/run.sh
4151

52+
command-docs:
53+
./test/commands/docs/run.sh
54+
55+
command-eval:
56+
./test/commands/eval/run.sh
57+
4258
command-exec:
4359
./test/commands/exec/run.sh
4460

4561
command-emacs:
4662
./test/commands/emacs/run.sh
4763

64+
command-format:
65+
./test/commands/format/run.sh
66+
67+
command-info:
68+
./test/commands/info/run.sh
69+
70+
command-init:
71+
./test/commands/init/run.sh
72+
4873
command-install:
4974
./test/commands/install/run.sh
5075

76+
command-link:
77+
./test/commands/link/run.sh
78+
79+
command-lint:
80+
./test/commands/lint/run.sh
81+
5182
command-outdated-upgrade:
5283
./test/commands/outdated_upgrade/run.sh
5384

85+
command-recipe:
86+
./test/commands/recipe/run.sh
87+
88+
command-run:
89+
./test/commands/run/run.sh
90+
5491
command-search:
5592
./test/commands/search/run.sh
5693

57-
command-link:
58-
./test/commands/link/run.sh
94+
command-source:
95+
./test/commands/source/run.sh
5996

6097
test-ert:
6198
./test/commands/test/ert/run.sh

test/commands/analyze/error/run.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (C) 2022-2025 the Eask authors.
4+
5+
# This program is free software; you can redistribute it and/or modify
6+
# it under the terms of the GNU General Public License as published by
7+
# the Free Software Foundation; either version 3, or (at your option)
8+
# any later version.
9+
10+
# This program is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
# GNU General Public License for more details.
14+
15+
# You should have received a copy of the GNU General Public License
16+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
18+
## Commentary:
19+
#
20+
# Test command/analyze `analyze` errors
21+
#
22+
23+
set -e
24+
25+
source ./test/fixtures/home/scripts/testing.sh
26+
27+
# Naviate to the test package
28+
cd $(dirname "$0")
29+
30+
echo "Testing analyze command... no files"
31+
should_error eask analyze

test/commands/bump/run.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (C) 2022-2025 the Eask authors.
4+
5+
# This program is free software; you can redistribute it and/or modify
6+
# it under the terms of the GNU General Public License as published by
7+
# the Free Software Foundation; either version 3, or (at your option)
8+
# any later version.
9+
10+
# This program is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
# GNU General Public License for more details.
14+
15+
# You should have received a copy of the GNU General Public License
16+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
18+
## Commentary:
19+
#
20+
# Test command/bump `bump` errors
21+
#
22+
23+
set -e
24+
25+
source ./test/fixtures/home/scripts/testing.sh
26+
27+
# Naviate to the test package
28+
cd $(dirname "$0")
29+
30+
echo "Testing bump command... no files"
31+
should_error eask bump

test/commands/compile/run.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (C) 2022-2025 the Eask authors.
4+
5+
# This program is free software; you can redistribute it and/or modify
6+
# it under the terms of the GNU General Public License as published by
7+
# the Free Software Foundation; either version 3, or (at your option)
8+
# any later version.
9+
10+
# This program is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
# GNU General Public License for more details.
14+
15+
# You should have received a copy of the GNU General Public License
16+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
18+
## Commentary:
19+
#
20+
# Test command/compile `compile` errors
21+
#
22+
23+
set -e
24+
25+
source ./test/fixtures/home/scripts/testing.sh
26+
27+
cd $(dirname "$0")
28+
29+
echo "Testing compile command... no files"
30+
should_error eask compile

test/commands/concat/run.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (C) 2022-2025 the Eask authors.
4+
5+
# This program is free software; you can redistribute it and/or modify
6+
# it under the terms of the GNU General Public License as published by
7+
# the Free Software Foundation; either version 3, or (at your option)
8+
# any later version.
9+
10+
# This program is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
# GNU General Public License for more details.
14+
15+
# You should have received a copy of the GNU General Public License
16+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
18+
## Commentary:
19+
#
20+
# Test command/concat `concat` errors
21+
#
22+
23+
set -e
24+
25+
source ./test/fixtures/home/scripts/testing.sh
26+
27+
# Naviate to the test package
28+
cd $(dirname "$0")
29+
30+
echo "Testing concat command... no files"
31+
should_error eask concat

test/commands/docs/run.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (C) 2022-2025 the Eask authors.
4+
5+
# This program is free software; you can redistribute it and/or modify
6+
# it under the terms of the GNU General Public License as published by
7+
# the Free Software Foundation; either version 3, or (at your option)
8+
# any later version.
9+
10+
# This program is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
# GNU General Public License for more details.
14+
15+
# You should have received a copy of the GNU General Public License
16+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
18+
## Commentary:
19+
#
20+
# Test command/docs `docs` errors
21+
#
22+
23+
set -e
24+
25+
source ./test/fixtures/home/scripts/testing.sh
26+
27+
# Naviate to the test package
28+
cd $(dirname "$0")
29+
30+
echo "Testing docs command... no files"
31+
should_error eask docs

test/commands/eval/run.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (C) 2022-2025 the Eask authors.
4+
5+
# This program is free software; you can redistribute it and/or modify
6+
# it under the terms of the GNU General Public License as published by
7+
# the Free Software Foundation; either version 3, or (at your option)
8+
# any later version.
9+
10+
# This program is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
# GNU General Public License for more details.
14+
15+
# You should have received a copy of the GNU General Public License
16+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
18+
## Commentary:
19+
#
20+
# Test command/eval `eval` errors
21+
#
22+
23+
set -e
24+
25+
source ./test/fixtures/home/scripts/testing.sh
26+
27+
cd $(dirname "$0")
28+
29+
echo "Testing eval command... no arg"
30+
should_error eask eval

test/commands/exec/run.sh

100644100755
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222

2323
set -e
2424

25+
source ./test/fixtures/home/scripts/testing.sh
26+
2527
echo "Test command 'exec'..."
2628
cd $(dirname "$0")
2729

@@ -32,3 +34,6 @@ eask exec echo hello world
3234

3335
eask exec buttercup -L .
3436
eask exec buttercup -L . --pattern 'pattern 1'
37+
38+
echo "Testing exec command... no files"
39+
should_error eask exec

test/commands/format/run.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (C) 2022-2025 the Eask authors.
4+
5+
# This program is free software; you can redistribute it and/or modify
6+
# it under the terms of the GNU General Public License as published by
7+
# the Free Software Foundation; either version 3, or (at your option)
8+
# any later version.
9+
10+
# This program is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
# GNU General Public License for more details.
14+
15+
# You should have received a copy of the GNU General Public License
16+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
18+
## Commentary:
19+
#
20+
# Test command/format errors
21+
#
22+
23+
set -e
24+
25+
source ./test/fixtures/home/scripts/testing.sh
26+
27+
cd $(dirname "$0")
28+
29+
echo "Testing elfmt command... no files"
30+
should_error eask format elfmt
31+
32+
echo "Testing elisp-autofmt command... no files"
33+
should_error eask format elisp-autofmt

test/commands/info/run.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (C) 2022-2025 the Eask authors.
4+
5+
# This program is free software; you can redistribute it and/or modify
6+
# it under the terms of the GNU General Public License as published by
7+
# the Free Software Foundation; either version 3, or (at your option)
8+
# any later version.
9+
10+
# This program is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
# GNU General Public License for more details.
14+
15+
# You should have received a copy of the GNU General Public License
16+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
18+
## Commentary:
19+
#
20+
# Test command/info errors
21+
#
22+
23+
set -e
24+
25+
source ./test/fixtures/home/scripts/testing.sh
26+
27+
echo "Testing info command... no files"
28+
should_error eask -g info
29+
# When run in the current directory this sees the eask file from the main project

test/commands/init/run.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (C) 2022-2025 the Eask authors.
4+
5+
# This program is free software; you can redistribute it and/or modify
6+
# it under the terms of the GNU General Public License as published by
7+
# the Free Software Foundation; either version 3, or (at your option)
8+
# any later version.
9+
10+
# This program is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
# GNU General Public License for more details.
14+
15+
# You should have received a copy of the GNU General Public License
16+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
18+
## Commentary:
19+
#
20+
# Test eask init errors
21+
#
22+
23+
set -e
24+
25+
source ./test/fixtures/home/scripts/testing.sh
26+
27+
cd $(dirname "$0")
28+
29+
echo "Testing init --from cask command... no files"
30+
should_error eask init --from cask
31+
32+
echo "Testing init --from keg command... no files"
33+
should_error eask init --from keg
34+
35+
echo "Testing init --from eldev command... no files"
36+
should_error eask init --from eldev
37+
38+
echo "Testing init --from source command... no files"
39+
should_error eask init --from source

0 commit comments

Comments
 (0)