diff --git a/.github/workflows/Builder.yml b/.github/workflows/Builder.yml index 50387767..77d5ec52 100644 --- a/.github/workflows/Builder.yml +++ b/.github/workflows/Builder.yml @@ -29,7 +29,7 @@ on: description: "Build for Linux" required: false type: boolean - default: true + default: false jobs: # ============================================================================== @@ -39,7 +39,7 @@ jobs: # if just linux is true, skip windows runs-on: windows-latest if: ${{ inputs.windows }} - timeout-minutes: 15 + timeout-minutes: 20 steps: - uses: actions/checkout@v3 with: @@ -85,27 +85,18 @@ jobs: $pythonpath = Get-Content pythonpath.txt Copy-Item -Path "$pythonpath\python311.dll" -Destination py4pd\ -Recurse Copy-Item -Path "$pythonpath\python3.dll" -Destination py4pd\ -Recurse + Copy-Item -Path "py4pd" -Destination "test" -Recurse + Copy-Item -Path "resources" -Destination "test/py4pd/" -Recurse cp py4pd.m_amd64 py4pd\ + cp py4pd.m_amd64 test\py4pd\py4pd.m_amd64 - name: Run tests continue-on-error: true + shell: cmd run: | - "..\pd\bin\pd.com" -nogui -send "start-test bang" 01-Install-modules.pd - - - name: Run tests - continue-on-error: true - run: | - "..\pd\bin\pd.exe" -nogui -send "start-test bang" 01-Install-modules.pd - - - name: Run tests - continue-on-error: true - run: | - "..\pd\bin\pd.com" --nogui --send "start-test bang" 01-Install-modules.pd - - - name: Run tests - continue-on-error: true - run: | - "..\pd\bin\pd.exe" --nogui --send "start-test bang" 01-Install-modules.pd + cd test + python3 -m pip install numpy -t py4pd/resources/py-modules + python3 runTests.py - name: Upload Object ZIP uses: actions/upload-artifact@v3 diff --git a/resources/py4pd-mod/src/test.py b/resources/py4pd-mod/src/test.py index d616c419..e673715f 100644 --- a/resources/py4pd-mod/src/test.py +++ b/resources/py4pd-mod/src/test.py @@ -38,16 +38,19 @@ def getMemoryUse(): return result except subprocess.CalledProcessError: return None - - elif platform.system() == 'Windows': + + elif platform.system() == "Windows": try: - command = 'tasklist | findstr pd' + command = "tasklist | findstr pd" result = subprocess.check_output(command, shell=True, text=True) - kbytes = float(result.split()[4]) * 1000 + try: + kbytes = float(result.split()[4]) * 1000 + except: + kbytes = float(result.split()[4].replace(",", ".")) * 1000 mb = kbytes / 1024 - return mb + return mb except subprocess.CalledProcessError: return None - + else: return 1 diff --git a/src/py4pd.c b/src/py4pd.c index b690ad2b..b4d0d16f 100644 --- a/src/py4pd.c +++ b/src/py4pd.c @@ -1007,7 +1007,7 @@ void *Py4pd_Py4pdNew(t_symbol *s, int argc, t_atom *argv) { pd_error(NULL, "\n!!!!!!\n [py4pd] Unable to import NumPy! Send " "[pipinstall " - "global numpy] to py4pd object to install it.] " + "numpy] to py4pd object to install it.] " "\n!!!!!!\n"); x->numpyImported = 0; return (x); diff --git a/test/01-Install-modules.pd b/test/01-Install-modules.pd index 569adb59..f75e85a7 100755 --- a/test/01-Install-modules.pd +++ b/test/01-Install-modules.pd @@ -1,19 +1,16 @@ -#N canvas 686 36 490 410 8; -#X obj 5 5 py4pd -lib py4pd; -#X msg 3 147 \; pd quit; -#X msg 95 130 :) ALL Test PY4PDPASS; -#X obj 95 151 print PASS; -#X obj 73 98 t b b; -#X obj 73 32 r start-test; -#X obj 3 130 delay 10 1 msec; -#X obj 73 78 py4pd; -#X msg 73 55 pipinstall numpy; -#X obj 140 32 loadbang; -#X connect 2 0 3 0; -#X connect 4 0 6 0; -#X connect 4 1 2 0; -#X connect 5 0 8 0; -#X connect 6 0 1 0; -#X connect 7 0 4 0; -#X connect 8 0 7 0; -#X connect 9 0 8 0; +#N canvas 686 36 446 316 8; +#X msg 3 119 \; pd quit; +#X msg 95 102 :) ALL Test PY4PDPASS; +#X obj 95 123 print PASS; +#X obj 73 70 t b b; +#X obj 73 4 r start-test; +#X obj 3 102 delay 10 1 msec; +#X obj 73 50 py4pd; +#X msg 73 27 pipinstall numpy; +#X connect 1 0 2 0; +#X connect 3 0 5 0; +#X connect 3 1 1 0; +#X connect 4 0 7 0; +#X connect 5 0 0 0; +#X connect 6 0 3 0; +#X connect 7 0 6 0; diff --git a/test/runTests.py b/test/runTests.py index f7c63eb3..8d7992cf 100755 --- a/test/runTests.py +++ b/test/runTests.py @@ -46,16 +46,17 @@ def runTest(pdpatch): print(f"Patch {pathfile} not found") sys.exit() py4pdPath = os.path.dirname(scriptfolder) - cmd = f'"../pd/bin/pd.com" -nogui -path {py4pdPath} -send "start-test bang" "{pathfile}"' + cmd = f'"..\\pd\\bin\\pd.com" -nogui -send "start-test bang" "{pathfile}"' try: # result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, timeout=timeout_seconds) print("Running: " + cmd) output = subprocess.run( cmd, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - text=True, - shell=True, + # stdout=subprocess.PIPE, + # stderr=subprocess.PIPE, + # text=True, + # shell=True, + timeout=60, ) outputLines = str(output).split("\\n") except subprocess.TimeoutExpired: