Commit Graph

4 Commits

Author SHA1 Message Date
Chandler Carruth 074a3568fc Switch from autogenerating tests to using the preprocessor.
NOTE: You may need to run 'make clean' or 'ninja -t clean' etc!!! This
      is due to really nasty bug/interactions between
      CMake/configure/make/Ninja/LIT...

This commit tries to back out the support for generating test cases as
part of the build system due to the issues I brought up in post-commit
review:

1) It adds a *lot* of complexity and fragility to the build system. See
   the number of commits required to try to get all the bots happy.
2) It isn't really necessary -- we can already run scripts to generate
   things with the RUN lines of a test.
3) It makes the tests somewhat harder to debug as they cross between
   more domains.
4) In almost all cases it isn't really needed or it can be done directly
   using the preprocessor.

I should have been more proactive reviewing this, and I'm really sorry
about the churn here. =/ To help keep track of what commits are going
where, this backs out most of the non-test-changes from these revisions:
  r176397
  r176373
  r176293
  r176184
  r175744
  r175624
  r175545
  r175544

There were several trivial or cleanup changes to the lit files or other
files. Some of these looked ok, but I didn't try to tease them apart...
Edwin, if you know what to look for, please carry on with the cleanups
there, and sorry for hosing stuff here but I'm not much of a Python
person, and so I was erring on the side of cautiously backing out the
change.

I've tried to preserve the test changes everywhere I could, but review
is appreciated here in case I missed some.

I then re-wrote the tests to use the preprocessor rather than python to
expand to the various bits of code. The nicest part of this is that now
all the files are just C++ code. They edit and behave like C++ code,
etc. RUN lines with different -D flags are used to run the same test
over multiple different configurations, and includes bracketed in
special defines are used to flesh out a collection of standard interface
stubs to test interactions between pieces. These probably aren't perfect
yet, but I think its an improvement (at least in terms of build system
complexity) and will hopefully be a useful demonstration of the
technique I prefer for these types of tests.

llvm-svn: 176627
2013-03-07 10:09:47 +00:00
Edwin Vane 8b526f22c6 Add support for auto-generating LIT tests by the build
autoconf and CMake flavours both updated to auto-generate files for use
in cpp11-migrate's LIT tests.

Auto-generated files are placed in the build directory under
test/cpp11-migrate/autogen. The directory structure past this point
mirrors the structure in the source directory under test/cpp11-migrate.
A lit.site.cfg is generated in test/cpp11-migrate/autogen to describe
the new test suite. When LIT runs, it runs the standard testsuite and
now also the auto-generated testsuite.

llvm-svn: 175544
2013-02-19 19:08:10 +00:00
Chandler Carruth 118232f2b4 Add a root CMakeLists.txt and fix up all the test build stuff.
With this we can build and test the remove-cstr-calls tool which should
serve as a good example of how to add tools and their tests to the
repository.

llvm-svn: 161404
2012-08-07 08:33:04 +00:00
Chandler Carruth c5062dc91a Copy some of the testing infrastructure from the primary Clang repository into
the new tools repo to preserve history. I'll subsequently be editting these
down to work w/ the tooling test suites.

llvm-svn: 161402
2012-08-07 07:09:14 +00:00