Skip to content

Commit

Permalink
Fix IDF verification script and cleanup testfiles/CMakeLists.txt entries
Browse files Browse the repository at this point in the history
  • Loading branch information
Myoldmopar committed Feb 11, 2021
1 parent efb9fb4 commit 5acc1f2
Show file tree
Hide file tree
Showing 2 changed files with 435 additions and 437 deletions.
22 changes: 10 additions & 12 deletions scripts/dev/verify_idfs_in_cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,27 +56,25 @@

import json
import os
import re
import sys


def usage():
print("""This script verifies that the idf list in CMakeLists.txt matches the idf files in the testfiles directory.
Call with one argument: the directory which includes idfs and the CMakeLists.txt file""")


current_script_dir = os.path.dirname(os.path.realpath(__file__))
test_files_dir = os.path.join(current_script_dir, '..', '..', 'testfiles')

cmake_lists_file = os.path.join(test_files_dir, "CMakeLists.txt")
cmake_list_idf_files = set()
with open(cmake_lists_file) as f:
for line in f.readlines():
line_stripped = line.strip()
if "ADD_SIMULATION_TEST" in line_stripped:
idf_file_index = line_stripped.index("IDF_FILE")
epw_file_index = line_stripped.index("EPW_FILE")
filename = line_stripped[idf_file_index + 9:epw_file_index - 1]
cmake_list_idf_files.add(filename)
contents = f.read()
matches = re.findall(r'\(([^)]+)\)', contents, re.MULTILINE)
for match in matches:
if 'IDF_FILE' not in match:
continue
cleaned_match = match.replace('\n', '')
tokens = cleaned_match.split() # special case that allows multiple whitespace delimiters
filename = tokens[1]
cmake_list_idf_files.add(filename)

found_idf_files = set()
for root, dirs, files in os.walk(test_files_dir):
Expand Down
Loading

4 comments on commit 5acc1f2

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmake_modernize (Myoldmopar) - x86_64-MacOS-10.15-clang-11.0.0: OK (3004 of 3004 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmake_modernize (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.5: OK (3044 of 3044 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmake_modernize (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-UnitTestsCoverage-Debug: OK (1568 of 1568 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmake_modernize (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-IntegrationCoverage-Debug: OK (722 of 722 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.