Check-in [35e596ec3e]
Overview
Comment:Added KitDLL to test suite
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:35e596ec3e70fffab6b5f28ba9449cf03bb80cdf
User & Date: rkeene on 2010-10-03 21:03:17
Other Links: manifest | tags
Context
2010-10-04
04:23
Fixed some KitDLL tests to correctly build

Added more KitDLL test cases

Fixed issue with test publisher not dealing with the new files in the kits directory check-in: 9374941c5a user: rkeene tags: trunk

2010-10-03
21:03
Added KitDLL to test suite check-in: 35e596ec3e user: rkeene tags: trunk
21:03
Updated KitDLL to support loading Mk4tcl check-in: e65eeb202c user: rkeene tags: trunk
Changes

Modified build/test/publish-tests from [4c8dc5fa58] to [6824fb8fe5].

    57     57   	}
    58     58   
    59     59   	return "Tcl $version for [string totitle $os] on $cpu"
    60     60   }
    61     61   
    62     62   proc pretty_print_buildinfo {buildinfo} {
    63     63   	set desc [list]
    64         -	foreach tag [list min static notk nomk4 statictk unthreaded threaded zip] {
           64  +	foreach tag [list kitdll min static notk nomk4 statictk unthreaded threaded zip] {
    65     65   		if {[lsearch -exact $buildinfo $tag] != -1} {
    66     66   			switch -- $tag {
           67  +				"kitdll" {
           68  +					lappend desc "Built as a Library"
           69  +				}
    67     70   				"min" {
    68     71   					lappend desc "Minimally Built"
    69     72   				}
    70     73   				"static" {
    71     74   					lappend desc "Statically Linked"
    72     75   				}
    73     76   				"notk" {

Modified build/test/test from [41f958cc6e] to [39ea564cba].

    49     49   	Xvfb :31 -screen 0 800x600x24 -nolisten tcp >/dev/null 2>/dev/null &
    50     50   	echo "$!"
    51     51   )"
    52     52   DISPLAY=:31
    53     53   export DISPLAY
    54     54   
    55     55   failed=""
    56         -for kit in normal normal-zip normal-threaded normal-threaded-zip normal-statictk normal-notk normal-threaded-notk normal-threaded-zip-notk normal-nomk4 min min-static win32-i586 win32-i586-zip win32-i586-threaded win32-i586-threaded-zip win32-i586-notk win32-i586-threaded-notk win32-i586-nomk4 linux-arm-min; do
           56  +for kit in normal normal-zip normal-threaded normal-threaded-zip normal-statictk normal-notk normal-threaded-notk normal-threaded-zip-notk normal-nomk4 min min-static normal-kitdll normal-threaded-kitdll normal-notk-kitdll normal-nomk4-notk-kitdll min-kitdll win32-i586 win32-i586-zip win32-i586-threaded win32-i586-threaded-zip win32-i586-notk win32-i586-threaded-notk win32-i586-nomk4 win32-i586-kitdll win32-i586-threaded-kitdll win32-i586-notk-kitdll win32-i586-nomk4-notk-kitdll linux-arm-min linux-arm-min-kitdll; do
    57     57   	kitcreator="./kitcreator"
    58     58   	args=""
    59     59   	runnable="1"
    60     60   	iszip="0"
    61     61   	statictk="0"
    62     62   	notk="0"
    63     63   	nomk4="0"
    64     64   	xcompile="0"
           65  +	kitdll="0"
    65     66   	kitruncmd=""
    66     67   
    67     68   	# Handle base configuration
    68     69   	os="$(uname -s | dd conv=lcase 2>/dev/null)"
    69     70   	cpu="$(uname -m | dd conv=lcase 2>/dev/null)"
    70     71   	case "${kit}" in
    71     72   		normal|normal-*)
................................................................................
   131    132   				fi
   132    133   				;;
   133    134   			*-nomk4-*)
   134    135   				tempkit="$(echo "${tempkit}" | sed 's@-nomk4-@-@')"
   135    136   				nomk4="1"
   136    137   				iszip="1"
   137    138   				;;
          139  +			*-kitdll-*)
          140  +				kitdll="1"
          141  +				;;
   138    142   		esac
   139    143   	done
   140    144   
   141    145   	for version in ${VERSIONS}; do
   142    146   		# Work around changes in default behaviour
   143    147   		if [ "${version}" = "cvs_HEAD" ]; then
   144    148   			kit="$(echo "${kit}" | sed 's@-threaded@-unthreaded@')"
   145    149   			args="$(echo "${args}" | sed 's@ --enable-threads@ --disable-threads@')"
   146    150   		fi
   147    151   
   148    152   		# Create Tclkit
   149         -		createdkit="tclkit-${version}"
   150         -		outputname="${TESTDIR}/kits/tclkit-${version}-${kit}"
   151         -		failoutputname="${TESTDIR}/kits/failed/tclkit-${version}-${kit}"
          153  +		if [ "${kitdll}" = "1" ]; then
          154  +			createdkit="libtclkit*.dll libtclkit*.*"
          155  +			outputname="${TESTDIR}/kits/libtclkit-${version}-${kit}"
          156  +			failoutputname="${TESTDIR}/kits/failed/libtclkit-${version}-${kit}"
          157  +		else
          158  +			createdkit="tclkit-${version}"
          159  +			outputname="${TESTDIR}/kits/tclkit-${version}-${kit}"
          160  +			failoutputname="${TESTDIR}/kits/failed/tclkit-${version}-${kit}"
          161  +		fi
   152    162   		buildlog="${outputname}-build.log"
   153    163   		failbuildlog="${failoutputname}-build.log"
   154    164   		testresultslog="${outputname}-tests.log"
   155    165   
   156    166   		if [ ! -f "${outputname}" ]; then
   157    167   			unset KITCREATOR_PKGS STATICTK
   158    168   
................................................................................
   160    170   				echo "Skipping rebuilding failed kit ${version}/${kit} ..."
   161    171   
   162    172   				failed="${failed} ${version}/${kit}-build"
   163    173   
   164    174   				continue
   165    175   			fi
   166    176   
          177  +			rm -f tclsh
          178  +			./kitcreator clean >/dev/null 2>/dev/null
          179  +
   167    180   			echo "Creating Tclkit ${version}/${kit}..."
   168    181   			echo " *** Build started $(whoami)@$(hostname) on $(date)" > "${buildlog}"
   169    182   			echo '' >> "${buildlog}"
   170    183   			echo " *** Build Script" >> "${buildlog}"
   171    184   
   172    185   			if [ "${notk}" = "1" ]; then
   173    186   				KITCREATOR_PKGS='itcl mk4tcl'
................................................................................
   176    189   			if [ "${nomk4}" = "1" ]; then
   177    190   				if [ -z "${KITCREATOR_PKGS}" ]; then
   178    191   					KITCREATOR_PKGS='itcl tk'
   179    192   				else
   180    193   					KITCREATOR_PKGS="$(echo "${KITCREATOR_PKGS}" | sed 's@mk4tcl@@')"
   181    194   				fi
   182    195   			fi
          196  +
          197  +			if [ "${kitdll}" = "1" ]; then
          198  +				if [ -z "${KITCREATOR_PKGS}" ]; then
          199  +					KITCREATOR_PKGS='tk itcl mk4tcl kitdll'
          200  +				else
          201  +					KITCREATOR_PKGS="${KITCREATOR_PKGS} kitdll"
          202  +				fi
          203  +			fi
          204  +
   183    205   			export KITCREATOR_PKGS
   184    206   
   185    207   			if [ -n "${KITCREATOR_PKGS}" ]; then
   186    208   				echo "  KITCREATOR_PKGS=\"${KITCREATOR_PKGS}\"" >> "${buildlog}"
   187    209   				echo "  export KITCREATOR_PKGS" >> "${buildlog}"
   188    210   			fi
   189    211   
................................................................................
   217    239   			echo " *** Build Results" >> "${buildlog}"
   218    240   			echo '' >> "${buildlog}"
   219    241   
   220    242   			buildfailed="0"
   221    243   			"${kitcreator}" "${version}" ${args} >> "${buildlog}" 2>&1 || buildfailed="1"
   222    244   			grep -n '^' */build.log >> "${buildlog}" 2>&1
   223    245   
          246  +			if [ "${kitdll}" = "1" ]; then
          247  +				# Create test drivers for KitDLL
          248  +				(
          249  +					echo ""
          250  +					echo ""
          251  +					echo ""
          252  +					echo " *** Building KitDLL test driver (tclsh)"
          253  +					echo ""
          254  +
          255  +					cd kitdll/build/kitdll-*/ || exit 1
          256  +					make tclsh
          257  +					cp tclsh ../../../
          258  +				) >> "${buildlog}" 2>&1
          259  +			fi
          260  +
          261  +			# Perform wildcard expansion
          262  +			createdkit="$(ls -f1 ${createdkit} 2>/dev/null | head -n 1)"
          263  +
   224    264   			if [ ! -f "${createdkit}" ]; then
   225    265   				echo "Failed to create kit ${version}/${kit}" >&2
   226    266   
   227    267   				failed="${failed} ${version}/${kit}-build"
   228    268   
   229    269   				touch "${failoutputname}"
   230    270   				mv "${buildlog}" "${failbuildlog}"
   231    271   
          272  +				rm -f tclsh
          273  +
   232    274   				continue
   233    275   			fi
   234    276   
   235    277   			# Verify sanity of created kit
   236    278   			issane=1
   237    279   
   238         -			## Verify the Win32 kits are 
          280  +			## Verify that Win32 builds are of correct type
          281  +			## Verify that DLL builds are of correct type
   239    282   			case "-${version}-${kit}-" in
          283  +				*-win32-kitdll-*|*-win32-*-kitdll-*)
          284  +					if ! file "${createdkit}" | grep 'MS Windows (DLL)' >/dev/null; then
          285  +						issane=0
          286  +					fi
          287  +					;;
          288  +				*-kitdll-*)
          289  +					if ! file "${createdkit}" | grep 'shared object' >/dev/null; then
          290  +						issane=0
          291  +					fi
          292  +					;;
   240    293   				*-win32-notk-*|*-win32-*-notk-*)
   241    294   					if ! file "${createdkit}" | grep 'MS Windows (console)' >/dev/null; then
   242    295   						echo "Kit failed sanity check for being a console application" >&2
   243    296   						issane=0
   244    297   					fi
   245    298   					;;
   246    299   				*-win32-*)
