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 benchmarks = os.path.join(root,
"benchmarks",
"sources.cmake")
46 cmakepaths = collections.namedtuple(
47 "CMakePaths",
"sources utests itests benchmarks"
49 return cmakepaths(sources, utests, itests, benchmarks)
58 src_dir = os.path.join(root,
"src")
59 tests_dir = os.path.join(root,
"tests")
60 bench_dir = os.path.join(root,
"benchmarks")
63 public = glob.glob(os.path.join(src_dir,
"precice",
"*.hpp"))
64 public += CONFIGURED_PUBLIC
65 public = [os.path.relpath(p, root)
for p
in public]
68 sources, utests = [], []
69 exts = [
".cpp",
".c",
".hpp",
".h"]
70 for dir, _, filenames
in os.walk(src_dir):
71 if any([elem
in dir
for elem
in IGNORE_PATTERNS]):
74 os.path.relpath(os.path.join(dir, name), root)
82 sources += CONFIGURED_SOURCES
85 for dir, _, filenames
in os.walk(tests_dir):
86 if any([elem
in dir
for elem
in IGNORE_PATTERNS]):
89 os.path.relpath(os.path.join(dir, name), root)
96 for dir, _, filenames
in os.walk(bench_dir):
98 os.path.relpath(os.path.join(dir, name), root)
185 print(
"Current dir {} is not the root of the precice repository!".format(root))
187 sources, public, utests, itests, benchmarks =
get_file_lists(root)
189 "Detected files:\n sources: {}\n public headers: {}\n unit tests: {}\n integration tests: {}\n benchmarks: {}".format(
190 len(sources), len(public), len(utests), len(itests), len(benchmarks)
197 set(sources + public + utests + itests)
198 - set(gitfiles + CONFIGURED_SOURCES + CONFIGURED_PUBLIC)
201 print(
"The source tree contains files not tracked by git.")
202 print(
"Please do one of the following with them:")
203 print(
" - track them using 'git add'")
204 print(
" - add them to IGNORE_PATTERNS in this script")
205 print(
" - add them to CONFIGURED_SOURCES in this script!")
207 for file
in not_tracked:
208 print(
" {}".format(file))
209 print(
"Verification FAILED")
211 print(
"Verification SUCCEEDED")
213 print(
"Git did not run successfully.")
214 print(
"Verification SKIPPED")
216 print(
"Generating CMake files")
224 print(
"Writing Files")
225 print(
" {}".format(files.sources))
226 with open(files.sources,
"w")
as f:
227 f.write(sources_content)
229 print(
" {}".format(files.utests))
230 with open(files.utests,
"w")
as f:
231 f.write(utests_content)
233 print(
" {}".format(files.itests))
234 with open(files.itests,
"w")
as f:
235 f.write(itests_content)
237 print(
" {}".format(files.benchmarks))
238 with open(files.benchmarks,
"w")
as f:
239 f.write(benchmarks_content)