/* check if remote pcn calls are defined and exported, and if exported calls are defined */ -proc_metacalls(export, tests:is_program, co_export:remote_call, coll:d_mvalue) export() {; coll:collect(tests:is_program(),co_export:remote_call(),RC), lookup(RC), /* try to find RC in the export lists */ coll:collect(true(), coll:d_mvalue("exports"), T), lookup(T) /* try to find the definitions of exported calls */ } remote_call(id, defn, r) { ? id ?= {_,mod,name}, defn ?= program(args, decl, block) -> {|| intermodules(mod,block,r) } } intermodules(local_mod, block,r) { ? block ?= block(_, blocks) -> {|| map_list(co_export:intermodules(),blocks,local_mod,r)}, block ?= call(id,_,_), id ?= {_,mod,name}, mod != local_mod -> {|| r=[id]}, block ?= call(id,_,_), id ?= {_,mod,name}, mod == local_mod -> {|| r=[]}, block ?= {"->",_,Block} -> {|| intermodules(local_mod,Block,r) }, block ?= prim(_,_) -> {|| r=[] } } map_list(op,L,arg,r) { ? L ?= [x|Xs] -> { ; op:apply(op,{arg,x,R}), map_list(op,Xs,arg,R1), coll:merge(R,R1,r) }, L ?= [] -> {|| r=[] } } -proc_metacalls(lookup, tests:mnamed, coll:name, tests:in_module, coll:d_mvalue) lookup(RC) { ? RC ?= [id|RCs], id ?= {_,mod,name} -> { ; coll:collect(tests:mnamed([id]),coll:name(),NM), { ? NM==[] -> {|| co:msg(["Error: ",mod,":",name," is referenced or exported but is not defined"])}, default -> { ; coll:collect(tests:in_module(mod), coll:d_mvalue("exports"),T), { ? T != [] -> {|| tests:on(id,T,R) }, default -> {|| R="true" } }, { ? R =="false" -> {|| co:msg(["Error: ",name," is not exported in ",mod," but is called from other module"])}, R == "true" -> {|| skip() } } } }, lookup(RCs) }, RC ?= [] -> {|| skip() } }