summarylogtreecommitdiffstats
path: root/0118-Update-smoketests.patch
blob: c27b70706158533523892e8b2ca4c8aa54d66ccf (plain)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
From 6cc4ce00eeed7ab066c848637b4d06381d161a11 Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Fri, 23 Jul 2021 08:56:15 +0200
Subject: [PATCH 118/N] Update smoketests

---
 .../smoketests.py => mingw_smoketests.py      | 27 +++++++++++++++++++
 1 file changed, 27 insertions(+)
 rename .github/workflows/smoketests.py => mingw_smoketests.py (90%)

diff --git a/.github/workflows/smoketests.py b/mingw_smoketests.py
similarity index 90%
rename from .github/workflows/smoketests.py
rename to mingw_smoketests.py
index d8f76e6..3f41855 100644
--- a/.github/workflows/smoketests.py
+++ b/mingw_smoketests.py
@@ -27,15 +27,41 @@ Feel free to extend.
 
 import os
 import unittest
+import sysconfig
 
 if "MSYSTEM" in os.environ:
     SEP = "/"
 else:
     SEP = "\\"
 
+_UCRT = "clang" in sysconfig.get_platform() or "ucrt" in sysconfig.get_platform()
+
 
 class Tests(unittest.TestCase):
 
+    def test_ctypes_find_library(self):
+        from ctypes.util import find_library
+        from ctypes import cdll
+        self.assertTrue(cdll.msvcrt)
+        if _UCRT:
+            self.assertIsNone(find_library('c'))
+        else:
+            self.assertEqual(find_library('c'), 'msvcrt.dll')
+
+    def test_ctypes_dlopen(self):
+        import ctypes
+        import sys
+        self.assertEqual(ctypes.RTLD_GLOBAL, 0)
+        self.assertEqual(ctypes.RTLD_GLOBAL,  ctypes.RTLD_LOCAL)
+        self.assertFalse(hasattr(sys, 'setdlopenflags'))
+        self.assertFalse(hasattr(sys, 'getdlopenflags'))
+        self.assertFalse([n for n in dir(os) if n.startswith("RTLD_")])
+
+    def test_strftime(self):
+        import time
+        with self.assertRaises(ValueError):
+            time.strftime('%Y', (12345,) + (0,) * 8)
+
     def test_sep(self):
         self.assertEqual(os.sep, SEP)
 
@@ -66,6 +92,7 @@ class Tests(unittest.TestCase):
         import sqlite3
         import ssl
         import ctypes
+        import curses
 
     def test_socket_inet_ntop(self):
         import socket
-- 
2.32.0