make test command more explicit
authorrobin
Thu, 26 Aug 2021 10:21:57 +0100
changeset 97 5fef5844f833
parent 96 1f2be2198067
child 98 6d4500c9dfd7
make test command more explicit
.github/workflows/buildwheels.yml
test/runAll.py
--- a/.github/workflows/buildwheels.yml	Tue Aug 24 11:31:46 2021 +0100
+++ b/.github/workflows/buildwheels.yml	Thu Aug 26 10:21:57 2021 +0100
@@ -32,8 +32,9 @@
       #CIBW_BEFORE_BUILD_LINUX: yum install cairo-devel -y
       #CIBW_BEFORE_TEST: pip install --no-cache-dir pyphen
       #CIBW_TEST_REQUIRES: "${{ matrix.os != 'macos-latest' && 'pyphen pycairo rlPyCairo' || 'pyphen' }}"
-      CIBW_TEST_SKIP: "*-macosx*"
-      CIBW_TEST_COMMAND: python -c "import sys,os;r=os.system(' '.join((sys.executable,os.path.join(r'{project}','setup.py'),'test')));sys.exit(('===== test command --> %s ====='%r) if r else r)"
+      #CIBW_TEST_SKIP: "*-macosx*"
+      CIBW_TEST_COMMAND: python -c "{project}/test/runAll.py"
+      CIBW_TEST_COMMAND_WINDOWS: python -c "{project}\test\runAll.py"
       CIBW_BUILD_VERBOSITY: 3
     strategy:
       fail-fast: true
--- a/test/runAll.py	Tue Aug 24 11:31:46 2021 +0100
+++ b/test/runAll.py	Thu Aug 26 10:21:57 2021 +0100
@@ -1,11 +1,20 @@
-#special case import to allow reportlab to modify the envirnment in development
-try:
-    import reportlab
-except ImportError:
-    pass
+def main():
+    import sys, os
+    wd = os.path.dirname(os.path.abspath(sys.argv[0]))
+    sys.path.insert(0,wd)
+    os.chdir(wd)
+    
+    #special case import to allow reportlab to modify the envirnment in development
+    try:
+        import reportlab
+    except ImportError:
+        pass
 
-import leaktest, testRXPbasic, test_xmltestsuite
+    import leaktest, testRXPbasic, test_xmltestsuite
 
-leaktest.main(100)
-testRXPbasic.main()
-test_xmltestsuite.main()
+    leaktest.main(100)
+    testRXPbasic.main()
+    test_xmltestsuite.main()
+
+if __name__=='__main__':
+    main()