improved output for testsuite

git-svn-id: https://projects.brucker.ch/su4sml/svn/su4sml/trunk@7973 3260e6d1-4efc-4170-b0a7-36055960796d
This commit is contained in:
Manuel Krucker 2008-05-14 12:15:34 +00:00
parent b4300e78fd
commit a0f2191de0
2 changed files with 17 additions and 29 deletions

View File

@ -87,12 +87,14 @@ val _ = trace high ("............. refine pog constraint loaded ...\n")
val po_rfm_SR = rename_wfpo "po_rfm_SR" (RFM_Data.put ({key=10,rfm_tuple=(["AbstractOverriding"],["ConcreteOverriding"])}) po_rfm) val po_rfm_SR = rename_wfpo "po_rfm_SR" (RFM_Data.put ({key=10,rfm_tuple=(["AbstractOverriding"],["ConcreteOverriding"])}) po_rfm)
val _ = trace high ("............. refine pog constraint loaded ...\n") val _ = trace high ("............. refine pog constraint loaded ...\n")
(* ALL CONSTRAINTS:
(* ALL CONSTRAINTS: *)
val wfc = val wfc =
[wfc_inf_nameclashes,wfc_inf_stereotypes,wfc_inf_all,wfc_vis_class,wfc_vis_inheritance,wfc_vis_runtime,wfc_vis_design_by_contract,wfc_vis,wfc_tax] [wfc_inf_nameclashes,wfc_inf_stereotypes,wfc_inf_all,wfc_vis_class,wfc_vis_inheritance,wfc_vis_runtime,wfc_vis_design_by_contract,wfc_vis_all,wfc_tax]
val pos = val pos =
[po_lsk_pre,po_lsk_post,po_lsk_inv,po_cm,po_sm,po_om,po_cstr_post,po_cstr_attribute,po_cstr] [po_lsk_pre,po_lsk_post,po_lsk_inv,po_cm,po_sm,po_om,po_cstr_post,po_cstr_attribute,po_cstr_all]
*)
(*
val wfcs = [] val wfcs = []
val pos = [po_lsk_inv] val pos = [po_lsk_inv]
*)

View File

@ -71,11 +71,11 @@ val testcases = [
uml = prefix^"simple_rfm/simple_rfm.zargo", uml = prefix^"simple_rfm/simple_rfm.zargo",
ocl = prefix^"simple_rfm/simple_rfm.ocl" ocl = prefix^"simple_rfm/simple_rfm.ocl"
}, },
{ (*{
name = "company", name = "company",
uml = prefix^"company/company.zargo", uml = prefix^"company/company.zargo",
ocl = prefix^"company/company.ocl" ocl = prefix^"company/company.ocl"
}:testcase, }:testcase,*)
{ {
name = "ebank", name = "ebank",
uml = prefix^"ebank/ebank.zargo", uml = prefix^"ebank/ebank.zargo",
@ -91,11 +91,11 @@ val testcases = [
uml = prefix^"isp/isp.zargo", uml = prefix^"isp/isp.zargo",
ocl = prefix^"isp/isp.ocl" ocl = prefix^"isp/isp.ocl"
}:testcase,*) }:testcase,*)
{ (* {
name = "royals_and_loyals", name = "royals_and_loyals",
uml = prefix^"royals_and_loyals/royals_and_loyals.zargo", uml = prefix^"royals_and_loyals/royals_and_loyals.zargo",
ocl = prefix^"royals_and_loyals/royals_and_loyals.ocl" ocl = prefix^"royals_and_loyals/royals_and_loyals.ocl"
}:testcase, }:testcase, *)
{ {
name = "simple", name = "simple",
uml = prefix^"simple/simple.zargo", uml = prefix^"simple/simple.zargo",
@ -111,11 +111,11 @@ val testcases = [
uml = prefix^"vehicles/vehicles.zargo", uml = prefix^"vehicles/vehicles.zargo",
ocl = prefix^"vehicles/vehicles.ocl" ocl = prefix^"vehicles/vehicles.ocl"
}:testcase, }:testcase,
{ (* {
name = "SimpleChair", name = "SimpleChair",
uml = prefix^"SimpleChair/SimpleChair.zargo", uml = prefix^"SimpleChair/SimpleChair.zargo",
ocl = prefix^"SimpleChair/ConcreteSimpleChair01.ocl" ocl = prefix^"SimpleChair/ConcreteSimpleChair01.ocl"
}:testcase, }:testcase, *)
{ {
name = "overriding", name = "overriding",
uml = prefix^"overriding/overriding.zargo", uml = prefix^"overriding/overriding.zargo",
@ -138,12 +138,11 @@ fun start_tests model [] = []
let let
val _ = trace wgen ("Testing a wellformed constraint: \n") val _ = trace wgen ("Testing a wellformed constraint: \n")
val res_wfcs = check_wfcs model [h] val res_wfcs = check_wfcs model [h]
handle WFCPOG.WFC_FailedMessage s => handle WFCPOG.WFC_FailedException (wfc,s) =>
let let
val _ = trace wgen ("WFC_Failed_Exception handler ...\n") val _ = buffer:=((!buffer)^"\n\n"^s)
val _ = buffer:=((!buffer)^s)
in in
raise WFCPOG.WFC_FailedException(h,s) [(h,false)]
end end
val check = List.all (fn (a,b) => b = true) res_wfcs val check = List.all (fn (a,b) => b = true) res_wfcs
in in
@ -174,11 +173,11 @@ fun start_tests model [] = []
let let
val _ = trace wgen ("Testing a proof obligation constraint: \n") val _ = trace wgen ("Testing a proof obligation constraint: \n")
val pos = generate_pos model [h] val pos = generate_pos model [h]
handle WFCPOG.WFC_FailedMessage s => handle WFCPOG.WFC_FailedException (po,s) =>
let let
val _ = buffer:=((!buffer)^s) val _ = buffer:=((!buffer)^s)
in in
raise WFCPOG.WFC_FailedException (h,s) [(h,[(["Exception"],(Variable("x",OclVoid)))])]
end end
in in
case pos of case pos of
@ -234,12 +233,6 @@ fun runTest name wfs pos =
val _ = trace wgen ("Accessing model ...\n") val _ = trace wgen ("Accessing model ...\n")
val s1 = (print_tc tc) val s1 = (print_tc tc)
val _ = (test tc wfs pos) val _ = (test tc wfs pos)
handle WFCPOG.WFC_FailedException (wfpo,s) =>
let
val _ = buffer:=((!buffer)^s)
in
[]
end
val _ = buffer:=s1^(!buffer) val _ = buffer:=s1^(!buffer)
in in
(if (String.isSubstring "[Error]" (!buffer)) (if (String.isSubstring "[Error]" (!buffer))
@ -258,13 +251,6 @@ fun runTests wfs pos =
val s1 = (print_tc a) val s1 = (print_tc a)
val _ = buffer:=(!buffer)^s1 val _ = buffer:=(!buffer)^s1
val data = (test a wfs pos) val data = (test a wfs pos)
handle WFCPOG.WFC_FailedException (wfpo,s) =>
let
val _ = buffer:=((!buffer)^s)
val _ = trace wgen (!buffer)
in
raise WFCPOG_TestSuiteError ("one wfc failed\n")
end
in in
data data
end) testcases end) testcases