Module: tools
Branch: master
Commit: ee5abd8508e7168c613f112b0cd311a8c4445e28
URL: https://source.winehq.org/git/tools.git/?a=commit;h=ee5abd8508e7168c613f112…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Wed Feb 16 20:15:55 2022 +0100
testbot/SetWinLocale: Use the Powershell script to get keyboard layouts.
The Powershell API can provide information about locales related to
the ones that have been installed which the registry does not. For
instance after installing fr_FR one can also get the LCID and keyboard
layout for fr_BE, fr_CH, etc.
Add GetWinProperties() to standardize retrieving information from the
SetWinLocale.ps1 script.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/bin/SetWinLocale | 40 ++++++++++++++--------------------------
1 file changed, 14 insertions(+), 26 deletions(-)
diff --git a/testbot/bin/SetWinLocale b/testbot/bin/SetWinLocale
index 29b57b3..73c774e 100755
--- a/testbot/bin/SetWinLocale
+++ b/testbot/bin/SetWinLocale
@@ -43,7 +43,6 @@ use WineTestBot::Utils;
my $HKCU_INTERNATIONAL = "HKCU\\Control Panel\\International";
my $HKCU_GEO = "HKCU\\Control Panel\\International\\Geo";
-my $HKCU_USER_PROFILE = "HKCU\\Control Panel\\International\\User Profile";
#
@@ -679,10 +678,11 @@ else
FatalError("could not open '$0.ps1' for reading: $!\n");
}
-sub GetWinSettings()
+sub GetWinProperties($)
{
- my $Cmd = ["powershell.exe", "-ExecutionPolicy", "ByPass", "-File",
- "$name0.ps1", "settings"];
+ my ($Cmd) = @_;
+
+ Debug(Elapsed($Start), " Running: @$Cmd\n");
my $Ret = $TA->RunAndWait($Cmd, 0, 30, undef, "$name0.out", "$name0.out");
FatalError("failed to run @$Cmd: ", $TA->GetLastError(), "\n") if ($Ret < 0);
my $Out = $TA->GetFileToString("$name0.out") if (!$Ret);
@@ -705,6 +705,12 @@ sub GetWinSettings()
return $Settings;
}
+sub GetWinSettings()
+{
+ return GetWinProperties(["powershell.exe", "-ExecutionPolicy", "ByPass",
+ "-File", "$name0.ps1", "settings"]);
+}
+
sub Value2Str($)
{
my ($Value) = @_;
@@ -774,28 +780,10 @@ sub GetWinKeyboardIds($)
{
my ($Locale) = @_;
- # The locale information is sometimes stored in a key with a non-standard
- # name, despite the standard locale name being used everywhere else!
- my $Key = $LocaleInfoKeys{$Locale} || $Locale;
- my $Values = RegGetValues("$HKCU_USER_PROFILE\\$Key", "*:*");
- if (!%$Values)
- {
- $Key =~ s/-.*$//;
- $Values = RegGetValues("$HKCU_USER_PROFILE\\$Key", "*:*");
- }
-
- # Look for the locale's keyboard id(s).
- my %WinLayouts;
- foreach my $VName (keys %$Values)
- {
- # The value is the keyboard layout's preference order
- $WinLayouts{hex($Values->{$VName})} = $VName if ($VName =~ /^[0-9A-F]{4}:/);
- }
- $WinKeyboardIds{$Locale} = %WinLayouts ? [] : $Keyboards{$Locale};
- foreach my $Index (sort { $a cmp $b } keys %WinLayouts)
- {
- push @{$WinKeyboardIds{$Locale}}, $WinLayouts{$Index};
- }
+ my $Info = GetWinProperties(["powershell.exe", "-ExecutionPolicy", "ByPass",
+ "-File", "$name0.ps1", "info", $Locale]);
+ $WinKeyboardIds{$Locale} = $Info->{InputMethodTips} ? [$Info->{InputMethodTips}] : $Keyboards{$Locale};
+ Debug("WinKeyboardIds=", Value2Str($WinKeyboardIds{$Locale}), "\n");
if (!$WinKeyboardIds{$Locale})
{
FatalError("could not find the $Locale LCID and keyboard ids. Maybe the locale is not installed?\n");
Module: tools
Branch: master
Commit: da9dbcdb9d6017eb0d3cbf80f00c344b0b7e23fd
URL: https://source.winehq.org/git/tools.git/?a=commit;h=da9dbcdb9d6017eb0d3cbf8…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Wed Feb 16 20:11:27 2022 +0100
testbot/LibvirtTool: Add support for UTF-8 and Unicode-only locales.
Adding '-u8' to a snapshot name sets the code pages to UTF-8 and allows
using a Unicode-only locale as the Windows system locale.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/bin/LibvirtTool.pl | 28 ++++++++++++++++++----------
1 file changed, 18 insertions(+), 10 deletions(-)
diff --git a/testbot/bin/LibvirtTool.pl b/testbot/bin/LibvirtTool.pl
index 481d0bd..10af2f8 100755
--- a/testbot/bin/LibvirtTool.pl
+++ b/testbot/bin/LibvirtTool.pl
@@ -560,7 +560,7 @@ sub GetSnapshotConfig($)
{
$Config->{locale} ||= $1; # take only the last match
}
- elsif ($Config->{base} =~ s/-(live)$//)
+ elsif ($Config->{base} =~ s/-(live|u8)$//)
{
$Config->{$1} = 1;
}
@@ -614,20 +614,28 @@ sub CreateSnapshot($$$$)
# A side effect is that it will force TestAgentd.exe.old to stay around.
}
- if ($Config->{locale})
+ my @Locale;
+ push @Locale, $Config->{locale} if ($Config->{locale});
+ push @Locale, $Config->{u8} if ($Config->{u8});
+ if (@Locale)
{
- Debug(Elapsed($Start), " Setting up the $Config->{locale} locale on $VMKey\n");
- # SetWinLocale --default performs a reboot and WaitForBoot()
- ResetBootCount($TA);
+ Debug(Elapsed($Start), " Setting up the @Locale locale on $VMKey\n");
+ my @Cmd = ("$BinDir/SetWinLocale", $VM->Hostname);
+ if ($Config->{locale})
+ {
+ push @Cmd, "--default", $Config->{locale};
+ # SetWinLocale --default performs a reboot and WaitForBoot()
+ ResetBootCount($TA);
+ $Booting = 1;
+ }
+ push @Cmd, "--utf8" if ($Config->{u8});
+ push @Cmd, "--debug" if ($Debug);
$TA->Disconnect();
- $Booting = 1;
- my @Cmd = ("$BinDir/SetWinLocale", $VM->Hostname, "--default", $Config->{locale});
- push @Cmd, "--debug" if ($Debug);
- Debug("Running: ", join(" ", @Cmd), "\n");
+ Debug("Running: @Cmd\n");
if (system(@Cmd))
{
- FatalError("Could not set the $VMKey locale to $Config->{locale}\n");
+ FatalError("Could not set the $VMKey locale to @Locale\n");
}
}
Module: tools
Branch: master
Commit: 588a9e088c5bb6a591f15cb867bf3588e1a20e15
URL: https://source.winehq.org/git/tools.git/?a=commit;h=588a9e088c5bb6a591f15cb…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Wed Feb 16 20:10:44 2022 +0100
testbot/LibvirtTool: Reorganize the snapshot creation.
WaitForBoot() is responsible for establishing the first connection after
the VM boots, which can take longer than usual.
PrepareVM() replaces SetupTestAgentd() and performs all the tasks
needed to make the VM ready for the tests.
CreateSnapshot() now also configures the VM before creating the
Libvirt snapshot.
And CheckBootCount() verifies that the VM did not crash at some point
during the process. It is now systematically called before creating
snapshots or declaring the VM fit for duty.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/bin/LibvirtTool.pl | 228 +++++++++++++++++++++++++++------------------
1 file changed, 135 insertions(+), 93 deletions(-)
Diff: https://source.winehq.org/git/tools.git/?a=commitdiff;h=588a9e088c5bb6a591f…