From 8638f32c4624d8d7b225eaf43333ba926c5acaf0 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Sat, 10 Mar 2018 23:22:10 +0000 Subject: Fixing tests --- .gitignore | 1 - c_parser/test/in/08.c | 6 +++--- c_parser/test/in/09.c | 8 ++++---- c_parser/test/ref/01.stdout.xml | 9 +++++++++ c_parser/test/ref/02.stdout.xml | 6 ++++++ c_parser/test/ref/03.stdout.xml | 7 +++++++ c_parser/test/ref/04.stdout.xml | 12 ++++++++++++ c_parser/test/ref/05.stdout.xml | 10 ++++++++++ c_parser/test/ref/06.stdout.xml | 14 ++++++++++++++ c_parser/test/ref/07.stdout.xml | 11 +++++++++++ c_parser/test/ref/08.stdout.xml | 16 ++++++++++++++++ c_parser/test/ref/09.stdout.xml | 20 ++++++++++++++++++++ c_parser/test/ref/10.stdout.xml | 19 +++++++++++++++++++ c_parser/test/ref/11.stdout.xml | 11 +++++++++++ c_parser/test/ref/12.stdout.xml | 10 ++++++++++ c_parser/test/ref/13.stdout.xml | 13 +++++++++++++ c_parser/test/ref/14.stdout.xml | 13 +++++++++++++ c_parser/test/ref/15.stdout.xml | 32 ++++++++++++++++++++++++++++++++ test_parser.sh | 2 ++ 19 files changed, 212 insertions(+), 8 deletions(-) create mode 100644 c_parser/test/ref/01.stdout.xml create mode 100644 c_parser/test/ref/02.stdout.xml create mode 100644 c_parser/test/ref/03.stdout.xml create mode 100644 c_parser/test/ref/04.stdout.xml create mode 100644 c_parser/test/ref/05.stdout.xml create mode 100644 c_parser/test/ref/06.stdout.xml create mode 100644 c_parser/test/ref/07.stdout.xml create mode 100644 c_parser/test/ref/08.stdout.xml create mode 100644 c_parser/test/ref/09.stdout.xml create mode 100644 c_parser/test/ref/10.stdout.xml create mode 100644 c_parser/test/ref/11.stdout.xml create mode 100644 c_parser/test/ref/12.stdout.xml create mode 100644 c_parser/test/ref/13.stdout.xml create mode 100644 c_parser/test/ref/14.stdout.xml create mode 100644 c_parser/test/ref/15.stdout.xml diff --git a/.gitignore b/.gitignore index 994633a..4a5f1b1 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,6 @@ build/ bin/ -ref/ out/ # ignore all files with these extensions diff --git a/c_parser/test/in/08.c b/c_parser/test/in/08.c index c57a6ab..dfac1e5 100644 --- a/c_parser/test/in/08.c +++ b/c_parser/test/in/08.c @@ -1,10 +1,10 @@ int func(int a, int b) { int c = 0; if(a == b) { - int d; + int d; } else if(a == d) { - int e; - return d; + int e; + return d; } return c; } diff --git a/c_parser/test/in/09.c b/c_parser/test/in/09.c index ae86bb1..950ae7c 100644 --- a/c_parser/test/in/09.c +++ b/c_parser/test/in/09.c @@ -6,10 +6,10 @@ int g; int zz(int a, int b, int c) { if(a==b){ - int a; - return a; + int a; + return a; }else{ - int fsdfsdfs; - return c; + int fsdfsdfs; + return c; } } diff --git a/c_parser/test/ref/01.stdout.xml b/c_parser/test/ref/01.stdout.xml new file mode 100644 index 0000000..e0545e4 --- /dev/null +++ b/c_parser/test/ref/01.stdout.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/c_parser/test/ref/02.stdout.xml b/c_parser/test/ref/02.stdout.xml new file mode 100644 index 0000000..1f73bca --- /dev/null +++ b/c_parser/test/ref/02.stdout.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/c_parser/test/ref/03.stdout.xml b/c_parser/test/ref/03.stdout.xml new file mode 100644 index 0000000..6ab6ab3 --- /dev/null +++ b/c_parser/test/ref/03.stdout.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/c_parser/test/ref/04.stdout.xml b/c_parser/test/ref/04.stdout.xml new file mode 100644 index 0000000..caae53b --- /dev/null +++ b/c_parser/test/ref/04.stdout.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/c_parser/test/ref/05.stdout.xml b/c_parser/test/ref/05.stdout.xml new file mode 100644 index 0000000..944d950 --- /dev/null +++ b/c_parser/test/ref/05.stdout.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/c_parser/test/ref/06.stdout.xml b/c_parser/test/ref/06.stdout.xml new file mode 100644 index 0000000..6422001 --- /dev/null +++ b/c_parser/test/ref/06.stdout.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/c_parser/test/ref/07.stdout.xml b/c_parser/test/ref/07.stdout.xml new file mode 100644 index 0000000..11c3b77 --- /dev/null +++ b/c_parser/test/ref/07.stdout.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/c_parser/test/ref/08.stdout.xml b/c_parser/test/ref/08.stdout.xml new file mode 100644 index 0000000..6cf0f8e --- /dev/null +++ b/c_parser/test/ref/08.stdout.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/c_parser/test/ref/09.stdout.xml b/c_parser/test/ref/09.stdout.xml new file mode 100644 index 0000000..6c137df --- /dev/null +++ b/c_parser/test/ref/09.stdout.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/c_parser/test/ref/10.stdout.xml b/c_parser/test/ref/10.stdout.xml new file mode 100644 index 0000000..89a6292 --- /dev/null +++ b/c_parser/test/ref/10.stdout.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/c_parser/test/ref/11.stdout.xml b/c_parser/test/ref/11.stdout.xml new file mode 100644 index 0000000..b9779d7 --- /dev/null +++ b/c_parser/test/ref/11.stdout.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/c_parser/test/ref/12.stdout.xml b/c_parser/test/ref/12.stdout.xml new file mode 100644 index 0000000..9f49265 --- /dev/null +++ b/c_parser/test/ref/12.stdout.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/c_parser/test/ref/13.stdout.xml b/c_parser/test/ref/13.stdout.xml new file mode 100644 index 0000000..a604ecd --- /dev/null +++ b/c_parser/test/ref/13.stdout.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/c_parser/test/ref/14.stdout.xml b/c_parser/test/ref/14.stdout.xml new file mode 100644 index 0000000..866d44e --- /dev/null +++ b/c_parser/test/ref/14.stdout.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/c_parser/test/ref/15.stdout.xml b/c_parser/test/ref/15.stdout.xml new file mode 100644 index 0000000..b06dde0 --- /dev/null +++ b/c_parser/test/ref/15.stdout.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test_parser.sh b/test_parser.sh index 3e56054..1bf6a44 100755 --- a/test_parser.sh +++ b/test_parser.sh @@ -20,6 +20,8 @@ echo " Testing parser" PASSED=0 CHECKED=0 +mkdir -p c_parser/test/out + for i in c_parser/test/in/*.c; do echo "===========================" echo "" -- cgit