URL:
https://svn.lrde.epita.fr/svn/scool/branches/scool-ng
ChangeLog:
2008-09-17 Maxime van Noppen <yabo(a)lrde.epita.fr>
Add reference files for tests on functions and variables
* check.sh: Evaluate properly the test command.
* config: Add a new test suite.
* function/c++_src/declaration_001.cc: New.
* function/c++_src/declaration_002.cc: New.
* function/c++_src/declaration_003.cc: New.
* function/c++_src/declaration_004.cc: New.
* function/c++_src/declaration_005.cc: New.
* function/c++_src/declaration_006.cc: New.
* function/c++_src/declaration_007.cc: New.
* function/c++_src/declaration_008.cc: New.
* function/c++_src/definition_001.cc: New.
* function/c++_src/definition_002.cc: New.
* function/c++_src/definition_003.cc: New.
* variable/c++_src/declaration_001.cc: New.
* variable/c++_src/declaration_002.cc: New.
* variable/c++_src/declaration_003.cc: New.
* variable/c++_src/declaration_004.cc: New.
* variable/c++_src/declaration_007.cc: New.
check.sh | 2 +-
config | 18 +++++++++++++++++-
function/c++_src/declaration_001.cc | 1 +
function/c++_src/declaration_002.cc | 1 +
function/c++_src/declaration_003.cc | 1 +
function/c++_src/declaration_004.cc | 3 +++
function/c++_src/declaration_005.cc | 2 ++
function/c++_src/declaration_006.cc | 2 ++
function/c++_src/declaration_007.cc | 2 ++
function/c++_src/declaration_008.cc | 2 ++
function/c++_src/definition_001.cc | 3 +++
function/c++_src/definition_002.cc | 4 ++++
function/c++_src/definition_003.cc | 4 ++++
variable/c++_src/declaration_001.cc | 1 +
variable/c++_src/declaration_002.cc | 1 +
variable/c++_src/declaration_003.cc | 1 +
variable/c++_src/declaration_004.cc | 1 +
variable/c++_src/declaration_007.cc | 1 +
18 files changed, 48 insertions(+), 2 deletions(-)
Index: branches/scool-ng/tests/config
===================================================================
--- branches/scool-ng/tests/config (revision 86)
+++ branches/scool-ng/tests/config (revision 87)
@@ -1,4 +1,4 @@
-number_of_tests=2
+number_of_tests=3
test_1 ()
{
@@ -29,3 +29,19 @@
ref_dir="c++_ast"
ref_extension=".aterm"
}
+
+test_3 ()
+{
+ desc="C++ pretty printer"
+ cmd='../../src/pp-cxx/pp-cxx -i $input_file | abox2text'
+ cmp='diff -EwbB -u $ref $output'
+ print_input_cmd='pp-aterm -i $input_file'
+ print_output_cmd='cat $input_file'
+
+ input_files="c++_ast/*.aterm"
+ input_extension=".aterm"
+
+ ref_dir="c++_src"
+ ref_extension=".cc"
+}
+
Index: branches/scool-ng/tests/function/c++_src/declaration_007.cc
===================================================================
--- branches/scool-ng/tests/function/c++_src/declaration_007.cc (revision 0)
+++ branches/scool-ng/tests/function/c++_src/declaration_007.cc (revision 87)
@@ -0,0 +1,2 @@
+template < typename T, typename S >
+void foo(const T& a, const S& b);
Index: branches/scool-ng/tests/function/c++_src/declaration_008.cc
===================================================================
--- branches/scool-ng/tests/function/c++_src/declaration_008.cc (revision 0)
+++ branches/scool-ng/tests/function/c++_src/declaration_008.cc (revision 87)
@@ -0,0 +1,2 @@
+template < bool B >
+void foo();
Index: branches/scool-ng/tests/function/c++_src/declaration_001.cc
===================================================================
--- branches/scool-ng/tests/function/c++_src/declaration_001.cc (revision 0)
+++ branches/scool-ng/tests/function/c++_src/declaration_001.cc (revision 87)
@@ -0,0 +1 @@
+void foo();
Index: branches/scool-ng/tests/function/c++_src/declaration_002.cc
===================================================================
--- branches/scool-ng/tests/function/c++_src/declaration_002.cc (revision 0)
+++ branches/scool-ng/tests/function/c++_src/declaration_002.cc (revision 87)
@@ -0,0 +1 @@
+void foo(int a);
Index: branches/scool-ng/tests/function/c++_src/declaration_003.cc
===================================================================
--- branches/scool-ng/tests/function/c++_src/declaration_003.cc (revision 0)
+++ branches/scool-ng/tests/function/c++_src/declaration_003.cc (revision 87)
@@ -0,0 +1 @@
+void foo(int a, const bar& b);
Index: branches/scool-ng/tests/function/c++_src/declaration_004.cc
===================================================================
--- branches/scool-ng/tests/function/c++_src/declaration_004.cc (revision 0)
+++ branches/scool-ng/tests/function/c++_src/declaration_004.cc (revision 87)
@@ -0,0 +1,3 @@
+void foo();
+float foo(int arg1);
+char foo(const toto& arg1, double& arg2);
Index: branches/scool-ng/tests/function/c++_src/definition_001.cc
===================================================================
--- branches/scool-ng/tests/function/c++_src/definition_001.cc (revision 0)
+++ branches/scool-ng/tests/function/c++_src/definition_001.cc (revision 87)
@@ -0,0 +1,3 @@
+void answer()
+{
+}
Index: branches/scool-ng/tests/function/c++_src/declaration_005.cc
===================================================================
--- branches/scool-ng/tests/function/c++_src/declaration_005.cc (revision 0)
+++ branches/scool-ng/tests/function/c++_src/declaration_005.cc (revision 87)
@@ -0,0 +1,2 @@
+template < typename T >
+void foo();
Index: branches/scool-ng/tests/function/c++_src/definition_002.cc
===================================================================
--- branches/scool-ng/tests/function/c++_src/definition_002.cc (revision 0)
+++ branches/scool-ng/tests/function/c++_src/definition_002.cc (revision 87)
@@ -0,0 +1,4 @@
+void answer()
+{
+ const int i;
+}
Index: branches/scool-ng/tests/function/c++_src/declaration_006.cc
===================================================================
--- branches/scool-ng/tests/function/c++_src/declaration_006.cc (revision 0)
+++ branches/scool-ng/tests/function/c++_src/declaration_006.cc (revision 87)
@@ -0,0 +1,2 @@
+template < typename T >
+void foo(const T& a);
Index: branches/scool-ng/tests/function/c++_src/definition_003.cc
===================================================================
--- branches/scool-ng/tests/function/c++_src/definition_003.cc (revision 0)
+++ branches/scool-ng/tests/function/c++_src/definition_003.cc (revision 87)
@@ -0,0 +1,4 @@
+int answer()
+{
+ return 42;
+}
Index: branches/scool-ng/tests/variable/c++_src/declaration_007.cc
===================================================================
--- branches/scool-ng/tests/variable/c++_src/declaration_007.cc (revision 0)
+++ branches/scool-ng/tests/variable/c++_src/declaration_007.cc (revision 87)
@@ -0,0 +1 @@
+const int i;
Index: branches/scool-ng/tests/variable/c++_src/declaration_001.cc
===================================================================
--- branches/scool-ng/tests/variable/c++_src/declaration_001.cc (revision 0)
+++ branches/scool-ng/tests/variable/c++_src/declaration_001.cc (revision 87)
@@ -0,0 +1 @@
+const int i;
Index: branches/scool-ng/tests/variable/c++_src/declaration_002.cc
===================================================================
--- branches/scool-ng/tests/variable/c++_src/declaration_002.cc (revision 0)
+++ branches/scool-ng/tests/variable/c++_src/declaration_002.cc (revision 87)
@@ -0,0 +1 @@
+const int i = 42;
Index: branches/scool-ng/tests/variable/c++_src/declaration_003.cc
===================================================================
--- branches/scool-ng/tests/variable/c++_src/declaration_003.cc (revision 0)
+++ branches/scool-ng/tests/variable/c++_src/declaration_003.cc (revision 87)
@@ -0,0 +1 @@
+int i;
Index: branches/scool-ng/tests/variable/c++_src/declaration_004.cc
===================================================================
--- branches/scool-ng/tests/variable/c++_src/declaration_004.cc (revision 0)
+++ branches/scool-ng/tests/variable/c++_src/declaration_004.cc (revision 87)
@@ -0,0 +1 @@
+int i = 42;
Index: branches/scool-ng/tests/check.sh
===================================================================
--- branches/scool-ng/tests/check.sh (revision 86)
+++ branches/scool-ng/tests/check.sh (revision 87)
@@ -47,7 +47,7 @@
if [ ! -r $ref -a $flush_sk -eq 0 ]; then return 1; fi
- $rcmd > $cmd_log 2> $cmd_err
+ eval $rcmd > $cmd_log 2> $cmd_err
cexit_val=$?
if [ ! -r $ref ]; then
--
\__/ \__/
(00) Maxime `yabo` van Noppen (00)
___) \ Epita 2009 / (___
(_____/ \_____)