aboutsummaryrefslogtreecommitdiff
path: root/test cases/30 pipeline
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2013-02-23 19:39:27 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2013-02-23 19:39:27 +0200
commit40012fad4550001c8dd181786608188d3a97ae4b (patch)
tree1a55c6ad59efc39c559dfd9bf731ac33fa74eb8c /test cases/30 pipeline
parentd200ad2e2e1a800e6fd7072931588b0bdb9472b2 (diff)
downloadmeson-40012fad4550001c8dd181786608188d3a97ae4b.zip
meson-40012fad4550001c8dd181786608188d3a97ae4b.tar.gz
meson-40012fad4550001c8dd181786608188d3a97ae4b.tar.bz2
Started work on pipelines by adding generator test case skeleton.
Diffstat (limited to 'test cases/30 pipeline')
-rw-r--r--test cases/30 pipeline/input_src.dat1
-rw-r--r--test cases/30 pipeline/meson.build3
-rw-r--r--test cases/30 pipeline/prog.c5
-rw-r--r--test cases/30 pipeline/srcgen.c33
4 files changed, 42 insertions, 0 deletions
diff --git a/test cases/30 pipeline/input_src.dat b/test cases/30 pipeline/input_src.dat
new file mode 100644
index 0000000..7412372
--- /dev/null
+++ b/test cases/30 pipeline/input_src.dat
@@ -0,0 +1 @@
+int func() { return 0; }
diff --git a/test cases/30 pipeline/meson.build b/test cases/30 pipeline/meson.build
new file mode 100644
index 0000000..a12495e
--- /dev/null
+++ b/test cases/30 pipeline/meson.build
@@ -0,0 +1,3 @@
+project('pipeline test', 'c')
+
+e1 = executable('srcgen', 'srcgen.c')
diff --git a/test cases/30 pipeline/prog.c b/test cases/30 pipeline/prog.c
new file mode 100644
index 0000000..175a90d
--- /dev/null
+++ b/test cases/30 pipeline/prog.c
@@ -0,0 +1,5 @@
+int func();
+
+int main(int argc, char **argv) {
+ return func();
+}
diff --git a/test cases/30 pipeline/srcgen.c b/test cases/30 pipeline/srcgen.c
new file mode 100644
index 0000000..c4e412b
--- /dev/null
+++ b/test cases/30 pipeline/srcgen.c
@@ -0,0 +1,33 @@
+#include<stdio.h>
+#include<assert.h>
+
+int main(int argc, char **argv) {
+ const int ARRSIZE = 80;
+ char arr[ARRSIZE];
+ if(argc != 3) {
+ fprintf(stderr, "%s <input file> <output file>\n", argv[0]);
+ return 1;
+ }
+ char *ifilename = argv[1];
+ char *ofilename = argv[2];
+ printf("%s\n", ifilename);
+ FILE *ifile = fopen(ifilename, "r");
+ if(!ifile) {
+ fprintf(stderr, "Could not open source file %s.\n", ifilename);
+ return 1;
+ }
+ FILE *ofile = fopen(ofilename, "w");
+ if(!ofile) {
+ fprintf(stderr, "Could not open target file %s\n", ofilename);
+ return 1;
+ }
+ size_t bytes;
+ bytes = fread(arr, 1, ARRSIZE, ifile);
+ assert(bytes < 80);
+ assert(bytes > 0);
+ fwrite(arr, 1, bytes, ofile);
+
+ fclose(ifile);
+ fclose(ofile);
+ return 0;
+}