TEST = ../../../../rtest -v

TESTFILES = \
PowerSystems.Examples.AC1ph_DC.Drives.BLDC.mos \
PowerSystems.Examples.AC1ph_DC.Drives.BLDCcharSpeed.mos \
PowerSystems.Examples.AC1ph_DC.Drives.DCcharSpeed.mos \
PowerSystems.Examples.AC1ph_DC.Drives.DCmotor_par.mos \
PowerSystems.Examples.AC1ph_DC.Drives.DCmotor_pm.mos \
PowerSystems.Examples.AC1ph_DC.Drives.DCmotor_ser.mos \
PowerSystems.Examples.AC1ph_DC.Elementary.Breaker.mos \
PowerSystems.Examples.AC1ph_DC.Elementary.DoubleLine.mos \
PowerSystems.Examples.AC1ph_DC.Elementary.Fault.mos \
PowerSystems.Examples.AC1ph_DC.Elementary.Impedance.mos \
PowerSystems.Examples.AC1ph_DC.Elementary.ImpedanceOneTerm.mos \
PowerSystems.Examples.AC1ph_DC.Elementary.Inverter.mos \
PowerSystems.Examples.AC1ph_DC.Elementary.Line.mos \
PowerSystems.Examples.AC1ph_DC.Elementary.LoadAC.mos \
PowerSystems.Examples.AC1ph_DC.Elementary.LoadDC.mos \
PowerSystems.Examples.AC1ph_DC.Elementary.Machines.mos \
PowerSystems.Examples.AC1ph_DC.Elementary.Rectifier.mos \
PowerSystems.Examples.AC1ph_DC.Elementary.Sensor.mos \
PowerSystems.Examples.AC1ph_DC.Elementary.Source.mos \
PowerSystems.Examples.AC1ph_DC.Elementary.Transformer.mos \
PowerSystems.Examples.AC1ph_DC.Inverters.Chopper.mos \
PowerSystems.Examples.AC1ph_DC.Inverters.InverterAvToGrid.mos \
PowerSystems.Examples.AC1ph_DC.Inverters.InverterToGrid.mos \
PowerSystems.Examples.AC1ph_DC.Inverters.InverterToLoad.mos \
PowerSystems.Examples.AC1ph_DC.Inverters.Rectifier.mos \
PowerSystems.Examples.AC1ph_DC.Transformation.OnePhase.mos \
PowerSystems.Examples.AC1ph_DC.Transformation.TapChanger.mos \
PowerSystems.Examples.AC3ph.Drives.ASM.mos \
PowerSystems.Examples.AC3ph.Drives.ASM_Y_D.mos \
PowerSystems.Examples.AC3ph.Drives.ASM_ctrl.mos \
PowerSystems.Examples.AC3ph.Drives.ASM_ctrlAv.mos \
PowerSystems.Examples.AC3ph.Drives.ASMav.mos \
PowerSystems.Examples.AC3ph.Drives.ASMav_icontrol.mos \
PowerSystems.Examples.AC3ph.Drives.ASMcharacteristic.mos \
PowerSystems.Examples.AC3ph.Drives.SM_ctrl.mos \
PowerSystems.Examples.AC3ph.Drives.SM_ctrlAv.mos \
PowerSystems.Examples.AC3ph.Elementary.Breaker.mos \
PowerSystems.Examples.AC3ph.Elementary.Fault.mos \
PowerSystems.Examples.AC3ph.Elementary.Impedance.mos \
PowerSystems.Examples.AC3ph.Elementary.ImpedanceYD.mos \
PowerSystems.Examples.AC3ph.Elementary.Inverter.mos \
PowerSystems.Examples.AC3ph.Elementary.Line.mos \
PowerSystems.Examples.AC3ph.Elementary.Load.mos \
PowerSystems.Examples.AC3ph.Elementary.Machines.mos \
PowerSystems.Examples.AC3ph.Elementary.Rectifier.mos \
PowerSystems.Examples.AC3ph.Elementary.Sensor.mos \
PowerSystems.Examples.AC3ph.Elementary.Source.mos \
PowerSystems.Examples.AC3ph.Elementary.Transformer.mos \
PowerSystems.Examples.AC3ph.Generation.GenOrder3and7.mos \
PowerSystems.Examples.AC3ph.Generation.Islanding.mos \
PowerSystems.Examples.AC3ph.Generation.LocalGeneration.mos \
PowerSystems.Examples.AC3ph.Generation.PQsource.mos \
PowerSystems.Examples.AC3ph.Generation.PVsource.mos \
PowerSystems.Examples.AC3ph.Generation.PowerAngle.mos \
PowerSystems.Examples.AC3ph.Generation.TieLine.mos \
PowerSystems.Examples.AC3ph.Generation.TurbineGenerator.mos \
PowerSystems.Examples.AC3ph.Generation.TurbineGeneratorLine.mos \
PowerSystems.Examples.AC3ph.Generation.TurboGeneratorLine.mos \
PowerSystems.Examples.AC3ph.Generation.TurboGroupGenerator.mos \
PowerSystems.Examples.AC3ph.Generation.Vsource.mos \
PowerSystems.Examples.AC3ph.Generation.WindGeneratorLine.mos \
PowerSystems.Examples.AC3ph.Inverters.InverterAvToGrid.mos \
PowerSystems.Examples.AC3ph.Inverters.InverterToGrid.mos \
PowerSystems.Examples.AC3ph.Inverters.InverterToLoad.mos \
PowerSystems.Examples.AC3ph.Inverters.Rectifier.mos \
PowerSystems.Examples.AC3ph.Precalculation.EqCircFromTransDat.mos \
PowerSystems.Examples.AC3ph.Precalculation.TransDatFromEqCirc.mos \
PowerSystems.Examples.AC3ph.Precalculation.Z_matrixEqCirc0.mos \
PowerSystems.Examples.AC3ph.Precalculation.Z_matrixEqCirc1.mos \
PowerSystems.Examples.AC3ph.Precalculation.Z_matrixEqCirc2.mos \
PowerSystems.Examples.AC3ph.Precalculation.Z_matrixEqCirc3.mos \
PowerSystems.Examples.AC3ph.Precalculation.Z_matrixTrDat0.mos \
PowerSystems.Examples.AC3ph.Precalculation.Z_matrixTrDat1.mos \
PowerSystems.Examples.AC3ph.Precalculation.Z_matrixTrDat2.mos \
PowerSystems.Examples.AC3ph.Precalculation.Z_matrixTrDat3.mos \
PowerSystems.Examples.AC3ph.Transformation.PhaseShifts.mos \
PowerSystems.Examples.AC3ph.Transformation.TapChanger.mos \
PowerSystems.Examples.AC3ph.Transformation.ThreeWinding.mos \
PowerSystems.Examples.AC3ph.Transmission.DoubleLineTG.mos \
PowerSystems.Examples.AC3ph.Transmission.DoubleRXline.mos \
PowerSystems.Examples.AC3ph.Transmission.DoubleRXlineTG.mos \
PowerSystems.Examples.AC3ph.Transmission.FaultRXline.mos \
PowerSystems.Examples.AC3ph.Transmission.FaultTline.mos \
PowerSystems.Examples.AC3ph.Transmission.PowerTransfer.mos \
PowerSystems.Examples.AC3ph.Transmission.RXline.mos \
PowerSystems.Examples.AC3ph.Transmission.Tline.mos \
PowerSystems.Examples.AC3ph.Transmission.VoltageStability.mos \
PowerSystems.Examples.Generic.Network.NetworkControlled.mos \
PowerSystems.Examples.Generic.Network.NetworkLoop.mos \
PowerSystems.Examples.Generic.Network.NetworkLoop_d.mos \
PowerSystems.Examples.Generic.Network.NetworkLoop_dq.mos \
PowerSystems.Examples.Generic.Network.NetworkLoop_dq0.mos \
PowerSystems.Examples.Generic.Network.NetworkOpened.mos \
PowerSystems.Examples.Generic.Test.AdmittanceTest.mos \
PowerSystems.Examples.Generic.Test.FixedCurrentTest.mos \
PowerSystems.Examples.Generic.Test.FixedLoadTest.mos \
PowerSystems.Examples.Generic.Test.GeneratorTest.mos \
PowerSystems.Examples.Generic.Test.GeneratorTest2.mos \
PowerSystems.Examples.Generic.Test.ImpedanceTest.mos \
PowerSystems.Examples.Generic.Test.InductiveLoadTest.mos \
PowerSystems.Examples.Generic.Test.PMeterTest.mos \
PowerSystems.Examples.Introductory.Display.mos \
PowerSystems.Examples.Introductory.Frequency.mos \
PowerSystems.Examples.Introductory.InitialSteadyState.mos \
PowerSystems.Examples.Introductory.ReferenceInertial.mos \
PowerSystems.Examples.Introductory.ReferenceSynchron.mos \
PowerSystems.Examples.Introductory.SimulationFixedInitial.mos \
PowerSystems.Examples.Introductory.SimulationSteadyInitial.mos \
PowerSystems.Examples.Introductory.SimulationSteadyState.mos \
PowerSystems.Examples.Introductory.Tables.mos \
PowerSystems.Examples.Introductory.Units.mos \
PowerSystems.Examples.PowerWorld.PowerWorld.mos \
PowerSystems.Examples.PowerWorld.Test.CityTest.mos \
PowerSystems.Examples.PowerWorld.Test.HydroPlantTest1.mos \
PowerSystems.Examples.PowerWorld.Test.HydroPlantTest2.mos \
PowerSystems.Examples.PowerWorld.Test.PowerPlantTest1.mos \
PowerSystems.Examples.PowerWorld.Test.PowerPlantTest2.mos \
PowerSystems.Examples.PowerWorld.Test.PowerPlantTest3.mos \
PowerSystems.Examples.PowerWorld.Test.WindFarmGridTest.mos \
PowerSystems.Examples.PowerWorld.Test.WindFarmHVDCTest.mos \
PowerSystems.Examples.Wind.Test.RotorTest.mos \
PowerSystems.Examples.Wind.WindFarm.mos \
PowerSystems.Examples.Wind.WindTurbine_DFIG.mos \
PowerSystems.Examples.Wind.WindTurbine_IG.mos \
PowerSystems.Examples.Wind.WindTurbine_PSGI.mos \
PowerSystems.Examples.Wind.WindTurbine_PSGR.mos \


