annotate SCRIPTS/process.sh @ 53:b584009ded4c

Fixes to package
author Chris Cannam
date Thu, 07 Aug 2014 19:49:13 +0100
parents 666a1c41ce51
children 6624f5416d67
rev   line source
Chris@1 1 #!/bin/bash
Chris@1 2
Chris@6 3 # Run this from the top-level vamp-build-and-test directory
Chris@6 4
Chris@1 5 ## Things to test:
Chris@1 6 ## the plugin builds!
Chris@1 7 ## plugin loads
Chris@1 8 ## passes vamp-plugin-tester tests
Chris@1 9 ## does not export any unnecessary symbols
Chris@1 10 ## has valid .cat and .n3
Chris@1 11
Chris@19 12 mydir=$(dirname "$0")
Chris@19 13 case "$mydir" in /*);; *) mydir=$(pwd)/"$mydir";; esac
Chris@19 14
Chris@22 15 do_rebuild=""
Chris@14 16
Chris@22 17 usage() {
Chris@22 18 echo
Chris@22 19 echo "Usage: $0 <platform> [-c] [<dir> ...]"
Chris@22 20 echo
Chris@31 21 echo " <platform> one of native, linux32, linux64, mingw32, mingw64, osx32, osx64"
Chris@22 22 echo " -c build from clean"
Chris@22 23 echo " <dir> directory to build (default is all of them)"
Chris@22 24 echo
Chris@22 25 echo "Platform usually should match the platform you are running this"
Chris@22 26 echo "script on, unless you have a cross-compile toolset installed and"
Chris@31 27 echo "this script knows how to run it. The special platform 'native'"
Chris@31 28 echo "tries to guess the currently running platform."
Chris@22 29 echo
Chris@22 30 exit 2
Chris@22 31 }
Chris@21 32
Chris@31 33 platform_arg="$1"
Chris@31 34
Chris@31 35 if [ "$platform_arg" = "native" ]; then
Chris@31 36 case `uname -a` in
Chris@31 37 Linux*x86_64*) platform_arg=linux64;;
Chris@31 38 Linux*) platform_arg=linux32;;
Chris@31 39 Darwin*) platform_arg=osx64;;
Chris@31 40 CYG*) platform_arg=mingw32;;
Chris@31 41 MINGW*) platform_arg=mingw32;;
Chris@31 42 esac
Chris@31 43 fi
Chris@31 44
Chris@31 45 case "$platform_arg" in
Chris@22 46 linux32)
Chris@22 47 platform=linux
Chris@22 48 bits=32
Chris@22 49 toolprefix=
Chris@22 50 pluginext=.so
Chris@22 51 hostwrapper=
Chris@22 52 hostext=
Chris@38 53 valgrind=valgrind
Chris@22 54 archflags=
Chris@42 55 identpattern='ELF 32'
Chris@22 56 ;;
Chris@22 57 linux64)
Chris@22 58 platform=linux
Chris@22 59 bits=64
Chris@22 60 toolprefix=
Chris@22 61 pluginext=.so
Chris@22 62 hostwrapper=
Chris@22 63 hostext=
Chris@38 64 valgrind=valgrind
Chris@22 65 archflags=
Chris@42 66 identpattern='ELF 64'
Chris@22 67 ;;
Chris@22 68 mingw32)
Chris@22 69 platform=mingw
Chris@22 70 bits=32
Chris@22 71 toolprefix=i686-w64-mingw32-
Chris@22 72 pluginext=.dll
Chris@22 73 hostwrapper=wine
Chris@22 74 hostext=.exe
Chris@38 75 valgrind=
Chris@22 76 archflags=
Chris@36 77 identpattern='PE32.*386.*Windows'
Chris@22 78 ;;
Chris@22 79 mingw64)
Chris@22 80 platform=mingw
Chris@22 81 bits=64
Chris@22 82 toolprefix=x86_64-w64-mingw32-
Chris@22 83 pluginext=.dll
Chris@22 84 hostwrapper=wine
Chris@22 85 hostext=.exe
Chris@38 86 valgrind=
Chris@22 87 archflags=
Chris@36 88 identpattern='not known yet' ##!!!
Chris@22 89 ;;
Chris@22 90 osx32)
Chris@22 91 platform=osx
Chris@22 92 bits=32
Chris@22 93 toolprefix=
Chris@22 94 pluginext=.dylib
Chris@22 95 hostwrapper=
Chris@22 96 hostext=
Chris@38 97 valgrind=
Chris@22 98 archflags="-arch i386"
Chris@40 99 identpattern='Mach-O .*i386'
Chris@22 100 ;;
Chris@22 101 osx64)
Chris@22 102 platform=osx
Chris@22 103 bits=64
Chris@22 104 toolprefix=
Chris@22 105 pluginext=.dylib
Chris@22 106 hostwrapper=
Chris@22 107 hostext=
Chris@38 108 valgrind=
Chris@26 109 # This is a difficult choice for various reasons... have to ponder
Chris@26 110 archflags="-mmacosx-version-min=10.6 -arch x86_64 -arch i386"
Chris@40 111 identpattern='Mach-O 64-bit .*x86_64'
Chris@22 112 ;;
Chris@22 113 esac;
Chris@22 114
Chris@22 115 shift
Chris@22 116
Chris@22 117 if [ -z "$platform" ]; then
Chris@22 118 usage
Chris@22 119 else
Chris@22 120 echo "(Platform is $platform, $bits bits)"
Chris@22 121 fi
Chris@22 122
Chris@22 123 if [ t"$1" = t"-c" ]; then
Chris@22 124 echo "(Building from clean)"
Chris@22 125 do_rebuild=yes
Chris@22 126 shift
Chris@22 127 fi
Chris@15 128
Chris@19 129 depincdir="$mydir"/../DEPENDENCIES/$platform$bits/include
Chris@19 130 deplibdir="$mydir"/../DEPENDENCIES/$platform$bits/lib
Chris@19 131
Chris@19 132 depincdir_generic="$mydir"/../DEPENDENCIES/generic/include
Chris@1 133
Chris@11 134 plugindirs="$@"
Chris@11 135 if [ -z "$plugindirs" ]; then
Chris@11 136 plugindirs=$(cat .hgsub | grep -v vamp-plugin-sdk | grep -v vamp-plugin-tester | awk '{ print $1; }')
Chris@11 137 fi
Chris@11 138
Chris@6 139 reportdir="REPORTS/$platform$bits"
Chris@49 140 packagedir="PACKAGES/$platform$bits"
Chris@49 141
Chris@49 142 mkdir -p "$reportdir" "$packagedir" || exit 1
Chris@6 143
Chris@9 144 built="/tmp/built.$$.txt"
Chris@9 145 testfailed="/tmp/testfailed.$$.txt"
Chris@19 146 envcheckfailed="/tmp/envcheckfailed.$$.txt"
Chris@9 147 notbuilt="/tmp/notbuilt.$$.txt"
Chris@49 148
Chris@19 149 trap 'rm -f "$built" "$envcheckfailed" "$testfailed" "$notbuilt"' 0
Chris@19 150 touch "$built" "$envcheckfailed" "$testfailed" "$notbuilt"
Chris@9 151
Chris@4 152 configure() {
Chris@4 153 dir="$1"
Chris@4 154 if [ -f "$dir/configure" ] ; then
Chris@6 155 ( cd "$dir" ; ./configure ) 2>&1 | tee "$reportdir/$dir.configure.txt"
Chris@4 156 fi
Chris@4 157 }
Chris@4 158
Chris@1 159 find_makefile() {
Chris@1 160 dir="$1"
Chris@9 161 for f in \
Chris@19 162 build/$platform$bits/Makefile.$platform$bits \
Chris@13 163 build/$platform/Makefile.$platform$bits \
Chris@19 164 build/$platform$bits/Makefile.$platform \
Chris@19 165 build/$platform$bits/Makefile \
Chris@19 166 build/Makefile.$platform$bits \
Chris@19 167 Makefile.$platform$bits \
Chris@13 168 build/$platform/Makefile.$platform \
Chris@13 169 build/$platform/Makefile \
Chris@13 170 build/Makefile.$platform \
Chris@9 171 Makefile.$platform \
Chris@13 172 Makefile ; do
Chris@1 173 if [ -f "$dir/$f" ]; then
Chris@1 174 echo $f
Chris@1 175 break
Chris@1 176 fi
Chris@1 177 done
Chris@1 178 }
Chris@1 179
Chris@13 180 configure_maybe() {
Chris@13 181 dir="$1"
Chris@43 182 if [ t"$do_rebuild" = t"yes" ]; then
Chris@43 183 configure "$dir"
Chris@43 184 else
Chris@43 185 mfile=$(find_makefile "$dir")
Chris@43 186 if [ -z "$mfile" ]; then
Chris@43 187 configure "$dir"
Chris@43 188 fi
Chris@13 189 fi
Chris@13 190 }
Chris@13 191
Chris@19 192 target_for() {
Chris@19 193 dir="$1"
Chris@19 194 if grep -q "^$dir: " METADATA/maketarget.txt ; then
Chris@19 195 grep "^$dir: " METADATA/maketarget.txt | head -1 | sed 's/^[^:]*: //'
Chris@19 196 fi
Chris@19 197 }
Chris@19 198
Chris@44 199 logfile_for() {
Chris@44 200 activity="$1"
Chris@44 201 dir="$2"
Chris@44 202 echo "$reportdir/$dir.$activity.txt"
Chris@44 203 }
Chris@44 204
Chris@4 205 build() {
Chris@4 206 dir="$1"
Chris@44 207 log=$(logfile_for build "$dir")
Chris@1 208 if configure_maybe "$dir"; then
Chris@1 209 mfile=$(find_makefile "$dir")
Chris@1 210 if [ -n "$mfile" ]; then
Chris@19 211 target=$(target_for "$dir")
Chris@19 212 TOOLPREFIX="$toolprefix" \
Chris@21 213 CXXFLAGS="-I${depincdir} -I${depincdir_generic} -I../vamp-plugin-sdk" \
Chris@21 214 LDFLAGS="-L${deplibdir} -L../vamp-plugin-sdk" \
Chris@21 215 ARCHFLAGS="$archflags" \
Chris@19 216 make -C "$dir" -f "$mfile" $target 2>&1 | \
Chris@44 217 tee "$log"
Chris@9 218 return ${PIPESTATUS[0]}
Chris@1 219 else
Chris@44 220 echo "Failed to find a Makefile in $dir!" | tee "$log"
Chris@4 221 return 1
Chris@1 222 fi
Chris@1 223 fi
Chris@4 224 }
Chris@4 225
Chris@4 226 rebuild() {
Chris@4 227 dir="$1"
Chris@44 228 log=$(logfile_for build "$dir")
Chris@13 229 if configure_maybe "$dir"; then
Chris@4 230 mfile=$(find_makefile "$dir")
Chris@4 231 if [ -n "$mfile" ]; then
Chris@32 232 if make -C "$dir" -f "$mfile" clean; then
Chris@32 233 build "$dir"
Chris@32 234 else
Chris@44 235 echo "Failed to 'make clean' in $dir!" | tee "$log"
Chris@32 236 return 1
Chris@32 237 fi
Chris@4 238 else
Chris@44 239 echo "Failed to find a Makefile in $dir!" | tee "$log"
Chris@4 240 return 1
Chris@4 241 fi
Chris@4 242 fi
Chris@4 243 }
Chris@4 244
Chris@22 245 build_or_rebuild() {
Chris@22 246 dir="$1"
Chris@22 247 if [ -n "$do_rebuild" ]; then
Chris@22 248 rebuild "$dir"
Chris@22 249 else
Chris@22 250 build "$dir"
Chris@22 251 fi
Chris@22 252 }
Chris@22 253
Chris@19 254 have_plugin() {
Chris@19 255 dir="$1"
Chris@44 256 log=$(logfile_for build "$dir")
Chris@19 257 for x in "$dir/"*"$pluginext"; do
Chris@19 258 if [ -f "$x" ]; then
Chris@36 259 if file "$x" | grep -q "$identpattern" ; then
Chris@36 260 return 0
Chris@36 261 else
Chris@44 262 echo "Plugin $x exists, but fails to match file type for correct platform (file type is: `file $x`, expected pattern is: $identpattern)" | tee "$log"
Chris@36 263 return 1
Chris@36 264 fi
Chris@19 265 fi
Chris@19 266 done
Chris@19 267 return 1
Chris@19 268 }
Chris@19 269
Chris@19 270 is_nondeterministic() {
Chris@19 271 plugin_id="$1"
Chris@19 272 grep -q "^$id\$" METADATA/nondeterministic.txt
Chris@19 273 }
Chris@19 274
Chris@44 275 plugin_ids_in() {
Chris@5 276 dir="$1"
Chris@40 277 # can't use sed to remove \r from DOS line endings -- BSD and GNU
Chris@44 278 # vary in how they interpret \r escape -- so we use perl for that...
Chris@44 279 VAMP_PATH="$dir" $hostwrapper \
Chris@44 280 vamp-plugin-sdk/host/vamp-simple-host$hostext --list-ids | \
Chris@44 281 grep '^vamp:' | \
Chris@44 282 sed 's/^vamp://' | \
Chris@44 283 perl -p -e 's/\r//g'
Chris@44 284 }
Chris@44 285
Chris@44 286 run_tester() {
Chris@44 287 ##!!! todo: timeout if the plugin takes too long and report as failure
Chris@44 288 dir="$1"
Chris@44 289 log=$(logfile_for test "$dir")
Chris@44 290 ids=$(plugin_ids_in "$dir")
Chris@44 291 cat /dev/null > "$log"
Chris@6 292 if [ -z "$ids" ]; then
Chris@6 293 echo
Chris@44 294 echo "No plugins reported to test in $dir" | tee -a "$log"
Chris@44 295 echo "$dir" >> "$testfailed"
Chris@44 296 return 1
Chris@44 297 fi
Chris@44 298 good=yes
Chris@44 299 for id in $ids; do
Chris@44 300 extra=""
Chris@44 301 if is_nondeterministic "$id"; then
Chris@44 302 extra="-n"
Chris@44 303 fi
Chris@44 304 echo "Running command: VAMP_PATH=\"$dir\" $hostwrapper vamp-plugin-tester/vamp-plugin-tester$hostext \"$extra\" \"$id\"" | tee -a "$log"
Chris@44 305 if ( VAMP_PATH="$dir" $hostwrapper vamp-plugin-tester/vamp-plugin-tester$hostext "$extra" "$id" 2>&1 | tee -a "$log" ; exit ${PIPESTATUS[0]} ) ; then
Chris@44 306 echo "OK"
Chris@44 307 else
Chris@44 308 echo
Chris@44 309 echo "Tester failed for id $id: running again with valgrind (if available) and verbose for a report..." | tee -a "$log"
Chris@44 310 VAMP_PATH="$dir" $valgrind $hostwrapper vamp-plugin-tester/vamp-plugin-tester$hostext -v "$extra" "$id" 2>&1 | tee -a "$log"
Chris@44 311 good=no
Chris@44 312 fi
Chris@44 313 done
Chris@44 314 if [ "$good" != "yes" ]; then
Chris@23 315 echo "$dir" >> "$testfailed"
Chris@6 316 return 1
Chris@5 317 else
Chris@44 318 return 0
Chris@5 319 fi
Chris@5 320 }
Chris@5 321
Chris@44 322 public_symbols_in() {
Chris@9 323 lib="$1"
Chris@23 324 # nm -g prints global symbols in both OS/X and GNU tools, but
Chris@23 325 # printing only global *defined* symbols is harder. In GNU it is
Chris@23 326 # nm -g --defined-only; the OS/X docs suggest nm -gu should work,
Chris@23 327 # but it doesn't. What I think will work with both is simply
Chris@23 328 # grepping out the undefineds:
Chris@23 329 "$toolprefix"nm -g "$lib" | grep -v ' U ' | awk '{ print $3; }'
Chris@9 330 }
Chris@9 331
Chris@44 332 env_test_exports() {
Chris@44 333 dir="$1"
Chris@44 334 log=$(logfile_for envtest "$dir")
Chris@44 335 good=yes
Chris@44 336 for lib in "$dir"/*"$pluginext"; do
Chris@44 337 if [ ! -f "$lib" ]; then
Chris@44 338 # This should only happen if the glob was not expanded at all
Chris@44 339 echo "NOTE: no library found in $dir?" | tee -a "$log"
Chris@44 340 good=no
Chris@44 341 break
Chris@44 342 fi
Chris@44 343 echo
Chris@44 344 echo "Testing for exported symbols in $lib..."
Chris@44 345 if public_symbols_in "$lib" | grep -q vampGetPluginDescriptor; then
Chris@44 346 others=`public_symbols_in "$lib" | grep -v vampGetPluginDescriptor`
Chris@44 347 if [ -n "$others" ]; then
Chris@44 348 count=`echo "$others" | wc -l`
Chris@44 349 echo "ERROR: library $lib exports $count extra symbols in addition to vampGetPluginDescriptor" | tee -a "$log"
Chris@44 350 good=no
Chris@44 351 else
Chris@44 352 echo "GOOD: library $lib only exports vampGetPluginDescriptor" | tee -a "$log"
Chris@44 353 fi
Chris@44 354 else
Chris@44 355 echo "NOTE: found library $lib that is not a Vamp plugin library" | tee -a "$log"
Chris@44 356 fi
Chris@44 357 done
Chris@44 358 [ "$good" = "yes" ]
Chris@44 359 }
Chris@44 360
Chris@44 361 env_test_stdout() {
Chris@44 362 dir="$1"
Chris@44 363 log=$(logfile_for envtest "$dir")
Chris@44 364 good=yes
Chris@44 365 ids=$(VAMP_PATH="$dir" $hostwrapper vamp-plugin-sdk/host/vamp-simple-host$hostext --list-ids);
Chris@44 366 echo
Chris@44 367 echo "Testing for any unwanted output to stdout..."
Chris@44 368 for id in $ids; do
Chris@44 369 case "$id" in
Chris@44 370 vamp:*) ;;
Chris@44 371 *)
Chris@44 372 echo "ERROR: plugin in $dir prints to stdout as it runs: found text $id (should use stderr for debug logging to avoid mixing with batch output stream)" | tee -a "$log"
Chris@44 373 good=no
Chris@44 374 ;;
Chris@44 375 esac
Chris@44 376 done
Chris@44 377 [ "$good" = "yes" ]
Chris@44 378 }
Chris@44 379
Chris@44 380 env_test_cat() {
Chris@44 381 dir="$1"
Chris@44 382 log=$(logfile_for envtest "$dir")
Chris@44 383 good=yes
Chris@44 384 first=yes
Chris@44 385 echo
Chris@44 386 echo "Testing some details of .cat files..."
Chris@44 387 for catfile in "$dir"/*".cat"; do
Chris@44 388 if [ ! -f "$catfile" ]; then
Chris@44 389 # This should only happen if the glob was not expanded at all
Chris@44 390 echo "ERROR: no .cat file found in $dir" | tee -a "$log"
Chris@44 391 good=no
Chris@44 392 break
Chris@44 393 fi
Chris@44 394 if [ "$first" = "yes" ]; then
Chris@44 395 first=no
Chris@44 396 else
Chris@44 397 echo "NOTE: multiple .cat files found in $dir" | tee -a "$log"
Chris@44 398 fi
Chris@44 399 done
Chris@44 400 if [ "$good" = "yes" ]; then
Chris@46 401 excess=$(plugin_ids_in "$dir" | sed 's/^/vamp:/' | \
Chris@44 402 cat "$dir"/*".cat" - | \
Chris@47 403 sed 's/::.*//' | \
Chris@47 404 sort | \
Chris@47 405 uniq -u)
Chris@44 406 if [ -n "$excess" ]; then
Chris@47 407 echo "ERROR: excess or missing definitions in .cat file? $excess" | tee -a "$log"
Chris@44 408 good=no
Chris@44 409 else
Chris@47 410 echo "GOOD: no excess or missing definitions in .cat files" | tee -a "$log"
Chris@44 411 fi
Chris@44 412 fi
Chris@44 413 [ "$good" = "yes" ]
Chris@44 414 }
Chris@44 415
Chris@44 416 env_test_ttl() {
Chris@44 417 dir="$1"
Chris@44 418 log=$(logfile_for envtest "$dir")
Chris@44 419 good=yes
Chris@44 420 first=yes
Chris@44 421 echo
Chris@44 422 echo "Testing existence of RDF files..."
Chris@44 423 for ttlfile in "$dir"/*.{n3,ttl}; do
Chris@44 424 if [ ! -f "$ttlfile" ]; then
Chris@44 425 # Because we have two different extensions, this isn't an
Chris@44 426 # error as it is with e.g. .cat (because one or the other
Chris@44 427 # of .n3 and .ttl almost certainly won't exist). But if we
Chris@44 428 # drop out the bottom and first is still true, then we
Chris@44 429 # know neither matched.
Chris@44 430 :
Chris@44 431 elif [ "$first" = "yes" ]; then
Chris@44 432 first=no
Chris@44 433 else
Chris@44 434 echo "NOTE: multiple .ttl or .n3 files found in $dir" | tee -a "$log"
Chris@44 435 fi
Chris@44 436 done
Chris@45 437 if [ "$first" = "yes" ]; then
Chris@45 438 good=no;
Chris@45 439 else
Chris@45 440 echo "GOOD: found one or more .ttl or .n3 files (we don't actually test their validity or content here though)" | tee -a "$log"
Chris@45 441 fi
Chris@45 442 [ "$good" = "yes" ]
Chris@45 443 }
Chris@45 444
Chris@45 445 env_test_accompaniments() {
Chris@45 446 dir="$1"
Chris@45 447 log=$(logfile_for envtest "$dir")
Chris@45 448 good=yes
Chris@46 449 echo
Chris@46 450 echo "Testing existence of README and accompanying files..."
Chris@45 451 if ! ls -1 "$dir" | egrep -qi "^readme(.txt|)$"; then
Chris@45 452 echo "ERROR: no README file found" | tee -a "$log"
Chris@45 453 good=no
Chris@45 454 fi
Chris@53 455 if ! ls -1 "$dir" | egrep -qi "^(copying|licen[cs]e)(.txt)?$"; then
Chris@45 456 echo "ERROR: no COPYING or LICEN[CS]E file found" | tee -a "$log"
Chris@45 457 good=no
Chris@45 458 fi
Chris@53 459 if ! ls -1 "$dir" | egrep -qi "^citation(.txt)?$"; then
Chris@45 460 echo "NOTE: no CITATION file found" | tee -a "$log"
Chris@45 461 fi
Chris@44 462 [ "$good" = "yes" ]
Chris@44 463 }
Chris@44 464
Chris@9 465 run_environmental_tests() {
Chris@9 466 dir="$1"
Chris@44 467 log=$(logfile_for envtest "$dir")
Chris@44 468 allgood=yes
Chris@44 469 cat /dev/null > "$log"
Chris@45 470 for test in exports stdout cat ttl accompaniments; do
Chris@44 471 "env_test_$test" "$dir" || allgood=no
Chris@9 472 done
Chris@44 473 if [ "$allgood" != "yes" ]; then
Chris@19 474 echo "$dir" >> "$envcheckfailed"
Chris@44 475 return 1
Chris@44 476 else
Chris@44 477 return 0
Chris@19 478 fi
Chris@9 479 }
Chris@4 480
Chris@49 481 vcs_id() {
Chris@49 482 dir="$1"
Chris@49 483 ( cd "$dir" ;
Chris@49 484 if [ -d .hg ]; then
Chris@49 485 hg id | awk '{ print $1; }'
Chris@49 486 elif [ -d .git ]; then
Chris@49 487 git rev-parse --short HEAD
Chris@49 488 elif [ -d .svn ]; then
Chris@49 489 svn info | grep ^Revision | awk '{ print $2; }'
Chris@49 490 else
Chris@49 491 echo "unknown"
Chris@49 492 fi
Chris@49 493 )
Chris@49 494 }
Chris@49 495
Chris@49 496 package() {
Chris@49 497 dir="$1"
Chris@49 498 id=$(vcs_id "$dir")
Chris@53 499 pstub="$dir-$platform$bits-$id"
Chris@53 500 pdir="$packagedir/$pstub"
Chris@49 501 mkdir -p "$pdir"
Chris@49 502 ( cd "$dir" ;
Chris@49 503 cp -av \
Chris@49 504 *"$pluginext" \
Chris@49 505 *.cat \
Chris@49 506 *.n3 \
Chris@49 507 *.ttl \
Chris@49 508 [Rr][Ee][Aa][Dd][Mm][Ee]* \
Chris@49 509 [Cc][Oo][Pp][Yy][Ii][Nn][Gg]* \
Chris@49 510 [Ll][Ii][Cc][Ee][Nn][CcSs][Ee]* \
Chris@49 511 [Cc][Ii][Tt][Aa][Tt][Ii][Oo][Nn]* \
Chris@49 512 [Cc][Hh][Aa][Nn][Gg][Ee][Ll][Oo][Gg]* \
Chris@49 513 ../"$pdir"/
Chris@49 514 )
Chris@49 515 ( cd "$packagedir";
Chris@49 516 if [ "$platform" = "mingw" ]; then
Chris@53 517 zip "$pstub".zip "$pstub"
Chris@49 518 else
Chris@53 519 tar cvjf "$pstub".tar.bz2 "$pstub"
Chris@49 520 fi;
Chris@53 521 rm -rf "$pstub"
Chris@49 522 )
Chris@49 523 }
Chris@49 524
Chris@22 525 if ! build_or_rebuild "vamp-plugin-sdk"; then
Chris@5 526 echo "Failed to build Vamp plugin SDK!"
Chris@5 527 exit 1
Chris@5 528 fi
Chris@5 529
Chris@26 530 # Ensure we can only link statically against these
Chris@26 531 for x in vamp-hostsdk vamp-sdk; do
Chris@26 532 for y in dylib dll so; do
Chris@26 533 rm -f "vamp-plugin-sdk/lib$x.$y"
Chris@26 534 rm -f "vamp-plugin-sdk/$x.$y"
Chris@26 535 done
Chris@26 536 done
Chris@26 537
Chris@22 538 if ! build_or_rebuild "vamp-plugin-tester"; then
Chris@5 539 echo "Failed to build Vamp plugin tester!"
Chris@5 540 exit 1
Chris@5 541 fi
Chris@5 542
Chris@11 543 for dir in $plugindirs ; do
Chris@31 544 dir=${dir%/*}
Chris@4 545 echo
Chris@4 546 echo "Processing: $dir"
Chris@31 547 if [ ! -d "$dir" ]; then
Chris@31 548 echo "Directory $dir not found!"
Chris@31 549 echo "$dir" >> "$notbuilt"
Chris@31 550 elif build_or_rebuild "$dir"; then
Chris@19 551 if have_plugin "$dir" ; then
Chris@19 552 echo "$dir" >> "$built"
Chris@19 553 run_tester "$dir"
Chris@19 554 run_environmental_tests "$dir"
Chris@19 555 else
Chris@44 556 log=$(logfile_for build "$dir")
Chris@44 557 echo "Build apparently succeeded, but no resulting plugin(s) found, or plugin(s) have wrong file type or platform" | tee -a "$log"
Chris@19 558 echo "$dir" >> "$notbuilt"
Chris@19 559 fi
Chris@4 560 else
Chris@6 561 echo "$dir" >> "$notbuilt"
Chris@4 562 fi
Chris@44 563 slog=$(logfile_for summary "$dir")
Chris@44 564 cat /dev/null > "$slog"
Chris@1 565 done
Chris@1 566
Chris@49 567 cat "$built" | while read dir; do
Chris@49 568 package "$dir"
Chris@49 569 done
Chris@49 570
Chris@4 571 echo
Chris@49 572 echo "** Built, tested, checked, and packaged:"
Chris@44 573 cat "$built" | while read dir; do
Chris@44 574 slog=$(logfile_for summary "$dir")
Chris@44 575 if ! grep -q "^$dir\$" "$testfailed"; then
Chris@44 576 if ! grep -q "^$dir\$" "$envcheckfailed"; then
Chris@44 577 echo "$dir"
Chris@44 578 echo "$dir: Success" >> "$slog"
Chris@32 579 fi
Chris@6 580 fi
Chris@6 581 done | sort
Chris@4 582
Chris@4 583 echo
Chris@19 584 echo "** Failed tests:"
Chris@44 585 cat "$testfailed" | sort | uniq | while read dir; do
Chris@44 586 slog=$(logfile_for summary "$dir")
Chris@44 587 echo "$dir"
Chris@44 588 echo "$dir: Built successfully, but failed tests" >> "$slog"
Chris@6 589 done
Chris@5 590
Chris@5 591 echo
Chris@19 592 echo "** Failed environmental checks:"
Chris@44 593 cat "$envcheckfailed" | sort | uniq | while read dir; do
Chris@44 594 slog=$(logfile_for summary "$dir")
Chris@44 595 echo "$dir"
Chris@44 596 echo "$dir: Built successfully, but failed environmental checks" >> "$slog"
Chris@19 597 done
Chris@19 598
Chris@19 599 echo
Chris@4 600 echo "** Failed to build:"
Chris@44 601 cat "$notbuilt" | sort | while read dir; do
Chris@44 602 slog=$(logfile_for summary "$dir")
Chris@44 603 echo "$dir"
Chris@44 604 echo "$dir: Failed to build" >> "$slog"
Chris@6 605 done
Chris@4 606
Chris@4 607 echo