Commit Graph
9 Commits
Author SHA1 Message Date
Cursor AgentandRobert C. Martin 0cfa995431 Copy asset catalogs into an Xcode worker.
actool does not follow a symlinked .xcassets, so the worker build fails
with a missing AppIcon and a mutant that still compiles is reported
killed. Copy the catalog, including resources that were themselves
links, and keep linking other files.

Proved by the worker overlay test and a stand-in xcodebuild that
rejects a symlinked catalog. 127 passed, 1 skipped.

Co-authored-by: Robert C. Martin <[email protected]>
2026-11-26 02:49:35 +00:00
Cursor AgentandRobert C. Martin 9a3d4a353f Count every line of a Swift coverage region.
crapper now reports a region as (start, end, count). The join still
unpacked (line, count), so the Swift coverage tests crashed, and a
mutation on the last line of a covered region was left uncovered.

line_covered decides each line. A nested region with count zero stays
uncovered, and a line in no region stays uncovered. An xccov summary
is unchanged.

The file-wide mutator run then found six older survivors in the path
join. A trailing slash still marks the file, the first of two equal
paths keeps its hits, and a shorter prefix beats a shorter suffix.
Comparisons that could not change a result are gone.

Proved by pytest (125 passed, 1 skipped; swift is not installed).
crapper's worst score besides parse_args is _prepare_coverage at 9.4;
_swift_hits is 6.0. dryer --threshold 0.8 reports no candidates.
mutator on src/mutator/coverage.py killed 49, with 0 survived and 0
uncovered.

Co-authored-by: Robert C. Martin <[email protected]>
2026-11-26 02:20:07 +00:00
Cursor AgentandRobert C. Martin 883a611b68 Document Swift mutation, discovery, and the Mac test commands.
The README and --help now name Swift with the other languages, list the
operators (including which edits are not made), and say how Tests,
*Tests.swift, .build, .swiftpm, and DerivedData are skipped. They also
give swift test, xcodebuild test, --xcode-scheme, and --xcode-destination,
and say an iOS run needs a Mac with Xcode.

Proved by the help test, which checks that --help names swift test,
xcodebuild, and *Tests.swift.

Co-authored-by: Robert C. Martin <[email protected]>
2026-11-26 00:01:19 +00:00
Robert C. Martin 0136cf5557 Skip test directories only at the project root or under src/test.
Why: crapper.discover treats any test-named folder at any depth as a
test path. That silently skipped production fixtures such as
src/agnesse/slim/test/SymbolManagingTableTable.java, even when the file
was named directly, because "test" appeared in the path.

What: Mutator now walks the tree itself. A path relative to the project
root is a test path when its first component is a TEST_DIRS name (test,
tests, spec, specs, or __tests__), or when it sits under src/test or
src/tests, the Maven and Gradle layout. SKIP_DIRS are still skipped at
any depth. Filename-based test files are still detected by
crapper.discover.is_test_file, applied to the filename so the any-depth
directory check is not reused. crapper itself is unchanged. README and
--help describe the new rule.

Proof: 12 new tests in test_sources.py plus help assertions. 84 tests
were green before; 96 pass now. crapper on the changed files: every new
function is under 10 (iter_source_files 9.0, is_test_path 5.0,
is_mutable_source 5.0); parse_args remains 30.2, the existing
option-parser exception. dryer: no candidates. mutator on sources.py:
25 killed, 0 survived, 0 uncovered. Dry run against /tmp/agn at
58fd81c37: SymbolManagingTableTable.java is discovered along with 54
other files under src/agnesse/slim/test/; no files under test/ are.
2026-11-24 03:22:55 -06:00
Robert C. Martin 1bad4b908a Mutate ?? and ?. in TypeScript and JavaScript, including Express handlers. 2026-10-03 08:49:10 -05:00
Robert C. Martin b35a9caf6f Run Python tests with the project's virtualenv.
Mutator's interpreter does not have the project installed, so the baseline failed before any mutant ran.
2026-10-02 10:29:11 -05:00
Robert C. Martin 4a9d0c0a5c Copy relative importers into the worker so Node loads the mutant.
Node resolves a relative import from the real path of the module. A symlinked test was loading the original source, so every mutant survived. Modules that reach the file under test are now real copies in the overlay.
2026-10-01 10:46:47 -05:00
Robert C. Martin 21d6d6f50b Run a file's mutants at the same time in symlink overlays.
Each worker keeps a private copy of the file under test and links the rest of the project, so the original tree stays put. The default is one worker per core, and --max-workers can set a lower cap.
2026-09-30 15:23:42 -05:00
Robert C. Martin bf42bd22e7 Add a multi-language mutation tester that writes .metrics/mutate for uml-viewer. 2026-09-30 10:40:54 -05:00