Makefile revision 5911
0887a65d2e1f7d938381bed11e859caed56cb47evboxsync# CDDL HEADER START
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# The contents of this file are subject to the terms of the
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# Common Development and Distribution License (the "License").
0887a65d2e1f7d938381bed11e859caed56cb47evboxsync# You may not use this file except in compliance with the License.
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# See the License for the specific language governing permissions
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# and limitations under the License.
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# When distributing Covered Code, include this CDDL HEADER in each
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# If applicable, add the following below this CDDL HEADER, with the
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# fields enclosed by brackets "[]" replaced with your own identifying
41a5daa2596de76f4977055944c7ff54a0afdc3avboxsync# information: Portions Copyright [yyyy] [name of copyright owner]
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# CDDL HEADER END
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# This variable has no impact on perl build, it is here merely to satisfy
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# "modernized" gate infrastructure. The bitness of the module is driven by the
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# bitness of perl interpreter itself. That is hardcoded in
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# $(WS_MAKE_RULES)/makemaker.mk
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync sha256:cc98bbcc33581fbc55b42ae681c6946b70a26f549b3c64466740dfe9a7eac91c
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsyncCOMPONENT_ARCHIVE_URL= http://search.cpan.org/CPAN/authors/id/C/CA/CAPTTOFU/$(COMPONENT_ARCHIVE)
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsyncCOMPONENT_PROJECT_URL= https://github.com/perl5-dbi/DBD-mysql
7eaaa8a4480370b82ef3735994f986f338fb4df2vboxsyncCOMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-all.master
f5253a692b2a71d484d5daff564934d85501ae28vboxsync '-e "s/[0-9][0-9]* wallclock secs (.*CPU)$$/<TIMINGS REMOVED>/" ' \
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync '-e "s/^\(\# mysql_[a-z][a-z]* is: \).*/\1<REMOVED>/" ' \
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync '-e "s/^\(\# SQL_DBMS_VER is \).*/\1<REMOVED>/" ' \
ed5e4f6195dae44fd45ec21052b1931eb8c5d313vboxsync '-e "s/^\(\# Driver version is \).*/\1<REMOVED>/" '
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsyncMYSQL_TEST_DATADIR = $(COMPONENT_TEST_BUILD_DIR)/test_datadir
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsyncCONFIGURE_OPTIONS += --mysql_config="$(MYSQL_BINDIR)/mysql_config"
5b802b5e11fed6e163afca32e9118d2599d312fbvboxsyncCONFIGURE_OPTIONS += --testpassword=$(MYSQL_TEST_PASSWORD)
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# !!!!!!!!! workaround for 22552923
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsyncMYSQL_LIBS = $(shell $(MYSQL_BINDIR)/mysql_config --libs)
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# !!!!!!!!! workaround for 22552923
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# For the testing we need to run mysql database first. The database needs it's
1b782fdb15aefa60d14641e47eda880841174653vboxsync# directory, which will be $(MYSQL_TEST_DATADIR). The directory will also
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# contain socket over which the testing will be performed. Problem is that the
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# path can be maximally 107 characters long. To overcome that limit, we'll
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# create a symlink in /tmp pointing to the directory and refer the database to
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# that symlink. The symlink must have random name, so that multiple tests may
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# be executed simultaneously. Problem is that we have to specify the symlink
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# name during configure. To overcome that I specify the socket name as
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# 'CHANGEME' and "fix" the tests once I know the name of symlink.
6df37320db2ea21e05e1f89e5824022b449b387dvboxsync# Second challenge is to make sure that the mysql daemon will be stopped once
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# the tests end (finish or are interrupted). There are three mechanisms to do
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# a) mysql stores it's pid to $(MYSQL_TEST_DATADIR)/pid
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# b) the COMPONENT_PRE_TEST_ACTION runs a background task which kills the
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# daemon in 10 minutes no matter what.
6df37320db2ea21e05e1f89e5824022b449b387dvboxsync# c) the COMPONENT_POST_TEST_ACTION kills both the mysql daemon and the
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# background task
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# If you want to keep mysqld running for your own testing purposes, delete all
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# the lines containing 'kill' in COMPONENT_PRE_TEST_ACTION and
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# COMPONENT_POST_TEST_ACTION. Then run "gmake test" once which will both run
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# the DB and configure the module to use it. After that you can "cd builds/..."
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# and "gmake test" directly there.
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# Normally the noise from background jobs is sent to /dev/null so that it does
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# not clobber the terminal. For debugging you can leave SILENT empty which will
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync# even turn on more output
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync : "Prepare the testing directory and create the symlink to it"; \
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync : "alter the tests to use the path we just created"; \
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync $(PERL) -pi -e "s,CHANGEME,$$TEST_LINK/socket," t/mysql.mtest ;\
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync --basedir=/usr/mysql/$(MYSQL_VERSION) $(SILENT) ; \
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync : "Run the daemon in background. --gdb makes it possible to terminate mysqld via Ctrl+C"; \
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync ps -p $$PID && kill $$PID || : \
aca7a56d52c58d8b388343450503c22822fd6620vboxsync : "Run job which will kill mysqld in 10 minutes"; \
1b782fdb15aefa60d14641e47eda880841174653vboxsync ( $(SET_X) PID=`cat "$$TEST_LINK"/pid`; sleep 600; ps -p $$PID && kill $$PID || : ) $(SILENT) & \
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync ( $(SET_X) PID=`cat $(MYSQL_TEST_DATADIR)/pid`; [ -n "$$PID" ] && ps -p $$PID && kill $$PID || : ) $(SILENT); \
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync ( $(SET_X) PID=`cat $(MYSQL_TEST_DATADIR)/pid_of_guard`; [ -n "$$PID" ] && ps -p $$PID && kill $$PID || : ) $(SILENT); \
c705e4282ea0c4e6b1f4a9b9c9183ebf2955ebe5vboxsync ( $(SET_X) if [ -e "$(MYSQL_TEST_DATADIR)/test_link" ]; then rm -f `cat "$(MYSQL_TEST_DATADIR)/test_link"`; fi ) $(SILENT); \
dd770e74b6654ce0e5584dbd4ec72e90fd4cc58fvboxsync $(PERL) -pe 's/COMPONENT_VERSION/$(COMPONENT_VERSION)/g' "$<" > "$@"