@@ -10,17 +10,17 @@ run_test("deps-in-desc",
1010 artifacts = c(" DESCRIPTION" = test_path(" in/DESCRIPTION" ))
1111)
1212
13- # in sub directory with wrong root
14- run_test(" deps-in-desc" ,
15- suffix = " -fail.R" , std_err = " Could not find R package" ,
16- file_transformer = function (files ) {
17- fs :: path_abs(fs :: file_move(files , " rpkg" ))
18- },
19- artifacts = c(" rpkg/DESCRIPTION" = test_path(" in/DESCRIPTION" ))
20- )
2113
22- # in sub directory with correct root
2314if (! on_cran()) {
15+ # in sub directory with wrong root
16+ run_test(" deps-in-desc" ,
17+ suffix = " -fail.R" , std_err = " Could not find R package" ,
18+ file_transformer = function (files ) {
19+ fs :: path_abs(fs :: file_move(files , " rpkg" ))
20+ },
21+ artifacts = c(" rpkg/DESCRIPTION" = test_path(" in/DESCRIPTION" ))
22+ )
23+ # in sub directory with correct root
2424 run_test(" deps-in-desc" ,
2525 cmd_args = " --root=rpkg" ,
2626 suffix = " -fail.R" , std_err = " Dependency check failed" ,
@@ -41,93 +41,95 @@ if (!on_cran()) {
4141}
4242
4343
44- # with :::
45- run_test(" deps-in-desc" ,
46- " deps-in-desc-dot3" ,
47- suffix = " -fail.R" , std_err = " Dependency check failed" ,
48- artifacts = c(" DESCRIPTION" = test_path(" in/DESCRIPTION" ))
49- )
50-
51- run_test(" deps-in-desc" ,
52- " deps-in-desc-dot3" ,
53- suffix = " -success.R" , std_err = NULL ,
54- artifacts = c(" DESCRIPTION" = test_path(" in/DESCRIPTION" ))
55- )
56-
57- run_test(" deps-in-desc" ,
58- " deps-in-desc-dot3" ,
59- suffix = " -fail.R" , std_err = NULL ,
60- artifacts = c(" DESCRIPTION" = test_path(" in/DESCRIPTION" )),
61- cmd_args = " --allow_private_imports"
62- )
44+ if (! on_windows_on_cran()) {
45+ # with :::
46+ run_test(" deps-in-desc" ,
47+ " deps-in-desc-dot3" ,
48+ suffix = " -fail.R" , std_err = " Dependency check failed" ,
49+ artifacts = c(" DESCRIPTION" = test_path(" in/DESCRIPTION" ))
50+ )
6351
64- # Rmd
65- run_test(" deps-in-desc" ,
66- " deps-in-desc" ,
67- suffix = " -fail.Rmd" , std_err = " Dependency check failed" ,
68- std_out = " deps-in-desc-fail.Rmd`: ttyzp" ,
69- artifacts = c(" DESCRIPTION" = test_path(" in/DESCRIPTION" ))
70- )
52+ run_test(" deps-in-desc" ,
53+ " deps-in-desc-dot3" ,
54+ suffix = " -success.R" , std_err = NULL ,
55+ artifacts = c(" DESCRIPTION" = test_path(" in/DESCRIPTION" ))
56+ )
7157
72- run_test(" deps-in-desc" ,
73- " deps-in-desc" ,
74- suffix = " -success.Rmd" , std_err = NULL ,
75- artifacts = c(" DESCRIPTION" = test_path(" in/DESCRIPTION" ))
76- )
58+ run_test(" deps-in-desc" ,
59+ " deps-in-desc-dot3" ,
60+ suffix = " -fail.R" , std_err = NULL ,
61+ artifacts = c(" DESCRIPTION" = test_path(" in/DESCRIPTION" )),
62+ cmd_args = " --allow_private_imports"
63+ )
7764
78- # README.Rmd is excluded
79- run_test(" deps-in-desc" ,
80- " README.Rmd" ,
81- suffix = " " , std_err = NULL ,
82- artifacts = c(" DESCRIPTION" = test_path(" in/DESCRIPTION-no-deps.dcf" ))
83- )
65+ # Rmd
66+ run_test(" deps-in-desc" ,
67+ " deps-in-desc" ,
68+ suffix = " -fail.Rmd" , std_err = " Dependency check failed" ,
69+ std_out = " deps-in-desc-fail.Rmd`: ttyzp" ,
70+ artifacts = c(" DESCRIPTION" = test_path(" in/DESCRIPTION" ))
71+ )
8472
73+ run_test(" deps-in-desc" ,
74+ " deps-in-desc" ,
75+ suffix = " -success.Rmd" , std_err = NULL ,
76+ artifacts = c(" DESCRIPTION" = test_path(" in/DESCRIPTION" ))
77+ )
8578
79+ # README.Rmd is excluded
80+ run_test(" deps-in-desc" ,
81+ " README.Rmd" ,
82+ suffix = " " , std_err = NULL ,
83+ artifacts = c(" DESCRIPTION" = test_path(" in/DESCRIPTION-no-deps.dcf" ))
84+ )
8685
87- # Rnw
88- run_test(" deps-in-desc" ,
89- " deps-in-desc" ,
90- suffix = " -fail.Rnw" , std_err = " Dependency check failed" ,
91- artifacts = c(" DESCRIPTION" = test_path(" in/DESCRIPTION" ))
92- )
9386
94- run_test(" deps-in-desc" ,
95- " deps-in-desc" ,
96- suffix = " -success.Rnw" , std_err = NULL ,
97- artifacts = c(" DESCRIPTION" = test_path(" in/DESCRIPTION" ))
98- )
9987
100- # Rprofile
101- # because .Rprofile is executed on startup, this must be an installed
102- # package (to not give an error staight away) not listed in
103- # test_path("in/DESCRIPTION")
104- if (Sys.getenv(" GITHUB_WORKFLOW" ) != " Hook tests" ) {
105- # seems like .Rprofile with renv activation does not get executed when
106- # argument to Rscript contains Rprofile ?! Skip this
107- expect_true(rlang :: is_installed(" R.cache" ))
88+ # Rnw
10889 run_test(" deps-in-desc" ,
109- " Rprofile" ,
110- suffix = " " , std_err = " Dependency check failed" ,
111- artifacts = c(" DESCRIPTION" = test_path(" in/DESCRIPTION" )),
112- file_transformer = function (files ) {
113- writeLines(" R.cache::findCache" , files )
114- fs :: file_move(
115- files ,
116- fs :: path(fs :: path_dir(files ), paste0(" ." , fs :: path_file(files )))
117- )
118- }
90+ " deps-in-desc" ,
91+ suffix = " -fail.Rnw" , std_err = " Dependency check failed" ,
92+ artifacts = c(" DESCRIPTION" = test_path(" in/DESCRIPTION" ))
11993 )
12094
12195 run_test(" deps-in-desc" ,
122- " Rprofile" ,
123- suffix = " " , std_err = NULL ,
124- artifacts = c(" DESCRIPTION" = test_path(" in/DESCRIPTION" )),
125- file_transformer = function (files ) {
126- writeLines(" utils::head" , files )
127- fs :: file_move(
128- files ,
129- fs :: path(fs :: path_dir(files ), paste0(" ." , fs :: path_file(files )))
130- )
131- }
96+ " deps-in-desc" ,
97+ suffix = " -success.Rnw" , std_err = NULL ,
98+ artifacts = c(" DESCRIPTION" = test_path(" in/DESCRIPTION" ))
13299 )
100+
101+ # Rprofile
102+ # because .Rprofile is executed on startup, this must be an installed
103+ # package (to not give an error staight away) not listed in
104+ # test_path("in/DESCRIPTION")
105+ if (Sys.getenv(" GITHUB_WORKFLOW" ) != " Hook tests" ) {
106+ # seems like .Rprofile with renv activation does not get executed when
107+ # argument to Rscript contains Rprofile ?! Skip this
108+ expect_true(rlang :: is_installed(" R.cache" ))
109+ run_test(" deps-in-desc" ,
110+ " Rprofile" ,
111+ suffix = " " , std_err = " Dependency check failed" ,
112+ artifacts = c(" DESCRIPTION" = test_path(" in/DESCRIPTION" )),
113+ file_transformer = function (files ) {
114+ writeLines(" R.cache::findCache" , files )
115+ fs :: file_move(
116+ files ,
117+ fs :: path(fs :: path_dir(files ), paste0(" ." , fs :: path_file(files )))
118+ )
119+ }
120+ )
121+
122+ run_test(" deps-in-desc" ,
123+ " Rprofile" ,
124+ suffix = " " , std_err = NULL ,
125+ artifacts = c(" DESCRIPTION" = test_path(" in/DESCRIPTION" )),
126+ file_transformer = function (files ) {
127+ writeLines(" utils::head" , files )
128+ fs :: file_move(
129+ files ,
130+ fs :: path(fs :: path_dir(files ), paste0(" ." , fs :: path_file(files )))
131+ )
132+ }
133+ )
134+ }
133135}
0 commit comments