Tuxpaint GUI testing with xautomation

Tuxpaint could be a poster child for l10n. It has translations now for 68 different locales. The large number of locales poses somewhat of a problem for testing1.

Tuxpaint 0.9.16 just released. During the release preparation, the manual testing of all of these locales drove me nearly insane. So to help out next time, I created the following bash script using xautomation2, imagemagick and xprop (from xbase-clients):


#!/bin/bash
testname="tuxpaint"
root_geometry=`xprop -root _NET_DESKTOP_GEOMETRY |cut -d= -f2`
root_x=`echo $root_geometry |cut -d, -f1`
root_y=`echo $root_geometry |cut -d, -f2`
xc=$((root_x/2-1))
yc=$((root_y/2-1))

capture_tuxpaint () {
   tuxpaint --startblank --nolockfile --lang $1 --640x480 --windowed --nosound &
   sleep 1
   xte "mousemove $xc $yc"
   xte "mouseclick 1"
   sleep 1
   xte "key Escape"
   sleep 2
   import -silent -window "Tux Paint" $testname-$1.png
   xte "mousermove -120 -40"
   xte "mouseclick 1"
}

for lang in `tuxpaint --lang help |awk '$1~/^[[:lower:]]/ {print $1}'`; do
   capture_tuxpaint $lang
done

I’m not entirely happy with it, but it’s at least a starting point. Ideally, I’d make .pat files to use with visgrep to find coordinates for the button images instead of hardwiring the approximate button positions. Also, the script needs a companion script to configure the system for testing (i.e. perform the locales configuration and install all fonts).

Here are the resulting screenshots which show up a few problems with the translations. It looks like the quit dialog strings have been updated since they were first translated, so now we need retranslation for several languages. Also, there are some languages, like Swahili and Klingon, for which there are no locales in glibc in Debian. I’ll have to talk to the glibc maintainers about that. And for that matter, I don’t even know if a DFSG-free Klingon font exists.

In any event, I’m delighted with the results, and look forward to using xautomation more for GUI testing.

1 For one thing, several languages require special fonts. For another, there is no way to get tuxpaint to tell you what locales it supports. Granted, there is --lang help, but this is a crude approximation, as the mapping between language and locale is arbitrarily hardwired (which hmh on #debian-devel irc pointed out to me is just plain wrong). It doesn’t help me at all in the arduous task of configuring glibc locales so I can test them. For that, I need to look at i18n.c.

2 I tried using xmacro at first, but xmacrorec just made my pointer jiggle back and forth. It seemed like it was updating the position for a short distance, and then X was resetting it back to the former position of the pointer. Some strange interaction with my window manager, perhaps? But ultimately I am happier with the xautomation approach anyway.

Facebooktwittergoogle_plusredditpinterestlinkedinmail

Geek father

Being Father’s Day today gives me pause to consider Debian Jr., a project for kids. The goal was to make Debian the OS kids prefer to use. I wanted my own kids to grow up enjoying using a system that puts the fewest barriers in the way to learning about how computers work, and to making computers work for them.

It’s nearly six years later now: enough time for my second youngest to grow from a toddler to an eight-year-old girl, for my youngest girl to be born and put to the test the lower limit of our “for kids from 0 to 99” slogan, for our boy in the middle to grow from a preschooler to a preteen, and for the two oldest girls to turn into teenagers. Perhaps by the time we have grandkids, Debian Jr. will finally be “done”.

In that time, our kids have gone from using a VT-420 attached to my Pentium 100, exploring commands using the “magic” tab-key at the bash prompt, playing with words and letters in pico, to playing 3D games and creating artwork in the Gimp on the family Sempron 3300+. And through it all, they’ve remained happy and proud to use Linux, which none of their friends have. They have become, I believe, more firmly grounded and comfortable with computing than they might have been using a system “dumbed down” for kids.

To all the Debian using fathers out there today, Happy Father’s Day! May you and your kids’ lives be enriched as you share in the finest OS in the world.

Facebooktwittergoogle_plusredditpinterestlinkedinmail

Junior programming refocused on “kid languages”

I’ve refocused the Debian Jr. programming metapackage on languages made for kids. I’m sure there are some who have used scheme or python with their kids, and sure, if you want to do that, go ahead. But these were only initially included because of a lack of choices.

Littlewizard is an icon-based language only recently added, and kturtle replaces the less-kid-friendly ucblogo. I’ve also been pursuing #236721 to see what it would take to get Squeak into main. While it doesn’t look like there’s hope of that anytime soon, recent changes to their licensing might allow it to go into non-free.

Facebooktwittergoogle_plusredditpinterestlinkedinmail