* using log directory 'd:/Rcompile/CRANpkg/local/4.1/simplermarkdown.Rcheck' * using R version 4.1.3 (2022-03-10) * using platform: x86_64-w64-mingw32 (64-bit) * using session charset: ISO8859-1 * checking for file 'simplermarkdown/DESCRIPTION' ... OK * this is package 'simplermarkdown' version '0.0.6' * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking whether package 'simplermarkdown' can be installed ... OK * checking installed package size ... OK * checking package directory ... OK * checking 'build' directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking R files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... OK * checking whether the package can be loaded with stated dependencies ... OK * checking whether the package can be unloaded cleanly ... OK * checking whether the namespace can be loaded with stated dependencies ... OK * checking whether the namespace can be unloaded cleanly ... OK * checking loading without being on the library search path ... OK * checking use of S3 registration ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... [4s] OK * checking Rd files ... [1s] OK * checking Rd metadata ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking installed files from 'inst/doc' ... OK * checking files in 'vignettes' ... OK * checking examples ... NONE * checking for unstated dependencies in 'tests' ... OK * checking tests ... [3s] ERROR Running 'test_file_subs_ext.R' [0s] Running 'test_mdtangle.R' [0s] Running 'test_mdweave.R' [1s] Running 'test_run_and_capture.R' [0s] Running the tests in 'tests/test_mdweave.R' failed. Complete output: > # mdweave a couple of documents and check if the output is the > # same as the corresponding reference documents > > library(simplermarkdown) > > if (simplermarkdown:::has_pandoc()) { + + # We only want to check if the output of mdweave matches the reference if the + # pandoc version matches that which generated the reference. Otherwise there + # is a large chance that the output does not match + pandoc_version <- system("pandoc --version", intern = TRUE) + #correct_pandoc_version <- c("pandoc 2.5", + # "Compiled with pandoc-types 1.17.5.4, texmath 0.11.2.2, skylighting 0.7.7") + correct_pandoc_version <- "pandoc 2.17.1.1" + is_correct_pandoc_version <- all(pandoc_version[1] == correct_pandoc_version) + + + # Create tempdir + dir <- tempdir() + dir.create(dir, recursive = TRUE, showWarnings = FALSE) + oldwd <- setwd(dir) + + # When running tests the environment variable R_TESTS is set. This + # causes issues when running a second R instance as mdweave does. Therefore + # we unser it. + old_env <- Sys.getenv("R_TESTS") + Sys.setenv("R_TESTS" = "") + + # ============================================================================= + message("Checking iris.md") + md <- "iris.md" + + message("Weave file") + fn <- system.file(file.path("examples", md), package = "simplermarkdown") + mdweave(fn) + + message("Check if result generated") + stopifnot(file.exists(md)) + + if (is_correct_pandoc_version) { + message("Compare to reference") + lines <- readLines(md) + fn_ref <- system.file(file.path("examples_output", md), + package = "simplermarkdown") + lines_ref <- readLines(fn_ref) + print(all.equal(lines, lines_ref)) + system(paste0("diff ", md, " ", fn_ref)) + writeLines(lines) + stopifnot(isTRUE(all.equal(lines, lines_ref))) + } + + message("Check images") + # We don't check if the images are exactly the same; this probably + # depends on the exact output device used; versions etc. + stopifnot(file.exists("figures/iris.png")) + + message("Cleanup") + #unlink(md) + unlink("figures") + + # ============================================================================= + message("Checking iris.md with format_copypaste") + md <- "iris_copypaste.md" + + message("Weave file") + fn <- system.file(file.path("examples", md), package = "simplermarkdown") + mdweave(fn) + + message("Check if result generated") + stopifnot(file.exists(md)) + + if (is_correct_pandoc_version) { + message("Compare to reference") + lines <- readLines(md) + fn_ref <- system.file(file.path("examples_output", md), + package = "simplermarkdown") + lines_ref <- readLines(fn_ref) + print(all.equal(lines, lines_ref)) + system(paste0("diff ", md, " ", fn_ref)) + writeLines(lines) + stopifnot(isTRUE(all.equal(lines, lines_ref))) + } + + message("Check images") + # We don't check if the images are exactly the same; this probably + # depends on the exact output device used; versions etc. + stopifnot(file.exists("figures/iris.png")) + + message("Cleanup") + #unlink(md) + unlink("figures") + + # ============================================================================= + message("Checking example1.md") + md <- "example1.md" + + message("Weave file") + fn <- system.file(file.path("examples", md), package = "simplermarkdown") + mdweave(fn) + + message("Check if result generated") + stopifnot(file.exists(md)) + + if (is_correct_pandoc_version) { + message("Compare to reference") + lines <- readLines(md) + fn_ref <- system.file(file.path("examples_output", md), + package = "simplermarkdown") + lines_ref <- readLines(fn_ref) + print(all.equal(lines, lines_ref)) + system(paste0("diff ", md, " ", fn_ref)) + stopifnot(isTRUE(all.equal(lines, lines_ref))) + } + + message("Check images") + # We don't check if the images are exactly the same; this probably + # depends on the exact output device used; versions etc. + stopifnot(file.exists("figures/foo.png")) + stopifnot(file.exists("figures/test.pdf")) + + message("Cleanup") + unlink(md) + unlink("figures") + + + # ============================================================================= + # An markdown file without a header block gave an error with version 0.0.3. + # Regression test + fn <- tempfile(fileext=".md") + writeLines("# Introduction", fn) + fn2 <- tempfile(fileext=".md") + mdweave(fn, fn2) + unlink(fn) + unlink(fn2) + + + # ============================================================================= + # END + Sys.setenv("R_TESTS" = old_env) + setwd(oldwd) + } Checking iris.md Weave file Evaluating code in block 'table'. Evaluating code in block 'figure'. Evaluating code in block ''. Evaluating code in inline block ''. Evaluating code in inline block ''. Error in run_cmd(cmd2, paste0("Failed to convert the processed JSON file back to ", : Running '' had status 127; this generally means that '' could not be found. Make sure '' in on the path. Calls: mdweave -> run_cmd Execution halted * checking for unstated dependencies in vignettes ... OK * checking package vignettes in 'inst/doc' ... OK * checking re-building of vignette outputs ... [1s] WARNING Error(s) in re-building vignettes: --- re-building 'intro.md' using mdweave_to_html Evaluating code in block 'codeblock1'. Error: processing vignette 'intro.md' failed with diagnostics: Running '' had status 127; this generally means that '' could not be found. Make sure '' in on the path. --- failed re-building 'intro.md' SUMMARY: processing the following file failed: 'intro.md' Error: Vignette re-building failed. Execution halted * checking PDF version of manual ... OK * DONE Status: 1 ERROR, 1 WARNING