Check-in [205ad8c75e]
Overview
Comment:Updated to create tests log with PASS/FAIL

Added additional information to Locale test

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 205ad8c75e5ad0c7a924e57318a2d4dd8a74099f
User & Date: rkeene on 2010-09-26 04:48:25
Other Links: manifest | tags
Context
2010-09-26
04:48
Updated locale test to use LC_ALL since dietlibc's setlocale() ignores LANG check-in: 0d9a6198ae user: rkeene tags: trunk
04:48
Updated to create tests log with PASS/FAIL

Added additional information to Locale test check-in: 205ad8c75e user: rkeene tags: trunk

04:48
Minor cleanup of diff check-in: 6992d94246 user: rkeene tags: trunk
Changes

Modified build/test/publish-tests from [ebc8777c64] to [a10ea41136].

136
137
138
139
140
141
142


143




















144
145
146
147
148

149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168

169
170
171
172
173
174
175
		"*.log" - "*.ttml" - "*.html" - "*.desc" {
			continue
		}
	}

	# Derive what we can from the filename
	set buildfile "${shortfile}-build.log"


	set failedtests [glob -nocomplain -tails -directory $WEBDIR "${shortfile}-\[0-9\]\[0-9\]-*.log"]





















	# If this kit represents a failed build, set the failed tests to that
	set kitbuilt 1
	if {[file tail [file dirname $file]] == "failed"} {
		set failedtests [list "${shortfile}-XX-build.log"]

		set kitbuilt 0
	}

	## Split the filename into parts and store each part
	unset -nocomplain kitos kitcpu
	set kitbuildinfo [split $shortfile -]
	set tclversion [lindex $kitbuildinfo 1]
	set kitos [lindex $kitbuildinfo 2]
	set kitcpu [lindex $kitbuildinfo 3]

	### Store the remainder as a list of tags
	set kitbuildinfo [lsort -dictionary [lrange $kitbuildinfo 4 end]]

	# Generate array to describe this kit
	unset -nocomplain kitinfo
	set kitinfo(version) $tclversion
	set kitinfo(file) $shortfile
	set kitinfo(fullfile) $file
	set kitinfo(buildfile) $buildfile
	set kitinfo(failedtests) $failedtests

	set kitinfo(buildflags) $kitbuildinfo
	set kitinfo(os) $kitos
	set kitinfo(cpu) $kitcpu
	set kitinfo(built) $kitbuilt

	# Store kit information with all kits
	set key [list $tclversion $kitos $kitcpu]







>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>





>




















>







136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
		"*.log" - "*.ttml" - "*.html" - "*.desc" {
			continue
		}
	}

	# Derive what we can from the filename
	set buildfile "${shortfile}-build.log"

	# Determine which tests passed/failed
	set failedtests [list]
	set passedtests [list]
	set testsfile "${file}-tests.log"
	if {[file exists $testsfile]} {
		set testfd [open $testsfile r]
		foreach line [split [read $testfd] \n] {
			set work [split $line :]
			set test [string trim [lindex $work 0]]
			set result [string trim [lindex $work 1]]

			switch -- $result {
				"PASS" {
					lappend passedtests "${shortfile}-${test}.log"
				}
				"FAIL" {
					lappend failedtests "${shortfile}-${test}.log"
				}
			}
		}
		close $testfd
	}

	# If this kit represents a failed build, set the failed tests to that
	set kitbuilt 1
	if {[file tail [file dirname $file]] == "failed"} {
		set failedtests [list "${shortfile}-XX-build.log"]
		set passedtests [list]
		set kitbuilt 0
	}

	## Split the filename into parts and store each part
	unset -nocomplain kitos kitcpu
	set kitbuildinfo [split $shortfile -]
	set tclversion [lindex $kitbuildinfo 1]
	set kitos [lindex $kitbuildinfo 2]
	set kitcpu [lindex $kitbuildinfo 3]

	### Store the remainder as a list of tags
	set kitbuildinfo [lsort -dictionary [lrange $kitbuildinfo 4 end]]

	# Generate array to describe this kit
	unset -nocomplain kitinfo
	set kitinfo(version) $tclversion
	set kitinfo(file) $shortfile
	set kitinfo(fullfile) $file
	set kitinfo(buildfile) $buildfile
	set kitinfo(failedtests) $failedtests
	set kitinfo(passedtests) $passedtests
	set kitinfo(buildflags) $kitbuildinfo
	set kitinfo(os) $kitos
	set kitinfo(cpu) $kitcpu
	set kitinfo(built) $kitbuilt

	# Store kit information with all kits
	set key [list $tclversion $kitos $kitcpu]
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
		unset -nocomplain kitinfo
		array set kitinfo $kitinfo_list

		if {[llength $kitinfo(failedtests)] == 0} {
			set status ok

			# If we are cross-compiled, note that no tests were run
			if {[lsearch -exact $kitinfo(buildflags) xcompile] != -1} {
				set status untested
			}
		} else {
			set status non-critical
		}









