Skip to content

Commit

Permalink
tests: remove legacy backticks
Browse files Browse the repository at this point in the history
Same as for cqfd, see https://www.shellcheck.net/wiki/SC2006 for rationale.
  • Loading branch information
joufellasfl committed Mar 12, 2023
1 parent bc09b02 commit 3e04f1d
Show file tree
Hide file tree
Showing 21 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion tests/00-setup
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

. `dirname $0`/jtest.inc "$1"
. "$(dirname $0)"/jtest.inc "$1"

jtest_prepare "create a test skeleton in temporary directory"

Expand Down
4 changes: 2 additions & 2 deletions tests/01-cqfd_init
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

. `dirname $0`/jtest.inc "$1"
. "$(dirname $0)"/jtest.inc "$1"

cd $TDIR/

Expand All @@ -18,7 +18,7 @@ fi
################################################################################
# 'cqfd init' with a nonexistent Dockerfile should fail
################################################################################
cqfdrc_old=`mktemp`
cqfdrc_old=$(mktemp)
jtest_prepare "init with a nonexisting dockerfile shall fail"
cp -f .cqfdrc $cqfdrc_old
sed -i -e "s/\[build\]/[build]\ndistro='thisshouldfail'/" .cqfdrc
Expand Down
2 changes: 1 addition & 1 deletion tests/03-cqfd_error
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

. `dirname $0`/jtest.inc "$1"
. "$(dirname $0)"/jtest.inc "$1"

################################################################################
# Running cqfd with an unknown argument shall fail
Expand Down
4 changes: 2 additions & 2 deletions tests/03-cqfd_help
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/usr/bin/env bash

. `dirname $0`/jtest.inc "$1"
. "$(dirname $0)"/jtest.inc "$1"

################################################################################
# 'cqfd help' shall be an accepted command
################################################################################
jtest_prepare "cqfd help shall exit normally"
TEST=`mktemp`
TEST=$(mktemp)

if ! $TDIR/.cqfd/cqfd help >$TEST; then
jtest_result fail
Expand Down
4 changes: 2 additions & 2 deletions tests/03-cqfd_version
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/usr/bin/env bash

. `dirname $0`/jtest.inc "$1"
. "$(dirname $0)"/jtest.inc "$1"

################################################################################
# 'cqfd version' shall be an accepted command
################################################################################
jtest_prepare "cqfd version shall exit normally"
TEST=`mktemp`
TEST=$(mktemp)

if ! $TDIR/.cqfd/cqfd version >$TEST; then
jtest_result fail
Expand Down
2 changes: 1 addition & 1 deletion tests/05-cqfd_init_alt_ext
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

. `dirname $0`/jtest.inc "$1"
. "$(dirname $0)"/jtest.inc "$1"
cd $TDIR/

################################################################################
Expand Down
4 changes: 2 additions & 2 deletions tests/05-cqfd_init_flavor
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

. `dirname $0`/jtest.inc "$1"
. "$(dirname $0)"/jtest.inc "$1"
cqfd="$TDIR/.cqfd/cqfd"
flavor="foo"

Expand All @@ -9,7 +9,7 @@ cd $TDIR/
################################################################################
# 'cqfd init' with different flavor makes a different container
################################################################################
cqfdrc_old=`mktemp`
cqfdrc_old=$(mktemp)
cp -f .cqfdrc $cqfdrc_old
sed -i -e "s/\[foo\]/[foo]\ndistro='centos'/" .cqfdrc

Expand Down
2 changes: 1 addition & 1 deletion tests/05-cqfd_run
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

. `dirname $0`/jtest.inc "$1"
. "$(dirname $0)"/jtest.inc "$1"
cqfd="$TDIR/.cqfd/cqfd"
test_file="a/cqfd_a.txt"

Expand Down
2 changes: 1 addition & 1 deletion tests/05-cqfd_run_c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

. `dirname $0`/jtest.inc "$1"
. "$(dirname $0)"/jtest.inc "$1"
cqfd="$TDIR/.cqfd/cqfd"
test_file="a/cqfd_a.txt"
test_run_c_file="test_run_c.txt"
Expand Down
2 changes: 1 addition & 1 deletion tests/05-cqfd_run_c_flavor
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

