Module: vkd3d
Branch: master
Commit: f11f7032cd4ed46b615e222bb90cdcbc6b55fb46
URL: https://source.winehq.org/git/vkd3d.git/?a=commit;h=f11f7032cd4ed46b615e222…
Author: Zebediah Figura <zfigura(a)codeweavers.com>
Date: Mon Mar 21 20:42:17 2022 -0500
tests: Make the "texture" structure more generic.
Use it to hold any type of resource, regardless of type and binding.
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
tests/shader_runner.c | 55 ++++++++++----------
tests/shader_runner.h | 19 ++++---
tests/shader_runner_d3d11.c | 89 ++++++++++++++++++--------------
tests/shader_runner_d3d12.c | 123 +++++++++++++++++++++++++-------------------
4 files changed, 161 insertions(+), 125 deletions(-)
Diff: https://source.winehq.org/git/vkd3d.git/?a=commitdiff;h=f11f7032cd4ed46b615…
Module: tools
Branch: master
Commit: 45fb19982f2d0d6977fa8a6ffb75cda3c1fb149e
URL: https://source.winehq.org/git/tools.git/?a=commit;h=45fb19982f2d0d6977fa8a6…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Tue Mar 22 13:21:28 2022 +0100
testbot/web: Better initialize and check the Days main page parameter.
Set the FormPage property descriptors list. This allows
FormPage::Validate() to do most of the validation work and removes the
need for a custom Validate() method.
Treat "00" the same as "0".
Also remove the need for redefining OnAction().
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/web/index.pl | 42 ++++++++++++++++--------------------------
1 file changed, 16 insertions(+), 26 deletions(-)
diff --git a/testbot/web/index.pl b/testbot/web/index.pl
index 1336d1e..605e23b 100644
--- a/testbot/web/index.pl
+++ b/testbot/web/index.pl
@@ -2,6 +2,7 @@
# WineTestBot status page
#
# Copyright 2009 Ge van Geldorp
+# Copyright 2013-2022 Francois Gouget
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -31,6 +32,7 @@ use WineTestBot::Branches;
use WineTestBot::Users;
use WineTestBot::Utils;
+my $DAYS_DEFAULT = 4;
sub SortKeys($$)
@@ -239,6 +241,7 @@ package StatusPage;
use ObjectModel::CGI::FreeFormPage;
our @ISA = qw(ObjectModel::CGI::FreeFormPage);
+use ObjectModel::BasicPropertyDescriptor;
use ObjectModel::Collection;
use WineTestBot::Config;
@@ -253,29 +256,20 @@ sub _initialize($$$)
{
my ($self, $Request, $RequiredRole) = @_;
- $self->{Days} = $self->GetParam("Days");
- $self->Validate();
-
$self->{start} = Time();
- $self->SUPER::_initialize($Request, $RequiredRole);
-}
-
-sub Validate($)
-{
- my ($self) = @_;
+ my @PropertyDescriptors = (
+ CreateBasicPropertyDescriptor("Days", "Days ", !1, 1, "N", 2),
+ );
+ $self->SUPER::_initialize($Request, $RequiredRole, \@PropertyDescriptors);
- if (!defined $self->{Days} or !$self->{Days})
+ if (!$self->GetParam("Days") or !$self->Validate() or
+ !int($self->GetParam("Days"))) # 00 case!
{
- $self->{Days} = $DefaultIndexDays;
+ # Replace with the default value so the cutoff can be calculated
+ $self->SetParam("Days", $DAYS_DEFAULT);
}
- elsif ($self->{Days} !~ /^[0-9]{1,2}$/)
- {
- $self->{ErrField} = "Days";
- $self->{ErrMessage} = "The number of days must be between 1 and 99";
- $self->{Days} = $DefaultIndexDays;
- return undef;
- }
- return $self->SUPER::Validate();
+ # The action is a no-op so unset it to not need to redefine OnAction()
+ $self->SetParam("Action", undef);
}
sub OutputDot($$)
@@ -351,7 +345,8 @@ sub GenerateBody($)
print "<h2><a name='jobs'></a>Jobs</h2>\n";
my $Jobs = CreateJobs();
- my $CutOff = time() - $self->{Days} * 24 * 60 * 60;
+ my $Days = $self->GetParam("Days");
+ my $CutOff = time() - $Days * 24 * 60 * 60;
$Jobs->AddFilter("Submitted", [$CutOff], ">=");
my $JobsCollectionBlock = new JobStatusBlock($Jobs, $self);
@@ -385,7 +380,7 @@ sub GenerateBody($)
<form id="Days" action='/' method='get'>
<div class='ItemProperty'><label>Show jobs for the past</label>
<div class='ItemValue'>
- <input type='text' name='Days' maxlength='2' size='2' value='$self->{Days}' /> days
+ <input type='text' name='Days' maxlength='2' size='2' value='$Days' /> days
<input type='submit' value='Update'/>
</div>
</div>
@@ -400,11 +395,6 @@ EOF
print "<p class='GeneralFooterText'>Generated in ", Elapsed($self->{start}), " s</p>\n";
}
-sub OnAction($$)
-{
- my ($self, $Action) = @_;
- return $self->Validate() ? 1 : undef;
-}
package main;
Module: tools
Branch: master
Commit: 259b97e6f58f4ddb23912765d3ee7ceb86e53454
URL: https://source.winehq.org/git/tools.git/?a=commit;h=259b97e6f58f4ddb2391276…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Tue Mar 22 13:20:59 2022 +0100
testbot/web: Better document the default Days stats page value.
Store it in a variable at the start of the file so it's easy to spot.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/web/Stats.pl | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/testbot/web/Stats.pl b/testbot/web/Stats.pl
index 5ec6979..8433c6d 100644
--- a/testbot/web/Stats.pl
+++ b/testbot/web/Stats.pl
@@ -32,6 +32,8 @@ use WineTestBot::Log; # For Elapsed()
use WineTestBot::Utils;
use WineTestBot::VMs;
+my $DAYS_DEFAULT = 7;
+
sub _initialize($$$)
{
@@ -46,7 +48,7 @@ sub _initialize($$$)
if (!$self->GetParam("Days") or !$self->Validate() or
!int($self->GetParam("Days"))) # 00 case!
{
- $self->SetParam("Days", 7) if (!defined $self->{ErrMessage});
+ $self->SetParam("Days", $DAYS_DEFAULT) if (!defined $self->{ErrMessage});
$self->{NoStats} = 1;
}
# The action is a no-op so unset it to not need to redefine OnAction()
Module: tools
Branch: master
Commit: 6a634e007bf9c2d8759d42d9fe7770364fd7a68f
URL: https://source.winehq.org/git/tools.git/?a=commit;h=6a634e007bf9c2d8759d42d…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Tue Mar 22 13:20:27 2022 +0100
testbot/web: Better initialize and check the Hours activity page parameter.
Set the FormPage property descriptors list. This allows
FormPage::Validate() to do most of the validation work.
Treat "00" the same as "0".
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/web/Activity.pl | 28 ++++++++++++++++++----------
1 file changed, 18 insertions(+), 10 deletions(-)
diff --git a/testbot/web/Activity.pl b/testbot/web/Activity.pl
index 9444779..272215f 100644
--- a/testbot/web/Activity.pl
+++ b/testbot/web/Activity.pl
@@ -27,28 +27,35 @@ our @ISA = qw(ObjectModel::CGI::FreeFormPage);
use POSIX qw(strftime);
use URI::Escape;
+use ObjectModel::BasicPropertyDescriptor;
use WineTestBot::Config;
use WineTestBot::Activity;
use WineTestBot::Log; # For Elapsed()
use WineTestBot::Utils;
use WineTestBot::VMs;
-
my $HOURS_DEFAULT = 12;
+
sub _initialize($$$)
{
my ($self, $Request, $RequiredRole) = @_;
$self->{start} = Time();
- $self->{hours} = $self->GetParam("Hours");
- if (!defined $self->{hours} or $self->{hours} !~ /^\d{1,3}$/)
- {
- $self->{hours} = $HOURS_DEFAULT;
- }
-
+ my @PropertyDescriptors = (
+ CreateBasicPropertyDescriptor("Hours", "Hours", !1, 1, "N", 3),
+ );
$self->SUPER::_initialize($Request, $RequiredRole);
$self->{Method} = "get";
+
+ if (!$self->GetParam("Hours") or !$self->Validate() or
+ !int($self->GetParam("Hours"))) # 00 case!
+ {
+ # This page always needs a valid value to calculate the cutoff. So just
+ # replace invalid values with the default (no error message is shown
+ # either).
+ $self->SetParam("Hours", $HOURS_DEFAULT);
+ }
}
sub GetPageTitle($$)
@@ -61,7 +68,8 @@ sub GetPageTitle($$)
sub GeneratePage($)
{
my ($self) = @_;
- if ($self->{hours} and $self->{hours} <= $HOURS_DEFAULT)
+
+ if ($self->GetParam("Hours") <= $HOURS_DEFAULT)
{
$self->{Request}->headers_out->add("Refresh", "60");
}
@@ -101,7 +109,7 @@ sub GenerateBody($)
# Generate a custom form to let the user specify the Hours field.
$self->GenerateFormStart();
- print "<div class='ItemProperty'><label>Analyze the activity of the past <div class='ItemValue'><input type='text' name='Hours' maxlength='3' size='3' value='$self->{hours}'/></div> hours.</label></div>\n";
+ print "<div class='ItemProperty'><label>Analyze the activity of the past <div class='ItemValue'><input type='text' name='Hours' maxlength='3' size='3' value='", $self->GetParam("Hours"), "'/></div> hours.</label></div>\n";
$self->GenerateFormEnd();
print "<h1>${ProjectName} Test Bot activity</h1>\n";
@@ -148,7 +156,7 @@ EOF
### Generate the HTML table with the newest record first
print "<tbody>\n";
- my ($Activity, $_Counters) = GetActivity($VMs, $self->{hours} * 3600);
+ my ($Activity, $_Counters) = GetActivity($VMs, $self->GetParam("Hours") * 3600);
for (my $Index = @$Activity; $Index--; )
{
my $Group = $Activity->[$Index];