Skip to content

Commit

Permalink
[libc++][test] Improves src include paths. (llvm#86864)
Browse files Browse the repository at this point in the history
Instead of including a relative path use an absolute path based on the
available lit substitution. This makes it easier to understand what is
included and moving the test to a different directory level no longer
breaks the test.

This is based on a question by @EricWF in
llvm#82113.
  • Loading branch information
mordante authored Mar 30, 2024
1 parent 556bf03 commit 6aa5388
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// UNSUPPORTED: c++03, c++11, c++14
// UNSUPPORTED: availability-filesystem-missing
// UNSUPPORTED: no-filesystem
// ADDITIONAL_COMPILE_FLAGS: -I %S/../../../../../../src
// ADDITIONAL_COMPILE_FLAGS: -I %{libcxx-dir}/src

// This test relies on calling functions from the libcxx internal headers
// of <filesystem>; the Windows implementation uses different
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

// typedef TrivialClock file_time_type;

// ADDITIONAL_COMPILE_FLAGS: -I %S/../../../../src -Wno-macro-redefined
// ADDITIONAL_COMPILE_FLAGS: -I %{libcxx-dir}/src -Wno-macro-redefined

#include <cassert>
#include <chrono>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// Tests the IANA database rules parsing and operations.
// This is not part of the public tzdb interface.
// The test uses private implementation headers.
// ADDITIONAL_COMPILE_FLAGS: -I %S/../../../../../src/include
// ADDITIONAL_COMPILE_FLAGS: -I %{libcxx-dir}/src/include

#include <chrono>
#include <fstream>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// Tests the IANA database zones parsing and operations.
// This is not part of the public tzdb interface.
// The test uses private implementation headers.
// ADDITIONAL_COMPILE_FLAGS: -I %S/../../../../../src/include
// ADDITIONAL_COMPILE_FLAGS: -I %{libcxx-dir}/src/include

#include <cassert>
#include <chrono>
Expand Down

0 comments on commit 6aa5388

Please sign in to comment.