diff --git a/scripts/mutation_test.py b/scripts/mutation_test.py index fb6bfa1..7d49dbb 100755 --- a/scripts/mutation_test.py +++ b/scripts/mutation_test.py @@ -286,9 +286,25 @@ def copy_tree(src, dst): # other reason -- it was driven in place out of deps/basicinterpret -- and # now lives in tests/reference/, which comes along with the rest of the tree. # Only vendored Windows DLLs are dead weight, hence "*.dll". - ignore = shutil.ignore_patterns("build*", ".git", "*.o", "*.so", "*~", - "#*#", "*.iso", "*.png", "*.gcno", "*.gcda", - "*.dll") + # + # **PNGs are ours or theirs, and the difference matters.** This used to drop + # every one of them, which was right when the only PNGs in the tree were + # SDL_image's and libpng's test corpora -- 39 MB that nothing here reads. + # docs/images/ changed that: docs_examples asserts every `screenshot=` block + # has its figure, so dropping them made the *baseline* fail and no mutation + # run could start at all. Keep the project's thirteen; still drop the + # dependencies' thousands. + patterns = shutil.ignore_patterns("build*", ".git", "*.o", "*.so", "*~", + "#*#", "*.iso", "*.gcno", "*.gcda", + "*.dll") + depsdir = os.path.join(os.path.abspath(src), "deps") + + def ignore(directory, names): + skip = set(patterns(directory, names)) + if os.path.abspath(directory).startswith(depsdir): + skip.update(n for n in names if n.endswith(".png")) + return skip + shutil.copytree(src, dst, ignore=ignore, symlinks=True)