This is an archive of the discontinued LLVM Phabricator instance.

Introduce explicit add_file_reading_unittest target for tests that use llvm::getInputFileDirectory()
ClosedPublic

Authored by thakis on Sep 14 2018, 7:54 AM.

Details

Summary

Using llvm::getInputFileDirectory() in unit tests is discouraged, so require an explicit opt-in.

This way, cmake also writes ~60 fewer unused files to disk.

Diff Detail

Event Timeline

thakis created this revision.Sep 14 2018, 7:54 AM
zturner accepted this revision.Sep 14 2018, 9:51 AM
zturner added inline comments.
unittests/DebugInfo/PDB/CMakeLists.txt
7

Can you call this add_llvm_unittest_with_input_files? The distinction is subtle, but we already have plenty of unittests that read files and don't need this functionality (specifically, most of the tests of Support/FileSystem.h itself. This way it's clear what's being read.

This revision is now accepted and ready to land.Sep 14 2018, 9:51 AM
thakis closed this revision.Sep 14 2018, 10:36 AM
thakis marked an inline comment as done.

r342248, thanks!

unittests/DebugInfo/PDB/CMakeLists.txt
7

Good suggestion, thanks.