................................................................................
   263    316   				echo "Kit failed sanity ${version}/${kit}" >&2
   264    317   
   265    318   				failed="${failed} ${version}/${kit}-sanity"
   266    319   
   267    320   				mv "${createdkit}" "${failoutputname}"
   268    321   				mv "${buildlog}" "${failbuildlog}"
   269    322   
          323  +				rm -f tclsh
          324  +
   270    325   				continue
   271    326   			fi
   272    327   
   273    328   			# Rename created kit to final destination
   274    329   			mv "${createdkit}" "${outputname}"
          330  +			if [ -f "tclsh" ]; then
          331  +				mv "tclsh" "${outputname}-tclsh"
          332  +			fi
          333  +
          334  +			# For KitDLL, make a note of the original name
          335  +			if [ "${kitdll}" = "1" ]; then
          336  +				echo "${createdkit}" > "${outputname}-origname"
          337  +			fi
   275    338   		fi
   276    339   
   277    340   		# Test zip status
   278    341   		if unzip -l "${outputname}" 2>&1 | grep 'boot\.tcl' >/dev/null; then
   279    342   			canunzip="1"
   280    343   		else
   281    344   			canunzip="0"
................................................................................
   289    352   			continue
   290    353   		fi
   291    354   
   292    355   		# Do not continue past here for un-runnable kits
   293    356   		if [ "${runnable}" != "1" ]; then
   294    357   			continue
   295    358   		fi
          359  +
          360  +		# If the name of the original build matters, symlink it up
          361  +		if [ -f "${outputname}-origname" ]; then
          362  +			createdkit="$(cat "${outputname}-origname")"
          363  +
          364  +			ln -s "${outputname}" "${createdkit}"
          365  +		fi
   296    366   
   297    367   		# Perform battery of tests
   298    368   		## Clean tests log
   299    369   		rm -f "${testresultslog}"
   300    370   		for testscp in "${TESTDIR}"/tests/*.tcl; do
   301    371   			testscp_tag="$(basename "${testscp}" .tcl)"
   302    372   			testscppre="$(dirname "${testscp}")/${testscp_tag}.sh"
................................................................................
   318    388   			fi
   319    389   
   320    390   			(
   321    391   				if [ -f "${testscppre}" ]; then
   322    392   					. "${testscppre}"
   323    393   				fi
   324    394   
   325         -				${kitruncmd} "${outputname}" "${testscp}" "${outputname}" "${kit}" "${version}"
          395  +				if [ "${kitdll}" = "1" ]; then
          396  +					${kitruncmd} "${outputname}-tclsh" "${testscp}" "${outputname}" "${kit}" "${version}"
          397  +				else
          398  +					${kitruncmd} "${outputname}" "${testscp}" "${outputname}" "${kit}" "${version}"
          399  +				fi
   326    400   			) > "${scplogfile}" 2>&1
   327    401   
   328    402   			if [ "$?" != "0" ]; then
   329    403   				echo "Script failed: ${testscp_tag} on ${version}/${kit}" >&2
   330    404   
   331    405   				failed="${failed} ${version}/${kit}-test-${testscp_tag}"
   332    406   
................................................................................
   340    414   				kill -9 "${kitrunkillpid}" >/dev/null 2>/dev/null
   341    415   			fi
   342    416   
   343    417   			echo "${testscp_tag}: PASS" >>  "${testresultslog}"
   344    418   
   345    419   			rm -f "${scplogfile}"
   346    420   		done
          421  +
          422  +		if [ -f "${outputname}-origname" ]; then
          423  +			rm -f "${createdkit}"
          424  +		fi
   347    425   	done
   348    426   done
   349    427   
   350    428   if [ -n "${failed}" ]; then
   351    429   	echo "Failed: ${failed}"
   352    430   fi
   353    431   
   354    432   # Terminate Xvfb
   355    433   kill -9 "${XVFB_PID}"
          434  +
          435  +# Cleanup
          436  +./kitcreator clean
          437  +rm -f tclsh

Modified build/test/tests/02-nameofexe.tcl from [08a58cef96] to [cc4d6e243b].

     1      1   #! /usr/bin/env tclsh
     2      2   
     3      3   set outputname [lindex $argv 0]
            4  +set buildflags [split [lindex $argv 1] -]
            5  +
            6  +# If we built a KitDLL, the executable name will be "./tclsh"
            7  +if {[lsearch -exact $buildflags "kitdll"] != -1} {
            8  +	set outputname "${outputname}-tclsh"
            9  +}
     4     10   
     5     11   if {[info nameofexecutable] == $outputname} {
     6     12   	exit 0
     7     13   }
     8     14   
     9     15   # Under Wine, the drive letter is added
    10     16   if {[info nameofexecutable] == "Z:$outputname"} {