Francois Gouget : testbot/build: Let PatchUtils.pm generate testlist.txt.
Module: tools Branch: master Commit: 494539d0f6a3fec4c1176ed76379d1f3f7c2dc42 URL: https://source.winehq.org/git/tools.git/?a=commit;h=494539d0f6a3fec4c1176ed7... Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Thu Jun 14 10:36:48 2018 +0200 testbot/build: Let PatchUtils.pm generate testlist.txt. This makes it possible to reuse the code in other build scripts. Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- testbot/bin/build/Reconfig.pl | 18 +++++------------- testbot/lib/WineTestBot/PatchUtils.pm | 33 ++++++++++++++++++++++++++++++++- 2 files changed, 37 insertions(+), 14 deletions(-) diff --git a/testbot/bin/build/Reconfig.pl b/testbot/bin/build/Reconfig.pl index 32cbad7..c950d49 100755 --- a/testbot/bin/build/Reconfig.pl +++ b/testbot/bin/build/Reconfig.pl @@ -41,6 +41,7 @@ sub BEGIN } use WineTestBot::Config; +use WineTestBot::PatchUtils; my $LogFileName = "$LogDir/Reconfig.log"; @@ -133,20 +134,11 @@ sub GitPull() return !1; } - if (open(my $fh, ">", "$DataDir/testlist.txt")) + my $ErrMessage = UpdateWineData("$DataDir/wine"); + if ($ErrMessage) { - foreach my $TestFile (glob("$DataDir/wine/*/*/tests/*.c"), - glob("$DataDir/wine/*/*/tests/*.spec")) - { - next if ($TestFile =~ m=/testlist\.c$=); - $TestFile =~ s=^$DataDir/wine/==; - print $fh "$TestFile\n"; - } - close($fh); - } - else - { - LogMsg "Could not open 'testlist.txt' for writing: $!\n"; + LogMsg "$ErrMessage\n"; + return !1; } return 1; diff --git a/testbot/lib/WineTestBot/PatchUtils.pm b/testbot/lib/WineTestBot/PatchUtils.pm index 833394a..3a555af 100644 --- a/testbot/lib/WineTestBot/PatchUtils.pm +++ b/testbot/lib/WineTestBot/PatchUtils.pm @@ -31,7 +31,7 @@ the Wine builds. =cut use Exporter 'import'; -our @EXPORT = qw(GetPatchImpact); +our @EXPORT = qw(GetPatchImpact UpdateWineData); use WineTestBot::Config; @@ -39,6 +39,37 @@ use WineTestBot::Config; =pod =over 12 +=item C<UpdateWineData()> + +Updates the summary information about the Wine source such as the list of +tests (testlist.txt). + +=back +=cut + +sub UpdateWineData($) +{ + my ($WineDir) = @_; + + if (open(my $fh, ">", "$DataDir/testlist.txt")) + { + foreach my $TestFile (glob("$WineDir/*/*/tests/*.c"), + glob("$WineDir/*/*/tests/*.spec")) + { + next if ($TestFile =~ m=/testlist\.c$=); + $TestFile =~ s=^$WineDir/==; + print $fh "$TestFile\n"; + } + close($fh); + return undef; + } + + return "Could not open 'testlist.txt' for writing: $!"; +} + +=pod +=over 12 + =item C<GetTestList()> Returns a hashtable containing the list of the source files for a given module.
participants (1)
-
Alexandre Julliard