diff --git a/tests/unit/custom_assertions_test.sh b/tests/unit/api/custom_assertions_test.sh similarity index 100% rename from tests/unit/custom_assertions_test.sh rename to tests/unit/api/custom_assertions_test.sh diff --git a/tests/unit/globals_test.sh b/tests/unit/api/globals_test.sh similarity index 97% rename from tests/unit/globals_test.sh rename to tests/unit/api/globals_test.sh index fcb39646..4e648226 100644 --- a/tests/unit/globals_test.sh +++ b/tests/unit/api/globals_test.sh @@ -23,7 +23,7 @@ function tear_down() { } function test_globals_current_dir() { - assert_same "tests/unit" "$(bashunit::current_dir)" + assert_same "tests/unit/api" "$(bashunit::current_dir)" } function test_globals_current_filename() { @@ -38,7 +38,7 @@ function globals_test::call_caller_filename() { } function test_globals_caller_filename() { - assert_same "tests/unit" "$(globals_test::call_caller_filename)" + assert_same "tests/unit/api" "$(globals_test::call_caller_filename)" } function test_globals_caller_line() { diff --git a/tests/unit/skip_todo_test.sh b/tests/unit/api/skip_todo_test.sh similarity index 100% rename from tests/unit/skip_todo_test.sh rename to tests/unit/api/skip_todo_test.sh diff --git a/tests/unit/test_title_test.sh b/tests/unit/api/test_title_test.sh similarity index 100% rename from tests/unit/test_title_test.sh rename to tests/unit/api/test_title_test.sh diff --git a/tests/unit/assert_advanced_test.sh b/tests/unit/assert/advanced_test.sh similarity index 100% rename from tests/unit/assert_advanced_test.sh rename to tests/unit/assert/advanced_test.sh diff --git a/tests/unit/assert_assertions_test.sh b/tests/unit/assert/assertions_test.sh similarity index 100% rename from tests/unit/assert_assertions_test.sh rename to tests/unit/assert/assertions_test.sh diff --git a/tests/unit/assert_basic_test.sh b/tests/unit/assert/basic_test.sh similarity index 100% rename from tests/unit/assert_basic_test.sh rename to tests/unit/assert/basic_test.sh diff --git a/tests/unit/assert_dates_test.sh b/tests/unit/assert/dates_test.sh similarity index 100% rename from tests/unit/assert_dates_test.sh rename to tests/unit/assert/dates_test.sh diff --git a/tests/unit/assert_duration_test.sh b/tests/unit/assert/duration_test.sh similarity index 100% rename from tests/unit/assert_duration_test.sh rename to tests/unit/assert/duration_test.sh diff --git a/tests/unit/file_test.sh b/tests/unit/assert/files_test.sh similarity index 100% rename from tests/unit/file_test.sh rename to tests/unit/assert/files_test.sh diff --git a/tests/unit/directory_test.sh b/tests/unit/assert/folders_test.sh similarity index 100% rename from tests/unit/directory_test.sh rename to tests/unit/assert/folders_test.sh diff --git a/tests/unit/assert_json_test.sh b/tests/unit/assert/json_test.sh similarity index 100% rename from tests/unit/assert_json_test.sh rename to tests/unit/assert/json_test.sh diff --git a/tests/unit/assert_numeric_test.sh b/tests/unit/assert/numeric_test.sh similarity index 100% rename from tests/unit/assert_numeric_test.sh rename to tests/unit/assert/numeric_test.sh diff --git a/tests/unit/assert_once_test.sh b/tests/unit/assert/once_test.sh similarity index 100% rename from tests/unit/assert_once_test.sh rename to tests/unit/assert/once_test.sh diff --git a/tests/unit/assert_snapshot_test.sh b/tests/unit/assert/snapshot_test.sh similarity index 100% rename from tests/unit/assert_snapshot_test.sh rename to tests/unit/assert/snapshot_test.sh diff --git a/tests/unit/snapshots/assert_snapshot_test_sh.test_successful_assert_match_snapshot.snapshot b/tests/unit/assert/snapshots/snapshot_test_sh.test_successful_assert_match_snapshot.snapshot similarity index 100% rename from tests/unit/snapshots/assert_snapshot_test_sh.test_successful_assert_match_snapshot.snapshot rename to tests/unit/assert/snapshots/snapshot_test_sh.test_successful_assert_match_snapshot.snapshot diff --git a/tests/unit/snapshots/assert_snapshot_test_sh.test_successful_assert_match_snapshot_ignore_colors.snapshot b/tests/unit/assert/snapshots/snapshot_test_sh.test_successful_assert_match_snapshot_ignore_colors.snapshot similarity index 100% rename from tests/unit/snapshots/assert_snapshot_test_sh.test_successful_assert_match_snapshot_ignore_colors.snapshot rename to tests/unit/assert/snapshots/snapshot_test_sh.test_successful_assert_match_snapshot_ignore_colors.snapshot diff --git a/tests/unit/snapshots/assert_snapshot_test_sh.test_unsuccessful_assert_match_snapshot.snapshot b/tests/unit/assert/snapshots/snapshot_test_sh.test_unsuccessful_assert_match_snapshot.snapshot similarity index 100% rename from tests/unit/snapshots/assert_snapshot_test_sh.test_unsuccessful_assert_match_snapshot.snapshot rename to tests/unit/assert/snapshots/snapshot_test_sh.test_unsuccessful_assert_match_snapshot.snapshot diff --git a/tests/unit/snapshots/assert_snapshot_test_sh.test_unsuccessful_assert_match_snapshot_ignore_colors.snapshot b/tests/unit/assert/snapshots/snapshot_test_sh.test_unsuccessful_assert_match_snapshot_ignore_colors.snapshot similarity index 100% rename from tests/unit/snapshots/assert_snapshot_test_sh.test_unsuccessful_assert_match_snapshot_ignore_colors.snapshot rename to tests/unit/assert/snapshots/snapshot_test_sh.test_unsuccessful_assert_match_snapshot_ignore_colors.snapshot diff --git a/tests/unit/assert_string_test.sh b/tests/unit/assert/string_test.sh similarity index 100% rename from tests/unit/assert_string_test.sh rename to tests/unit/assert/string_test.sh diff --git a/tests/unit/benchmark_test.sh b/tests/unit/benchmark/benchmark_test.sh similarity index 100% rename from tests/unit/benchmark_test.sh rename to tests/unit/benchmark/benchmark_test.sh diff --git a/tests/unit/doc_test.sh b/tests/unit/cli/doc_test.sh similarity index 100% rename from tests/unit/doc_test.sh rename to tests/unit/cli/doc_test.sh diff --git a/tests/unit/upgrade_test.sh b/tests/unit/cli/upgrade_test.sh similarity index 100% rename from tests/unit/upgrade_test.sh rename to tests/unit/cli/upgrade_test.sh diff --git a/tests/unit/watch_checksum_test.sh b/tests/unit/cli/watch_checksum_test.sh similarity index 100% rename from tests/unit/watch_checksum_test.sh rename to tests/unit/cli/watch_checksum_test.sh diff --git a/tests/unit/watch_polling_test.sh b/tests/unit/cli/watch_polling_test.sh similarity index 100% rename from tests/unit/watch_polling_test.sh rename to tests/unit/cli/watch_polling_test.sh diff --git a/tests/unit/watch_test.sh b/tests/unit/cli/watch_test.sh similarity index 100% rename from tests/unit/watch_test.sh rename to tests/unit/cli/watch_test.sh diff --git a/tests/unit/env_deprecated_aliases_test.sh b/tests/unit/config/env_deprecated_aliases_test.sh similarity index 100% rename from tests/unit/env_deprecated_aliases_test.sh rename to tests/unit/config/env_deprecated_aliases_test.sh diff --git a/tests/unit/env_test.sh b/tests/unit/config/env_test.sh similarity index 100% rename from tests/unit/env_test.sh rename to tests/unit/config/env_test.sh diff --git a/tests/unit/parallel_test.sh b/tests/unit/config/parallel_test.sh similarity index 100% rename from tests/unit/parallel_test.sh rename to tests/unit/config/parallel_test.sh diff --git a/tests/unit/rerun_test.sh b/tests/unit/config/rerun_test.sh similarity index 100% rename from tests/unit/rerun_test.sh rename to tests/unit/config/rerun_test.sh diff --git a/tests/unit/colors_test.sh b/tests/unit/console/colors_test.sh similarity index 100% rename from tests/unit/colors_test.sh rename to tests/unit/console/colors_test.sh diff --git a/tests/unit/console_header_test.sh b/tests/unit/console/header_test.sh similarity index 100% rename from tests/unit/console_header_test.sh rename to tests/unit/console/header_test.sh diff --git a/tests/unit/console_results_diff_test.sh b/tests/unit/console/results_diff_test.sh similarity index 100% rename from tests/unit/console_results_diff_test.sh rename to tests/unit/console/results_diff_test.sh diff --git a/tests/unit/console_results_test.sh b/tests/unit/console/results_test.sh similarity index 100% rename from tests/unit/console_results_test.sh rename to tests/unit/console/results_test.sh diff --git a/tests/unit/coverage_branches_test.sh b/tests/unit/coverage/branches_test.sh similarity index 100% rename from tests/unit/coverage_branches_test.sh rename to tests/unit/coverage/branches_test.sh diff --git a/tests/unit/coverage_core_test.sh b/tests/unit/coverage/core_test.sh similarity index 100% rename from tests/unit/coverage_core_test.sh rename to tests/unit/coverage/core_test.sh diff --git a/tests/unit/coverage_engine_test.sh b/tests/unit/coverage/engine_test.sh similarity index 100% rename from tests/unit/coverage_engine_test.sh rename to tests/unit/coverage/engine_test.sh diff --git a/tests/unit/coverage_executable_test.sh b/tests/unit/coverage/executable_test.sh similarity index 100% rename from tests/unit/coverage_executable_test.sh rename to tests/unit/coverage/executable_test.sh diff --git a/tests/unit/coverage_helpers_test.sh b/tests/unit/coverage/helpers_test.sh similarity index 100% rename from tests/unit/coverage_helpers_test.sh rename to tests/unit/coverage/helpers_test.sh diff --git a/tests/unit/coverage_parallel_aggregation_test.sh b/tests/unit/coverage/parallel_aggregation_test.sh similarity index 100% rename from tests/unit/coverage_parallel_aggregation_test.sh rename to tests/unit/coverage/parallel_aggregation_test.sh diff --git a/tests/unit/coverage_percent_test.sh b/tests/unit/coverage/percent_test.sh similarity index 100% rename from tests/unit/coverage_percent_test.sh rename to tests/unit/coverage/percent_test.sh diff --git a/tests/unit/coverage_reporting_test.sh b/tests/unit/coverage/reporting_test.sh similarity index 100% rename from tests/unit/coverage_reporting_test.sh rename to tests/unit/coverage/reporting_test.sh diff --git a/tests/unit/coverage_subshell_test.sh b/tests/unit/coverage/subshell_test.sh similarity index 100% rename from tests/unit/coverage_subshell_test.sh rename to tests/unit/coverage/subshell_test.sh diff --git a/tests/unit/test_doubles_test.sh b/tests/unit/doubles/test_doubles_test.sh similarity index 97% rename from tests/unit/test_doubles_test.sh rename to tests/unit/doubles/test_doubles_test.sh index 3420cc4e..667164c6 100644 --- a/tests/unit/test_doubles_test.sh +++ b/tests/unit/doubles/test_doubles_test.sh @@ -71,7 +71,7 @@ function test_unsuccessful_spy_called_times() { function test_successful_spy_with_source_function() { # shellcheck source=/dev/null - source "$(bashunit::current_dir)/fixtures/fake_function_to_spy.sh" + source "$(bashunit::current_dir)/../fixtures/fake_function_to_spy.sh" bashunit::spy function_to_be_spied_on function_to_be_spied_on @@ -81,7 +81,7 @@ function test_successful_spy_with_source_function() { function test_unsuccessful_spy_with_source_function_have_been_called() { # shellcheck source=/dev/null - source "$(bashunit::current_dir)/fixtures/fake_function_to_spy.sh" + source "$(bashunit::current_dir)/../fixtures/fake_function_to_spy.sh" bashunit::spy function_to_be_spied_on function_to_be_spied_on @@ -99,7 +99,7 @@ function test_unsuccessful_spy_with_source_function_have_been_called() { function test_successful_spy_called_times_with_source() { # shellcheck source=/dev/null - source "$(bashunit::current_dir)/fixtures/fake_function_to_spy.sh" + source "$(bashunit::current_dir)/../fixtures/fake_function_to_spy.sh" bashunit::spy function_to_be_spied_on function_to_be_spied_on diff --git a/tests/unit/helpers_test.sh b/tests/unit/helper/helper_test.sh similarity index 93% rename from tests/unit/helpers_test.sh rename to tests/unit/helper/helper_test.sh index a1ae3f4a..91370a81 100644 --- a/tests/unit/helpers_test.sh +++ b/tests/unit/helper/helper_test.sh @@ -125,28 +125,28 @@ function test_successful_unset_if_exists() { function test_check_duplicate_functions_with_duplicates() { local file - file="$(bashunit::current_dir)/fixtures/duplicate_functions.sh" + file="$(bashunit::current_dir)/../fixtures/duplicate_functions.sh" assert_general_error "$(bashunit::helper::check_duplicate_functions "$file")" } function test_check_duplicate_functions_without_duplicates() { local file - file="$(bashunit::current_dir)/fixtures/no_duplicate_functions.sh" + file="$(bashunit::current_dir)/../fixtures/no_duplicate_functions.sh" assert_successful_code "$(bashunit::helper::check_duplicate_functions "$file")" } function test_check_duplicate_functions_without_function_keyword() { local file - file="$(bashunit::current_dir)/fixtures/no_function_keyword_duplicates.sh" + file="$(bashunit::current_dir)/../fixtures/no_function_keyword_duplicates.sh" assert_general_error "$(bashunit::helper::check_duplicate_functions "$file")" } function test_check_duplicate_functions_reports_each_duplicate_name_sorted() { local file names - file="$(bashunit::current_dir)/fixtures/multiple_duplicate_functions.sh" + file="$(bashunit::current_dir)/../fixtures/multiple_duplicate_functions.sh" # Isolate the state mutation in a subshell; report the stored duplicate names. names=$( @@ -255,7 +255,7 @@ function test_get_provider_data_should_returns_empty_when_not_exists_provider_fu "$(bashunit::helper::get_provider_data "fake_function_get_not_existing_provider_data" "${BASH_SOURCE[0]}")" } -FIXTURE_PROVIDER_MAP="$(dirname "${BASH_SOURCE[0]}")/fixtures/provider_map/sample_providers.sh" +FIXTURE_PROVIDER_MAP="$(dirname "${BASH_SOURCE[0]}")/../fixtures/provider_map/sample_providers.sh" function provider_for() { bashunit::helper::build_provider_map "$1" @@ -324,7 +324,7 @@ function test_build_provider_map_no_parallel_marker_defaults_false() { function test_find_files_recursive_given_file() { local path - path="$(bashunit::current_dir)/fixtures/tests/example1_test.sh" + path="tests/unit/fixtures/tests/example1_test.sh" local result result=$(bashunit::helper::find_files_recursive "$path") @@ -334,7 +334,7 @@ function test_find_files_recursive_given_file() { function test_find_files_recursive_given_dir() { local path - path="$(bashunit::current_dir)/fixtures/tests" + path="tests/unit/fixtures/tests" local result result=$(bashunit::helper::find_files_recursive "$path") @@ -347,7 +347,7 @@ tests/unit/fixtures/tests/example3_test.bash" \ function test_find_files_recursive_given_wildcard() { local path - path="$(bashunit::current_dir)/fixtures/tests/*2_test.sh" + path="tests/unit/fixtures/tests/*2_test.sh" local result result=$(bashunit::helper::find_files_recursive "$path") @@ -357,7 +357,7 @@ function test_find_files_recursive_given_wildcard() { function test_find_files_recursive_given_bash_extension() { local path - path="$(bashunit::current_dir)/fixtures/tests/*3_test.bash" + path="tests/unit/fixtures/tests/*3_test.bash" local result result=$(bashunit::helper::find_files_recursive "$path") @@ -465,21 +465,21 @@ function test_find_total_tests_no_files() { function test_find_total_tests_simple_file() { local file - file="$(bashunit::current_dir)/fixtures/find_total_tests/simple_fixture.sh" + file="$(bashunit::current_dir)/../fixtures/find_total_tests/simple_fixture.sh" assert_same "2" "$(helpers_test::find_total_in_subshell "" "$file")" } function test_find_total_tests_simple_file_bash() { local file - file="$(bashunit::current_dir)/fixtures/find_total_tests/simple_fixture.bash" + file="$(bashunit::current_dir)/../fixtures/find_total_tests/simple_fixture.bash" assert_same "2" "$(helpers_test::find_total_in_subshell "" "$file")" } function test_find_total_tests_with_provider() { local file - file="$(bashunit::current_dir)/fixtures/find_total_tests/provider_fixture.sh" + file="$(bashunit::current_dir)/../fixtures/find_total_tests/provider_fixture.sh" assert_same "3" "$(helpers_test::find_total_in_subshell "" "$file")" } @@ -487,8 +487,8 @@ function test_find_total_tests_with_provider() { function test_find_total_tests_multiple_files() { local file1 local file2 - file1="$(bashunit::current_dir)/fixtures/find_total_tests/simple_fixture.sh" - file2="$(bashunit::current_dir)/fixtures/find_total_tests/provider_fixture.sh" + file1="$(bashunit::current_dir)/../fixtures/find_total_tests/simple_fixture.sh" + file2="$(bashunit::current_dir)/../fixtures/find_total_tests/provider_fixture.sh" assert_same "5" "$(helpers_test::find_total_in_subshell "" "$file1" "$file2")" } @@ -496,8 +496,8 @@ function test_find_total_tests_multiple_files() { function test_find_total_tests_with_filter() { local file1 local file2 - file1="$(bashunit::current_dir)/fixtures/find_total_tests/simple_fixture.sh" - file2="$(bashunit::current_dir)/fixtures/find_total_tests/provider_fixture.sh" + file1="$(bashunit::current_dir)/../fixtures/find_total_tests/simple_fixture.sh" + file2="$(bashunit::current_dir)/../fixtures/find_total_tests/provider_fixture.sh" assert_same "3" "$(helpers_test::find_total_in_subshell "with_provider" "$file1" "$file2")" } @@ -574,28 +574,28 @@ function test_parse_file_path_filter_with_colon_in_path() { function test_find_function_at_line_first_function() { local file - file="$(bashunit::current_dir)/fixtures/find_total_tests/simple_fixture.sh" + file="$(bashunit::current_dir)/../fixtures/find_total_tests/simple_fixture.sh" assert_same "test_first" "$(bashunit::helper::find_function_at_line "$file" 4)" } function test_find_function_at_line_second_function() { local file - file="$(bashunit::current_dir)/fixtures/find_total_tests/simple_fixture.sh" + file="$(bashunit::current_dir)/../fixtures/find_total_tests/simple_fixture.sh" assert_same "test_second" "$(bashunit::helper::find_function_at_line "$file" 8)" } function test_find_function_at_line_exact_function_line() { local file - file="$(bashunit::current_dir)/fixtures/find_total_tests/simple_fixture.sh" + file="$(bashunit::current_dir)/../fixtures/find_total_tests/simple_fixture.sh" assert_same "test_first" "$(bashunit::helper::find_function_at_line "$file" 3)" } function test_find_function_at_line_before_any_function() { local file - file="$(bashunit::current_dir)/fixtures/find_total_tests/simple_fixture.sh" + file="$(bashunit::current_dir)/../fixtures/find_total_tests/simple_fixture.sh" assert_same "" "$(bashunit::helper::find_function_at_line "$file" 1)" } diff --git a/tests/unit/helpers_tag_test.sh b/tests/unit/helper/tag_test.sh similarity index 100% rename from tests/unit/helpers_tag_test.sh rename to tests/unit/helper/tag_test.sh diff --git a/tests/unit/helpers_tags_map_test.sh b/tests/unit/helper/tags_map_test.sh similarity index 90% rename from tests/unit/helpers_tags_map_test.sh rename to tests/unit/helper/tags_map_test.sh index d05a1caa..f6fa1bd6 100644 --- a/tests/unit/helpers_tags_map_test.sh +++ b/tests/unit/helper/tags_map_test.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash # shellcheck disable=SC2317 -FIXTURE_TAGS_MAP="$(dirname "${BASH_SOURCE[0]}")/fixtures/tags_map/sample_tags.sh" -FIXTURE_TAGS_MAP_OTHER="$(dirname "${BASH_SOURCE[0]}")/fixtures/tags_map/sample_tags_other.sh" +FIXTURE_TAGS_MAP="$(dirname "${BASH_SOURCE[0]}")/../fixtures/tags_map/sample_tags.sh" +FIXTURE_TAGS_MAP_OTHER="$(dirname "${BASH_SOURCE[0]}")/../fixtures/tags_map/sample_tags_other.sh" function tags_for() { bashunit::helper::build_tags_map "$1" diff --git a/tests/unit/learn_test.sh b/tests/unit/learn/learn_test.sh similarity index 98% rename from tests/unit/learn_test.sh rename to tests/unit/learn/learn_test.sh index b8f6df25..b7a9e846 100644 --- a/tests/unit/learn_test.sh +++ b/tests/unit/learn/learn_test.sh @@ -13,7 +13,7 @@ function _learn_in_sandbox() { sandbox="$(bashunit::temp_dir)" # Resolve the repo root from this test file, not $BASHUNIT_ROOT_DIR: under # `build.sh --verify` the running binary's root dir has no src/ (#834). - root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" + root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)" # stdin is /dev/null so the `read -p "Press Enter to continue..."` prompts in # the interactive paths hit EOF and return instead of blocking the suite. # BASHUNIT_ROOT_DIR is set INSIDE the child (run_lesson_test shells out to the diff --git a/tests/unit/completions_test.sh b/tests/unit/main/completions_test.sh similarity index 100% rename from tests/unit/completions_test.sh rename to tests/unit/main/completions_test.sh diff --git a/tests/unit/main_test.sh b/tests/unit/main/main_test.sh similarity index 100% rename from tests/unit/main_test.sh rename to tests/unit/main/main_test.sh diff --git a/tests/unit/bash_compatibility_test.sh b/tests/unit/project/bash_compatibility_test.sh similarity index 100% rename from tests/unit/bash_compatibility_test.sh rename to tests/unit/project/bash_compatibility_test.sh diff --git a/tests/unit/bash_version_test.sh b/tests/unit/project/bash_version_test.sh similarity index 100% rename from tests/unit/bash_version_test.sh rename to tests/unit/project/bash_version_test.sh diff --git a/tests/unit/build_test.sh b/tests/unit/project/build_test.sh similarity index 99% rename from tests/unit/build_test.sh rename to tests/unit/project/build_test.sh index d2cb8996..61a3fabb 100644 --- a/tests/unit/build_test.sh +++ b/tests/unit/project/build_test.sh @@ -3,7 +3,7 @@ ROOT_DIR="" function set_up_before_script() { - ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" + ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)" } function src_files_sourced_by_entrypoint() { diff --git a/tests/unit/package_json_test.sh b/tests/unit/project/package_json_test.sh similarity index 97% rename from tests/unit/package_json_test.sh rename to tests/unit/project/package_json_test.sh index 01f88a5b..918ba241 100644 --- a/tests/unit/package_json_test.sh +++ b/tests/unit/project/package_json_test.sh @@ -5,7 +5,7 @@ PKG_FILE="" DOCS_PKG_FILE="" function set_up_before_script() { - ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" + ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)" PKG_FILE="$ROOT_DIR/package.json" DOCS_PKG_FILE="$ROOT_DIR/docs/package.json" } diff --git a/tests/unit/redirect_error_test.sh b/tests/unit/project/redirect_error_test.sh similarity index 100% rename from tests/unit/redirect_error_test.sh rename to tests/unit/project/redirect_error_test.sh diff --git a/tests/unit/release_generation_test.sh b/tests/unit/project/release_generation_test.sh similarity index 98% rename from tests/unit/release_generation_test.sh rename to tests/unit/project/release_generation_test.sh index c5b2f97d..23bd8c94 100644 --- a/tests/unit/release_generation_test.sh +++ b/tests/unit/project/release_generation_test.sh @@ -11,8 +11,8 @@ RELEASE_SCRIPT_DIR="" FIXTURES_DIR="" function set_up_before_script() { - RELEASE_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" - FIXTURES_DIR="$(dirname "${BASH_SOURCE[0]}")/fixtures/release" + RELEASE_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)" + FIXTURES_DIR="$(dirname "${BASH_SOURCE[0]}")/../fixtures/release" # Source release.sh to get access to functions # shellcheck source=/dev/null diff --git a/tests/unit/release_sandbox_test.sh b/tests/unit/project/release_sandbox_test.sh similarity index 99% rename from tests/unit/release_sandbox_test.sh rename to tests/unit/project/release_sandbox_test.sh index 4fde81bd..01b83c7c 100644 --- a/tests/unit/release_sandbox_test.sh +++ b/tests/unit/project/release_sandbox_test.sh @@ -11,7 +11,7 @@ RELEASE_SCRIPT_DIR="" FIXTURE_DIR="" function set_up_before_script() { - RELEASE_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" + RELEASE_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)" # Source release.sh to get access to functions # shellcheck source=/dev/null diff --git a/tests/unit/release_update_test.sh b/tests/unit/project/release_update_test.sh similarity index 98% rename from tests/unit/release_update_test.sh rename to tests/unit/project/release_update_test.sh index 7ffeb5e3..14b30df1 100644 --- a/tests/unit/release_update_test.sh +++ b/tests/unit/project/release_update_test.sh @@ -11,8 +11,8 @@ RELEASE_SCRIPT_DIR="" FIXTURES_DIR="" function set_up_before_script() { - RELEASE_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" - FIXTURES_DIR="$(dirname "${BASH_SOURCE[0]}")/fixtures/release" + RELEASE_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)" + FIXTURES_DIR="$(dirname "${BASH_SOURCE[0]}")/../fixtures/release" # Source release.sh to get access to functions # shellcheck source=/dev/null diff --git a/tests/unit/release_utilities_test.sh b/tests/unit/project/release_utilities_test.sh similarity index 99% rename from tests/unit/release_utilities_test.sh rename to tests/unit/project/release_utilities_test.sh index 2faeab18..a1c942c5 100644 --- a/tests/unit/release_utilities_test.sh +++ b/tests/unit/project/release_utilities_test.sh @@ -11,8 +11,8 @@ RELEASE_SCRIPT_DIR="" FIXTURES_DIR="" function set_up_before_script() { - RELEASE_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" - FIXTURES_DIR="$(dirname "${BASH_SOURCE[0]}")/fixtures/release" + RELEASE_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)" + FIXTURES_DIR="$(dirname "${BASH_SOURCE[0]}")/../fixtures/release" # Source release.sh to get access to functions # shellcheck source=/dev/null diff --git a/tests/unit/release_validation_test.sh b/tests/unit/project/release_validation_test.sh similarity index 99% rename from tests/unit/release_validation_test.sh rename to tests/unit/project/release_validation_test.sh index 4c576416..533ca9d3 100644 --- a/tests/unit/release_validation_test.sh +++ b/tests/unit/project/release_validation_test.sh @@ -10,7 +10,7 @@ fi RELEASE_SCRIPT_DIR="" function set_up_before_script() { - RELEASE_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" + RELEASE_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)" # Source release.sh to get access to functions # shellcheck source=/dev/null diff --git a/tests/unit/reports_json_test.sh b/tests/unit/reports/report_json_test.sh similarity index 100% rename from tests/unit/reports_json_test.sh rename to tests/unit/reports/report_json_test.sh diff --git a/tests/unit/reports_test.sh b/tests/unit/reports/reports_test.sh similarity index 100% rename from tests/unit/reports_test.sh rename to tests/unit/reports/reports_test.sh diff --git a/tests/unit/runner_context_test.sh b/tests/unit/runner/context_test.sh similarity index 100% rename from tests/unit/runner_context_test.sh rename to tests/unit/runner/context_test.sh diff --git a/tests/unit/runner_diagnostics_test.sh b/tests/unit/runner/diagnostics_test.sh similarity index 100% rename from tests/unit/runner_diagnostics_test.sh rename to tests/unit/runner/diagnostics_test.sh diff --git a/tests/unit/runner_discovery_test.sh b/tests/unit/runner/discovery_test.sh similarity index 100% rename from tests/unit/runner_discovery_test.sh rename to tests/unit/runner/discovery_test.sh diff --git a/tests/unit/runner_exec_test.sh b/tests/unit/runner/exec_test.sh similarity index 100% rename from tests/unit/runner_exec_test.sh rename to tests/unit/runner/exec_test.sh diff --git a/tests/unit/setup_teardown_test.sh b/tests/unit/runner/hooks_test.sh similarity index 100% rename from tests/unit/setup_teardown_test.sh rename to tests/unit/runner/hooks_test.sh diff --git a/tests/unit/runner_payload_test.sh b/tests/unit/runner/payload_test.sh similarity index 100% rename from tests/unit/runner_payload_test.sh rename to tests/unit/runner/payload_test.sh diff --git a/tests/unit/state_test.sh b/tests/unit/state/state_test.sh similarity index 100% rename from tests/unit/state_test.sh rename to tests/unit/state/state_test.sh diff --git a/tests/unit/check_os_test.sh b/tests/unit/system/check_os_test.sh similarity index 97% rename from tests/unit/check_os_test.sh rename to tests/unit/system/check_os_test.sh index 84ea08f4..83266a3b 100644 --- a/tests/unit/check_os_test.sh +++ b/tests/unit/system/check_os_test.sh @@ -85,7 +85,7 @@ function test_module_load_detects_os_with_a_single_uname_call() { # under `build.sh --verify` the built bashunit lives in a folder # without src/, and sourcing through $BASHUNIT_ROOT_DIR crashed # the whole verification run (silently, until #834 gated it). - source "$(dirname "${BASH_SOURCE[0]}")/../../src/system/check_os.sh" + source "$(dirname "${BASH_SOURCE[0]}")/../../../src/system/check_os.sh" assert_have_been_called_times 1 uname } diff --git a/tests/unit/dependencies_test.sh b/tests/unit/system/dependencies_test.sh similarity index 100% rename from tests/unit/dependencies_test.sh rename to tests/unit/system/dependencies_test.sh diff --git a/tests/unit/io_test.sh b/tests/unit/system/io_test.sh similarity index 100% rename from tests/unit/io_test.sh rename to tests/unit/system/io_test.sh diff --git a/tests/unit/clock_test.sh b/tests/unit/util/clock_test.sh similarity index 100% rename from tests/unit/clock_test.sh rename to tests/unit/util/clock_test.sh diff --git a/tests/unit/math_test.sh b/tests/unit/util/math_test.sh similarity index 100% rename from tests/unit/math_test.sh rename to tests/unit/util/math_test.sh diff --git a/tests/unit/str_test.sh b/tests/unit/util/str_test.sh similarity index 100% rename from tests/unit/str_test.sh rename to tests/unit/util/str_test.sh