[PATCH] Teach CMake build system to run lit's own test suite

Dan Liew via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 28 19:12:05 PST 2015


Hi Jonathan,


> Make them faster? Timeout tests don't have to be slow. Just set them up as
> infinite loops that get killed by a very short timeout. If the timeout is
> working, the test runs quick. If the timeout is not working, then the test
> runs slowly (or never finishes), indicating that the test is broken.

There are a few issues with making them run faster

- Currently the timeout is an integer (seconds). If you want a shorter
timeout than 1 second the implementation needs to be changed to use
floats. If the timeout is made too short the tests may also become
unreliable.
- Some of the tests are more sophisticated than just running a tool
that loops infinitely. For example the "quick_then_slow.py" has two
``RUN:`` lines and checks that when the timeout occurred it is during
the second ``RUN:`` line and that the first invocation of the ``RUN:``
line managed to finished.
- The tests (e.g. ``shtest-timeout.py``) are run sequentially so that
the output checked by FileCheck is in a predictable order.
- The shell tests actually run multiple times. Once for the internal
shell, once for the external shell and once to check that the timeout
can be overriden correctly.

> One more issue:
>
> The lit testsuite writes temporaries to the src dir, which is inappropriate
> for out-of-source builds. I implemented this in
> http://reviews.llvm.org/D14722, and promptly forgot about it.

Oh. I didn't know about that patch.

I've implemented a new version of my patch (attached) that fixes the
out of source build issue. My patch is similar to your implementation
but there are some differences in how I've handled performing the copy
of the tests from the source directory to the build directory.

Thanks,
Dan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Teach-the-CMake-build-system-to-run-lit-s-tests.-The.v2.patch
Type: text/x-patch
Size: 4990 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151229/49d93985/attachment.bin>


More information about the llvm-commits mailing list