aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/expect4.adb
blob: 7a974cc758e1db9ad67d4de525149454cfa7d23a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
--  { dg-do run }

with GNAT.Expect.TTY;
with GNAT.OS_Lib;

procedure Expect4 is
   Pid    : GNAT.Expect.TTY.TTY_Process_Descriptor;
   Args   : GNAT.OS_Lib.Argument_List (1 .. 0);
   Result : GNAT.Expect.Expect_Match;

begin
   Pid.Non_Blocking_Spawn ("true", Args);

   begin
      Pid.Expect (Result, ".*");

      raise Program_Error;

   exception
      when GNAT.Expect.Process_Died =>
         null;
   end;

   begin
      Pid.Expect (Result, ".*");

      raise Program_Error;

   exception
      when GNAT.Expect.Process_Died =>
         null;
   end;

   Pid.Close;
end Expect4;