42 sources = os.path.join(root,
"src",
"sources.cmake")
43 utests = os.path.join(root,
"src",
"tests.cmake")
44 itests = os.path.join(root,
"tests",
"tests.cmake")
45 cmakepaths = collections.namedtuple(
"CMakePaths",
"sources utests itests")
46 return cmakepaths(sources, utests, itests)
55 src_dir = os.path.join(root,
"src")
56 tests_dir = os.path.join(root,
"tests")
59 public = glob.glob(os.path.join(src_dir,
"precice",
"*.hpp"))
60 public += CONFIGURED_PUBLIC
61 public = [os.path.relpath(p, root)
for p
in public]
64 sources, utests = [], []
65 exts = [
".cpp",
".c",
".hpp",
".h"]
66 for dir, _, filenames
in os.walk(src_dir):
67 if any([elem
in dir
for elem
in IGNORE_PATTERNS]):
70 os.path.relpath(os.path.join(dir, name), root)
78 sources += CONFIGURED_SOURCES
81 for dir, _, filenames
in os.walk(tests_dir):
82 if any([elem
in dir
for elem
in IGNORE_PATTERNS]):
85 os.path.relpath(os.path.join(dir, name), root)
91 return sorted(sources), sorted(public), sorted(utests), sorted(itests)
162 print(
"Current dir {} is not the root of the precice repository!".format(root))
166 "Detected files:\n sources: {}\n public headers: {}\n unit tests: {}\n integration tests: {}".format(
167 len(sources), len(public), len(utests), len(itests)
174 set(sources + public + utests + itests)
175 - set(gitfiles + CONFIGURED_SOURCES + CONFIGURED_PUBLIC)
178 print(
"The source tree contains files not tracked by git.")
179 print(
"Please do one of the following with them:")
180 print(
" - track them using 'git add'")
181 print(
" - add them to IGNORE_PATTERNS in this script")
182 print(
" - add them to CONFIGURED_SOURCES in this script!")
184 for file
in not_tracked:
185 print(
" {}".format(file))
186 print(
"Verification FAILED")
188 print(
"Verification SUCCEEDED")
190 print(
"Git did not run successfully.")
191 print(
"Verification SKIPPED")
193 print(
"Generating CMake files")
200 print(
"Writing Files")
201 print(
" {}".format(files.sources))
202 with open(files.sources,
"w")
as f:
203 f.write(sources_content)
205 print(
" {}".format(files.utests))
206 with open(files.utests,
"w")
as f:
207 f.write(utests_content)
209 print(
" {}".format(files.itests))
210 with open(files.itests,
"w")
as f:
211 f.write(itests_content)