SubDir PLASMA NDDL test compiler ;

if ! $(PLASMA_READY) {

local compiler_test = no-world.nddl ;
local hh = $(compiler_test:S=.hh) ;
local cc = $(compiler_test:S=.cc) ;
LocalDepends nddl-tests : $(hh) $(cc) ;
NddlCompiler $(hh) $(cc) : $(compiler_test) ;
ModuleObjects NddlMain.cc : NDDL ;

local model ;

for model in
	csp.0.nddl csp.1.nddl csp.2.nddl classes.0.tx.nddl classes.1.tx.nddl
	classes.2.tx.nddl inheritance.0.nddl inheritance.1.nddl inheritance.2.nddl
	composition.0.nddl nddl.tx.nddl nddl.tx.0.nddl nddl.tx.1.nddl nddl.tx.2.nddl
	class-constructor.nddl   simple-rules.nddl guards.nddl
	existential.nddl         plasma-base.nddl  subclass.nddl
	simple-class.nddl constraint-test.nddl
	interval-constants.nddl  simple-predicate.nddl
	less-basic-model.nddl    foreach-exec.nddl
	gnats-2537.nddl #gnats-3100.nddl
        simple-resources.nddl 
        multi-resources.nddl
	multidot.nddl gnats_2830.nddl globals.nddl string-domain.nddl
	gnats_3140.nddl
{
  local exe = $(model:S=) ;
  NddlMain $(exe) : NddlMain.o : $(model) : NDDL ;
  RunModuleMain run-$(exe) : $(exe) : $(model:S=.xml) ;

	local hh = $(model:S=.hh) ;
	local cc = [ FGristFiles $(model:S=.cc) ] ;

	if $(INVALID)
	{
		GenerateValid generate-valids : $(hh) $(cc) ;
		LocalDepends run-nddl-tests : generate-valids ;
	}
	else
	{
		ALWAYS $(hh).diff $(cc).diff ;
		NOTFILE $(hh).diff $(cc).diff ;
		Diff $(hh).diff : $(hh).valid $(hh) ;
		Diff $(cc).diff : $(cc).valid $(cc) ;
  	LocalDepends run-nddl-tests : $(hh).diff $(cc).diff ;
	}

  LocalDepends run-nddl-tests : run-$(exe) ;
}

} # PLASMA_READY
