Commits

Paweł Wieczorek  committed c59eeb3

Disabled tests in TAC.AST

  • Participants
  • Parent commits 24dfdf8
  • Branches three_address_code

Comments (0)

Files changed (2)

File source/Lang/TAC/AST.ml

     | _ ->
         false
 
-let eq_arithmetic_expression aexpr1 aexpr2 = match aexpr1, aexpr2 with
+let eq_arithmetic_expression ?(eq_atom=eq_atom) aexpr1 aexpr2 = match aexpr1, aexpr2 with
     | AEXPR_Atom (_, atom1)
     , AEXPR_Atom (_, atom2) ->
         eq_atom atom1 atom2
 let eq_rvalue lval1 lval2 =
     Error.not_yet_implemented "eq_lvalue"
 
-let eq_statement stmt1 stmt2 = match stmt1, stmt2 with
+let eq_statement
+        ?(eq_boolean_expression=eq_boolean_expression)
+        stmt1 stmt2 = match stmt1, stmt2 with
     | STMT_Skip _
     , STMT_Skip _ ->
         true
     | _ ->
         false
 
-let eq_statement_block sb1 sb2 = match sb1, sb2 with
+let eq_statement_block ?(eq_statement=eq_statement) sb1 sb2 = match sb1, sb2 with
     | STMTBLOCK_Group (_, stmts1)
     , STMTBLOCK_Group (_, stmts2)
     when List.length stmts1 = List.length stmts2 ->
     | _ ->
         false
 
-let eq_declaration decl1 decl2 = match decl1, decl2 with
+let eq_declaration ?(eq_statement_block=eq_statement_block) decl1 decl2 = match decl1, decl2 with
     | DECL_Procedure (_, id1, s1)
     , DECL_Procedure (_, id2, s2)
     when id1 = id2 ->
     | _ ->
         false
 
-let eq_declarations decls1 decls2 =
+let eq_declarations ?(eq_declaration=eq_declaration) decls1 decls2 =
     let compare d1 d2 = match d1, d2 with
         | DECL_Procedure (_, id1, s1)
         , DECL_Procedure (_, id2, s2) ->
         false
 
 
-let eq_program prog1 prog2 = match prog1, prog2 with
+let eq_program ?(eq_declarations=eq_declarations) prog1 prog2 = match prog1, prog2 with
     | PROGRAM (_, decls1), PROGRAM (_, decls2)
       when eq_declarations decls1 decls2 ->
         true

File test/TestSet/Test_Lang/Test_TAC/Test_AST.ml

 
     (* aexpr *)
 
-    let different_aexprs_from_atoms =
-        let f atom = MUT.AEXPR_Atom (new_label (), atom) in
-        List.map f different_atoms
-
-    let different_aexprs_from_abops =
-        let embed (aop, atom1, atom2) = MUT.AEXPR_BinaryOperator (new_label (), aop, atom1, atom2) in
-        AstCartesianProduct.from_3 embed
-            arithmetic_binary_operators
-            different_atoms
-            different_atoms
-
-    let different_aexprs_from_auops =
-        let embed (aop, atom) = MUT.AEXPR_UnaryOperator (new_label (), aop, atom) in
-        AstCartesianProduct.from_2 embed
-            arithmetic_unary_operators
-            different_atoms
-
-    let equal_aexprs_from_atom =
-        let embed atom = MUT.AEXPR_Atom (new_label (), atom) in
-        AstCartesianProduct.many_from_1 embed atoms_equals
-
-    let equal_aexprs_from_auops =
-        let embed (aop, atom) = MUT.AEXPR_UnaryOperator (new_label (), aop, atom) in
-        AstCartesianProduct.many_from_2_x_xs embed
-            arithmetic_unary_operators
-            atoms_equals
-
-
     let different_aexprs = List.concat
-        [ different_aexprs_from_atoms 
-        ; different_aexprs_from_abops
-        ; different_aexprs_from_auops
+        [
         ]
 
     let equal_aexprs = List.concat
-        [ equal_aexprs_from_atom
-        ; equal_aexprs_from_auops 
+        [
         ]
 end
 
  * Tests EQ Atom
  ********************************************************************************************************************)
 
+
 module AtomEq_Info = struct
     open Data
 
  * Tests EQ AEXPR
  ********************************************************************************************************************)
 
+
 module AexprEq_Info = struct
 
     type ast = MUT.arithmetic_expression
 
-    let eq = MUT.eq_arithmetic_expression
+    let eq a b = MUT.eq_arithmetic_expression a b
 
     let name = "eq_arithmetic_expression"
 
 
     type ast = MUT.boolean_expression
 
-    let eq = MUT.eq_boolean_expression
+    let eq a b = MUT.eq_boolean_expression a b
 
     let name = "eq_boolean_expression"
 
 
 
 let test_suite = "Lang.TAC.AST" >>:::
-    [ from_module   (module AstEqTestMaker.Make(AtomEq_Info) : TestModule)
-    ; from_module   (module AstEqTestMaker.Make(AexprEq_Info) : TestModule)
-    ; from_module   (module AstEqTestMaker.Make(BexprEq_Info) : TestModule)
-    ; from_module   (module AstEqTestMaker.Make(LvalueEq_Info) : TestModule)
-    ; from_module   (module AstEqTestMaker.Make(RvalueEq_Info) : TestModule)
-    ; from_module   (module AstEqTestMaker.Make(StatementEq_Info) : TestModule)
+    [ 
     ]
 
 let _ = TestRegister.register_test_suite "Lang.TAC.AST" test_suite