glcpp: Add tests for line continuation

First we test that line continuations are honored within a comment, (as
recently changed in glcpp), then we test that line continuations can be
disabled via an option within the context. This is tested via the new support
for a test-specific command-line option passed to glcpp.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Carl Worth 2012-12-05 13:36:31 -08:00
parent 2483039aca
commit cc5fc8bf2f
4 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,9 @@
// This comment continues to the next line, hiding the define \
#define CONTINUATION_UNSUPPORTED
#ifdef CONTINUATION_UNSUPPORTED
failure
#else
success
#endif

View File

@ -0,0 +1,10 @@
success

View File

@ -0,0 +1,13 @@
// glcpp-args: --disable-line-continuations
// This comments ends with a backslash \\
#define NO_CONTINUATION
#ifdef NO_CONTINUATION
success
#else
failure
#endif

View File

@ -0,0 +1,14 @@
success