diff --git a/.gitignore b/.gitignore index e849f161..1492c159 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/tests/autoconfig.py b/tests/autoconfig.py index 1babf8f7..6afd2d09 100644 --- a/tests/autoconfig.py +++ b/tests/autoconfig.py @@ -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. diff --git a/tests/text_reader_tester.py b/tests/test_text_reader.py similarity index 100% rename from tests/text_reader_tester.py rename to tests/test_text_reader.py diff --git a/unittests/type_as_exception_bug_tester.py b/tests/test_type_as_exception_bug.py similarity index 100% rename from unittests/type_as_exception_bug_tester.py rename to tests/test_type_as_exception_bug.py diff --git a/unittests/type_traits_tester.py b/tests/test_type_traits.py similarity index 100% rename from unittests/type_traits_tester.py rename to tests/test_type_traits.py diff --git a/unittests/typedefs_tester.py b/tests/test_typedefs.py similarity index 100% rename from unittests/typedefs_tester.py rename to tests/test_typedefs.py diff --git a/unittests/unnamed_classes_tester.py b/tests/test_unnamed_classes.py similarity index 100% rename from unittests/unnamed_classes_tester.py rename to tests/test_unnamed_classes.py diff --git a/unittests/unnamed_enums_bug_tester.py b/tests/test_unnamed_enums_bug.py similarity index 100% rename from unittests/unnamed_enums_bug_tester.py rename to tests/test_unnamed_enums_bug.py diff --git a/unittests/variable_matcher_tester.py b/tests/test_variable_matcher.py similarity index 100% rename from unittests/variable_matcher_tester.py rename to tests/test_variable_matcher.py diff --git a/unittests/xmlfile_reader_tester.py b/tests/test_xmlfile_reader.py similarity index 98% rename from unittests/xmlfile_reader_tester.py rename to tests/test_xmlfile_reader.py index 8024d2fb..e22a3688 100644 --- a/unittests/xmlfile_reader_tester.py +++ b/tests/test_xmlfile_reader.py @@ -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) diff --git a/unittests/autoconfig.py b/unittests/autoconfig.py index 4c97c8ac..bc7a5941 100644 --- a/unittests/autoconfig.py +++ b/unittests/autoconfig.py @@ -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. diff --git a/unittests/declarations_cache_tester.py b/unittests/declarations_cache_tester.py index 862da48c..038267f7 100644 --- a/unittests/declarations_cache_tester.py +++ b/unittests/declarations_cache_tester.py @@ -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( diff --git a/unittests/test_all.py b/unittests/test_all.py index e60f4d67..29597ccd 100644 --- a/unittests/test_all.py +++ b/unittests/test_all.py @@ -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 @@ -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 @@ -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 @@ -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, @@ -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,