Add --tests argument to makepanda, instructions to README.md

This commit is contained in:
rdb 2017-11-03 20:06:49 +01:00
parent b865b31390
commit c043755f94
3 changed files with 31 additions and 3 deletions

6
.gitignore vendored
View File

@ -52,6 +52,10 @@ Thumbs.db
ehthumbs.db
# Python
__pycache__
__pycache__/
*.pyc
*.pyo
# Test tool cache directories
.tox/
.cache/

View File

@ -156,6 +156,17 @@ python3.6 makepanda/makepanda.py --everything --installer --no-egl --no-gles --n
If successful, this will produce a .pkg file in the root of the source
directory which you can install using `pkg install`.
Running Tests
=============
Install [PyTest](https://docs.pytest.org/en/latest/getting-started.html#installation)
and run the `pytest` command. If you have not installed Panda3D, you will
need to configure your enviroment by pointing the `PYTHONPATH` variable at
the `built` directory. On Linux, you will also need to point the
`LD_LIBRARY_PATH` variable at the `built/lib` directory.
As a convenience, you can alternatively pass the `--tests` option to makepanda.
Reporting Issues
================

View File

@ -40,6 +40,7 @@ import sys
COMPILER=0
INSTALLER=0
WHEEL=0
RUNTESTS=0
GENMAN=0
COMPRESSOR="zlib"
THREADCOUNT=0
@ -126,6 +127,7 @@ def usage(problem):
print(" --help (print the help message you're reading now)")
print(" --verbose (print out more information)")
print(" --runtime (build a runtime build instead of an SDK build)")
print(" --tests (run the test suite)")
print(" --installer (build an installer)")
print(" --wheel (build a pip-installable .whl)")
print(" --optimize X (optimization level can be 1,2,3,4)")
@ -163,12 +165,12 @@ def usage(problem):
os._exit(1)
def parseopts(args):
global INSTALLER,WHEEL,RTDIST,RUNTIME,GENMAN,DISTRIBUTOR,VERSION
global INSTALLER,WHEEL,RUNTESTS,RTDIST,RUNTIME,GENMAN,DISTRIBUTOR,VERSION
global COMPRESSOR,THREADCOUNT,OSXTARGET,OSX_ARCHS,HOST_URL
global DEBVERSION,WHLVERSION,RPMRELEASE,GIT_COMMIT,P3DSUFFIX,RTDIST_VERSION
global STRDXSDKVERSION, WINDOWS_SDK, MSVC_VERSION, BOOUSEINTELCOMPILER
longopts = [
"help","distributor=","verbose","runtime","osxtarget=",
"help","distributor=","verbose","runtime","osxtarget=","tests",
"optimize=","everything","nothing","installer","wheel","rtdist","nocolor",
"version=","lzma","no-python","threads=","outputdir=","override=",
"static","host=","debversion=","rpmrelease=","p3dsuffix=","rtdist-version=",
@ -192,6 +194,7 @@ def parseopts(args):
if (option=="--help"): raise Exception
elif (option=="--optimize"): optimize=value
elif (option=="--installer"): INSTALLER=1
elif (option=="--tests"): RUNTESTS=1
elif (option=="--wheel"): WHEEL=1
elif (option=="--verbose"): SetVerbose(True)
elif (option=="--distributor"): DISTRIBUTOR=value
@ -6684,6 +6687,16 @@ except:
SaveDependencyCache()
raise
# Run the test suite.
if RUNTESTS:
cmdstr = BracketNameWithQuotes(SDK["PYTHONEXEC"].replace('\\', '/'))
if sys.version_info >= (2, 6):
cmdstr += " -B"
cmdstr += " -m pytest tests"
if GetVerbose():
cmdstr += " --verbose"
oscmd(cmdstr)
##########################################################################################
#
# The Installers