############################################################
# Makefile for the regression tests that are run on travis
############################################################
ROOT = ../../../..

test-documentation:
	(cd $(ROOT)/Buildings; ../bin/runUnitTests.py --validate-html-only)
	(cd $(ROOT)/Buildings/Resources/Documentation/userGuide; make regressiontest)
	(cd $(ROOT)/Buildings/Resources/src/fluid/heatpumps/calibration/doc; make regressiontest)

test-autogenerated-files:
	# Check for package.order to be up to date
	(cd  $(ROOT)/Buildings; \
	  python -c 'import buildingspy.development.refactor as r; \
	  r.write_package_order(".", recursive=True)'; \
	  git diff --exit-code . )

	#echo Verify that all OpenModelica scripts are up to date, and no old scripts exist
	(cd  $(ROOT)/Buildings; \
	  rm -rf $(ROOT)/Buildings/Resources/Scripts/OpenModelica/compareVars/*.mos; \
	  python -c 'import buildingspy.development.regressiontest as u; \
	  u.Tester().writeOpenModelicaResultDictionary()')
	git status --porcelain $(ROOT)/Buildings/Resources/Scripts/OpenModelica;
	test -z "$$(git status --porcelain $(ROOT)/Buildings/Resources/Scripts/OpenModelica)"


test-dymola:
	(cd $(ROOT)/Buildings && python ../bin/runUnitTests.py --batch --single-package $(PACKAGE))
