diff options
Diffstat (limited to 'c_parser/test')
38 files changed, 169 insertions, 53 deletions
diff --git a/c_parser/test/in/01.c b/c_parser/test/in/01.c new file mode 100644 index 0000000..76425b5 --- /dev/null +++ b/c_parser/test/in/01.c @@ -0,0 +1,6 @@ +int a; +int b = 0; +int c, d; + +int e, + f; diff --git a/c_parser/test/in/02.c b/c_parser/test/in/02.c new file mode 100644 index 0000000..45b1467 --- /dev/null +++ b/c_parser/test/in/02.c @@ -0,0 +1 @@ +int f() {} diff --git a/c_parser/test/in/03.c b/c_parser/test/in/03.c new file mode 100644 index 0000000..e57aaa9 --- /dev/null +++ b/c_parser/test/in/03.c @@ -0,0 +1 @@ +int foo(int bar) {} diff --git a/c_parser/test/in/04.c b/c_parser/test/in/04.c new file mode 100644 index 0000000..0e50c88 --- /dev/null +++ b/c_parser/test/in/04.c @@ -0,0 +1,4 @@ +int foo(int bar1, int bar2) { + int x; + int y, z; +} diff --git a/c_parser/test/in/05.c b/c_parser/test/in/05.c new file mode 100644 index 0000000..a5ac579 --- /dev/null +++ b/c_parser/test/in/05.c @@ -0,0 +1,3 @@ +int foo(int x, int y) { + {} +} diff --git a/c_parser/test/in/06.c b/c_parser/test/in/06.c new file mode 100644 index 0000000..f182bd9 --- /dev/null +++ b/c_parser/test/in/06.c @@ -0,0 +1,6 @@ +int f(int a, int b, int c) { + int d; + { + int e; + } +} diff --git a/c_parser/test/in/07.c b/c_parser/test/in/07.c new file mode 100644 index 0000000..baa3ba5 --- /dev/null +++ b/c_parser/test/in/07.c @@ -0,0 +1,3 @@ +if(x == y) { + int z; +} diff --git a/c_parser/test/out/01.diff.txt b/c_parser/test/out/01.diff.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/c_parser/test/out/01.diff.txt diff --git a/c_parser/test/out/01.stderr.txt b/c_parser/test/out/01.stderr.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/c_parser/test/out/01.stderr.txt diff --git a/c_parser/test/out/01.stdout.txt b/c_parser/test/out/01.stdout.txt new file mode 100644 index 0000000..bd7cd1f --- /dev/null +++ b/c_parser/test/out/01.stdout.txt @@ -0,0 +1,9 @@ +<?xml version="1.0"?> +<Program> +<Variable id="a" /> +<Variable id="b" /> +<Variable id="c" /> +<Variable id="d" /> +<Variable id="e" /> +<Variable id="f" /> +</Program> diff --git a/c_parser/test/out/01.stdout.xml b/c_parser/test/out/01.stdout.xml new file mode 100644 index 0000000..bd7cd1f --- /dev/null +++ b/c_parser/test/out/01.stdout.xml @@ -0,0 +1,9 @@ +<?xml version="1.0"?> +<Program> +<Variable id="a" /> +<Variable id="b" /> +<Variable id="c" /> +<Variable id="d" /> +<Variable id="e" /> +<Variable id="f" /> +</Program> diff --git a/c_parser/test/out/02.diff.txt b/c_parser/test/out/02.diff.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/c_parser/test/out/02.diff.txt diff --git a/c_parser/test/out/02.stderr.txt b/c_parser/test/out/02.stderr.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/c_parser/test/out/02.stderr.txt diff --git a/c_parser/test/out/02.stdout.xml b/c_parser/test/out/02.stdout.xml new file mode 100644 index 0000000..bc37d7a --- /dev/null +++ b/c_parser/test/out/02.stdout.xml @@ -0,0 +1,7 @@ +<?xml version="1.0"?> +<Program> +<Function id="f"> +<Scope> +</Scope> +</Function> +</Program> diff --git a/c_parser/test/out/03.diff.txt b/c_parser/test/out/03.diff.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/c_parser/test/out/03.diff.txt diff --git a/c_parser/test/out/03.stderr.txt b/c_parser/test/out/03.stderr.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/c_parser/test/out/03.stderr.txt diff --git a/c_parser/test/out/03.stdout.xml b/c_parser/test/out/03.stdout.xml new file mode 100644 index 0000000..6ca0ab2 --- /dev/null +++ b/c_parser/test/out/03.stdout.xml @@ -0,0 +1,8 @@ +<?xml version="1.0"?> +<Program> +<Function id="foo"> +<Parameter id="bar" /> +<Scope> +</Scope> +</Function> +</Program> diff --git a/c_parser/test/out/04.diff.txt b/c_parser/test/out/04.diff.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/c_parser/test/out/04.diff.txt diff --git a/c_parser/test/out/04.stderr.txt b/c_parser/test/out/04.stderr.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/c_parser/test/out/04.stderr.txt diff --git a/c_parser/test/out/04.stdout.xml b/c_parser/test/out/04.stdout.xml new file mode 100644 index 0000000..9257eac --- /dev/null +++ b/c_parser/test/out/04.stdout.xml @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<Program> +<Function id="foo"> +<Parameter id="bar1" /> +<Parameter id="bar2" /> +<Scope> +<Variable id="x" /> +<Variable id="y" /> +<Variable id="z" /> +</Scope> +</Function> +</Program> diff --git a/c_parser/test/out/05.diff.txt b/c_parser/test/out/05.diff.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/c_parser/test/out/05.diff.txt diff --git a/c_parser/test/out/05.stderr.txt b/c_parser/test/out/05.stderr.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/c_parser/test/out/05.stderr.txt diff --git a/c_parser/test/out/05.stdout.xml b/c_parser/test/out/05.stdout.xml new file mode 100644 index 0000000..7381e51 --- /dev/null +++ b/c_parser/test/out/05.stdout.xml @@ -0,0 +1,11 @@ +<?xml version="1.0"?> +<Program> +<Function id="foo"> +<Parameter id="x" /> +<Parameter id="y" /> +<Scope> +<Scope> +</Scope> +</Scope> +</Function> +</Program> diff --git a/c_parser/test/out/06.diff.txt b/c_parser/test/out/06.diff.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/c_parser/test/out/06.diff.txt diff --git a/c_parser/test/out/06.stderr.txt b/c_parser/test/out/06.stderr.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/c_parser/test/out/06.stderr.txt diff --git a/c_parser/test/out/06.stdout.xml b/c_parser/test/out/06.stdout.xml new file mode 100644 index 0000000..fbcbebd --- /dev/null +++ b/c_parser/test/out/06.stdout.xml @@ -0,0 +1,14 @@ +<?xml version="1.0"?> +<Program> +<Function id="f"> +<Parameter id="a" /> +<Parameter id="b" /> +<Parameter id="c" /> +<Scope> +<Variable id="d" /> +<Scope> +<Variable id="e" /> +</Scope> +</Scope> +</Function> +</Program> diff --git a/c_parser/test/out/07.diff.txt b/c_parser/test/out/07.diff.txt new file mode 100644 index 0000000..292a596 --- /dev/null +++ b/c_parser/test/out/07.diff.txt @@ -0,0 +1,7 @@ +1,6d0 +< <?xml version="1.0"?> +< <Program> +< <Scope> +< <Variable id="z" /> +< </Scope> +< </Program> diff --git a/c_parser/test/out/07.stderr.txt b/c_parser/test/out/07.stderr.txt new file mode 100644 index 0000000..6200509 --- /dev/null +++ b/c_parser/test/out/07.stderr.txt @@ -0,0 +1 @@ +Parse error : syntax error diff --git a/c_parser/test/out/07.stdout.xml b/c_parser/test/out/07.stdout.xml new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/c_parser/test/out/07.stdout.xml diff --git a/c_parser/test/output.xml b/c_parser/test/output.xml deleted file mode 100644 index d4594a2..0000000 --- a/c_parser/test/output.xml +++ /dev/null @@ -1,37 +0,0 @@ -<?xml version="1.0"?> -<Program> -<Variable id="a" /> -<Variable id="b" /> -<Variable id="c" /> -<Variable id="yann" /> -<Variable id="is" /> -<Variable id="the" /> -<Variable id="best" /> -<Variable id="d" /> -<Variable id="hello" /> -<Variable id="asd" /> -<Variable id="a" /> -<Function id="f"> -<Parameter id="i" /> -<Parameter id="b" /> -<Parameter id="c" /> -<Parameter id="d" /> -<Scope> -<Variable id="a" /> -</Scope> -</Function> -<Variable id="a" /> -<Variable id="b" /> -<Variable id="c" /> -<Variable id="c" /> -<Variable id="d" /> -<Function id="func"> -<Parameter id="asd" /> -<Parameter id="b" /> -<Scope> -<Variable id="a" /> -<Variable id="b" /> -<Variable id="c" /> -</Scope> -</Function> -</Program> diff --git a/c_parser/test/ref/01.stdout.xml b/c_parser/test/ref/01.stdout.xml new file mode 100644 index 0000000..bd7cd1f --- /dev/null +++ b/c_parser/test/ref/01.stdout.xml @@ -0,0 +1,9 @@ +<?xml version="1.0"?> +<Program> +<Variable id="a" /> +<Variable id="b" /> +<Variable id="c" /> +<Variable id="d" /> +<Variable id="e" /> +<Variable id="f" /> +</Program> diff --git a/c_parser/test/ref/02.stdout.xml b/c_parser/test/ref/02.stdout.xml new file mode 100644 index 0000000..bc37d7a --- /dev/null +++ b/c_parser/test/ref/02.stdout.xml @@ -0,0 +1,7 @@ +<?xml version="1.0"?> +<Program> +<Function id="f"> +<Scope> +</Scope> +</Function> +</Program> diff --git a/c_parser/test/ref/03.stdout.xml b/c_parser/test/ref/03.stdout.xml new file mode 100644 index 0000000..6ca0ab2 --- /dev/null +++ b/c_parser/test/ref/03.stdout.xml @@ -0,0 +1,8 @@ +<?xml version="1.0"?> +<Program> +<Function id="foo"> +<Parameter id="bar" /> +<Scope> +</Scope> +</Function> +</Program> diff --git a/c_parser/test/ref/04.stdout.xml b/c_parser/test/ref/04.stdout.xml new file mode 100644 index 0000000..9257eac --- /dev/null +++ b/c_parser/test/ref/04.stdout.xml @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<Program> +<Function id="foo"> +<Parameter id="bar1" /> +<Parameter id="bar2" /> +<Scope> +<Variable id="x" /> +<Variable id="y" /> +<Variable id="z" /> +</Scope> +</Function> +</Program> diff --git a/c_parser/test/ref/05.stdout.xml b/c_parser/test/ref/05.stdout.xml new file mode 100644 index 0000000..7381e51 --- /dev/null +++ b/c_parser/test/ref/05.stdout.xml @@ -0,0 +1,11 @@ +<?xml version="1.0"?> +<Program> +<Function id="foo"> +<Parameter id="x" /> +<Parameter id="y" /> +<Scope> +<Scope> +</Scope> +</Scope> +</Function> +</Program> diff --git a/c_parser/test/ref/06.stdout.xml b/c_parser/test/ref/06.stdout.xml new file mode 100644 index 0000000..fbcbebd --- /dev/null +++ b/c_parser/test/ref/06.stdout.xml @@ -0,0 +1,14 @@ +<?xml version="1.0"?> +<Program> +<Function id="f"> +<Parameter id="a" /> +<Parameter id="b" /> +<Parameter id="c" /> +<Scope> +<Variable id="d" /> +<Scope> +<Variable id="e" /> +</Scope> +</Scope> +</Function> +</Program> diff --git a/c_parser/test/ref/07.stdout.xml b/c_parser/test/ref/07.stdout.xml new file mode 100644 index 0000000..baedd20 --- /dev/null +++ b/c_parser/test/ref/07.stdout.xml @@ -0,0 +1,6 @@ +<?xml version="1.0"?> +<Program> +<Scope> +<Variable id="z" /> +</Scope> +</Program> diff --git a/c_parser/test/test_parser.c b/c_parser/test/test_parser.c deleted file mode 100644 index 55a15b7..0000000 --- a/c_parser/test/test_parser.c +++ /dev/null @@ -1,16 +0,0 @@ -int a; -int b; -int c; -int yann, is, the, best; -int d = 0; -int hello = 122, asd = 123; - -int f(int i, int b, int c, int d) { - int a; -} - -int func(int asd, int b) { - int a, b, c; - int c = 0; - int d; -} |