Commit c544093
authored
add tests for isProcessForkedChild() and archSystemFile() (#266)
* add tests for isProcessForkedChild() and archSystemFile()
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
* compare file paths with normalizePath() rather than identical()
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).
* test archSystemFile() against 'libs', which actually uses the arch subdir
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.
* clarify that arch subdirs are not Windows-specific in test comments1 parent 0a650d9 commit c544093
2 files changed
Lines changed: 75 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
0 commit comments