From d8f68607f788433b10b00bf99ab60e9e8e9ea244 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Wed, 1 May 2024 12:12:00 -0400 Subject: [PATCH] tests: allow cwd to be main dir too Signed-off-by: Henry Schreiner --- tests/BUILD.bazel | 2 -- tests/HelpersTest.cpp | 12 ------------ tests/tests/.gitkeep | 0 3 files changed, 14 deletions(-) create mode 100644 tests/tests/.gitkeep diff --git a/tests/BUILD.bazel b/tests/BUILD.bazel index 240aa7311..5aefd860b 100644 --- a/tests/BUILD.bazel +++ b/tests/BUILD.bazel @@ -29,7 +29,6 @@ cc_test( "ensure_utf8_twice", ], local_defines = [ - "BAZEL", 'CLI11_ENSURE_UTF8_EXE=\\"$(rootpath ensure_utf8)\\"', 'CLI11_ENSURE_UTF8_TWICE_EXE=\\"$(rootpath ensure_utf8_twice)\\"', ], @@ -47,7 +46,6 @@ cc_test( test + ".cpp", "app_helper.hpp", ], - local_defines = ["BAZEL"], deps = [ "catch_main", "//:cli11", diff --git a/tests/HelpersTest.cpp b/tests/HelpersTest.cpp index 970ea7d6b..0fceed550 100644 --- a/tests/HelpersTest.cpp +++ b/tests/HelpersTest.cpp @@ -522,11 +522,7 @@ TEST_CASE("Validators: FileIsDir", "[helpers]") { } TEST_CASE("Validators: DirectoryExists", "[helpers]") { -#ifdef BAZEL std::string mydir{"tests"}; -#else - std::string mydir{"../tests"}; -#endif CHECK(CLI::ExistingDirectory(mydir).empty()); } @@ -547,11 +543,7 @@ TEST_CASE("Validators: DirectoryIsFile", "[helpers]") { } TEST_CASE("Validators: PathExistsDir", "[helpers]") { -#ifdef BAZEL std::string mydir{"tests"}; -#else - std::string mydir{"../tests"}; -#endif CHECK(CLI::ExistingPath(mydir).empty()); } @@ -673,11 +665,7 @@ TEST_CASE("Validators: CombinedPaths", "[helpers]") { bool ok = static_cast(std::ofstream(myfile.c_str()).put('a')); // create file CHECK(ok); -#ifdef BAZEL std::string dir{"tests"}; -#else - std::string dir{"../tests"}; -#endif std::string notpath{"nondirectory"}; auto path_or_dir = CLI::ExistingPath | CLI::ExistingDirectory; diff --git a/tests/tests/.gitkeep b/tests/tests/.gitkeep new file mode 100644 index 000000000..e69de29bb