Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions R/pkg_harness_create.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,30 @@ deepstate_pkg_create<-function(package_path){
package_path <-normalizePath(package_path, mustWork=TRUE)
package_path <- sub("/$","",package_path)
inst_path <- file.path(package_path, "inst")
if(!dir.exists(inst_path)){
dir.create(inst_path)
}
test_path <- file.path(inst_path,"testfiles")
packagename <- basename(package_path)

# Test directory structure initialization
unlink(test_path, recursive = TRUE)
if(!file.exists(file.path(package_path,"src/*.so"))){
if(!dir.exists(inst_path)) {
dir.create(inst_path)
}
dir.create(test_path,showWarnings = FALSE)

if(!file.exists(file.path(package_path,"src/*.so"))) {
# ensure that the debugging symbols are embedded in the resulting shared object
makevars_file <- file.path(package_path, "src", "Makevars")
makevars_content <- "PKG_CXXFLAGS += -g "
write(makevars_content, makevars_file, append=FALSE)

system(paste0("R CMD INSTALL ",package_path),intern = FALSE,ignore.stderr =TRUE,ignore.stdout = TRUE)
unlink(makevars_file, recursive = FALSE)
}

if(!(file.exists("~/.RcppDeepState/deepstate-master/build/libdeepstate32.a") &&
file.exists("~/.RcppDeepState/deepstate-master/build/libdeepstate.a")))
{
RcppDeepState::deepstate_make_run()
}
dir.create(test_path,showWarnings = FALSE)
Rcpp::compileAttributes(package_path)
harness <- list()
failed.harness <- list()
Expand Down