Guest User

Untitled

a guest
Jul 20th, 2018
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.55 KB | None | 0 0
  1. From bb227adcae287750a9b150a5889b5c011aac9c0f Mon Sep 17 00:00:00 2001
  2. From: Florian Ragwitz <rafl@debian.org>
  3. Date: Sat, 22 Jan 2011 09:03:20 +0100
  4. Subject: [PATCH] Stop EU::CBuilder's tests from failing in parallel
  5.  
  6. It used to use the same paths for temporary files in all tests. This blew up
  7. randomly when the tests were run in parallel.
  8. ---
  9. dist/ExtUtils-CBuilder/t/01-basic.t | 10 +++++-----
  10. dist/ExtUtils-CBuilder/t/02-link.t | 6 +++---
  11. dist/ExtUtils-CBuilder/t/03-cplusplus.t | 10 +++++-----
  12. dist/ExtUtils-CBuilder/t/04-base.t | 12 ++++++------
  13. 4 files changed, 19 insertions(+), 19 deletions(-)
  14.  
  15. diff --git a/dist/ExtUtils-CBuilder/t/01-basic.t b/dist/ExtUtils-CBuilder/t/01-basic.t
  16. index ffcd60c..70305af 100644
  17. --- a/dist/ExtUtils-CBuilder/t/01-basic.t
  18. +++ b/dist/ExtUtils-CBuilder/t/01-basic.t
  19. @@ -30,11 +30,11 @@ ok $b, "created EU::CB object";
  20.  
  21. ok $b->have_compiler, "have_compiler";
  22.  
  23. -$source_file = File::Spec->catfile('t', 'compilet.c');
  24. +$source_file = File::Spec->catfile('t', 'basict.c');
  25. {
  26. local *FH;
  27. open FH, "> $source_file" or die "Can't create $source_file: $!";
  28. - print FH "int boot_compilet(void) { return 1; }\n";
  29. + print FH "int boot_basict(void) { return 1; }\n";
  30. close FH;
  31. }
  32. ok -e $source_file, "source file '$source_file' created";
  33. @@ -48,7 +48,7 @@ $lib_file = $b->lib_file($object_file);
  34. ok 1;
  35.  
  36. my ($lib, @temps) = $b->link(objects => $object_file,
  37. - module_name => 'compilet');
  38. + module_name => 'basict');
  39. $lib =~ tr/"'//d;
  40. is $lib_file, $lib;
  41.  
  42. @@ -58,8 +58,8 @@ for ($source_file, $object_file, $lib_file) {
  43. }
  44.  
  45. if ($^O eq 'VMS') {
  46. - 1 while unlink 'COMPILET.LIS';
  47. - 1 while unlink 'COMPILET.OPT';
  48. + 1 while unlink 'BASICT.LIS';
  49. + 1 while unlink 'BASICT.OPT';
  50. }
  51.  
  52. my @words = $b->split_like_shell(' foo bar');
  53. diff --git a/dist/ExtUtils-CBuilder/t/02-link.t b/dist/ExtUtils-CBuilder/t/02-link.t
  54. index 822b071..e6dba55 100644
  55. --- a/dist/ExtUtils-CBuilder/t/02-link.t
  56. +++ b/dist/ExtUtils-CBuilder/t/02-link.t
  57. @@ -31,7 +31,7 @@ else {
  58.  
  59. ok $b, "created EU::CB object";
  60.  
  61. -$source_file = File::Spec->catfile('t', 'compilet.c');
  62. +$source_file = File::Spec->catfile('t', 'linkt.c');
  63. {
  64. open my $FH, "> $source_file" or die "Can't create $source_file: $!";
  65. print $FH "int main(void) { return 11; }\n";
  66. @@ -77,8 +77,8 @@ for ($source_file, $object_file, $exe_file) {
  67. }
  68.  
  69. if ($^O eq 'VMS') {
  70. - 1 while unlink 'COMPILET.LIS';
  71. - 1 while unlink 'COMPILET.OPT';
  72. + 1 while unlink 'LINKT.LIS';
  73. + 1 while unlink 'LINKT.OPT';
  74. }
  75.  
  76. sub my_system {
  77. diff --git a/dist/ExtUtils-CBuilder/t/03-cplusplus.t b/dist/ExtUtils-CBuilder/t/03-cplusplus.t
  78. index 02555df..638a0a2 100644
  79. --- a/dist/ExtUtils-CBuilder/t/03-cplusplus.t
  80. +++ b/dist/ExtUtils-CBuilder/t/03-cplusplus.t
  81. @@ -30,10 +30,10 @@ ok $b, "created EU::CB object";
  82.  
  83. ok $b->have_cplusplus, "have_cplusplus";
  84.  
  85. -$source_file = File::Spec->catfile('t', 'compilet.cc');
  86. +$source_file = File::Spec->catfile('t', 'cplust.cc');
  87. {
  88. open my $FH, "> $source_file" or die "Can't create $source_file: $!";
  89. - print $FH "class Bogus { public: int boot_compilet() { return 1; } };\n";
  90. + print $FH "class Bogus { public: int boot_cplust() { return 1; } };\n";
  91. close $FH;
  92. }
  93. ok -e $source_file, "source file '$source_file' created";
  94. @@ -47,7 +47,7 @@ $lib_file = $b->lib_file($object_file);
  95. ok 1;
  96.  
  97. my ($lib, @temps) = $b->link(objects => $object_file,
  98. - module_name => 'compilet');
  99. + module_name => 'cplust');
  100. $lib =~ tr/"'//d;
  101. is $lib_file, $lib;
  102.  
  103. @@ -57,7 +57,7 @@ for ($source_file, $object_file, $lib_file) {
  104. }
  105.  
  106. if ($^O eq 'VMS') {
  107. - 1 while unlink 'COMPILET.LIS';
  108. - 1 while unlink 'COMPILET.OPT';
  109. + 1 while unlink 'CPLUST.LIS';
  110. + 1 while unlink 'CPLUST.OPT';
  111. }
  112.  
  113. diff --git a/dist/ExtUtils-CBuilder/t/04-base.t b/dist/ExtUtils-CBuilder/t/04-base.t
  114. index 5b235a5..c3bf6b5 100644
  115. --- a/dist/ExtUtils-CBuilder/t/04-base.t
  116. +++ b/dist/ExtUtils-CBuilder/t/04-base.t
  117. @@ -129,14 +129,14 @@ $base = ExtUtils::CBuilder::Base->new( quiet => 1 );
  118. ok( $base, "ExtUtils::CBuilder::Base->new() returned true value" );
  119. isa_ok( $base, 'ExtUtils::CBuilder::Base' );
  120.  
  121. -$source_file = File::Spec->catfile('t', 'compilet.c');
  122. +$source_file = File::Spec->catfile('t', 'baset.c');
  123. create_c_source_file($source_file);
  124. ok(-e $source_file, "source file '$source_file' created");
  125.  
  126. # object filename automatically assigned
  127. my $obj_ext = $base->{config}{obj_ext};
  128. is( $base->object_file($source_file),
  129. - File::Spec->catfile('t', "compilet$obj_ext"),
  130. + File::Spec->catfile('t', "baset$obj_ext"),
  131. "object_file(): got expected automatically assigned name for object file"
  132. );
  133.  
  134. @@ -155,7 +155,7 @@ $base = ExtUtils::CBuilder::Base->new( quiet => 1 );
  135. ok( $base, "ExtUtils::CBuilder::Base->new() returned true value" );
  136. isa_ok( $base, 'ExtUtils::CBuilder::Base' );
  137.  
  138. -$source_file = File::Spec->catfile('t', 'compilet.c');
  139. +$source_file = File::Spec->catfile('t', 'baset.c');
  140. create_c_source_file($source_file);
  141. ok(-e $source_file, "source file '$source_file' created");
  142.  
  143. @@ -337,14 +337,14 @@ for ($source_file, $object_file, $lib_file) {
  144. pass("Completed all tests in $0");
  145.  
  146. if ($^O eq 'VMS') {
  147. - 1 while unlink 'COMPILET.LIS';
  148. - 1 while unlink 'COMPILET.OPT';
  149. + 1 while unlink 'BASET.LIS';
  150. + 1 while unlink 'BASET.OPT';
  151. }
  152.  
  153. sub create_c_source_file {
  154. my $source_file = shift;
  155. open my $FH, '>', $source_file or die "Can't create $source_file: $!";
  156. - print $FH "int boot_compilet(void) { return 1; }\n";
  157. + print $FH "int boot_baset(void) { return 1; }\n";
  158. close $FH;
  159. }
  160.  
  161. --
  162. 1.7.2.3
Add Comment
Please, Sign In to add comment