소스 검색

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.
Mitchell Stokes 7 년 전
부모
커밋
d613523f14
2개의 변경된 파일22개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      samples/asteroids/setup.py
  2. 19 0
      tests/build_samples.py

+ 3 - 3
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',
             ],
         }
     }

+ 19 - 0
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()