diff --git a/.gitignore b/.gitignore index 5bbe6c8c7..21a8f8b60 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ __pycache__/ # C extensions *.so +vc140.pdb # Distribution / packaging .Python @@ -51,6 +52,7 @@ htmlcov/ .cache nosetests.xml coverage.xml +test-output.xml *.cover *.py,cover .hypothesis/ diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d46fd4bb3..d61bbf56c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -17,6 +17,9 @@ jobs: py38-macos: python.version: '3.8' imageName: 'macos-latest' + py38-win: + python.version: '3.8' + imageName: 'windows-latest' steps: - template: azure-templates/ccache.yml parameters: @@ -51,6 +54,9 @@ jobs: py38-macos: python.version: '3.8' imageName: 'macos-latest' + py38-win: + python.version: '3.8' + imageName: 'windows-latest' steps: - template: azure-templates/ccache.yml parameters: diff --git a/test/support.py b/test/support.py index 06edc01e3..84e2e5cf8 100644 --- a/test/support.py +++ b/test/support.py @@ -182,14 +182,28 @@ def compile_module(self, ExtensionTemplate, main_src, name, extra_sources): extra_filename = self._expand(ExtensionTemplate, 'extmod_%d' % i, src) sources.append(extra_filename) # - compile_args = [ - '-g', '-O0', - '-Wfatal-errors', # stop after one error (unrelated to warnings) - '-Werror', # turn warnings into errors (all, for now) - ] - link_args = [ - '-g', - ] + if sys.platform == 'win32': + # not strictly true, could be mingw + compile_args = [ + '/Od', + '/WX', # turn warnings into errors (all, for now) + # '/Wall', # this is too aggresive, makes windows itself fail + '/Zi', + '-D_CRT_SECURE_NO_WARNINGS', # something about _snprintf and _snprintf_s + ] + link_args = [ + '/DEBUG', + '/LTCG', + ] + else: + compile_args = [ + '-g', '-O0', + '-Wfatal-errors', # stop after one error (unrelated to warnings) + '-Werror', # turn warnings into errors (all, for now) + ] + link_args = [ + '-g', + ] # ext = Extension( name, diff --git a/test/test_argparse.py b/test/test_argparse.py index a3ce33b61..2e4f04d24 100644 --- a/test/test_argparse.py +++ b/test/test_argparse.py @@ -12,7 +12,10 @@ class TestParseItem(HPyTest): def make_parse_item(self, fmt, type, hpy_converter): mod = self.make_module(""" - __attribute__((unused)) static inline + #ifndef _MSC_VER + __attribute__((unused)) + #endif + static inline HPy char_to_hpybytes(HPyContext ctx, char a) {{ return HPyBytes_FromStringAndSize(ctx, &a, 1); }}