Skip to content

Commit

Permalink
Added verification of files
Browse files Browse the repository at this point in the history
  • Loading branch information
mwetter committed Mar 4, 2020
1 parent ee8b528 commit 4112078
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ env:
global:
- ENERGYPLUS_VERSION=EnergyPlus-9.2.0-921312fa1d-Linux-x86_64
jobs:
- TEST_ARG="make test-documentation test-experiment-setup test-autogenerated-files"
- TEST_ARG="make test-documentation test-experiment-setup test-autogenerated-files test-verify-files"
- TEST_ARG="make test-dymola PACKAGE=\"Buildings.{Air,Examples}\""
- TEST_ARG="make test-optimica PACKAGE=\"Buildings.{Air,Examples}\""
- TEST_ARG="make test-jmodelica PACKAGE=\"Buildings.{Air,Examples}\""
Expand Down
3 changes: 3 additions & 0 deletions Buildings/Resources/Scripts/travis/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ test-autogenerated-files:
python Buildings/Resources/src/Controls/OBC/UnitConversions/unit_converters.py; \
git diff --exit-code Buildings)

test-verify-files:
(cd $(ROOT)/Buildings && ../bin/verifyFiles.py)

# Test whether all EnergyPlus validation files are up to date.
# This targets searches all files `run.sh` and executes them.
test-energyplus-validations:
Expand Down
19 changes: 12 additions & 7 deletions bin/checkRelease.py → bin/verifyFiles.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
#!/usr/bin/python
#!/usr/bin/python3
#####################################################################
# This script checks mo and mos files for invalid syntax.
# Run this file before checking changes into the trunk.
#
# [email protected] 2011-03-06
#####################################################################
import os, string, fnmatch, os.path, sys
# --------------------------
# Global settings
LIBHOME=os.path.abspath(".")
LIBHOME=os.path.join(".")

# List of invalid strings
# Regarding the strings __Dymola_*, see https://trac.modelica.org/Modelica/ticket/786
# for possible replacements.
INVALID_IN_ALL=["fixme", "import \"",
"import Buildings;",
"import IBPSA;",
"<h1", "<h2", "<h3", "todo", "xxx", "tt>", "<--",
"realString", "integerString", "structurallyIncomplete",
"preferedView", "Algorithm=", "Diagram,", "DocumentationClass",
Expand All @@ -37,7 +37,12 @@
"__Dymola_normallyConstant",
"__Dymola_NumberOfIntervals",
"__Dymola_saveSelector",
"__Dymola_Text"]
"__Dymola_Text",
"modelica://AixLib",
"modelica://IBPSA",
"modelica://BuildingSystems",
"modelica://IDEAS",
"modelica://https://"]
# List of invalid strings in .mos files
INVALID_IN_MOS=[]
# List of invalid regular expressions in .mo files
Expand All @@ -47,7 +52,7 @@

#########################################################
def reportError(message):
print "*** Error: ", message
print("*** Error: ", message)
global IERR
IERR=IERR+1

Expand Down Expand Up @@ -153,5 +158,5 @@ def reportErrorIfMissing(fileName, listOfStrings):
# Terminate if there was an error.
# This allows other scripts to check the return value
if IERR != 0:
print "*** Terminating due to found errors in examined files."
sys.exit(2)
print("*** Terminating due to found errors in examined files.")
sys.exit(1)

0 comments on commit 4112078

Please sign in to comment.