From d613523f14782b4bdf9f5904082b493bd32337cf Mon Sep 17 00:00:00 2001 From: Mitchell Stokes Date: Thu, 22 Mar 2018 18:53:26 -0700 Subject: [PATCH] deploy-ng: Add tests/build_samples.py script This script will run python setup.py bdist_apps on each sample in a list (currently only contains asteroids). The script will fail if any of the builds fail. We can use this for some automated sanitity checking of deploy-ng builds. --- samples/asteroids/setup.py | 6 +++--- tests/build_samples.py | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 tests/build_samples.py diff --git a/samples/asteroids/setup.py b/samples/asteroids/setup.py index 8fb122585b..c592c0911f 100644 --- a/samples/asteroids/setup.py +++ b/samples/asteroids/setup.py @@ -18,9 +18,9 @@ setup( ], 'platforms': [ 'manylinux1_x86_64', - #'macosx_10_6_x86_64', - #'win32', - #'win_amd64', + 'macosx_10_6_x86_64', + 'win32', + 'win_amd64', ], } } diff --git a/tests/build_samples.py b/tests/build_samples.py new file mode 100644 index 0000000000..3abd2bfb2f --- /dev/null +++ b/tests/build_samples.py @@ -0,0 +1,19 @@ +import os +import subprocess + +SAMPLES_TO_BUILD = [ + 'asteroids', +] +SAMPLES_DIR = os.path.join(os.path.dirname(__file__), '..', 'samples') + +def main(): + for sample in SAMPLES_TO_BUILD: + sampledir = os.path.join(SAMPLES_DIR, sample) + os.chdir(sampledir) + + # This will raise a CalledProcessError if the build fails, which will cause + # this script to fail + subprocess.check_call(['python', 'setup.py', 'bdist_apps']) + +if __name__ == '__main__': + main()