Mesa (master): glcpp: Add tests for line continuation

Carl Worth cworth at kemper.freedesktop.org
Fri Jan 11 22:31:40 UTC 2013


Module: Mesa
Branch: master
Commit: cc5fc8bf2f6a8b6390e4d9088060938fe23831e1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=cc5fc8bf2f6a8b6390e4d9088060938fe23831e1

Author: Carl Worth <cworth at cworth.org>
Date:   Wed Dec  5 13:36:31 2012 -0800

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 at whitecape.org>

---

 src/glsl/glcpp/tests/115-line-continuations.c      |    9 +++++++++
 .../glcpp/tests/115-line-continuations.c.expected  |   10 ++++++++++
 .../glcpp/tests/116-disable-line-continuations.c   |   13 +++++++++++++
 .../116-disable-line-continuations.c.expected      |   14 ++++++++++++++
 4 files changed, 46 insertions(+), 0 deletions(-)

diff --git a/src/glsl/glcpp/tests/115-line-continuations.c b/src/glsl/glcpp/tests/115-line-continuations.c
new file mode 100644
index 0000000..105590d
--- /dev/null
+++ b/src/glsl/glcpp/tests/115-line-continuations.c
@@ -0,0 +1,9 @@
+// This comment continues to the next line, hiding the define \
+#define CONTINUATION_UNSUPPORTED
+
+#ifdef CONTINUATION_UNSUPPORTED
+failure
+#else
+success
+#endif
+
diff --git a/src/glsl/glcpp/tests/115-line-continuations.c.expected b/src/glsl/glcpp/tests/115-line-continuations.c.expected
new file mode 100644
index 0000000..f67ba1c
--- /dev/null
+++ b/src/glsl/glcpp/tests/115-line-continuations.c.expected
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+success
+
+
+
diff --git a/src/glsl/glcpp/tests/116-disable-line-continuations.c b/src/glsl/glcpp/tests/116-disable-line-continuations.c
new file mode 100644
index 0000000..83d5ddf
--- /dev/null
+++ b/src/glsl/glcpp/tests/116-disable-line-continuations.c
@@ -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
+
+
+
diff --git a/src/glsl/glcpp/tests/116-disable-line-continuations.c.expected b/src/glsl/glcpp/tests/116-disable-line-continuations.c.expected
new file mode 100644
index 0000000..9b9a8c5
--- /dev/null
+++ b/src/glsl/glcpp/tests/116-disable-line-continuations.c.expected
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+success
+
+
+
+
+
+
+




More information about the mesa-commit mailing list