Просмотр исходного кода

tests: added test for bug 41457

mattias 1 неделя назад
Родитель
Сommit
efcfa3ce1e

+ 14 - 0
tests/tppu/bug41457/bug41457_ant.pas

@@ -0,0 +1,14 @@
+unit bug41457_ant;
+
+interface
+
+uses
+  bug41457_seagull
+  ,bug41457_eagle
+  ;
+
+implementation
+
+uses bug41457_bird;
+
+end.

+ 8 - 0
tests/tppu/bug41457/bug41457_bird.pas

@@ -0,0 +1,8 @@
+unit bug41457_bird;
+
+interface
+
+uses bug41457_ant;
+
+implementation
+end.

+ 8 - 0
tests/tppu/bug41457/bug41457_eagle.pas

@@ -0,0 +1,8 @@
+unit bug41457_eagle;
+
+interface
+
+uses bug41457_hawk;
+
+implementation
+end.

+ 9 - 0
tests/tppu/bug41457/bug41457_hawk.pas

@@ -0,0 +1,9 @@
+unit bug41457_hawk;
+
+interface
+
+implementation
+
+uses bug41457_ant;
+
+end.

+ 9 - 0
tests/tppu/bug41457/bug41457_seagull.pas

@@ -0,0 +1,9 @@
+unit bug41457_seagull;
+
+interface
+
+implementation
+
+uses bug41457_ant;
+
+end.

+ 25 - 0
tests/tppu/tcrecompile.pas

@@ -43,6 +43,8 @@ type
     procedure TestChangeInner1; // prog+2 units, change inner unit, keep leaf
     procedure TestChangeInlineBodyBug; // Bug: prog+1 unit plus a package of 2 units, change of inline body should change crc, but does not
 
+    procedure TestBug41457; // two cycles of size 2 and 3
+
     // inline modifier in implementation (not in interface)
     procedure TestImplInline1; // 2 units, cycle, impl inline
     procedure TestImplInline2; // program + 2 units cycle, impl inline
@@ -345,6 +347,29 @@ begin
   CheckCompiled(['testcib_prog.pas']);
 end;
 
+procedure TTestRecompile.TestBug41457;
+begin
+  UnitPath:='bug41457';
+  OutDir:=UnitPath+PathDelim+'ppus';
+  MainSrc:=UnitPath+PathDelim+'bug41457_bird.pas';
+
+  Step:='First compile';
+  CleanOutputDir;
+  Compile;
+  CheckCompiled(['bug41457_ant.pas',
+    'bug41457_bird.pas',
+    'bug41457_eagle.pas',
+    'bug41457_hawk.pas',
+    'bug41457_seagull.pas']);
+
+  Step:='Second compile';
+  // the two deepest nodes of the two cycles are eagle and hawk, which are not recompiled
+  Compile;
+  CheckCompiled(['bug41457_ant.pas',
+    'bug41457_bird.pas',
+    'bug41457_seagull.pas']);
+end;
+
 procedure TTestRecompile.TestImplInline1;
 // unit ant uses bird
 // unit bird impl uses ant and has a function with inline modifier in implementation