add tests for isProcessForkedChild() and archSystemFile()#266
Merged
Conversation
cover two 6.0.0 additions that previously had no automated tests: - isProcessForkedChild(): FALSE in the parent, TRUE in parallel::mclapply workers (skipped on Windows, which has no fork()) - archSystemFile(): delegates to system.file() with no arch subdir, and composes the arch-specific subdirectory when .Platform$r_arch is set
identical() is a byte-for-byte string comparison, but two paths can denote
the same file while differing in separators, case, or symlink resolution.
normalize both sides before comparing, preserving system.file()'s ""
not-found sentinel (normalizePath("") would resolve to the working dir).
…bdir
the previous existence check used archSystemFile("include", ...), but the
arch-specific subdirectory only ever holds compiled libraries -- headers are
never installed under it. on Windows (r_arch = "x64") this looked for
'include/x64/RcppParallel.h', which does not exist; on unix (r_arch = "")
the injection was a no-op, so the mistake was invisible locally. use 'libs',
where the package's compiled code lives on every platform.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds automated coverage for two additions since 5.1.11 that previously had no tests.
tests/test-fork.RCovers
isProcessForkedChild()(#243, #244):FALSEin the parent processTRUEinsideparallel::mclapplyworkers (skipped on Windows, which has nofork())tests/test-arch-system-file.RCovers
archSystemFile()(#251, #252):system.file()when there is no arch subdirectory.Platform$r_archis setinclude/RcppParallel.h) resolves to an existing pathBoth follow the existing
tests/test-*.Rharness conventions (test_init()+assert()), so they run underR CMD check.