# Run make failingtest
FAILINGTESTFILES=  \


DISABLED_TOO_SLOW = \
PowerSystems.Examples.AC3ph.Transmission.DoubleLine.mos \


# Dependency files that are not .mo .mos or Makefile
# Add them here or they will be cleaned.
DEPENDENCIES = \
*.mos \
Makefile \


CLEAN = `ls | grep -w -v -f deps.tmp`

.PHONY : test clean getdeps failingtest


test:
	@echo
	@echo Running tests...
	@echo
	@echo OPENMODELICAHOME=" $(OPENMODELICAHOME) "
	@$(TEST) $(TESTFILES)

# Cleans all files that are not listed as dependencies
clean :
	@echo $(DEPENDENCIES) | sed 's/ /\\|/g' > deps.tmp
	@rm -f *.mos.txt
	@rm -rf $(CLEAN)

# Run this if you want to list out the files (dependencies).
# do it after cleaning and updating the folder
# then you can get a list of file names (which must be dependencies
# since you got them from repository + your own new files)
# then add them to the DEPENDENCIES. You can find the
# list in deps.txt
getdeps:
	@echo $(DEPENDENCIES) | sed 's/ /\\|/g' > deps.tmp
	@echo $(CLEAN) | sed -r 's/deps.txt|deps.tmp//g' | sed 's/ / \\\n/g' > deps.txt
	@echo Dependency list saved in deps.txt.
	@echo Copy the list from deps.txt and add it to the Makefile @DEPENDENCIES

failingtest :
	@echo
	@echo Running failing tests...
	@echo
	@$(TEST) $(FAILINGTESTFILES)
