diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-02 16:23:49 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-02 16:31:22 +1200 |
commit | d1c2c6339342083ceee1b96485dfc65893e68dca (patch) | |
tree | f416ef11c71c20ccc6e2eb3800b9f3a0a17d00ab /test | |
parent | Get rid of a lot of comment boilerplate (diff) | |
download | dotfiles-d1c2c6339342083ceee1b96485dfc65893e68dca.tar.gz dotfiles-d1c2c6339342083ceee1b96485dfc65893e68dca.zip |
Move tests and lints into their own scripts
Much nicer than having them embedded in the Makefile. Might do this for
some of the more complex install targets too. Or maybe all of them ...
Diffstat (limited to 'test')
-rwxr-xr-x | test/bash | 7 | ||||
-rwxr-xr-x | test/bin | 9 | ||||
-rwxr-xr-x | test/games | 9 | ||||
-rwxr-xr-x | test/sh | 7 | ||||
-rwxr-xr-x | test/urxvt | 5 |
5 files changed, 37 insertions, 0 deletions
diff --git a/test/bash b/test/bash new file mode 100755 index 00000000..6f52d522 --- /dev/null +++ b/test/bash @@ -0,0 +1,7 @@ +#!/bin/sh +for bash in bash/* bash/bashrc.d/* bash/bash_profile.d/* ; do + if [ -f "$bash" ] && ! bash -n "$bash" ; then + exit 1 + fi +done +printf 'All bash(1) scripts parsed successfully.\n' diff --git a/test/bin b/test/bin new file mode 100755 index 00000000..c514495a --- /dev/null +++ b/test/bin @@ -0,0 +1,9 @@ +#!/bin/sh +for bin in bin/* ; do + if sed 1q "$bin" | grep -q 'bash$' ; then + bash -n "$bin" || exit 1 + elif sed 1q "$bin" | grep -q 'sh$' ; then + sh -n "$bin" || exit 1 + fi +done +printf 'All shell scripts in bin parsed successfully.\n' diff --git a/test/games b/test/games new file mode 100755 index 00000000..f75de7a5 --- /dev/null +++ b/test/games @@ -0,0 +1,9 @@ +#!/bin/sh +for game in games/* ; do + if sed 1q "$game" | grep -q 'bash$' ; then + bash -n "$game" || exit 1 + elif sed 1q "$game" | grep -q 'sh$' ; then + sh -n "$game" || exit 1 + fi +done +printf 'All shell scripts in games parsed successfully.\n' diff --git a/test/sh b/test/sh new file mode 100755 index 00000000..354a40c7 --- /dev/null +++ b/test/sh @@ -0,0 +1,7 @@ +#!/bin/sh +for sh in sh/* sh/profile.d/* ; do + if [ -f "$sh" ] && ! sh -n "$sh" ; then + exit 1 + fi +done +printf 'All sh(1) scripts parsed successfully.\n' diff --git a/test/urxvt b/test/urxvt new file mode 100755 index 00000000..90a298d7 --- /dev/null +++ b/test/urxvt @@ -0,0 +1,5 @@ +#!/bin/sh +for perl in urxvt/ext/* ; do + perl -c "$perl" >/dev/null || exit 1 +done +printf 'All Perl scripts in urxvt/ext parsed successfully.\n' |