Skip to content

Commit

Permalink
add check for srcbmi and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
langevin-usgs committed Sep 23, 2023
1 parent d9a1864 commit 0868658
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,45 @@ def get_msvs_files(vfproj_file):
return msvs_files


if __name__ == "__main__":

# get list of source files and files in msvs project files
src_files = get_source_files("src")
msvs_files = []
for vfproj in ["./msvs/mf6core.vfproj", "./msvs/mf6.vfproj"]:
msvs_files.extend(get_msvs_files(vfproj))

print(f"Verifying src files are in msvs project files...")
def check_files(name, src_files, msvs_files):
print(f"Verifying {name} src files are referenced in msvs project files...")
number_failures = 0
for f in src_files:
if f not in msvs_files:
print(f"{f} not found in msvs project file")
number_failures += 1

print(f"Verifying msvs project files are in src folder...")
print(f"Verifying {name} files referenced in msvs project files are in src folder...")
for f in msvs_files:
if f not in src_files:
print(f"{f} not found in src folder")
number_failures += 1

assert number_failures == 0, "msvs project files not up to date..."
print ("msvs project files appear up to date...")
return number_failures


def check_mf6():
# get list of source files and files referenced in msvs project files
src_files = get_source_files("src")
msvs_files = []
for vfproj in ["./msvs/mf6core.vfproj", "./msvs/mf6.vfproj"]:
msvs_files.extend(get_msvs_files(vfproj))
number_failures = check_files("MF6", src_files, msvs_files)
assert number_failures == 0, "MF6 msvs project files not up to date..."


def check_bmi():
# get list of source files and files referenced in msvs project files
src_files = get_source_files("srcbmi")
msvs_files = []
for vfproj in ["./msvs/mf6bmi.vfproj"]:
msvs_files.extend(get_msvs_files(vfproj))
number_failures = check_files("BMI", src_files, msvs_files)
assert number_failures == 0, "BMI msvs project files not up to date..."


if __name__ == "__main__":

check_mf6()
check_bmi()
print ("msvs project (vfproj) files appear up-to-date...")
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
- name: Check Fortran source formatting
run: python .github/common/fortran_format_check.py

- name: Check msvs project files are valid
- name: Check msvs project files
run: python .github/common/msvs_file_check.py

build:
Expand Down

0 comments on commit 0868658

Please sign in to comment.