Skip to content

Commit

Permalink
Merge pull request CastXML#187 from iMichka/pytest6
Browse files Browse the repository at this point in the history
Tests: move another batch to pytest
  • Loading branch information
iMichka authored May 6, 2024
2 parents dc05032 + 3c8d87d commit 3d70c9e
Show file tree
Hide file tree
Showing 13 changed files with 11 additions and 20 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
*.pyo
*~
docs/_build
tests/temp
tests/data/pygccxml.cache
tests/data/directory_cache_test
tests/data/ogre.1.7.xml
unittests/temp
unittests/data/pygccxml.cache
unittests/data/directory_cache_test
Expand Down
3 changes: 3 additions & 0 deletions tests/autoconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
data_directory = os.path.join(this_module_dir_path, '../unittests', 'data')
build_directory = os.path.join(this_module_dir_path, 'temp')

if not os.path.exists(build_directory):
os.makedirs(build_directory)

sys.path.insert(1, os.path.join(os.curdir, '..'))
# The tests are run on the parent pygccxml directory, not the one
# in site-packages. Insert the directory's path.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def __init__(self, *args):
self.__fname = 'core_types.hpp'
# self.__fname = 'merge_free_functions.hpp'

def test(self):
def test_read_xml_file(self):
src_reader = parser.source_reader_t(self.config)
src_decls = src_reader.read_file(self.__fname)

Expand Down
3 changes: 3 additions & 0 deletions unittests/autoconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
data_directory = os.path.join(this_module_dir_path, 'data')
build_directory = os.path.join(this_module_dir_path, 'temp')

if not os.path.exists(build_directory):
os.makedirs(build_directory)

# We want to make sure we throw an error for ALL the warnings during the
# tests. This will allow us to be notified by the build bots, so that the
# warnings can be fixed.
Expand Down
5 changes: 0 additions & 5 deletions unittests/declarations_cache_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@

class Test(parser_test_case.parser_test_case_t):

def __init__(self, *args):
parser_test_case.parser_test_case_t.__init__(self, *args)
if not os.path.exists(autoconfig.build_directory):
os.makedirs(autoconfig.build_directory)

def test_file_signature(self):
file1 = os.path.join(autoconfig.data_directory, 'decl_cache_file1.txt')
file1_dup = os.path.join(
Expand Down
14 changes: 0 additions & 14 deletions unittests/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,19 @@
from . import source_reader_tester
from . import start_with_declarations_tester
from . import templates_tester
from . import type_traits_tester
from . import core_tester
from . import xmlfile_reader_tester
from . import hierarchy_traveling
from . import patcher_tester
from . import call_invocation_tester
from . import bit_fields_tester
from . import complex_types_tester
from . import cached_source_file_tester
from . import variable_matcher_tester
from . import namespace_matcher_tester
from . import calldef_matcher_tester
from . import filters_tester
from . import cache_enums_tester
from . import decl_printer_tester
from . import typedefs_tester
from . import non_copyable_classes_tester
from . import unnamed_enums_bug_tester
from . import vector_traits_tester
from . import string_traits_tester
from . import declarations_cache_tester
Expand All @@ -44,7 +39,6 @@
from . import free_operators_tester
from . import remove_template_defaults_tester
from . import find_container_traits_tester
from . import type_as_exception_bug_tester
from . import copy_constructor_tester
from . import plain_c_tester
from . import function_traits_tester
Expand All @@ -56,7 +50,6 @@
from . import gccxml10185_tester
from . import inline_specifier_tester
from . import example_tester
from . import unnamed_classes_tester
from . import test_directory_cache
from . import deprecation_tester
from . import test_overrides
Expand All @@ -72,27 +65,22 @@
start_with_declarations_tester,
templates_tester,
core_tester,
xmlfile_reader_tester,
hierarchy_traveling,
call_invocation_tester,
bit_fields_tester,
complex_types_tester,
cached_source_file_tester,
variable_matcher_tester,
namespace_matcher_tester,
calldef_matcher_tester,
filters_tester,
cache_enums_tester,
typedefs_tester,
non_copyable_classes_tester,
unnamed_enums_bug_tester,
vector_traits_tester,
string_traits_tester,
declarations_cache_tester,
has_binary_operator_traits_tester,
dependencies_tester,
free_operators_tester,
type_as_exception_bug_tester,
plain_c_tester,
function_traits_tester,
better_templates_matcher_tester,
Expand All @@ -102,10 +90,8 @@
gccxml10184_tester,
gccxml10185_tester,
inline_specifier_tester,
unnamed_classes_tester,
test_directory_cache,
decl_printer_tester,
type_traits_tester,
remove_template_defaults_tester,
patcher_tester,
find_container_traits_tester,
Expand Down

0 comments on commit 3d70c9e

Please sign in to comment.