summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2023-11-17 23:09:30 +0000
committerOri Bernstein <ori@eigenstate.org>2023-11-17 23:09:30 +0000
commit0f3953f95405ea694206f6ec41b9fd47358f03cd (patch)
treec8d444151a3b29131e77fa0d17c03fb7a4559faf
parent04d6a2acecfe4fe44947da8b676f63bcd0f3c0fe (diff)
cpp: run tests with 'mk test'
-rw-r--r--sys/src/cmd/cpp/test.expected49
-rw-r--r--sys/src/cmd/cpp/test/edges.expected55
-rw-r--r--sys/src/cmd/cpp/test/edges.in (renamed from sys/src/cmd/cpp/test.c)1
-rwxr-xr-xsys/src/cmd/cpp/test/edges.rc3
-rw-r--r--sys/src/cmd/cpp/test/mkfile6
5 files changed, 65 insertions, 49 deletions
diff --git a/sys/src/cmd/cpp/test.expected b/sys/src/cmd/cpp/test.expected
deleted file mode 100644
index bf4b3aa99..000000000
--- a/sys/src/cmd/cpp/test.expected
+++ /dev/null
@@ -1,49 +0,0 @@
-#line 1 "/usr/ori/src/cpp/test.c"
-
-
-
-x fooEOF y
-x EOFfoo y
-x(-1) y
-y foo x
-x foo y
-X y
-
-
- foobar
-
-
-foo ## bar
-
-
- ablahb
-
-
-
- 33
-
-
-#line 32 "/usr/ori/src/cpp/test.c"
-
-
-
-
- a,b
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- f(2 * (y+1)) + f(2 * (f(2 * (z[0])))) % f(2 * (0)) + t(1);
- f(2 * (2+(3,4)- 0,1)) | f(2 * (~ 5)) & f(2 * (0,1))^ m(0,1);
-#line 55 "/usr/ori/src/cpp/test.c"
diff --git a/sys/src/cmd/cpp/test/edges.expected b/sys/src/cmd/cpp/test/edges.expected
new file mode 100644
index 000000000..f168a8f00
--- /dev/null
+++ b/sys/src/cmd/cpp/test/edges.expected
@@ -0,0 +1,55 @@
+#line 1 "/sys/src/cmd/cpp/test/edges.in"
+
+
+
+x fooEOF y
+x EOFfoo y
+x(-1) y
+y foo x
+x foo y
+X y
+
+
+ foobar
+
+
+foo ## bar
+
+
+ ablahb
+
+
+
+ 33
+
+
+ a bc d
+WUT
+
+
+#line 36 "/sys/src/cmd/cpp/test/edges.in"
+
+
+
+
+ a,b
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ f(2 * (y+1)) + f(2 * (f(2 * (z[0])))) % f(2 * (0)) + t(1);
+ f(2 * (2 +(3,4)- 0,1)) | f(2 * (~ 5)) & f(2 * (0,1))^ m(0,1);
+#line 59 "/sys/src/cmd/cpp/test/edges.in"
+
+#line 66 "/sys/src/cmd/cpp/test/edges.in"
diff --git a/sys/src/cmd/cpp/test.c b/sys/src/cmd/cpp/test/edges.in
index 510419050..02623fa4b 100644
--- a/sys/src/cmd/cpp/test.c
+++ b/sys/src/cmd/cpp/test/edges.in
@@ -23,6 +23,7 @@ FOO
/* Expected: a bc d */
CAT(a b, c d)
+WUT
/*
* CURRENTLY BROKEN:
diff --git a/sys/src/cmd/cpp/test/edges.rc b/sys/src/cmd/cpp/test/edges.rc
new file mode 100755
index 000000000..76871e2cc
--- /dev/null
+++ b/sys/src/cmd/cpp/test/edges.rc
@@ -0,0 +1,3 @@
+#!/bin/rc
+
+../6.out edges.in > edges.out && cmp edges.out edges.expected
diff --git a/sys/src/cmd/cpp/test/mkfile b/sys/src/cmd/cpp/test/mkfile
new file mode 100644
index 000000000..dd84f8126
--- /dev/null
+++ b/sys/src/cmd/cpp/test/mkfile
@@ -0,0 +1,6 @@
+</$objtype/mkfile
+
+TEST=\
+ edges
+
+</sys/src/cmd/mktest