File: test_link_flags.R

package info (click to toggle)
r-bioc-rhdf5lib 1.20.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 384 kB
  • sloc: sh: 67; ansic: 40; makefile: 7
file content (53 lines) | stat: -rw-r--r-- 1,136 bytes parent folder | download | duplicates (2)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
library(mockery)
library(Rhdf5lib)

## testing windows behaviour on a non-windows OS
mockOS <- mock(setNames("Windows", "sysname"), 
               setNames("Linux", "sysname"),
               cycle = TRUE)
stub(pkgconfig, what = "Sys.info", how = mockOS)
stub(pkgconfig, what = "utils::shortPathName", how = "c:/foobar")

##  Windows
expect_stdout(
  pkgconfig(opt = "PKG_C_LIBS"),
  pattern = "foobar -lhdf5"
)
##  Non-Windows
expect_stdout(
  pkgconfig(opt = "PKG_C_LIBS"),
  pattern = "libhdf5.a"
)

##  Windows
expect_stdout(
  pkgconfig(opt = "PKG_CXX_LIBS"),
  pattern = "foobar -lhdf5_cpp -lhdf5"
)
##  Non-Windows
expect_stdout(
  pkgconfig(opt = "PKG_CXX_LIBS"),
  pattern = "libhdf5_cpp.a"
)

##  Windows
expect_stdout(
  pkgconfig(opt = "PKG_C_HL_LIBS"),
  pattern = "foobar -lhdf5_hl -lhdf5"
)
##  Non-Windows
expect_stdout(
  pkgconfig(opt = "PKG_C_HL_LIBS"),
  pattern = "libhdf5_hl.a"
)

##  Windows
expect_stdout(
  pkgconfig(opt = "PKG_CXX_HL_LIBS"),
  pattern = "foobar -lhdf5_hl_cpp -lhdf5_hl -lhdf5_cpp -lhdf5"
)
##  Non-Windows
expect_stdout(
  pkgconfig(opt = "PKG_CXX_HL_LIBS"),
  pattern = "libhdf5_hl_cpp.a"
)