Results 1 to 4 of 4
Is there any way to validate the coverage of the shell scripts ? i have project having lot's of shell scripting, i need to ensure static Analysis can be performed ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 08-25-2011 #1Just Joined!
- Join Date
- May 2011
- Posts
- 4
code coverage tools for validating the scripts
Is there any way to validate the coverage of the shell scripts ? i have project having lot's of shell scripting, i need to ensure static Analysis can be performed on the coverage for the shell scripts, is there any tool available ?
- 08-25-2011 #2Trusted Penguin
- Join Date
- May 2011
- Posts
- 3,746
I'm not sure what you mean by "static Analysis", but if you want to check that the syntax of the shell scripts (and they are bash/sh) are okay, you can use Bash's built-in feature:
If the syntax is okay, a '0' will be printed. If there is something wrong with the syntax, then errors will no doubt be spewed to the terminal, and a non-zero exit status will be printed.Code:bash -n script.sh;echo $?
- 08-25-2011 #3You must always face the curtain with a bow.
- 08-26-2011 #4Linux Engineer
- Join Date
- Apr 2006
- Location
- Saint Paul, MN, USA / CentOS, Debian, Solaris, SuSE
- Posts
- 1,202
Hi.
A work in progress:
https://github.com/feuerbach/loker
and possibly not quite what you want:
checkbashisms
cheers, drlWelcome - get the most out of the forum by reading forum basics and guidelines: click here.
90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
We look forward to helping you with the challenge of the other 10%.
( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )


1Likes
Reply With Quote
