Skip to content

Commit 6aa5388

Browse files
authored
[libc++][test] Improves src include paths. (#86864)
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 #82113.
1 parent 556bf03 commit 6aa5388

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

libcxx/test/libcxx/input.output/filesystems/class.directory_entry/directory_entry.mods/last_write_time.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// UNSUPPORTED: c++03, c++11, c++14
1010
// UNSUPPORTED: availability-filesystem-missing
1111
// UNSUPPORTED: no-filesystem
12-
// ADDITIONAL_COMPILE_FLAGS: -I %S/../../../../../../src
12+
// ADDITIONAL_COMPILE_FLAGS: -I %{libcxx-dir}/src
1313

1414
// This test relies on calling functions from the libcxx internal headers
1515
// of <filesystem>; the Windows implementation uses different

libcxx/test/libcxx/input.output/filesystems/convert_file_time.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
// typedef TrivialClock file_time_type;
1515

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

1818
#include <cassert>
1919
#include <chrono>

libcxx/test/libcxx/time/time.zone/time.zone.db/rules.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
// Tests the IANA database rules parsing and operations.
1818
// This is not part of the public tzdb interface.
1919
// The test uses private implementation headers.
20-
// ADDITIONAL_COMPILE_FLAGS: -I %S/../../../../../src/include
20+
// ADDITIONAL_COMPILE_FLAGS: -I %{libcxx-dir}/src/include
2121

2222
#include <chrono>
2323
#include <fstream>

libcxx/test/libcxx/time/time.zone/time.zone.db/zones.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
// Tests the IANA database zones parsing and operations.
1818
// This is not part of the public tzdb interface.
1919
// The test uses private implementation headers.
20-
// ADDITIONAL_COMPILE_FLAGS: -I %S/../../../../../src/include
20+
// ADDITIONAL_COMPILE_FLAGS: -I %{libcxx-dir}/src/include
2121

2222
#include <cassert>
2323
#include <chrono>

0 commit comments

Comments
 (0)