Skip to content

Commit

Permalink
add cmd as main shell
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesneimog committed Dec 10, 2023
1 parent 8dc0549 commit 00fe78b
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 49 deletions.
27 changes: 9 additions & 18 deletions .github/workflows/Builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ on:
description: "Build for Linux"
required: false
type: boolean
default: true
default: false

jobs:
# ==============================================================================
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand Down
15 changes: 9 additions & 6 deletions resources/py4pd-mod/src/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/py4pd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
35 changes: 16 additions & 19 deletions test/01-Install-modules.pd
Original file line number Diff line number Diff line change
@@ -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;
11 changes: 6 additions & 5 deletions test/runTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 00fe78b

Please sign in to comment.