Просмотр исходного кода

deploy-ng: Add files to build application out of the unit tests

This will be a good way to make sure everything in the tests work under
a frozen environment.

NOTE: The application builds and runs, but no tests are collected. We
still need to figure out how we want to handle tests. Freeze them all
and modify test collection? Add py/test files to the build directory and
try to run them?
Mitchell Stokes 8 лет назад
Родитель
Сommit
33fd302a8e
3 измененных файлов с 49 добавлено и 0 удалено
  1. 13 0
      tests/main.py
  2. 3 0
      tests/requirements.txt
  3. 33 0
      tests/setup.py

+ 13 - 0
tests/main.py

@@ -0,0 +1,13 @@
+import _pytest
+if not hasattr(_pytest, '__file__'):
+    import os
+    import _pytest._pluggy
+    import py
+
+    _pytest.__file__ = os.getcwd()
+    _pytest._pluggy.__file__ = os.getcwd()
+    py.__file__ = os.getcwd()
+
+import pytest
+
+pytest.main()

+ 3 - 0
tests/requirements.txt

@@ -0,0 +1,3 @@
+pytest
+--pre --extra-index-url https://archive.panda3d.org/branches/deploy-ng
+panda3d

+ 33 - 0
tests/setup.py

@@ -0,0 +1,33 @@
+from setuptools import setup
+import pytest
+
+setup(
+    name="panda3d-tester",
+    options = {
+        'build_apps': {
+            'gui_apps': {
+                'tester': 'main.py',
+            },
+            'plugins': [
+                'pandagl',
+                'p3openal_audio',
+            ],
+            'include_modules': {
+                '*': [
+                    'pkg_resources.*.*',
+                    # TODO why does the above not get these modules too?
+                    'pkg_resources._vendor.packaging.*',
+                    'pkg_resources._vendor.packaging.version',
+                    'pkg_resources._vendor.packaging.specifiers',
+                    'pkg_resources._vendor.packaging.requirements',
+                ] + pytest.freeze_includes(),
+            },
+            'deploy_platforms': [
+                'manylinux1_x86_64',
+                'macosx_10_6_x86_64',
+                'win32',
+                'win_amd64',
+            ],
+        }
+    }
+)