summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorsvu <svu>2004-05-06 01:00:44 +0000
committersvu <svu>2004-05-06 01:00:44 +0000
commit27500e1766f2c076e8d41e2cb31b70a993f3f5d1 (patch)
treecc6dc4676b1e41809ec34e7a1789178fd0a923c0 /tests
parent7e0efefa1e4beeb4d022af82ae64289228dec9f4 (diff)
one more test - but still problems passing it
Diffstat (limited to 'tests')
-rw-r--r--tests/listCI2.xsl2
-rwxr-xr-xtests/testLayouts.pl2
-rwxr-xr-xtests/testOptions.pl13
-rwxr-xr-xtests/xkbTestFunc.pm27
4 files changed, 34 insertions, 10 deletions
diff --git a/tests/listCI2.xsl b/tests/listCI2.xsl
index 894096a..3dd48d7 100644
--- a/tests/listCI2.xsl
+++ b/tests/listCI2.xsl
@@ -8,7 +8,7 @@
<xsl:param name="parentId"/>
<xsl:template match="configItem">
- <xsl:if test="name(..) = $type and ../../../configItem/name = $parentId">
+ <xsl:if test="name(..) = $type and ( ../../../configItem/name = $parentId or ../../configItem/name = $parentId )">
<xsl:value-of select="./name"/>
</xsl:if>
</xsl:template>
diff --git a/tests/testLayouts.pl b/tests/testLayouts.pl
index bf7478f..bcb657b 100755
--- a/tests/testLayouts.pl
+++ b/tests/testLayouts.pl
@@ -8,6 +8,6 @@ xkbTestFunc::backupXkbSettings();
xkbTestFunc::dumpXkbSettingsBackup();
-xkbTestFunc::testLevel2( "layout", "variant", 2, "(", ")" );
+xkbTestFunc::testLevel2( "layout", "variant", 2, "(", ")", 1, 1 );
xkbTestFunc::restoreXkbSettings();
diff --git a/tests/testOptions.pl b/tests/testOptions.pl
new file mode 100755
index 0000000..c880579
--- /dev/null
+++ b/tests/testOptions.pl
@@ -0,0 +1,13 @@
+#!/bin/env perl
+
+use strict;
+use warnings;
+use xkbTestFunc;
+
+xkbTestFunc::backupXkbSettings();
+
+xkbTestFunc::dumpXkbSettingsBackup();
+
+xkbTestFunc::testLevel2( "group", "option", 4, ":", "", 0, 0 );
+
+xkbTestFunc::restoreXkbSettings();
diff --git a/tests/xkbTestFunc.pm b/tests/xkbTestFunc.pm
index b612088..d78c16d 100755
--- a/tests/xkbTestFunc.pm
+++ b/tests/xkbTestFunc.pm
@@ -44,6 +44,7 @@ sub setXkbSettings
"-layout", $xkbLayouts,
"-variant", $xkbVariants,
"-option", $xkbOptions ) == 0 ) or die "Could not set xkb configuration";
+ sleep 1;
}
sub restoreXkbSettings
@@ -97,7 +98,7 @@ sub testLevel1
sub testLevel2
{
- my ( $type, $subtype, $idx, $delim1, $delim2 ) = @_;
+ my ( $type, $subtype, $idx, $delim1, $delim2, $ifCheckLevel1, $ifAddLevel1 ) = @_;
open ( XSLTPROC, "xsltproc --stringparam type $type listCIs.xsl ../rules/base.xml.in |" ) or
die ( "Could not start xsltproc" );
@@ -109,12 +110,15 @@ sub testLevel2
my $paramValue=$1;
print "--- scanning $type: [$paramValue]\n";
- my @params = defaultXkbSettings();
- $params[$idx] = "$paramValue";
- dumpXkbSettings ( @params );
- setXkbSettings ( @params );
- #print "--- dump:\n";
- #dumpXkbSettings( getXkbSettings() );
+ if ( $ifCheckLevel1 )
+ {
+ my @params = defaultXkbSettings();
+ $params[$idx] = "$paramValue";
+ dumpXkbSettings ( @params );
+ setXkbSettings ( @params );
+ #print "--- dump:\n";
+ #dumpXkbSettings( getXkbSettings() );
+ }
open ( XSLTPROC2, "xsltproc --stringparam type $subtype --stringparam parentId $paramValue listCI2.xsl ../rules/base.xml.in |" ) or
die ( "Could not start xsltproc" );
@@ -126,7 +130,14 @@ sub testLevel2
my $paramValue2=$1;
print " --- $subtype: [$paramValue2]\n";
my @params = defaultXkbSettings();
- $params[$idx] = "$paramValue$delim1$paramValue2$delim2";
+ if ( $ifAddLevel1 )
+ {
+ $params[$idx] = "$paramValue$delim1$paramValue2$delim2";
+ }
+ else
+ {
+ $params[$idx] = "$paramValue2";
+ }
dumpXkbSettings ( @params );
setXkbSettings ( @params );
#print "--- dump:\n";