diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2023-02-04 12:31:31 +0100 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2023-02-04 12:31:31 +0100 |
commit | c1f4b790c458f0de368f32487a007d571858207c (patch) | |
tree | 45d7293ea14d0b4249e2e286327b4d8490ff563e /test/unit | |
parent | debian/README: update (diff) | |
parent | t/i: call links-update twice, just in case (diff) | |
download | config-links-c1f4b790c458f0de368f32487a007d571858207c.tar.gz config-links-c1f4b790c458f0de368f32487a007d571858207c.zip |
Merge tag 'v2.0.3' into debian
Diffstat (limited to '')
-rw-r--r-- | test/unit/dest/1.txt (renamed from test/dest/1.txt) | 0 | ||||
-rw-r--r-- | test/unit/dest/bar/3.txt (renamed from test/dest/bar/3.txt) | 0 | ||||
-rw-r--r-- | test/unit/src/%DEST%/1.txt (renamed from test/src/%DEST%/1.txt) | 0 | ||||
-rw-r--r-- | test/unit/src/%DEST%/bar/3.txt (renamed from test/src/%DEST%/bar/3.txt) | 0 | ||||
-rw-r--r-- | test/unit/src/%DEST%/bar/baz/4.txt (renamed from test/src/%DEST%/bar/baz/4.txt) | 0 | ||||
-rw-r--r-- | test/unit/src/%DEST%/foo/2.txt (renamed from test/src/%DEST%/foo/2.txt) | 0 | ||||
-rwxr-xr-x | test/unit/test.sh (renamed from test/test.sh) | 23 |
7 files changed, 19 insertions, 4 deletions
diff --git a/test/dest/1.txt b/test/unit/dest/1.txt index 3a2e3f4..3a2e3f4 100644 --- a/test/dest/1.txt +++ b/test/unit/dest/1.txt diff --git a/test/dest/bar/3.txt b/test/unit/dest/bar/3.txt index a83d1d5..a83d1d5 100644 --- a/test/dest/bar/3.txt +++ b/test/unit/dest/bar/3.txt diff --git a/test/src/%DEST%/1.txt b/test/unit/src/%DEST%/1.txt index d00491f..d00491f 100644 --- a/test/src/%DEST%/1.txt +++ b/test/unit/src/%DEST%/1.txt diff --git a/test/src/%DEST%/bar/3.txt b/test/unit/src/%DEST%/bar/3.txt index 00750ed..00750ed 100644 --- a/test/src/%DEST%/bar/3.txt +++ b/test/unit/src/%DEST%/bar/3.txt diff --git a/test/src/%DEST%/bar/baz/4.txt b/test/unit/src/%DEST%/bar/baz/4.txt index b8626c4..b8626c4 100644 --- a/test/src/%DEST%/bar/baz/4.txt +++ b/test/unit/src/%DEST%/bar/baz/4.txt diff --git a/test/src/%DEST%/foo/2.txt b/test/unit/src/%DEST%/foo/2.txt index 0cfbf08..0cfbf08 100644 --- a/test/src/%DEST%/foo/2.txt +++ b/test/unit/src/%DEST%/foo/2.txt diff --git a/test/test.sh b/test/unit/test.sh index 05c5d65..f693aa1 100755 --- a/test/test.sh +++ b/test/unit/test.sh @@ -1,7 +1,8 @@ #!/usr/bin/env bash set -o errexit -o nounset -o pipefail -shopt -s inherit_errexit lastpipe +shopt -s inherit_errexit 2> /dev/null || true +shopt -s lastpipe script_dir="$( dirname -- "${BASH_SOURCE[0]}" )" script_dir="$( cd -- "$script_dir" && pwd )" @@ -9,6 +10,9 @@ readonly script_dir script_name="$( basename -- "${BASH_SOURCE[0]}" )" readonly script_name +root_dir="$( git -C "$script_dir" rev-parse --show-toplevel )" +readonly root_dir + readonly src_dir_name='src' readonly dest_dir_name='dest' readonly alt_dest_dir_name='alt_dest' @@ -62,15 +66,15 @@ call_bin_script() { } call_update() { - call_bin_script "$script_dir/../links-update" "$@" + call_bin_script "$root_dir/links-update" "$@" } call_remove() { - call_bin_script "$script_dir/../links-remove" + call_bin_script "$root_dir/links-remove" } call_chmod() { - call_bin_script "$script_dir/../links-chmod" "$@" + call_bin_script "$root_dir/links-chmod" "$@" } verify_output() { @@ -413,7 +417,18 @@ $test_dest_dir/foo/2.txt->$test_src_dir/%DEST%/foo/2.txt" verify_mode "$expected_mode" "$test_src_dir/%DEST%/1.txt" } +show_env() { + echo + echo ====================================================================== + echo Environment + echo ====================================================================== + + bash --version +} + main() { + show_env + test_update_works test_remove_works test_remove_does_not_overwrite_files |