mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 05:16:10 +01:00
Remove Clara from external folder
As Clara is no longer maintained as a separate project, the implementation was moved to the internal subfolder of top-level folder. This removes one folder and avoids potential user confusion. Also simplified the convenience header checking script accordingly.
This commit is contained in:
parent
75b711a360
commit
e1a0cce82b
@ -36,11 +36,11 @@
|
|||||||
#include <catch2/catch_totals.hpp>
|
#include <catch2/catch_totals.hpp>
|
||||||
#include <catch2/catch_version.hpp>
|
#include <catch2/catch_version.hpp>
|
||||||
#include <catch2/catch_version_macros.hpp>
|
#include <catch2/catch_version_macros.hpp>
|
||||||
#include <catch2/external/catch_external_all.hpp>
|
|
||||||
#include <catch2/generators/catch_generators_all.hpp>
|
#include <catch2/generators/catch_generators_all.hpp>
|
||||||
#include <catch2/interfaces/catch_interfaces_all.hpp>
|
#include <catch2/interfaces/catch_interfaces_all.hpp>
|
||||||
#include <catch2/internal/catch_assertionhandler.hpp>
|
#include <catch2/internal/catch_assertionhandler.hpp>
|
||||||
#include <catch2/internal/catch_clara.hpp>
|
#include <catch2/internal/catch_clara.hpp>
|
||||||
|
#include <catch2/internal/catch_clara_upstream.hpp>
|
||||||
#include <catch2/internal/catch_commandline.hpp>
|
#include <catch2/internal/catch_commandline.hpp>
|
||||||
#include <catch2/internal/catch_common.hpp>
|
#include <catch2/internal/catch_common.hpp>
|
||||||
#include <catch2/internal/catch_compiler_capabilities.hpp>
|
#include <catch2/internal/catch_compiler_capabilities.hpp>
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#pragma clang diagnostic ignored "-Wshadow"
|
#pragma clang diagnostic ignored "-Wshadow"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <catch2/external/clara.hpp>
|
#include <catch2/internal/catch_clara_upstream.hpp>
|
||||||
|
|
||||||
#ifdef __clang__
|
#ifdef __clang__
|
||||||
#pragma clang diagnostic pop
|
#pragma clang diagnostic pop
|
||||||
|
@ -13,7 +13,6 @@ The top level header is called `catch_all.hpp`.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
internal_dirs = ['detail', 'internal']
|
internal_dirs = ['detail', 'internal']
|
||||||
excluded_dirs = ['external']
|
|
||||||
|
|
||||||
from scriptCommon import catchPath
|
from scriptCommon import catchPath
|
||||||
from glob import glob
|
from glob import glob
|
||||||
@ -44,8 +43,6 @@ def folders_in_folder(folder):
|
|||||||
def collated_includes(folder):
|
def collated_includes(folder):
|
||||||
base = headers_in_folder(folder)
|
base = headers_in_folder(folder)
|
||||||
for subfolder in folders_in_folder(folder):
|
for subfolder in folders_in_folder(folder):
|
||||||
if folder in excluded_dirs:
|
|
||||||
continue
|
|
||||||
if subfolder.name in internal_dirs:
|
if subfolder.name in internal_dirs:
|
||||||
base.extend(headers_in_folder(subfolder.path))
|
base.extend(headers_in_folder(subfolder.path))
|
||||||
else:
|
else:
|
||||||
@ -98,7 +95,7 @@ def verify_convenience_header(folder):
|
|||||||
header_name = 'catch_all.hpp'
|
header_name = 'catch_all.hpp'
|
||||||
else:
|
else:
|
||||||
header_name = 'catch_{}_all.hpp'.format('_'.join(path_pieces))
|
header_name = 'catch_{}_all.hpp'.format('_'.join(path_pieces))
|
||||||
|
|
||||||
# 1) Does it exist?
|
# 1) Does it exist?
|
||||||
full_path = path + '/' + header_name
|
full_path = path + '/' + header_name
|
||||||
if not os.path.isfile(full_path):
|
if not os.path.isfile(full_path):
|
||||||
@ -116,7 +113,7 @@ def verify_convenience_header(folder):
|
|||||||
for duplicate in duplicated:
|
for duplicate in duplicated:
|
||||||
errors_found = True
|
errors_found = True
|
||||||
print("'{}': Duplicated include: '{}'".format(header_name, duplicate))
|
print("'{}': Duplicated include: '{}'".format(header_name, duplicate))
|
||||||
|
|
||||||
target_includes = normalize_includes(collated_includes(path))
|
target_includes = normalize_includes(collated_includes(path))
|
||||||
# Avoid requiring the convenience header to include itself
|
# Avoid requiring the convenience header to include itself
|
||||||
target_includes = [x for x in target_includes if header_name not in x]
|
target_includes = [x for x in target_includes if header_name not in x]
|
||||||
@ -132,15 +129,15 @@ def verify_convenience_header(folder):
|
|||||||
for include in file_incs:
|
for include in file_incs:
|
||||||
if include not in desired_set:
|
if include not in desired_set:
|
||||||
errors_found = True
|
errors_found = True
|
||||||
print("'{}': superfluous include '{}'".format(header_name, include))
|
print("'{}': superfluous include '{}'".format(header_name, include))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def walk_source_folders(current):
|
def walk_source_folders(current):
|
||||||
verify_convenience_header(current)
|
verify_convenience_header(current)
|
||||||
for folder in folders_in_folder(current.path):
|
for folder in folders_in_folder(current.path):
|
||||||
fname = folder.name
|
fname = folder.name
|
||||||
if fname not in internal_dirs and fname not in excluded_dirs:
|
if fname not in internal_dirs:
|
||||||
walk_source_folders(folder)
|
walk_source_folders(folder)
|
||||||
|
|
||||||
# This is an ugly hack because we cannot instantiate DirEntry manually
|
# This is an ugly hack because we cannot instantiate DirEntry manually
|
||||||
|
Loading…
Reference in New Issue
Block a user