|







224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
		unset -nocomplain kitinfo
		array set kitinfo $kitinfo_list

		if {[llength $kitinfo(failedtests)] == 0} {
			set status ok

			# If we are cross-compiled, note that no tests were run
			if {[llength $kitinfo(passedtests)] == 0} {
				set status untested
			}
		} else {
			set status non-critical
		}


Modified build/test/test from [cf8d3f1fd9] to [6b4cd9a999].

129
130
131
132
133
134
135

136
137
138
139
140
141
142

		# Create Tclkit
		createdkit="tclkit-${version}"
		outputname="${TESTDIR}/kits/tclkit-${version}-${kit}"
		failoutputname="${TESTDIR}/kits/failed/tclkit-${version}-${kit}"
		buildlog="${outputname}-build.log"
		failbuildlog="${failoutputname}-build.log"


		if [ ! -f "${outputname}" ]; then
			unset KITCREATOR_PKGS STATICTK

			if [ -f "${failoutputname}" ]; then
				echo "Skipping rebuilding failed kit ${version}/${kit} ..."








>







129
130
131
132
133
134
135
136
137
138
139
140
141
142
143

		# Create Tclkit
		createdkit="tclkit-${version}"
		outputname="${TESTDIR}/kits/tclkit-${version}-${kit}"
		failoutputname="${TESTDIR}/kits/failed/tclkit-${version}-${kit}"
		buildlog="${outputname}-build.log"
		failbuildlog="${failoutputname}-build.log"
		testresultslog="${outputname}-tests.log"

		if [ ! -f "${outputname}" ]; then
			unset KITCREATOR_PKGS STATICTK

			if [ -f "${failoutputname}" ]; then
				echo "Skipping rebuilding failed kit ${version}/${kit} ..."

262
263
264
265
266
267
268


269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286


287
288


289
290
291
292
293
294
295
296
297

		# Do not continue past here for un-runnable kits
		if [ "${runnable}" != "1" ]; then
			continue
		fi

		# Perform battery of tests


		for testscp in "${TESTDIR}"/tests/*.tcl; do
			testscp_tag="$(basename "${testscp}" .tcl)"
			testscppre="$(dirname "${testscp}")/${testscp_tag}.sh"
			scplogfile="${outputname}-${testscp_tag}.log"

			(
				if [ -f "${testscppre}" ]; then
					. "${testscppre}"
				fi

				"${outputname}" "${testscp}" "${outputname}" "${kit}" "${version}"
			) > "${scplogfile}" 2>&1

			if [ "$?" != "0" ]; then
				echo "Script failed: ${testscp_tag} on ${version}/${kit}" >&2

				failed="${failed} ${version}/${kit}-test-${testscp_tag}"



				continue
			fi



			rm -f "${scplogfile}"
		done
	done
done

if [ -n "${failed}" ]; then
	echo "Failed: ${failed}"
fi







>
>


















>
>


>
>









263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304

		# Do not continue past here for un-runnable kits
		if [ "${runnable}" != "1" ]; then
			continue
		fi

		# Perform battery of tests
		## Clean tests log
		rm -f "${testresultslog}"
		for testscp in "${TESTDIR}"/tests/*.tcl; do
			testscp_tag="$(basename "${testscp}" .tcl)"
			testscppre="$(dirname "${testscp}")/${testscp_tag}.sh"
			scplogfile="${outputname}-${testscp_tag}.log"

			(
				if [ -f "${testscppre}" ]; then
					. "${testscppre}"
				fi

				"${outputname}" "${testscp}" "${outputname}" "${kit}" "${version}"
			) > "${scplogfile}" 2>&1

			if [ "$?" != "0" ]; then
				echo "Script failed: ${testscp_tag} on ${version}/${kit}" >&2

				failed="${failed} ${version}/${kit}-test-${testscp_tag}"

				echo "${testscp_tag}: FAIL" >>  "${testresultslog}"

				continue
			fi

			echo "${testscp_tag}: PASS" >>  "${testresultslog}"

			rm -f "${scplogfile}"
		done
	done
done

if [ -n "${failed}" ]; then
	echo "Failed: ${failed}"
fi

Modified build/test/tests/05-locale.tcl from [302e0dfbb0] to [19da5ec8b9].

1
2
3
4
5
6
7
8
9
10



11
12
#! /usr/bin/env tclsh

# Tcl 8.4 doesn't support fetching the system encoding from the environment
if {$tcl_version == "8.4"} {
	exit 0
}

if {[encoding system] == "utf-8"} {
	exit 0
}




exit 1










>
>
>


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#! /usr/bin/env tclsh

# Tcl 8.4 doesn't support fetching the system encoding from the environment
if {$tcl_version == "8.4"} {
	exit 0
}

if {[encoding system] == "utf-8"} {
	exit 0
}

puts "Locale:   [encoding system]"
puts "Expected: utf-8"

exit 1