fix pbxprojs
[wdl/wdl-ol.git] / IPlugExamples / IPlugChunks / validate_audiounit.command
blobebc71f6599f8473f8bbec5d6d6c7571a76560ffa
1 #! /bin/sh
2 # shell script to validate your iplug audiounit using auval
3 # run from terminal with the argument leaks to perform the leaks test (See auval docs)
5 BASEDIR=$(dirname $0)
7 cd $BASEDIR
9 OS_VERSION=`sw_vers -productVersion | egrep -o '10\.[0-9]+'`
11 x86_ARGS=""
12 x64_ARGS=""
14 if [[ $OS_VERSION == "10.9" ]] || [[ $OS_VERSION == "10.10" ]]
15 then
16 x86_ARGS="-32"
17 x64_ARGS=""
18 else
19 x86_ARGS=""
20 x64_ARGS="-64"
23 PUID=`echo | grep PLUG_UNIQUE_ID resource.h`
24 PUID=${PUID//\#define PLUG_UNIQUE_ID }
25 PUID=${PUID//\'}
27 PMID=`echo | grep PLUG_MFR_ID resource.h`
28 PMID=${PMID//\#define PLUG_MFR_ID }
29 PMID=${PMID//\'}
31 PII=`echo | grep PLUG_IS_INST resource.h`
32 PII=${PII//\#define PLUG_IS_INST }
34 PDM=`echo | grep PLUG_DOES_MIDI resource.h`
35 PDM=${PDM//\#define PLUG_DOES_MIDI }
37 TYPE=aufx
39 if [ $PII == 1 ] # instrument
40 then
41 TYPE=aumu
42 else
43 if [ $PDM == 1 ] # midi effect
44 then
45 TYPE=aumf
49 if [ "$1" == "leaks" ]
50 then
51 echo "testing for leaks (i386 32 bit)"
52 echo 'launch a new shell and type: ps axc|awk "{if (\$5==\"auvaltool\") print \$1}" to get the pid';
53 echo "then leaks PID"
55 export MallocStackLogging=1
56 set env MallocStackLoggingNoCompact=1
58 auval $x86_ARGS -v $TYPE $PUID $PMID -w -q
60 unset MallocStackLogging
62 else
64 echo "\nvalidating i386 32 bit... ------------------------"
65 echo "--------------------------------------------------"
66 echo "--------------------------------------------------"
67 echo "--------------------------------------------------"
68 echo "--------------------------------------------------"
69 echo "--------------------------------------------------"
71 auval $x86_ARGS -v $TYPE $PUID $PMID
73 echo "\nvalidating i386 64 bit... ------------------------"
74 echo "--------------------------------------------------"
75 echo "--------------------------------------------------"
76 echo "--------------------------------------------------"
77 echo "--------------------------------------------------"
78 echo "--------------------------------------------------"
80 auval $x64_ARGS -v $TYPE $PUID $PMID
84 echo "done"