3 ms·
You mean including code snippets of not compiling code in the automated(!) tests and compiling them from there? Hm, That makes sense. Anybody know a good fram
by xaedes 9y ago
You mean including code snippets of not compiling code in the automated(!) tests and compiling them from there?
Hm, That makes sense.
Anybody know a good framework for this? I can imagine that supporting different compilers output isn't a trivial thing that one should have to rebuild themselves.
Btw: The undefined behaviour question was meant to be unrelated to the "not compiling" one.
- saghm 9y agoOffhand, I would just use whatever CI tool you're already using to test various compiler/OS combinations and then just write a bash script to run that compiles a test file (given as an argument) and exits with the opposite exit code that the compiler gives (i.e. 0 for failure, 1 for success).
- gpderetta 9y agoMany test systems allow for expected-fail tests. Also this being c++, of course there are ways to test that an expression does not compile via metaprogramming (i.e. SFINAE).
- saghm 9y agoAlmost forgot to respond to the UB part: you can use clang's UBSAN to help detect when undefined behavior occurs. https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html