Skip to content

Commit d8f6860

Browse files
committed
tests: allow cwd to be main dir too
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
1 parent 39a60e7 commit d8f6860

File tree

3 files changed

+0
-14
lines changed

3 files changed

+0
-14
lines changed

tests/BUILD.bazel

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ cc_test(
2929
"ensure_utf8_twice",
3030
],
3131
local_defines = [
32-
"BAZEL",
3332
'CLI11_ENSURE_UTF8_EXE=\\"$(rootpath ensure_utf8)\\"',
3433
'CLI11_ENSURE_UTF8_TWICE_EXE=\\"$(rootpath ensure_utf8_twice)\\"',
3534
],
@@ -47,7 +46,6 @@ cc_test(
4746
test + ".cpp",
4847
"app_helper.hpp",
4948
],
50-
local_defines = ["BAZEL"],
5149
deps = [
5250
"catch_main",
5351
"//:cli11",

tests/HelpersTest.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -522,11 +522,7 @@ TEST_CASE("Validators: FileIsDir", "[helpers]") {
522522
}
523523

524524
TEST_CASE("Validators: DirectoryExists", "[helpers]") {
525-
#ifdef BAZEL
526525
std::string mydir{"tests"};
527-
#else
528-
std::string mydir{"../tests"};
529-
#endif
530526
CHECK(CLI::ExistingDirectory(mydir).empty());
531527
}
532528

@@ -547,11 +543,7 @@ TEST_CASE("Validators: DirectoryIsFile", "[helpers]") {
547543
}
548544

549545
TEST_CASE("Validators: PathExistsDir", "[helpers]") {
550-
#ifdef BAZEL
551546
std::string mydir{"tests"};
552-
#else
553-
std::string mydir{"../tests"};
554-
#endif
555547
CHECK(CLI::ExistingPath(mydir).empty());
556548
}
557549

@@ -673,11 +665,7 @@ TEST_CASE("Validators: CombinedPaths", "[helpers]") {
673665
bool ok = static_cast<bool>(std::ofstream(myfile.c_str()).put('a')); // create file
674666
CHECK(ok);
675667

676-
#ifdef BAZEL
677668
std::string dir{"tests"};
678-
#else
679-
std::string dir{"../tests"};
680-
#endif
681669
std::string notpath{"nondirectory"};
682670

683671
auto path_or_dir = CLI::ExistingPath | CLI::ExistingDirectory;

tests/tests/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)