[Mesa-dev] [PATCH 10/10] glsl: Add test for '#line XX "filename.c"'

Carl Worth cworth at cworth.org
Sat Dec 8 13:43:45 PST 2012


Verifying that the filename from the #line directive appears in subsequent
error messages.
---
 src/glsl/tests/directives/04-hash-line-source-filename.glsl |   11 +++++++++++
 .../directives/04-hash-line-source-filename.glsl.expected   |    2 ++
 2 files changed, 13 insertions(+)
 create mode 100644 src/glsl/tests/directives/04-hash-line-source-filename.glsl
 create mode 100644 src/glsl/tests/directives/04-hash-line-source-filename.glsl.expected

diff --git a/src/glsl/tests/directives/04-hash-line-source-filename.glsl b/src/glsl/tests/directives/04-hash-line-source-filename.glsl
new file mode 100644
index 0000000..6b56c95
--- /dev/null
+++ b/src/glsl/tests/directives/04-hash-line-source-filename.glsl
@@ -0,0 +1,11 @@
+void main(void)
+{
+
+      /* In this test, we verify that a source filename in a #line
+       * directive is reflected in a subsequent error message.
+       * Syntax error should be reported on line 21 of foo.c.
+       */
+
+#line 21 "foo.c"
+      if (; /* Syntax error */
+}
diff --git a/src/glsl/tests/directives/04-hash-line-source-filename.glsl.expected b/src/glsl/tests/directives/04-hash-line-source-filename.glsl.expected
new file mode 100644
index 0000000..12a3c82
--- /dev/null
+++ b/src/glsl/tests/directives/04-hash-line-source-filename.glsl.expected
@@ -0,0 +1,2 @@
+foo.c:21(6): error: syntax error, unexpected ';'
+
-- 
1.7.10



More information about the mesa-dev mailing list