D
D
Dmitry2013-09-09 15:44:22
C++ / C#
Dmitry, 2013-09-09 15:44:22

Using compile-fail rule in boost build?

I want to use the "compile-fail" rule to check if some of the compile-time checks are correct, but there are some side effects that I don't know how to overcome.
Minimal example:
Jamfile.jam

import testing ;
compile-fail compile/1.cpp ;

1.cpp
not_the_code_to_be_compiled
In the output I get
gcc.compile.c++ .build/test/1.test/gcc-4.7/release/1.o
test/compile/1.cpp:1:1: error: ‘not_the_code_to_be_compiled’ does not name a type
(failed-as-expected) .build/test/1.test/gcc-4.7/release/1.o
**passed** .build/test/1.test/gcc-4.7/release/1.test
...updated 3 targets...

The result suits me. One small feature does not suit - there is a compiler diagnostic message in the log. Diagnostic messages can be large (for example when using templates) and I want them not to end up in the output. I would be fine if these messages ended up in a text file or simply not displayed on the screen. I want my output to look something like this
gcc.compile.c++ .build/test/1.test/gcc-4.7/release/1.o
(failed-as-expected) .build/test/1.test/gcc-4.7/release/1.o
**passed** .build/test/1.test/gcc-4.7/release/1.test
...updated 3 targets...

Couldn't find it in the boost documentation. Perhaps he was looking for something or not there.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question