diff options
Diffstat (limited to '')
-rwxr-xr-x | .travis/bin/main.sh | 19 | ||||
-rwxr-xr-x | .travis/bin/mutual_friends.sh (renamed from .travis/test/mutual_friends.sh) | 10 | ||||
-rwxr-xr-x | .travis/bin/online_sessions.sh (renamed from .travis/test/online_sessions.sh) | 10 | ||||
-rwxr-xr-x | .travis/bin/show_status.sh (renamed from .travis/test/show_status.sh) | 8 | ||||
-rwxr-xr-x | .travis/bin/track_status.sh (renamed from .travis/test/track_status.sh) | 6 |
5 files changed, 44 insertions, 9 deletions
diff --git a/.travis/bin/main.sh b/.travis/bin/main.sh new file mode 100755 index 0000000..bfe2052 --- /dev/null +++ b/.travis/bin/main.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +# Copyright (c) 2019 Egor Tensin <Egor.Tensin@gmail.com> +# This file is part of the "VK scripts" project. +# For details, see https://github.com/egor-tensin/vk-scripts. +# Distributed under the MIT License. + +set -o errexit -o nounset -o pipefail + +script_dir="$( dirname -- "${BASH_SOURCE[0]}" )" +script_dir="$( cd -- "$script_dir" && pwd )" +readonly script_dir + +"$script_dir/mutual_friends.sh" + +"$script_dir/online_sessions.sh" + +"$script_dir/show_status.sh" +"$script_dir/track_status.sh" diff --git a/.travis/test/mutual_friends.sh b/.travis/bin/mutual_friends.sh index ebecf8e..4a00fb8 100755 --- a/.travis/test/mutual_friends.sh +++ b/.travis/bin/mutual_friends.sh @@ -7,13 +7,17 @@ set -o errexit -o nounset -o pipefail +script_dir="$( dirname -- "${BASH_SOURCE[0]}" )" +script_dir="$( cd -- "$script_dir" && pwd )" +readonly script_dir + test_users() { - ./.travis/test.sh bin.mutual_friends --format csv "$@" - ./.travis/test.sh bin.mutual_friends --format json "$@" + "$script_dir/../lib/test.sh" bin.mutual_friends --format csv "$@" + "$script_dir/../lib/test.sh" bin.mutual_friends --format json "$@" } main() { test_users kreed58 maxkorzh_official } -main "$@" +main diff --git a/.travis/test/online_sessions.sh b/.travis/bin/online_sessions.sh index 7d26630..2534735 100755 --- a/.travis/test/online_sessions.sh +++ b/.travis/bin/online_sessions.sh @@ -7,7 +7,11 @@ set -o errexit -o nounset -o pipefail -readonly db_path='.travis/test_db.csv' +script_dir="$( dirname -- "${BASH_SOURCE[0]}" )" +script_dir="$( cd -- "$script_dir" && pwd )" +readonly script_dir + +readonly db_path="$script_dir/../share/test_db.csv" try_output() { local output_path @@ -18,7 +22,7 @@ try_output() { trap "$rm_aux_files" RETURN - ./.travis/test.sh bin.online_sessions "$@" "$db_path" "$output_path" + "$script_dir/../lib/test.sh" bin.online_sessions "$@" "$db_path" "$output_path" if file --brief --dereference --mime -- "$output_path" | grep --quiet -- 'charset=binary$'; then echo 'Output is a binary file, not going to show that' @@ -51,4 +55,4 @@ main() { online_sessions } -main "$@" +main diff --git a/.travis/test/show_status.sh b/.travis/bin/show_status.sh index ff0ce47..c9f8e26 100755 --- a/.travis/test/show_status.sh +++ b/.travis/bin/show_status.sh @@ -7,12 +7,16 @@ set -o errexit -o nounset -o pipefail +script_dir="$( dirname -- "${BASH_SOURCE[0]}" )" +script_dir="$( cd -- "$script_dir" && pwd )" +readonly script_dir + test_users() { - ./.travis/test.sh bin.show_status "$@" + "$script_dir/../lib/test.sh" bin.show_status "$@" } main() { test_users egor.tensin } -main "$@" +main diff --git a/.travis/test/track_status.sh b/.travis/bin/track_status.sh index 2b3e001..9aedb6b 100755 --- a/.travis/test/track_status.sh +++ b/.travis/bin/track_status.sh @@ -7,6 +7,10 @@ set -o errexit -o nounset -o pipefail +script_dir="$( dirname -- "${BASH_SOURCE[0]}" )" +script_dir="$( cd -- "$script_dir" && pwd )" +readonly script_dir + test_users() { local log_path log_path="$( mktemp )" @@ -17,7 +21,7 @@ test_users() { rm_aux_files="$( printf -- 'rm -f -- %q %q' "$log_path" "$db_path" )" trap "$rm_aux_files" RETURN - ./.travis/test.sh bin.track_status "$@" --log "$log_path" --format csv --output "$db_path" & + "$script_dir/../lib/test.sh" bin.track_status "$@" --log "$log_path" --format csv --output "$db_path" & local pid="$!" sleep 3 |