@@ -2,6 +2,7 @@ module test_os
2
2
use testdrive, only : new_unittest, unittest_type, error_type, check, skip_test
3
3
use stdlib_system, only: get_runtime_os, OS_WINDOWS, OS_UNKNOWN, OS_TYPE, is_windows, null_device, &
4
4
get_terminal_size
5
+ use stdlib_error, only: state_type
5
6
implicit none
6
7
7
8
contains
@@ -22,14 +23,25 @@ end subroutine collect_suite
22
23
subroutine test_get_terminal_size (error )
23
24
type (error_type), allocatable , intent (out ) :: error
24
25
integer :: columns, lines
26
+ type (state_type) :: err
25
27
26
28
! > Get terminal size
27
- call get_terminal_size(columns, lines)
29
+ call get_terminal_size(columns, lines, err )
28
30
29
- call check(error, columns > 0 , " Terminal width is not positive" )
30
- if (allocated (error)) return
31
+ if (err% ok()) then
32
+ call check(error, columns > 0 , " Terminal width is not positive" )
33
+ if (allocated (error)) return
34
+
35
+ call check(error, lines > 0 , " Terminal height is not positive" )
36
+
37
+ ! > In Github Actions, the terminal size is not available, standard output is redirected to a file
38
+ else
39
+ call check(error, columns, - 1 )
40
+ if (allocated (error)) return
41
+
42
+ call check(error, lines, - 1 )
31
43
32
- call check(error, lines > 0 , " Terminal height is not positive " )
44
+ end if
33
45
34
46
end subroutine test_get_terminal_size
35
47
0 commit comments