File: test_toolchain.py

package info (click to toggle)
python-ctypeslib 0.0.0%2Bsvn20100125-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 344 kB
  • ctags: 398
  • sloc: python: 2,845; makefile: 38
file content (33 lines) | stat: -rw-r--r-- 1,128 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import unittest
import sys
from ctypeslib import h2xml, xml2py

class ToolchainTest(unittest.TestCase):
    if sys.platform == "win32":
        def test_windows(self):
            h2xml.main(["h2xml", "-q",
                        "-D WIN32_LEAN_AND_MEAN",
                        "-D _UNICODE", "-D UNICODE",
                        "-D", "NO_STRICT",
                        "-c", "windows.h",
                        "-o", "_windows_gen.xml"])
            xml2py.main(["xml2py", "_windows_gen.xml",
                         "-w",
                         "-m", "ctypes.wintypes",
                         "-o", "_winapi_gen.py"])
            import _winapi_gen

    def test(self):
        h2xml.main(["h2xml", "-q",
                    "-c", "stdio.h",
                    "-o", "_stdio_gen.xml"])
        if sys.platform == "win32":
            xml2py.main(["xml2py", "_stdio_gen.xml", "-l", "msvcrt", "-o", "_stdio_gen.py"])
        else:
            xml2py.main(["xml2py", "_stdio_gen.xml", "-l", "c", "-o", "_stdio_gen.py"])
        import _stdio_gen


if __name__ == "__main__":
    import unittest
    unittest.main()