[OS-BUILD PATCHv14 4/5] [redhat] self-test/0001-shellcheck.bats: check for shellcheck

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ben Crocker <bcrocker@xxxxxxxxxx>

Check via 'test -x' whether /usr/bin/shellcheck is present; if not,
skip the test and print a message.

Signed-off-by: Ben Crocker <bcrocker@xxxxxxxxxx>
---
 redhat/self-test/0001-shellcheck.bats | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/redhat/self-test/0001-shellcheck.bats b/redhat/self-test/0001-shellcheck.bats
index cac9e3ab7c29..2fb9afbc875b 100644
--- a/redhat/self-test/0001-shellcheck.bats
+++ b/redhat/self-test/0001-shellcheck.bats
@@ -1,4 +1,8 @@
 @test "shellcheck" {
-      run shellcheck $(find $BATS_TEST_DIRNAME/.. -name "*.sh")
-      [ "$status" = 0 ]
+    if ! test -x /usr/bin/shellcheck
+    then
+        skip "The ShellCheck package is not installed"
+    fi
+    run shellcheck $(find $BATS_TEST_DIRNAME/.. -name "*.sh")
+    [ "$status" = 0 ]
 }
-- 
GitLab
_______________________________________________
kernel mailing list -- kernel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/kernel@xxxxxxxxxxxxxxxxxxxxxxx




[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux