Skip to content

Commit

Permalink
Test more dependency types
Browse files Browse the repository at this point in the history
Update Test.amxd with implicit dependencies and refreeze FrozenTest.amxd to match the updated Test.amxd
  • Loading branch information
mkp committed Nov 15, 2024
1 parent 3b101ef commit 2ec44bd
Show file tree
Hide file tree
Showing 13 changed files with 500 additions and 18 deletions.
24 changes: 16 additions & 8 deletions maxdiff/tests/test_baselines/FrozenTest.amxd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,26 @@ MIDI Effect Device
-------------------
Device is frozen
----- Contents -----
Test.amxd: 24675 bytes, modified at 2024/10/21 12:19:47 UTC <= Device
Test.amxd: 39511 bytes, modified at 2024/10/21 12:50:20 UTC <= Device
ParamAbstraction.maxpat: 1570 bytes, modified at 2024/05/24 13:59:36 UTC, 2 instances
MyAbstraction.maxpat: 2015 bytes, modified at 2024/10/21 12:18:20 UTC, 6 instances
AbstractionWithParameter.maxpat: 1569 bytes, modified at 2024/05/24 13:59:36 UTC, 2 instances
hz-icon.svg: 484 bytes, modified at 2024/05/24 13:59:36 UTC, 1 instance
beat-icon.svg: 533 bytes, modified at 2024/05/24 13:59:36 UTC, 1 instance
fpic.png: 7094 bytes, modified at 2024/05/24 13:59:36 UTC, 1 instance
hz-icon.svg: 484 bytes, modified at 2024/05/24 13:59:36 UTC, 3 instances
beat-icon.svg: 533 bytes, modified at 2024/05/24 13:59:36 UTC, 3 instances
fpic.png: 7094 bytes, modified at 2024/05/24 13:59:36 UTC, 5 instances
shakerkicksnare.aif: 352854 bytes, modified at 2024/10/21 12:21:12 UTC, 2 instances
VisibleBang.js: 317 bytes, modified at 2024/10/21 12:21:12 UTC, 1 instance
my-maxnode-basic.js: 464 bytes, modified at 2024/10/21 12:21:12 UTC, 1 instance
times3.gendsp: 2047 bytes, modified at 2024/10/21 12:21:12 UTC, 1 instance
myxfade.genjit: 3156 bytes, modified at 2024/10/21 12:21:12 UTC, 2 instances
mystorage.json: 239 bytes, modified at 2024/10/21 12:21:12 UTC, 1 instance
myTestTable: 410 bytes, modified at 2024/10/21 12:21:12 UTC, 1 instance
TestScript.js: 87 bytes, modified at 2024/10/21 12:21:12 UTC, 1 instance
collContent.txt: 8 bytes, modified at 2024/05/24 13:59:36 UTC, NOT FOUND IN PATCH

Total - Counting every abstraction instance - Indicates loading time
Object instances: 64
Connections: 24
Object instances: 90
Connections: 26
Unique - Counting abstractions once - Indicates maintainability
Object instances: 47
Connections: 14
Object instances: 73
Connections: 16
62 changes: 52 additions & 10 deletions maxdiff/tests/test_baselines/Test.amxd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ parameters:
[bpatcher ParamAbstraction.maxpat]/[obj-1]: ['InsideBpatcher', 'live.dial', 0]
[AbstractionWithParameter]/[obj-1]: ['MyParameter', 'MyParameter', 0]
[AbstractionWithParameter]/[obj-1]: ['MyParameter[1]', 'MyParameter', 0] > override > ['MyParameter[1]', '-', '-']
[p ImplicitDependencies]/[live.tab]: ['Time Mode', 'Time Mode', 0]
[p ImplicitDependencies]/[live.text]: ['live.text', 'live.text', 0]
[p ImplicitDependencies]/[live.menu]: ['live.menu', 'live.menu', 0]
[bpatcher ParamAbstraction.maxpat]/[obj-1]: ['OverruledParamLongName', 'OverruledParamShortName', 0] > override > ['OverruledParamLongName', 'OverruledParamShortName', '-']
[live.tab]: ['Time Mode', 'Time Mode', 0]
[bpatcher ThisWasAnAbstractionBeforeEmbeddingIt.maxpat <embedded>]/[live.numbox]: ['EmbeddedParam', 'Embedded', 0]
[live.dial]: ['live.dial', 'live.dial', 0]
[live.dial]: ['live.dial[1]', 'live.dial', 0]
Expand All @@ -17,10 +19,18 @@ dependency_cache:
{'name': 'AbstractionWithParameter.maxpat', 'bootpath': '~/maxdevtools/maxdiff/tests/test_files', 'type': 'JSON', 'implicit': 1}
{'name': 'MyAbstraction.maxpat', 'bootpath': '~/maxdevtools/maxdiff/tests/test_files', 'type': 'JSON', 'implicit': 1}
{'name': 'ParamAbstraction.maxpat', 'bootpath': '~/maxdevtools/maxdiff/tests/test_files', 'type': 'JSON', 'implicit': 1}
{'name': 'TestScript.js', 'bootpath': '~/maxdevtools/maxdiff/tests/test_files', 'type': 'TEXT', 'implicit': 1}
{'name': 'VisibleBang.js', 'bootpath': '~/maxdevtools/maxdiff/tests/test_files', 'type': 'TEXT', 'implicit': 1}
{'name': 'beat-icon.svg', 'bootpath': '~/maxdevtools/maxdiff/tests/test_files', 'type': 'svg', 'implicit': 1}
{'name': 'collContent.txt', 'bootpath': '~/maxdevtools/maxdiff/tests/test_files', 'type': 'TEXT', 'implicit': 1}
{'name': 'fpic.png', 'bootpath': '~/maxdevtools/maxdiff/tests/test_files', 'type': 'PNG', 'implicit': 1}
{'name': 'hz-icon.svg', 'bootpath': '~/maxdevtools/maxdiff/tests/test_files', 'type': 'svg', 'implicit': 1}
{'name': 'my-maxnode-basic.js', 'bootpath': '~/maxdevtools/maxdiff/tests/test_files', 'type': 'TEXT', 'implicit': 1}
{'name': 'myTestTable', 'bootpath': '~/maxdevtools/maxdiff/tests/test_files', 'type': 'TEXT', 'implicit': 1}
{'name': 'mystorage.json', 'bootpath': '~/maxdevtools/maxdiff/tests/test_files', 'type': 'JSON', 'implicit': 1}
{'name': 'myxfade.genjit', 'bootpath': '~/maxdevtools/maxdiff/tests/test_files', 'type': 'gJIT', 'implicit': 1}
{'name': 'shakerkicksnare.aif', 'bootpath': '~/maxdevtools/maxdiff/tests/test_files', 'type': 'AIFF', 'implicit': 1}
{'name': 'times3.gendsp', 'bootpath': '~/maxdevtools/maxdiff/tests/test_files', 'type': 'gDSP', 'implicit': 1}

project:
version: 1 | creationdate: 3590052786 | modificationdate: 3590052786 | viewrect: [25, 106, 300, 500] | autoorganize: 1 | hideprojectwindow: 1 | showdependencies: 1 | autolocalize: 0 | layout: {} | searchpath: {} | detailsvisible: 0 | amxdtype: 1835887981 | readonly: 0 | devpathtype: 0 | devpath: . | sortmode: 0 | viewmode: 0 | includepackages: 0
Expand All @@ -29,11 +39,48 @@ project:
collContent.txt

----------- patcher -----------
appversion: 8.6.4-x64-1 | rect: [65, 399, 1244, 429] | openrect: [0, 0, 0, 169] | default_fontsize: 10.0 | default_fontname: Arial Bold | gridsize: [8, 8] | boxanimatetime: 500 | latency: 0 | is_mpe: 0 | platform_compatibility: 0 | autosave: 0
appversion: 8.6.4-x64-1 | rect: [91, 153, 1288, 310] | openrect: [0, 0, 0, 169] | default_fontsize: 10.0 | default_fontname: Arial Bold | gridsize: [8, 8] | boxanimatetime: 500 | latency: 0 | is_mpe: 0 | platform_compatibility: 0 | autosave: 0
----------- objects -----------
[comment NOTE: after any changes to this device, also update FrozenTest.amxd]
[poly~ MyAbstraction]
[poly~ MyAbstraction 3]
[comment Explicit dependency (included in project)] bubble: 1 | linecount: 2
[loadbang]
[message read collContent.txt]
[coll]
[p ImplicitDependencies] varname: ImplicitDependencies
----------- patcher -----------
appversion: 8.6.4-x64-1 | rect: [60, 130, 639, 710]
----------- objects -----------
[js TestScript] filename: TestScript | parameter_enable: 0
[comment We would expect implicit dependencies for these but they don't seem to be added.] bubble: 1 | bubbleside: 2 | linecount: 2
[jit.movie @moviefile ChoppedBipBop.m4v @autostart 0]
[jit.gen @gen myxfade]
[imovie]
[message read myTestTable] fontname: Arial | fontsize: 13.0
[table myTestTable] name: myTestTable | parameter_enable: 0 | parameter_mappable: 0 | range: 128 | size: 128
[matrixctrl] bkgndpict: fpic.png | cellpict: fpic.png | columns: 2 | rows: 2
[nodes] displayknob: 2 | knobpict: fpic.png
[number] varname: number
[pattr test] restore: [1337] | varname: test
[pattrstorage mystorage @savemode 0] client_rect: [4, 44, 358, 172] | parameter_enable: 0 | parameter_mappable: 0 | storage_rect: [583, 69, 1034, 197] | varname: mystorage
[jit.pix @gen myxfade]
[buffer~ test shakerkicksnare.aif]
[gen~ @gen times3.gendsp]
[sfplay~ @audiofile shakerkicksnare.aif]
[node.script my-maxnode-basic.js] autostart: 0 | defer: 0 | watch: 0
[comment JSUI using script file] bubble: 1
[jsui] filename: VisibleBang.js
[live.menu] pictures: [hz-icon.svg, beat-icon.svg] | remapsvgcolors: 1 | parameter: <enum: [one, two, three] | longname: live.menu | mmax: 2 | modmode: 0 | shortname: live.menu | type: 2> | usepicture: 1 | usesvgviewbox: 1
[live.text] pictures: [hz-icon.svg, beat-icon.svg] | remapsvgcolors: 1 | parameter: <enum: [val1, val2] | longname: live.text | mmax: 1 | modmode: 0 | shortname: live.text | type: 2> | usepicture: 1 | usesvgviewbox: 1
[playlist~] basictuning: 440 | clipheight: 28.0 | data: {'clips': [{'absolutepath': 'shakerkicksnare.aif', 'filename': 'shakerkicksnare.aif', 'filekind': 'audiofile', 'id': 'u400003311', 'loop': 1, 'content_state': {'loop': 1}}]} | mode: basic | originallength: [0, ticks] | originaltempo: 120.0 | quality: basic
[pictslider] bkgndpict: fpic.png | clickedimage: 0 | knobpict: fpic.png
[pictctrl] name: fpic.png
[fpic] pic: fpic.png
[live.tab] annotation: Toggles between Beat Sync and Free running (Hz). | annotation_name: Time Mode | fontsize: 9.0 | livemode: 1 | num_lines_patching: 2 | num_lines_presentation: 2 | pictures: [hz-icon.svg, beat-icon.svg] | remapsvgcolors: 1 | parameter: <annotation_name: Time Mode | enum: [Free, Sync] | invisible: 2 | linknames: 1 | longname: Time Mode | mmax: 1 | modmode: 0 | shortname: Time Mode | type: 2 | unitstyle: 9> | usepicture: 1 | usesvgviewbox: 1 | varname: Time Mode
----------- patch cords -----------
[pattr test] (1) => (0) [number]
[message read myTestTable] (0) => (0) [table myTestTable]
[bpatcher ThisWasAnAbstractionBeforeEmbeddingIt.maxpat] embed: 1
----------- patcher -----------
appversion: 8.6.4-x64-1 | rect: [927, 431, 640, 480]
Expand Down Expand Up @@ -97,18 +144,13 @@ appversion: 8.6.4-x64-1 | rect: [65, 399, 1244, 429] | openrect: [0, 0, 0, 169]
----------- objects -----------
[live.dial] parameter: <longname: In a subpatcher | modmode: 0 | shortname: live.dial | type: 0 | unitstyle: 0>
[t b b]
[loadbang]
[message read collContent.txt]
[coll]
[fpic] pic: fpic.png
[live.tab] annotation: Toggles between Beat Sync and Free running (Hz). | annotation_name: Time Mode | fontsize: 9.0 | livemode: 1 | num_lines_patching: 2 | num_lines_presentation: 2 | pictures: [hz-icon.svg, beat-icon.svg] | remapsvgcolors: 1 | parameter: <annotation_name: Time Mode | enum: [Free, Sync] | invisible: 2 | linknames: 1 | longname: Time Mode | mmax: 1 | modmode: 0 | shortname: Time Mode | type: 2 | unitstyle: 9> | usepicture: 1 | usesvgviewbox: 1 | varname: Time Mode
[live.banks]
[bpatcher ParamAbstraction.maxpat] offset: [-73, -62]
[bpatcher ParamAbstraction.maxpat] offset: [-73, -62]
[live.dial] activefgdialcolor: live_display_handle_two | parameter: <longname: live.dial[1] | modmode: 0 | shortname: live.dial | type: 0 | unitstyle: 0> | varname: live.dial[1]
[live.dial] parameter: <longname: live.dial | modmode: 0 | shortname: live.dial | type: 0 | unitstyle: 0>
[live.dial] activefgdialcolor: live_display_handle_two | appearance: 1 | parameter: <longname: live.dial[1] | modmode: 0 | shortname: live.dial | type: 0 | unitstyle: 0> | varname: live.dial[1]
[live.dial] appearance: 1 | parameter: <longname: live.dial | modmode: 0 | shortname: live.dial | type: 0 | unitstyle: 0>
[button] presentation: 1 | presentation_rect: [265, 26, 24, 24]
[bpatcher MyAbstraction.maxpat] offset: [-29, -19]
[bpatcher MyAbstraction.maxpat] offset: [-4, -12]
[comment A comment]
[live.comment A live.comment]
[midiout] fontname: Arial Bold | fontsize: 10.0
Expand Down
Binary file modified maxdiff/tests/test_files/FrozenTest.amxd
Binary file not shown.
Binary file modified maxdiff/tests/test_files/Test.amxd
Binary file not shown.
9 changes: 9 additions & 0 deletions maxdiff/tests/test_files/TestScript.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"use strict";

/*
An empty test script file
*/

function bang() {
outlet(0,"yes")
}
105 changes: 105 additions & 0 deletions maxdiff/tests/test_files/UnusedAbstraction.maxpat
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
{
"patcher" : {
"fileversion" : 1,
"appversion" : {
"major" : 8,
"minor" : 6,
"revision" : 2,
"architecture" : "x64",
"modernui" : 1
}
,
"classnamespace" : "box",
"rect" : [ 312.0, 228.0, 221.0, 176.0 ],
"bglocked" : 0,
"openinpresentation" : 0,
"default_fontsize" : 12.0,
"default_fontface" : 0,
"default_fontname" : "Arial",
"gridonopen" : 1,
"gridsize" : [ 15.0, 15.0 ],
"gridsnaponopen" : 1,
"objectsnaponopen" : 1,
"statusbarvisible" : 2,
"toolbarvisible" : 1,
"lefttoolbarpinned" : 0,
"toptoolbarpinned" : 0,
"righttoolbarpinned" : 0,
"bottomtoolbarpinned" : 0,
"toolbars_unpinned_last_save" : 0,
"tallnewobj" : 0,
"boxanimatetime" : 200,
"enablehscroll" : 1,
"enablevscroll" : 1,
"devicewidth" : 0.0,
"description" : "",
"digest" : "",
"tags" : "",
"style" : "",
"subpatcher_template" : "",
"assistshowspatchername" : 0,
"boxes" : [ {
"box" : {
"id" : "obj-3",
"maxclass" : "button",
"numinlets" : 1,
"numoutlets" : 1,
"outlettype" : [ "bang" ],
"parameter_enable" : 0,
"patching_rect" : [ 113.0, 60.0, 24.0, 24.0 ]
}

}
, {
"box" : {
"comment" : "",
"id" : "obj-2",
"index" : 1,
"maxclass" : "outlet",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 40.0, 60.0, 30.0, 30.0 ]
}

}
, {
"box" : {
"comment" : "",
"id" : "obj-1",
"index" : 1,
"maxclass" : "inlet",
"numinlets" : 0,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 40.0, 22.0, 30.0, 30.0 ]
}

}
],
"lines" : [ {
"patchline" : {
"destination" : [ "obj-2", 0 ],
"order" : 1,
"source" : [ "obj-1", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-3", 0 ],
"order" : 0,
"source" : [ "obj-1", 0 ]
}

}
],
"saved_attribute_attributes" : {
"default_plcolor" : {
"expression" : ""
}

}

}

}
17 changes: 17 additions & 0 deletions maxdiff/tests/test_files/VisibleBang.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"use strict";

