added rbt to test-suite
git-svn-id: https://projects.brucker.ch/su4sml/svn/su4sml/trunk@8389 3260e6d1-4efc-4170-b0a7-36055960796d
This commit is contained in:
parent
62d0aeaab1
commit
c8ad578285
|
@ -6,7 +6,7 @@
|
||||||
* This file is part of su4sml.
|
* This file is part of su4sml.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2006, 2007 ETH Zurich, Switzerland
|
* Copyright (c) 2006, 2007 ETH Zurich, Switzerland
|
||||||
* 2008 Achim D. Brucker, Germany
|
* 2008-2009 Achim D. Brucker, Germany
|
||||||
*
|
*
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -151,6 +151,13 @@ val testcases = [
|
||||||
exclude = [],
|
exclude = [],
|
||||||
result = initResult
|
result = initResult
|
||||||
}:testcase ,
|
}:testcase ,
|
||||||
|
{
|
||||||
|
name = "Red-black Trees",
|
||||||
|
uml = prefix^"rbt/rbt.zargo",
|
||||||
|
ocl = prefix^"rbt/rbt.ocl",
|
||||||
|
exclude = [],
|
||||||
|
result = initResult
|
||||||
|
}:testcase,
|
||||||
{
|
{
|
||||||
name = "Invoicing Orders",
|
name = "Invoicing Orders",
|
||||||
uml = prefix^"InvoicingOrders/InvoicingOrders.zargo",
|
uml = prefix^"InvoicingOrders/InvoicingOrders.zargo",
|
||||||
|
@ -180,55 +187,35 @@ val testcases = [
|
||||||
|
|
||||||
fun test (tc:testcase) =
|
fun test (tc:testcase) =
|
||||||
let
|
let
|
||||||
|
val _ = print ("Running test case '"^(#name tc)^" ...'\n")
|
||||||
val xmi = ModelImport.parseUML (#uml tc)
|
val xmi = ModelImport.parseUML (#uml tc)
|
||||||
handle _ => ([],[])
|
handle _ => ([],[])
|
||||||
val ocl = ModelImport.parseOCL (#ocl tc)
|
val ocl = ModelImport.parseOCL (#ocl tc)
|
||||||
handle _ => []
|
handle _ => []
|
||||||
val OclParse = if ocl = [] then false else true
|
val OclParse = if ocl = [] then false else true
|
||||||
(*
|
|
||||||
val (xmi,ocl) = ModelImport.removePackages (xmi,ocl) (#exclude tc)
|
|
||||||
handle _ => (([],[]),[])
|
|
||||||
*)
|
|
||||||
val _ = print "### Preprocess Context List ###\n"
|
|
||||||
val fixed_ocl = Preprocessor.preprocess_context_list
|
val fixed_ocl = Preprocessor.preprocess_context_list
|
||||||
ocl ((OclLibrary.oclLib)@(#1 xmi))
|
ocl ((OclLibrary.oclLib)@(#1 xmi))
|
||||||
handle _ => []
|
handle _ => []
|
||||||
val OclPreprocess = if fixed_ocl = [] then false else true
|
val OclPreprocess = if fixed_ocl = [] then false else true
|
||||||
val _ = print "### Finished Preprocess Context List ###\n\n"
|
|
||||||
|
|
||||||
val _ = print "### Type Checking ###\n"
|
|
||||||
val typed_cl = TypeChecker.check_context_list
|
val typed_cl = TypeChecker.check_context_list
|
||||||
fixed_ocl (((OclLibrary.oclLib)@(#1 xmi)),#2 xmi)
|
fixed_ocl (((OclLibrary.oclLib)@(#1 xmi)),#2 xmi)
|
||||||
handle _ => []
|
handle _ => []
|
||||||
val OclTC = if typed_cl = [] then false else true
|
val OclTC = if typed_cl = [] then false else true
|
||||||
val _ = print "### Finished Type Checking ###\n\n"
|
|
||||||
|
|
||||||
val _ = print"### Updating Classifier List ###\n"
|
|
||||||
val model = Update_Model.gen_updated_classifier_list
|
val model = Update_Model.gen_updated_classifier_list
|
||||||
typed_cl ((OclLibrary.oclLib)@(#1 xmi))
|
typed_cl ((OclLibrary.oclLib)@(#1 xmi))
|
||||||
handle _ => []
|
handle _ => []
|
||||||
val modelUpdate = if model = [] then false else true
|
val modelUpdate = if model = [] then false else true
|
||||||
val _ = print "### Finished Updating Classifier List ###\n"
|
|
||||||
|
|
||||||
val cl = ModelImport.removeOclLibrary (model)
|
val cl = ModelImport.removeOclLibrary (model)
|
||||||
|
|
||||||
val _ = print"### Transform Model (remove associations) ###\n"
|
|
||||||
val cl = FixTyping.transform_ocl_spec FixTyping.transformForHolOcl
|
val cl = FixTyping.transform_ocl_spec FixTyping.transformForHolOcl
|
||||||
(#1 (Rep_Core.normalize_ext (cl, #2 xmi)))
|
(#1 (Rep_Core.normalize_ext (cl, #2 xmi)))
|
||||||
handle _ => []
|
handle _ => []
|
||||||
val transform = if cl = [] then false else true
|
val transform = if cl = [] then false else true
|
||||||
val _ = print "### Finished Transform Model (after transformation) ###\n"
|
|
||||||
|
|
||||||
val _ = print"### RemovingPackages ###\n"
|
|
||||||
val clrm = ModelImport.removePackages (#exclude tc) (cl, #2xmi)
|
val clrm = ModelImport.removePackages (#exclude tc) (cl, #2xmi)
|
||||||
handle _ => (([],[]):Rep_Core.transform_model)
|
handle _ => (([],[]):Rep_Core.transform_model)
|
||||||
val rmPkg = if (#exclude tc) = [] then true
|
val rmPkg = if (#exclude tc) = [] then true
|
||||||
else if (List.length cl) > (List.length (#1 clrm))
|
else if (List.length cl) > (List.length (#1 clrm))
|
||||||
then true
|
then true
|
||||||
else false
|
else false
|
||||||
val _ = print "### Finished Removing Packages ###\n"
|
|
||||||
|
|
||||||
|
|
||||||
val CodeGen =
|
val CodeGen =
|
||||||
let
|
let
|
||||||
val _ = Codegen.generateFromModel xmi "java"
|
val _ = Codegen.generateFromModel xmi "java"
|
||||||
|
@ -236,8 +223,6 @@ fun test (tc:testcase) =
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
handle _ => false
|
handle _ => false
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
@ -309,8 +294,6 @@ fun printSummary res =
|
||||||
()
|
()
|
||||||
end
|
end
|
||||||
|
|
||||||
(* val _ = (Ext_Library.log_level := 1);(); *)
|
|
||||||
|
|
||||||
fun runTest () = let
|
fun runTest () = let
|
||||||
val results = (map test testcases)
|
val results = (map test testcases)
|
||||||
val _ = map printResult results
|
val _ = map printResult results
|
||||||
|
|
Loading…
Reference in New Issue