annotate SCRIPTS/process.sh @ 77:2e60b888e526

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