/*
Outputs a bang when it becomes visible. Only passes on incoming bangs when visible.
Note that to be visible for a device in presentation mode, this object must be included in presentation.
*/

mgraphics.init()

function paint() {
outlet(0, "bang")
}

function bang() {
mgraphics.redraw()
}
15 changes: 15 additions & 0 deletions maxdiff/tests/test_files/my-maxnode-basic.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const path = require('path');
const Max = require('max-api');

// This will be printed directly to the Max console
Max.post(`Loaded the ${path.basename(__filename)} script`);

// Use the 'addHandler' function to register a function for a particular message
Max.addHandler("bang", () => {
Max.post("Who you think you bangin'?");
});

// Use the 'outlet' function to send messages out of node.script's outlet
Max.addHandler("echo", (msg) => {
Max.outlet(msg);
});
1 change: 1 addition & 0 deletions maxdiff/tests/test_files/myTestTable
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
table 0 0 0 0 0 100 97 91 86 84 76 73 71 69 65 57 55 50 49 47 43 39 37 32 29 28 28 29 32 33 34 35 37 38 39 42 43 44 45 46 48 49 51 52 53 54 56 59 61 62 64 67 70 71 72 74 82 84 86 92 104 112 117 124 123 118 114 101 95 92 84 72 65 49 39 37 35 32 29 27 25 25 25 25 25 25 26 27 27 27 28 28 28 29 30 31 32 33 34 35 36 37 38 40 44 45 76 80 88 91 99 101 102 104 106 106 107 108 108 108 110 110 110 110 111 111 111 112
25 changes: 25 additions & 0 deletions maxdiff/tests/test_files/mystorage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"pattrstorage" : {
"name" : "mystorage",
"slots" : {
"1" : {
"id" : 1,
"data" : {
"test" : [ 1337 ]
}

}
,
"2" : {
"id" : 2,
"data" : {
"test" : [ 74 ]
}

}

}

}

}
Loading

0 comments on commit 2ec44bd

Please sign in to comment.