tools: tests: drop the .sh extension from the testing script's name
authorBartosz Golaszewski <bgolaszewski@baylibre.com>
Tue, 6 Aug 2019 16:06:26 +0000 (18:06 +0200)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Tue, 6 Aug 2019 16:09:24 +0000 (18:09 +0200)
This script requires bash, so .sh extension is not accurate. Also: it's
executable, so there's no need to indicate the interpreter in the
extension.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
tools/Makefile.am
tools/gpio-tools-test [new file with mode: 0755]
tools/gpio-tools-test.sh [deleted file]

index da2528373dfa7e88e49ca14d34bc61db88e67e90..897ff32bc0440180b7c7bbd43e29494065b1e6cd 100644 (file)
@@ -28,10 +28,10 @@ gpiomon_SOURCES = gpiomon.c
 
 gpiofind_SOURCES = gpiofind.c
 
-EXTRA_DIST = gpio-tools-test.bats gpio-tools-test.sh
+EXTRA_DIST = gpio-tools-test gpio-tools-test.bats
 
 if WITH_TESTS
 
-bin_SCRIPTS = gpio-tools-test.sh gpio-tools-test.bats
+bin_SCRIPTS = gpio-tools-test gpio-tools-test.bats
 
 endif
diff --git a/tools/gpio-tools-test b/tools/gpio-tools-test
new file mode 100755 (executable)
index 0000000..f12f9ec
--- /dev/null
@@ -0,0 +1,58 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+#
+# This file is part of libgpiod.
+#
+# Copyright (C) 2019 Bartosz Golaszewski <bgolaszewski@baylibre.com>
+#
+
+MIN_KERNEL_VERSION="5.1.0"
+BATS_SCRIPT="gpio-tools-test.bats"
+SOURCE_DIR="$(dirname ${BASH_SOURCE[0]})"
+
+die() {
+       echo "$@" 1>&2
+       exit 1
+}
+
+check_kernel() {
+       local REQUIRED=$1
+       local CURRENT=$(uname -r)
+
+       SORTED=$(printf "$REQUIRED\n$CURRENT" | sort -V | head -n 1)
+
+       if [ "$SORTED" != "$REQUIRED" ]
+       then
+               die "linux kernel version must be at least: v$REQUIRED - got: v$CURRENT"
+       fi
+}
+
+check_prog() {
+       local PROG=$1
+
+       which "$PROG" > /dev/null
+       if [ "$?" -ne "0" ]
+       then
+               die "$PROG not found - needed to run the tests"
+       fi
+}
+
+# Check all required non-coreutils tools
+check_prog bats
+check_prog modprobe
+check_prog rmmod
+check_prog udevadm
+
+# Check if we're running a kernel at the required version or later
+check_kernel $MIN_KERNEL_VERSION
+
+# The bats script must be in the same directory.
+if [ ! -e "$SOURCE_DIR/$BATS_SCRIPT" ]
+then
+       die "testing script not found"
+fi
+
+BATS_PATH=$(which bats)
+
+exec $BATS_PATH $SOURCE_DIR/$BATS_SCRIPT ${1+"$@"}
diff --git a/tools/gpio-tools-test.sh b/tools/gpio-tools-test.sh
deleted file mode 100755 (executable)
index f12f9ec..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/usr/bin/env bash
-# SPDX-License-Identifier: LGPL-2.1-or-later
-
-#
-# This file is part of libgpiod.
-#
-# Copyright (C) 2019 Bartosz Golaszewski <bgolaszewski@baylibre.com>
-#
-
-MIN_KERNEL_VERSION="5.1.0"
-BATS_SCRIPT="gpio-tools-test.bats"
-SOURCE_DIR="$(dirname ${BASH_SOURCE[0]})"
-
-die() {
-       echo "$@" 1>&2
-       exit 1
-}
-
-check_kernel() {
-       local REQUIRED=$1
-       local CURRENT=$(uname -r)
-
-       SORTED=$(printf "$REQUIRED\n$CURRENT" | sort -V | head -n 1)
-
-       if [ "$SORTED" != "$REQUIRED" ]
-       then
-               die "linux kernel version must be at least: v$REQUIRED - got: v$CURRENT"
-       fi
-}
-
-check_prog() {
-       local PROG=$1
-
-       which "$PROG" > /dev/null
-       if [ "$?" -ne "0" ]
-       then
-               die "$PROG not found - needed to run the tests"
-       fi
-}
-
-# Check all required non-coreutils tools
-check_prog bats
-check_prog modprobe
-check_prog rmmod
-check_prog udevadm
-
-# Check if we're running a kernel at the required version or later
-check_kernel $MIN_KERNEL_VERSION
-
-# The bats script must be in the same directory.
-if [ ! -e "$SOURCE_DIR/$BATS_SCRIPT" ]
-then
-       die "testing script not found"
-fi
-
-BATS_PATH=$(which bats)
-
-exec $BATS_PATH $SOURCE_DIR/$BATS_SCRIPT ${1+"$@"}