You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.5 KiB

  1. #!/usr/bin/env bash
  2. function usage() {
  3. echo "run the mysql tests"
  4. echo "--mysqlbuild=$mysqlbuild --tests=$tests"
  5. }
  6. function expand() {
  7. echo $* | tr ,: " "
  8. }
  9. mysqlbuild=
  10. mysqlsocket=/tmp/mysql.sock
  11. gearmandir=/usr/local/gearmand-1.1.6
  12. gearmandhost=localhost
  13. system=$(uname -s | tr [:upper:] [:lower:])
  14. arch=$(uname -m | tr [:upper:] [:lower:])
  15. tests=run.mysql.tests.bash
  16. while [ $# -gt 0 ] ; do
  17. arg=$1; shift
  18. if [[ $arg =~ --(.*)=(.*) ]] ; then
  19. eval ${BASH_REMATCH[1]}=${BASH_REMATCH[2]}
  20. else
  21. usage; exit 1;
  22. fi
  23. done
  24. if [ -z $mysqlbuild ] ; then exit 1; fi
  25. for testname in $(expand $tests) ; do
  26. if [ $testname = "run.mysql.tests.bash" ] ; then
  27. run_mysqld=0
  28. else
  29. run_mysqld=1
  30. fi
  31. if [ $run_mysqld = 0 ] ; then
  32. setupextra="--shutdown=1 --install=1 --startup=0"
  33. else
  34. setupextra="--shutdown=1 --install=1 --startup=1"
  35. fi
  36. echo "echo \$(date) $mysqlbuild >>/tmp/$(whoami).$testname.trace 2>&1; \
  37. \$HOME/bin/setup.mysql.bash --mysqlbuild=$mysqlbuild $setupextra >>/tmp/$(whoami).$testname.trace 2>&1; \
  38. testexitcode=\$?; \
  39. echo \$(date) $mysqlbuild \$testexitcode >>/tmp/$(whoami).$testname.trace 2>&1; \
  40. if [ \$testexitcode -ne 0 ] ; then exit 1; fi; \
  41. \$HOME/bin/$testname --mysqlbuild=$mysqlbuild --commit=1 >>/tmp/$(whoami).$testname.trace 2>&1; \
  42. if [ $run_mysqld != 0 ] ; then mysqladmin -S$mysqlsocket shutdown; fi" | $gearmandir/bin/gearman -b -f mysql-test-$system-$arch -h $gearmandhost -p 4730
  43. done
  44. exit 0