Skip to content

Commit

Permalink
Update tools to ignore setting parse tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PabstMirror committed Oct 21, 2023
1 parent 73e533b commit 0cda0a6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
3 changes: 3 additions & 0 deletions tools/sqf_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ def main():

print("Validating SQF")

files_to_ignore_lower = [x.lower() for x in ["test_parse.sqf"]]

sqf_list = []
bad_count = 0

Expand All @@ -177,6 +179,7 @@ def main():

for root, dirnames, filenames in os.walk(rootDir + '/' + args.module):
for filename in fnmatch.filter(filenames, '*.sqf'):
if filename.lower() in files_to_ignore_lower: continue
sqf_list.append(os.path.join(root, filename))

for filename in sqf_list:
Expand Down
27 changes: 10 additions & 17 deletions tools/sqfvmChecker.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
import sys
import subprocess
import concurrent.futures
import tomllib

addon_base_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))

files_to_ignore_lower = [
x.lower() for x in ["initSettings.sqf", "initKeybinds.sqf", "XEH_PREP.sqf", "backwards_comp.sqf", "gui_createCategory.sqf"]
x.lower() for x in ["initSettings.sqf", "initKeybinds.sqf", "XEH_PREP.sqf", "backwards_comp.sqf", "gui_createCategory.sqf", "test_settings_comments.sqf", "test_settings_comments_eof.sqf", "test_settings_multiline.sqf", "test_settings_regular.sqf", "test_settings_unicode.sqf"]
]
sqfvm_exe = os.path.join(addon_base_path, "sqfvm.exe")
virtual_paths = [
Expand All @@ -25,22 +26,14 @@ def get_files_to_process(basePath):
if file.lower() in files_to_ignore_lower:
continue
skipPreprocessing = False
addonTomlPath = os.path.join(root, "addon.toml")
if os.path.isfile(addonTomlPath):
with open(addonTomlPath, "r") as f:
tomlFile = f.read()
if "preprocess = false" in tomlFile:
print("'preprocess = false' not supported")
raise
skipPreprocessing = "[preprocess]\nenabled = false" in tomlFile
addonTomlPath = os.path.join(os.path.dirname(root), "addon.toml")
if os.path.isfile(addonTomlPath):
with open(addonTomlPath, "r") as f:
tomlFile = f.read()
if "preprocess = false" in tomlFile:
print("'preprocess = false' not supported")
raise
skipPreprocessing = "[preprocess]\nenabled = false" in tomlFile
for addonTomlPath in [os.path.join(root, "addon.toml"), os.path.join(os.path.dirname(root), "addon.toml")]:
if os.path.isfile(addonTomlPath):
with open(addonTomlPath, "rb") as f:
tomlFile = tomllib.load(f)
try:
skipPreprocessing = not tomlFile.get('rapify')['enabled']
except:
pass
if file == "config.cpp" and skipPreprocessing:
continue # ignore configs with __has_include
filePath = os.path.join(root, file)
Expand Down

0 comments on commit 0cda0a6

Please sign in to comment.