. `dirname $0`/jtest.inc "$1"
. "$(dirname $0)"/jtest.inc "$1"
cqfd="$TDIR/.cqfd/cqfd"
flavor="foo"
test_file=$flavor
Expand Down
2 changes: 1 addition & 1 deletion tests/05-cqfd_run_command
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

. `dirname $0`/jtest.inc "$1"
. "$(dirname $0)"/jtest.inc "$1"
cqfd="$TDIR/.cqfd/cqfd"
test_file="file.$RANDOM"

Expand Down
2 changes: 1 addition & 1 deletion tests/05-cqfd_run_config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

. `dirname $0`/jtest.inc "$1"
. "$(dirname $0)"/jtest.inc "$1"
cqfd="$TDIR/.cqfd/cqfd"
confdir=$TDIR/.config/dir
flavor="foo"
Expand Down
2 changes: 1 addition & 1 deletion tests/05-cqfd_run_extra_env
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

. `dirname $0`/jtest.inc "$1"
. "$(dirname $0)"/jtest.inc "$1"
cqfd="$TDIR/.cqfd/cqfd"

cd $TDIR/
Expand Down
2 changes: 1 addition & 1 deletion tests/05-cqfd_run_extra_groups
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

. `dirname $0`/jtest.inc "$1"
. "$(dirname $0)"/jtest.inc "$1"
cqfd="$TDIR/.cqfd/cqfd"

cd $TDIR/
Expand Down
2 changes: 1 addition & 1 deletion tests/05-cqfd_run_extra_hosts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

. `dirname $0`/jtest.inc "$1"
. "$(dirname $0)"/jtest.inc "$1"
cqfd="$TDIR/.cqfd/cqfd"
getent_cmd="getent hosts 1.2.3.4"

Expand Down
2 changes: 1 addition & 1 deletion tests/05-cqfd_run_flavor
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

. `dirname $0`/jtest.inc "$1"
. "$(dirname $0)"/jtest.inc "$1"
cqfd="$TDIR/.cqfd/cqfd"
flavor="foo"

Expand Down
2 changes: 1 addition & 1 deletion tests/05-cqfd_run_home_env_var
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

. `dirname $0`/jtest.inc "$1"
. "$(dirname $0)"/jtest.inc "$1"
cqfd="$TDIR/.cqfd/cqfd"

cd $TDIR/
Expand Down
2 changes: 1 addition & 1 deletion tests/05-cqfd_run_spaces_in_path
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

. `dirname $0`/jtest.inc "$1"
. "$(dirname $0)"/jtest.inc "$1"
cqfd="$TDIR/.cqfd/cqfd"

cd $TDIR/
Expand Down
2 changes: 1 addition & 1 deletion tests/05-cqfd_run_tty
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# This test ensures cqfd works when not invoked from a tty (this is the case
# when running from a CI system for example).

. `dirname $0`/jtest.inc "$1"
. "$(dirname $0)"/jtest.inc "$1"
cqfd="$TDIR/.cqfd/cqfd"

################################################################################
Expand Down
4 changes: 2 additions & 2 deletions tests/06-cqfd_release
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

. `dirname $0`/jtest.inc "$1"
. "$(dirname $0)"/jtest.inc "$1"
cqfd="$TDIR/.cqfd/cqfd"

cd $TDIR/
Expand Down Expand Up @@ -119,7 +119,7 @@ rm -rf "${tmp_dir}"
jtest_prepare "build.archive can template filenames"

export CTEST=foobar
d3=`date --rfc-3339='date'`
d3=$(date --rfc-3339='date')
echo 'archive=cqfd-%D3-$CTEST.tar.xz' >> .cqfdrc

# Generate the release archive
Expand Down
2 changes: 1 addition & 1 deletion tests/jtest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jtest_log()
;;
esac

echo -e "\e[${color}m[`date +%T`|$level] $@\e[0m"
echo -e "\e[${color}m[$(date +%T)|$level] $@\e[0m"
}

# jtest_prepare() - prepare next test
Expand Down

0 comments on commit 3e04f1d

Please sign in to comment.