$79 GRAYBYTE WORDPRESS FILE MANAGER $94

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/cloudlinux/venv/lib/python3.11/site-packages/numpy/distutils/tests/

HOME
Current File : /opt/cloudlinux/venv/lib/python3.11/site-packages/numpy/distutils/tests//test_npy_pkg_config.py
import os

from numpy.distutils.npy_pkg_config import read_config, parse_flags
from numpy.testing import temppath, assert_

simple = """\
[meta]
Name = foo
Description = foo lib
Version = 0.1

[default]
cflags = -I/usr/include
libs = -L/usr/lib
"""
simple_d = {'cflags': '-I/usr/include', 'libflags': '-L/usr/lib',
        'version': '0.1', 'name': 'foo'}

simple_variable = """\
[meta]
Name = foo
Description = foo lib
Version = 0.1

[variables]
prefix = /foo/bar
libdir = ${prefix}/lib
includedir = ${prefix}/include

[default]
cflags = -I${includedir}
libs = -L${libdir}
"""
simple_variable_d = {'cflags': '-I/foo/bar/include', 'libflags': '-L/foo/bar/lib',
        'version': '0.1', 'name': 'foo'}

class TestLibraryInfo:
    def test_simple(self):
        with temppath('foo.ini') as path:
            with open(path,  'w') as f:
                f.write(simple)
            pkg = os.path.splitext(path)[0]
            out = read_config(pkg)

        assert_(out.cflags() == simple_d['cflags'])
        assert_(out.libs() == simple_d['libflags'])
        assert_(out.name == simple_d['name'])
        assert_(out.version == simple_d['version'])

    def test_simple_variable(self):
        with temppath('foo.ini') as path:
            with open(path,  'w') as f:
                f.write(simple_variable)
            pkg = os.path.splitext(path)[0]
            out = read_config(pkg)

        assert_(out.cflags() == simple_variable_d['cflags'])
        assert_(out.libs() == simple_variable_d['libflags'])
        assert_(out.name == simple_variable_d['name'])
        assert_(out.version == simple_variable_d['version'])
        out.vars['prefix'] = '/Users/david'
        assert_(out.cflags() == '-I/Users/david/include')

class TestParseFlags:
    def test_simple_cflags(self):
        d = parse_flags("-I/usr/include")
        assert_(d['include_dirs'] == ['/usr/include'])

        d = parse_flags("-I/usr/include -DFOO")
        assert_(d['include_dirs'] == ['/usr/include'])
        assert_(d['macros'] == ['FOO'])

        d = parse_flags("-I /usr/include -DFOO")
        assert_(d['include_dirs'] == ['/usr/include'])
        assert_(d['macros'] == ['FOO'])

    def test_simple_lflags(self):
        d = parse_flags("-L/usr/lib -lfoo -L/usr/lib -lbar")
        assert_(d['library_dirs'] == ['/usr/lib', '/usr/lib'])
        assert_(d['libraries'] == ['foo', 'bar'])

        d = parse_flags("-L /usr/lib -lfoo -L/usr/lib -lbar")
        assert_(d['library_dirs'] == ['/usr/lib', '/usr/lib'])
        assert_(d['libraries'] == ['foo', 'bar'])

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
14 Aug 2025 9.24 PM
root / root
0755
__pycache__
--
14 Aug 2025 9.24 PM
root / root
0755
__init__.py
0 KB
17 Apr 2025 8.10 PM
root / root
0644
test_build_ext.py
2.704 KB
17 Apr 2025 8.10 PM
root / root
0644
test_ccompiler_opt.py
28.104 KB
17 Apr 2025 8.10 PM
root / root
0644
test_ccompiler_opt_conf.py
6.198 KB
17 Apr 2025 8.10 PM
root / root
0644
test_exec_command.py
7.222 KB
17 Apr 2025 8.10 PM
root / root
0644
test_fcompiler.py
1.247 KB
17 Apr 2025 8.10 PM
root / root
0644
test_fcompiler_gnu.py
2.086 KB
17 Apr 2025 8.10 PM
root / root
0644
test_fcompiler_intel.py
1.033 KB
17 Apr 2025 8.10 PM
root / root
0644
test_fcompiler_nagfor.py
1.076 KB
17 Apr 2025 8.10 PM
root / root
0644
test_from_template.py
1.077 KB
17 Apr 2025 8.10 PM
root / root
0644
test_log.py
0.848 KB
17 Apr 2025 8.10 PM
root / root
0644
test_mingw32ccompiler.py
1.571 KB
17 Apr 2025 8.10 PM
root / root
0644
test_misc_util.py
3.143 KB
17 Apr 2025 8.10 PM
root / root
0644
test_npy_pkg_config.py
2.497 KB
17 Apr 2025 8.10 PM
root / root
0644
test_shell_utils.py
2.064 KB
17 Apr 2025 8.10 PM
root / root
0644
test_system_info.py
10.741 KB
17 Apr 2025 8.10 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF