-
Notifications
You must be signed in to change notification settings - Fork 287
Atlanta workshop test-suite overhaul #4322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kellerlv
wants to merge
280
commits into
Macaulay2:development
Choose a base branch
from
tbrysiewicz:development
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 250 commits
Commits
Show all changes
280 commits
Select commit
Hold shift + click to select a range
d5c4d0c
MCMApproximations: overhaul the test suite
kellerlv 4699fb9
added more tests pulled from examples
tbrysiewicz f1bcd02
Add tests for LieAlgebraRepresentations' untested exports
kellerlv a200411
ResLengthThree: overhaul the test suite
kellerlv 1402402
Add tests for TensorComplexes' untested exports
kellerlv 925df17
Add tests for TorAlgebra's untested exports
kellerlv 8873a19
Strengthen the InverseSystems test suite with rigorous assertions
kellerlv c78d075
Overhaul KustinMiller test coverage
kellerlv 21bcd44
HomotopyLieAlgebra: add test coverage, remove dead code
kellerlv 448744a
SchurComplexes: add TEST coverage for internal tableau helpers
kellerlv 257469e
SchurComplexes: add TEST coverage for standardZ2Tableaux
kellerlv d5865dd
SchurComplexes: add TEST coverage for tableauxDiff and straightening
kellerlv f14c3bc
SchurComplexes: add direct TEST coverage for permutedTableau and shuf…
kellerlv 32a647a
Add SpechtModule test coverage for the exported functions
kellerlv 5ecad30
SchurFunctors: add test coverage for the untested exports
kellerlv 48f1a22
HigherCIOperators: add TEST coverage for ciOperatorResolution
kellerlv 9f58ba3
HigherCIOperators: add TEST coverage for trueKoszul
kellerlv f9c9634
HigherCIOperators: add TEST coverage for exteriorMultiplication assoc…
kellerlv fbead79
Add tests for several untested DirectSummands exports
kellerlv ec956ba
IncidenceCorrespondenceCohomology: cover the incidenceCohomology gap
kellerlv e47daba
WeylGroups: cover untested Bruhat/Hasse exports and revive a silenced…
kellerlv f4771e7
MatrixFactorizations: fix two correctness bugs in MF_functions.m2
kellerlv d00091e
MatrixFactorizations: clean up stale documentation
kellerlv 25a62d9
MatrixFactorizations: add TEST coverage for untested exports
kellerlv 4342f35
add tests for untested exported functions
dave-k-johnson 7f5a13f
FormalGroupLaws test refactoring, instance tests, trivial cases
connorjhaynes db68c65
first draft of testaudit
tbrysiewicz 21f62e6
FormalGroupLaws instance tests
connorjhaynes b26dd22
FormalGroupLaws fix test
connorjhaynes 5ed896c
fix typo
dave-k-johnson c416b86
updated test audit
tbrysiewicz 6be4cba
Add error-handling and option tests for VirtualResolutions
kellerlv 909df90
Tableaux: add TEST coverage for untested exports
kellerlv bb56454
ExteriorExtensions: add a TEST suite covering all exports
kellerlv 4618451
Add Permutations test coverage for the indirect-only exports
kellerlv 8d254fd
Add SimplicialComplexes test coverage for the named-complex constructors
kellerlv 12eda73
SimplicialModules: test simplicialTensor, tensorLES, symmetricQuotient
kellerlv b501221
TateOnProducts: rigorous test-suite overhaul
kellerlv 7f83385
Add NoPrune, error-path, and kernel regression tests for PushForward
kellerlv 13a10c4
Add MatrixSchubert tests for dark exports, options, and algorithms
kellerlv f416c83
TateOnProducts: keep the package authors' commented scratch in place
kellerlv 4f830b1
Revert "Add NoPrune, error-path, and kernel regression tests for Push…
kellerlv a7fae0c
Posets: add tests for untested exported functions
kellerlv be43734
MultiplicitySequence: add tests for untested exported functions
kellerlv 69132e5
Add test coverage for the untested Graphs exports
kellerlv a26628f
MultiplicitySequence: resolve three issues flagged by the test audit
kellerlv 815fa5c
OIGroebnerBases: add tests and stress tests for untested exports
kellerlv 42c0c74
Add coverage and stress tests for Polyhedra
kellerlv 8ae1b94
Flag broken saveSession, bipyramid debug output, and orphan test file
kellerlv aea578a
Add Permanents test coverage for pminors and hand-computed permanents
kellerlv 53b0c65
Permanents: make glynn error in characteristic 2, fix pminors unit ideal
kellerlv 3d4974d
Add K3Carpets tests for the untested exports
kellerlv 2b6db0e
Add ReesAlgebra test coverage for specialFiber, symmetricKernel, options
kellerlv 12f667b
ReesAlgebra: fix the whichGm return value, an error message, stale code
kellerlv 52f7785
ReesAlgebra: flag the dead reesIdeal options with a FIXME
kellerlv d07155a
Schubert2: cover adams, degeneracyLocus, kernelBundle, intermediates
kellerlv 916926a
Add QuadraticIdealExamplesByRoos tests for the untested exports
kellerlv 4251d35
Fix missing-comma typo in roosTable#70
kellerlv b9cb8f8
Complexes: add tests and stress tests for the pruneComplex routines
kellerlv 582240b
Complexes: fix pruneComplex grading under PruningMap => false
kellerlv f58e160
Complexes: fix pruneDiff grading for twisted complexes
kellerlv edcefd9
Update TangentCone.m2
GuanyuLee eea4571
InvariantRing: add tests for previously untested exports
kellerlv 019f892
SegreClasses: add tests for isMultiHom, projectiveDegree, chowClass
kellerlv d771a20
Add ResidualIntersections test coverage; repair a broken TEST block
kellerlv d979279
ResidualIntersections: fix isLicci misclassifying complete intersections
kellerlv a416b22
ResidualIntersections: fix the no-op clamp in hasSlidingDepth
kellerlv a41a604
Regularity: fix mRegularity on monomial curves and dimension-0 ideals
kellerlv aefc87a
LexIdeals: expand the test suite and fix two empty-list crashes
kellerlv 08798cd
Add coverage and stress tests for SectionRing; fix isMRegular(F,m)
kellerlv 44e9707
Flag the globallyGenerated(Module) infinite loop with a FIXME
kellerlv f4381db
Add tests for untested exports in the Kronecker package
kellerlv 6920380
Kronecker: flag code-health issues with FIXME/TODO comments
kellerlv 84670db
Add coverage and stress tests for RelativeCanonicalResolution
kellerlv e495fa1
RationalMaps: add tests for the seven untested exports
kellerlv e5c7b8e
Add coverage and stress tests for PolyominoIdeals
kellerlv 2caf7a6
Fix randomPolyomino generators to produce edge-connected polyominoes
kellerlv 1f14d09
Add RandomComplexes test coverage for all exported functions
kellerlv 9560e1e
RandomComplexes: fix the sign flip in normalize
kellerlv 9b33924
RandomComplexes: flag the randomChainComplex homology-rank gap with a…
kellerlv a6da898
Update tests.m2
GuanyuLee 10af25e
ModuleDeformations: expand the test suite
kellerlv c46eff9
MonomialAlgebras: add tests for the untested option symbols
kellerlv bb859ed
MultiprojectiveVarieties: add tests for untested exports
kellerlv 18fea17
Add coverage, compatibility, and stress tests for MultigradedBGG
kellerlv db059df
added our working version of TestAudit, to be removed before monster …
tbrysiewicz 8204ec1
made a TODO note on long test
tbrysiewicz 496a314
add Normalize test to NumericalLinearAlgebra
dave-k-johnson d539184
add Reverse test to NumericalLinearAlgebra
dave-k-johnson bcc9d87
Update AnalyzeSheafOnP1.m2
GuanyuLee 7428449
Add coverage tests and repair a silenced test for NumericalSchubertCa…
kellerlv 5b21473
NumericalSemigroups: add tests for untested exports
kellerlv 48e0fde
Add tests for untested exports in the PencilsOfQuadrics package
kellerlv 7bc9aa9
NoetherianOperators: add tests for untested exports
kellerlv 8ab7967
QuaternaryQuartics: add tests for untested exports
kellerlv bc19569
Revive stranded tests and add stress tests for ResolutionsOfStanleyRe…
kellerlv 877b2dc
CorrespondenceScrolls: add tests for the untested export and stress c…
kellerlv f0e72bd
DecomposableSparseSystems: stress coverage and tests for the untested…
kellerlv 5a9a8ce
Fix a bug and add tests for the PlaneCurveLinearSeries package
kellerlv 9eca33e
PlaneCurveLinearSeries: flag code-health issues with TODO comments
kellerlv a2af019
Add tests for untested exports in the CotangentSchubert package
kellerlv f9e5664
CotangentSchubert: flag code-health issues with FIXME/TODO comments
kellerlv 46098c5
Add coverage tests for untested exports of WeilDivisors
kellerlv 28f2157
CoincidentRootLoci: add tests for untested exports
kellerlv 0dc3cc1
Add coverage tests for untested exports of CellularResolutions
kellerlv 6a3c1ae
Fix bare-Boolean test and add coverage tests for ExteriorIdeals
kellerlv cb67966
BinomialEdgeIdeals: fix isEffective bug and add tests for untested ex…
kellerlv 75bbcf4
Fix silent-pass test and add coverage tests for FastMinors
kellerlv 6520cfd
Strengthen existing tests and add closure-property tests for Exterior…
kellerlv 164eaff
GKMVarieties: add tests for the untested exports
kellerlv b725825
FiniteFittingIdeals: add tests for untested exports and upgrade shape…
kellerlv 903bffb
FiniteFittingIdeals: flag the four soft-failure paths with TODO
kellerlv c670c91
Fix broken QuotientRing methods and add coverage tests for GenericIni…
kellerlv c0e2165
Fix a bug in inTruncatedList and add tests for GeometricDecomposability
kellerlv 44211ef
GeometricDecomposability: flag code-health issues with TODO comments
kellerlv dd58f5f
StatePolytope: stress coverage for initialIdeals and structural cross…
kellerlv 19123d4
SimplicialPosets: add tests for testFVector and boundary cases
kellerlv 30c9651
Saturation: stress coverage for annihilator, saturate, and quotient
kellerlv a200fe9
ReflexivePolytopesDB: tests for availableOffline, description, KSEntr…
kellerlv 8b1f58e
RandomIdeals: fix randomBinomialIdeal(Sequence,Ring) dispatch and str…
kellerlv f2154ed
MonomialOrbits: fix empty-degs crash in fromLis and stress coverage
kellerlv 6f8527a
MonodromySolver: stress coverage for solveFamily, sparseMonodromySolv…
kellerlv ab853c1
LatticePolytopes test coverage increase
connorjhaynes 05da380
Matroids: fix extension typo/type-mismatch, document idealOrlikSolomo…
kellerlv bcc714f
Add coverage tests for untested exports of Jets
kellerlv abf4ff4
K3Surfaces: add live tests for the 5 functions and 2 types covered on…
kellerlv 8b765b9
K3Surfaces: flag the audit's open items with TODO comments
kellerlv 4d01ef7
Add coverage tests for untested exports of LinearTruncations
kellerlv 398a56d
M0nbar: add Fcurves(7) regression and permute identity/round-trip tests
kellerlv fb1fca0
Add coverage tests for untested exports of MatchingFields
kellerlv 3d60dad
Mark untested MatchingFields option symbols with TODO comments
kellerlv 021ce95
Fix duplicate Headline and add option-coverage tests for MixedMultipl…
kellerlv ccfec2f
Add coverage tests for untested options of MultigradedImplicitization
kellerlv 562f323
LocalRings: stress coverage for dark exports, prime-ideal hooks, and …
kellerlv 9aab903
MultiGradedRationalMap: add tests for isBiratMap, Hm1Rees0, and the d…
kellerlv 4172549
MultiGradedRationalMap: fix satSpecialFiber doc misfile, doc typos, a…
kellerlv 412afb1
MultiplierIdeals: re-enable disabled determinantal test, delete dead …
kellerlv 83347d2
MultiplierIdeals: flag style/doc observations with TODO comments
kellerlv 64ac719
Points: add tests for points, minMaxResolution, and the VerifyPoints …
kellerlv 2d59e40
Add the first registered tests to RandomCurvesOverVerySmallFiniteFields
kellerlv 9da0c57
QthPower: add direct tests for grevlexWeight, testWeightMatrix, qthCo…
kellerlv e97fd4e
Add tests for untested exports in RandomMonomialIdeals
kellerlv 2a05799
RandomMonomialIdeals: flag option-symbol and RNG-seeding gaps with TODOs
kellerlv e2f7b86
Strengthen cCode test and add coverage tests for SLPexpressions
kellerlv c727367
SCMAlgebras: add boundary tests and cross-dispatch consistency tests
kellerlv fc80628
SCMAlgebras: flag the suspected isSCM(Ideal) bug with a TODO
kellerlv 1716a8a
SLnEquivariantMatrices: fix doc cross-refs and add tests
kellerlv 7b25b81
SLnEquivariantMatrices: flag minor doc/test gaps with TODO comments
kellerlv b280cb2
Add coverage tests for untested exports of Seminormalization
kellerlv 7a91175
SimplicialDecomposability: add direct tests for shellingOrder and its…
kellerlv 7687658
Add coverage tests for isAdmissible and isAdmissibleGM in SpecialFano…
kellerlv b0de9c7
WittVectors: remove dead exports, fix doc/test bugs, add tests
kellerlv e19e1de
WittVectors: flag remaining code-health issues with FIXME/TODO comments
kellerlv d92b9d1
Add coverage tests for untested options and negative cases in Strongl…
kellerlv fc0e3f3
SuperLinearAlgebra: fix cout33/cout44 typos in superMatrixParity and …
kellerlv cb0cb2f
Hadamard: cover the four untested exports with assertions
kellerlv aca7ee4
SymbolicPowers test updates from Ashley
connorjhaynes 3b43ed6
add tests for Parametrization, consolidate tests
dave-k-johnson 2cec763
FourierMotzkin: stress coverage for error paths, doc claims, and dege…
kellerlv f39b24b
Fix testing issues in LatticePolytopes and SymbolicPowers
connorjhaynes 94d5f1f
added new version of testAudit
tbrysiewicz 54aea16
loaddoc is false now
tbrysiewicz a1067ab
ChainComplexExtras: cover extendFromMiddle and the documented-but-une…
kellerlv 7c654db
many loadpackages became false
tbrysiewicz e5d62c3
Update AnalyzeSheafOnP1.m2
GuanyuLee 4cc2956
ConnectionMatrices: cover connectionMatrix + direct normalForm tests,…
kellerlv 9db815e
ConnectionMatrices: TODO documenting the use-R scope gotcha
kellerlv 304fccf
Binomials: refactor incomprehensable-hack, expand untested-export cov…
kellerlv 9d1a462
MacaulayPosets: stress coverage for options, multi-arg ring ops, erro…
kellerlv df5cbad
EliminationMatrices: cover the audit-flagged untested exports
kellerlv 8ae0770
EliminationMatrices: structural assertions + cleanup the export block
kellerlv 168d1c2
Add coverage tests for untested exports of EllipticCurves
kellerlv 9b0200e
EnumerationCurves: split monolithic TEST, re-enable degree-5 Katz num…
kellerlv 616c6b4
Add option-coverage tests for FrobeniusThresholds
kellerlv 6695ac7
Brackets: fix commonRing missing-else bug, export GCMatrix, expand te…
kellerlv 35f177e
VersalDeformations: cover untested exports + fix three doc Usage typos
kellerlv b4c3abc
GroebnerStrata: fix latent bug, expand test coverage, align doc with …
kellerlv a948c88
LatticePolytopes more tests
connorjhaynes 153a557
Portability fix and coverage test for FunctionFieldDesingularization
kellerlv 42b3c95
FunctionFieldDesingularization: deeper assertions on arcs + doc fixes
kellerlv c91b23a
GroebnerWalk: fill audit-flagged gaps with seven targeted tests
kellerlv b3881f4
HodgeIntegrals: fix doc inconsistencies, prune dead code, expand stre…
kellerlv 7249e96
Add coverage tests + end-- terminator for InvolutiveBases
kellerlv c65e4f4
ChainComplexExtras: merge in core MonomialIdealResolutions functions
kellerlv 27024e5
WhitneyStratifications: remove undefined coordProj export, add test c…
kellerlv 4a43d17
ChainComplexExtras: reconcile isQuasiIsomorphism, migrate EK/AHH to C…
kellerlv 70903dc
Remove stray top-level dev-scratch from SymbolicPowers
kellerlv 09a07b2
add tests to NumericSolutions
dave-k-johnson fdb1748
AdjointIdeal: unskip tests and add traceMatrix coverage
kellerlv e283ad0
LatticePolytopes test refactoring, speedups
connorjhaynes 21b4678
AdjunctionForSurfaces: add test coverage for all 8 exports
kellerlv 24493dc
AlgebraicSplines: cover option-symbol exports
kellerlv f18ff50
AllMarkovBases: cover untested exports and option branches
kellerlv 87a56c6
add tests to Oscillators
dave-k-johnson 0edd4b2
AnalyzeSheafOnP1: fix swap-branch bug in analyze and add tests
kellerlv cc94e17
Benchmark: cover dispatch variants and error paths for runBenchmarks
kellerlv f01f16b
ConformalBlocks: wrap two call-with-no-assert tests in real assertions
kellerlv 0e75cb1
LatticePolytopes test speedup
connorjhaynes ddfb70a
ConvexInterface: fix doc Usage typos and add gated TEST scaffolding
kellerlv f236d1e
Update BGG.m2
GuanyuLee 8e52308
Browse: smoke-test the lone export and the menu dispatch surface
kellerlv 5625bec
Probability test coverage increased (thanks Ashley!)
connorjhaynes 32ba918
CpMackeyFunctors: cover untested exports and fix two silent-pass TESTs
kellerlv d45c669
add tests to VNumber
dave-k-johnson 2277f61
EliminationTemplates: fix parseMartyushevBases logic + doc typos + tests
kellerlv 50be871
FGLM: cover precondition error paths and the GroebnerBasis dispatch
kellerlv 0850bac
ForeignFunctions: cover 5 previously untested exports
kellerlv b7ab940
GameTheory: fix doc typos and cover KonstanzVariableName + ring guards
kellerlv 928a1cf
Isomorphism: pin current behavior of the silenced-assert TODO case
kellerlv 3bc2b4c
JSON: cover json alias + IndentLevel, add round-trip, wrap dev scratch
kellerlv 2968cf6
JSONRPC: fix doc typo and pin invalid-params error-code regression
kellerlv 84fa0d0
RandomObjects test (thanks Ashley!)
connorjhaynes 37f0c90
TriangularSets test cleanup. Strange test structure.
connorjhaynes 6753d57
LLLBases: cover gramm and the 8 strategy-symbol exports
kellerlv 7fcce5f
MRDI: fix two doc nits and cover save-path "not implemented yet" errors
kellerlv 9f23079
Markov: add the package's first TEST block
kellerlv d0d4d1c
Miura: fix error-string + doc typos and cover setPolynomialRing errors
kellerlv de19e0f
Removed leftover comments
connorjhaynes 456e510
MultiplierIdealsDim2: fix doc Usage typo + cover three option branches
kellerlv 2b39009
Quasidegrees: cover six previously-indirect exports
kellerlv 30c56aa
IntegerProgramming: cover infeasible branch + Matrix overloads + adap…
kellerlv d1bf4c5
OnlineLookup test coverage increased (thanks Ashley!)
connorjhaynes 13fdf00
PositivityToricBundles: cover four audit-flagged untested exports
kellerlv d06f262
RandomPlaneCurves: regression test for completeLinearSystemOnNodalPla…
kellerlv d66ec6c
RandomSpaceCurves: cover knownUnirationalComponentOfSpaceCurves + doc…
kellerlv a6317b4
add test to Book3264Examples
dave-k-johnson 7bd92ed
RationalPoints: cover the four option-symbol exports
kellerlv fda1105
Serialization: add the package's first TEST block
kellerlv eefcf06
Units: add the package's first TEST block
kellerlv feb6c62
XML: cover libxml round trip + xmlTypeTable + getChildren / getAttrib…
kellerlv 094222c
SimpleDoc: cover arXiv / wikipedia / stacksProject / packageTemplate …
kellerlv 268b472
SwitchingFields: fix char-0 string-return + cover extendFieldByDegree
kellerlv 4c42b9e
SpaceCurves: add the package's first TEST blocks
kellerlv 5d1d624
TerraciniLoci: cover the (ZZ, Matrix, Ideal) overload and r<1 error
kellerlv 36f0145
NAGtypes: cover five previously-indirect accessor / constructor exports
kellerlv bac7ed0
NonPrincipalTestIdeals: gate stray prints, fix stale error labels, dr…
kellerlv 2cd931e
PathSignatures: cover tensorLog and getCoefficientRing directly
kellerlv 9e2380f
SymmetricPolynomials test coverage increased
connorjhaynes 7781db7
ChainComplexExtras: re-export Complexes' Concentration option
kellerlv 14cf109
AdjointIdeal: reuse cached doc-example output on machines without Maple
kellerlv 4dcfd5c
add tests to ExampleSystems, fix bug in ExampleSystems
dave-k-johnson 7839e30
Update MergeTeX.m2
GuanyuLee 1890bfc
RationalPoints2 slight test coverage increase
connorjhaynes 0df6918
add tests to NumericalCertification
dave-k-johnson f46f22b
SRdeformation test coverage increased (thanks Ashley!)
connorjhaynes ea9dc62
MonodromySolver: drop pure-monomial mixedVolume assertion that crashe…
kellerlv e1eadec
MultiplierIdeals: re-disable (3,5) determinantal assertion that OOMs …
kellerlv 4d8991d
DirectSummands: tighten error tests + cover GF(p^e) and elliptic-curv…
kellerlv 0ed506d
Merge branch 'development' into development
mahrud dd786bb
Apply suggestion from @mahrud
kellerlv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,289 @@ | ||
| CommentReport = symbol CommentReport | ||
| SpeedReport = symbol SpeedReport | ||
|
|
||
| testAudit = method(Options => {CommentReport => false, SpeedReport => false}) | ||
|
|
||
| -------------------------------------------------------------------------------- | ||
| -- Helpers | ||
| -------------------------------------------------------------------------------- | ||
|
|
||
| testInputs = method() | ||
|
|
||
| testInputs Package := pkg -> tests pkg | ||
|
|
||
| testInputs String := pkgname -> testInputs needsPackage(pkgname, LoadDocumentation => true) | ||
|
|
||
|
|
||
| testCodeString = method() | ||
|
|
||
| testCodeStringFromInputs := inputs -> ( | ||
| demark(newline, apply(toList(0..#inputs-1), i -> inputs#i#"code")) | ||
| ) | ||
|
|
||
| testCodeString Package := pkg -> testCodeStringFromInputs testInputs pkg | ||
|
|
||
| testCodeString String := pkgname -> testCodeString needsPackage(pkgname, LoadDocumentation => true) | ||
|
|
||
|
|
||
| packageSourceString = method() | ||
|
|
||
| packageSourceString Package := pkg -> try get pkg#"source file" else "" | ||
|
|
||
| packageSourceString String := pkgname -> packageSourceString needsPackage(pkgname, LoadDocumentation => true) | ||
|
|
||
|
|
||
| exportedSymbols = method() | ||
|
|
||
| exportedSymbols Package := pkg -> sort toList pkg#"exported symbols" | ||
|
|
||
| exportedSymbols String := pkgname -> exportedSymbols needsPackage(pkgname, LoadDocumentation => true) | ||
|
|
||
|
|
||
| exportedValue := s -> try value s else null | ||
|
|
||
| className := x -> toString class x | ||
|
|
||
| isExportedFunction := s -> ( | ||
| v := exportedValue s; | ||
| member(className v, {"MethodFunction", "MethodFunctionWithOptions", "FunctionClosure", "Function"}) | ||
| ) | ||
|
|
||
| isExportedType := s -> ( | ||
| v := exportedValue s; | ||
| className v === "Type" | ||
| ) | ||
|
|
||
| optionNamesForSymbol := s -> ( | ||
| v := exportedValue s; | ||
| try sort apply(toList keys options v, toString) else {} | ||
| ) | ||
|
|
||
| methodStringsForSymbol := s -> ( | ||
| v := exportedValue s; | ||
| try sort apply(toList methods v, toString) else {} | ||
| ) | ||
|
|
||
| wordMatch := (name, code) -> match("\\b" | toString name | "\\b", code) | ||
|
|
||
| countLinesMatching := (pat, code) -> #select(lines code, line -> match(pat, line)) | ||
|
|
||
| shortList := (L, n) -> ( | ||
| if #L === 0 then "" | ||
| else if #L <= n then demark(", ", L) | ||
| else demark(", ", take(L, n)) | ", ..." | ||
| ) | ||
|
|
||
| lineNumbers := n -> if n === 0 then {} else toList(0..n-1) | ||
|
|
||
| snippet := (s, n) -> ( | ||
| t := replace("^ *| *$", "", s); | ||
| if length t <= n then t else substring(0, n, t) | "..." | ||
| ) | ||
|
|
||
| auditListLines := (label, L) -> ( | ||
| {"- " | label | " (" | toString(#L) | "):"} | | ||
| (if #L === 0 then {" none"} else apply(L, item -> " - " | item)) | | ||
| {""} | ||
| ) | ||
|
|
||
| printAuditList := (label, L) -> ( | ||
| scan(auditListLines(label, L), print); | ||
| ) | ||
|
|
||
| sourceLinesBeforeEnd := filename -> ( | ||
| srcLines := lines get filename; | ||
| endLines := select(lineNumbers(#srcLines), i -> match("^ *end *$", srcLines#i)); | ||
| if #endLines === 0 then srcLines else take(srcLines, first endLines) | ||
| ) | ||
|
|
||
| sourceLineMatches := (pkg, pat) -> ( | ||
| filename := try pkg#"source file" else ""; | ||
| if filename === "" or not fileExists filename then {} | ||
| else ( | ||
| srcLines := sourceLinesBeforeEnd filename; | ||
| apply(select(lineNumbers(#srcLines), i -> match(pat, srcLines#i)), i -> | ||
| snippet(srcLines#i, 72) | " (source: " | filename | ":" | toString(i + 1) | ")") | ||
| ) | ||
| ) | ||
|
|
||
| blockCommentLineMatches := (pkg, pat) -> ( | ||
| filename := try pkg#"source file" else ""; | ||
| if filename === "" or not fileExists filename then {} | ||
| else ( | ||
| srcLines := sourceLinesBeforeEnd filename; | ||
| inBlock := false; | ||
| matches := {}; | ||
| scan(lineNumbers(#srcLines), i -> ( | ||
| line := srcLines#i; | ||
| startsBlock := match("-\\*", line); | ||
| endsBlock := match("\\*-", line); | ||
| wasInBlock := inBlock; | ||
|
|
||
| if startsBlock then inBlock = true; | ||
| if (wasInBlock or startsBlock) and match(pat, line) then ( | ||
| matches = append(matches, snippet(line, 72) | " (source: " | filename | ":" | toString(i + 1) | ")") | ||
| ); | ||
| if endsBlock then inBlock = false; | ||
| )); | ||
| matches | ||
| ) | ||
| ) | ||
|
|
||
| silencedTestMatches := pkg -> unique(sourceLineMatches(pkg, "^ *--+ *TEST *///") | blockCommentLineMatches(pkg, "TEST *///")) | ||
|
|
||
| styleOfTests := inputs -> ( | ||
| locs := apply(toList(0..#inputs-1), i -> toString locate inputs#i); | ||
| if any(locs, loc -> match("/tests/", loc)) then "auxiliary file(s)" | ||
| else "interspersed" | ||
| ) | ||
|
|
||
| testSourceLines := inputs -> ( | ||
| files := unique apply(toList(0..#inputs-1), i -> (locate inputs#i)#0); | ||
| {"test sources:"} | | ||
| (if #files === 0 | ||
| then {" none"} | ||
| else apply(files, file -> " - " | file)) | ||
| ) | ||
|
|
||
| containsAll := (code, names) -> all(names, name -> wordMatch(name, code)) | ||
|
|
||
| typeNamesInMethodString := meth -> ( | ||
| parts := separate(",", replace("^\\([^,]*,?|\\)$", "", meth)); | ||
| select(apply(parts, s -> replace("^ *| *$", "", s)), s -> s =!= "") | ||
| ) | ||
|
|
||
| isMethodTested := (meth, code) -> ( | ||
| pieces := separate(",", replace("^\\(|\\)$", "", meth)); | ||
| if #pieces === 0 then false | ||
| else ( | ||
| functionName := replace("^ *| *$", "", first pieces); | ||
| wordMatch(functionName, code) and containsAll(code, typeNamesInMethodString meth) | ||
| ) | ||
| ) | ||
|
|
||
| -------------------------------------------------------------------------------- | ||
| -- Comment report | ||
| -------------------------------------------------------------------------------- | ||
|
|
||
| commentLinesIn := code -> select(lines code, line -> match("^ *--", line) and not match("^ *-- test source:", line)) | ||
|
|
||
| headerCommentLinesBefore := testInput -> ( | ||
| loc := locate testInput; | ||
| filename := loc#0; | ||
| startLine := loc#1; | ||
| if not fileExists filename then {} | ||
| else ( | ||
| srcLines := lines get filename; | ||
| i := startLine - 2; | ||
| comments := {}; | ||
| while i >= 0 and match("^ *--", srcLines#i) do ( | ||
| comments = prepend(srcLines#i, comments); | ||
| i = i - 1; | ||
| ); | ||
| comments | ||
| ) | ||
| ) | ||
|
|
||
| commentSectionLines := (label, comments) -> ( | ||
| if #comments === 0 then {} | ||
| else {label | ":"} | apply(comments, c -> " " | c) | ||
| ) | ||
|
|
||
| commentReportLines := inputs -> ( | ||
| {"", "Comments:"} | flatten apply(toList(0..#inputs-1), i -> ( | ||
| code := inputs#i#"code"; | ||
| headerComments := headerCommentLinesBefore inputs#i; | ||
| inTestComments := commentLinesIn code; | ||
|
|
||
| if #headerComments > 0 or #inTestComments > 0 | ||
| then {"", "TEST " | toString i | " -- source: " | toString locate inputs#i, "------------------------------------------------------------------------"} | | ||
| commentSectionLines("Header comments", headerComments) | | ||
| commentSectionLines("In-test comments", inTestComments) | ||
| else {} | ||
| )) | ||
| ) | ||
|
|
||
| printCommentReport := inputs -> ( | ||
| scan(commentReportLines inputs, print); | ||
| ) | ||
|
|
||
| -------------------------------------------------------------------------------- | ||
| -- Speed report | ||
| -------------------------------------------------------------------------------- | ||
|
|
||
| timeString := seconds -> toString seconds | "s" | ||
|
|
||
| speedReportLines := (pkg, inputs) -> ( | ||
| timings := apply(toList(0..#inputs-1), i -> ( | ||
| result := try ( | ||
| t := elapsedTiming check(i, pkg); | ||
| {i, t#0, toString locate inputs#i, true} | ||
| ) else {i, null, toString locate inputs#i, false}; | ||
| result | ||
| )); | ||
| successful := select(timings, row -> row#3); | ||
| totalTime := sum apply(successful, row -> row#1); | ||
|
|
||
| {"", "Speed Report:", ""} | | ||
| apply(timings, row -> ( | ||
| if row#3 | ||
| then " - TEST " | toString(row#0) | ": " | timeString(row#1) | " (" | row#2 | ")" | ||
| else " - TEST " | toString(row#0) | ": failed while timing (" | row#2 | ")" | ||
| )) | | ||
| {"", " total timed tests: " | toString(#successful) | "/" | toString(#timings), | ||
| " total time: " | timeString totalTime} | ||
| ) | ||
|
|
||
| -------------------------------------------------------------------------------- | ||
| -- Main audit | ||
| -------------------------------------------------------------------------------- | ||
|
|
||
| testAudit Package := opts -> pkg -> ( | ||
| inputs := testInputs pkg; | ||
| code := testCodeStringFromInputs inputs; | ||
| sourceCode := packageSourceString pkg; | ||
| syms := exportedSymbols pkg; | ||
|
|
||
| funcs := select(syms, isExportedFunction); | ||
| types := select(syms, isExportedType); | ||
| others := select(syms, s -> not isExportedFunction s and not isExportedType s); | ||
|
|
||
| untestedFunctions := select(apply(funcs, toString), name -> not wordMatch(name, code)); | ||
|
|
||
| optionPairs := flatten apply(funcs, f -> apply(optionNamesForSymbol f, opt -> {toString f, opt})); | ||
| untestedOptions := select(optionPairs, pair -> ( | ||
| opt := pair#1; | ||
| not wordMatch(opt, code) | ||
| )); | ||
| untestedOptionLabels := apply(untestedOptions, pair -> pair#0 | ": " | pair#1); | ||
|
|
||
| methodPairs := flatten apply(funcs, f -> methodStringsForSymbol f); | ||
| untestedMethods := select(methodPairs, meth -> not isMethodTested(meth, code)); | ||
|
|
||
| silencedTests := silencedTestMatches pkg; | ||
| fixmeTodos := sourceLineMatches(pkg, "FIXME|TODO|fixme|todo"); | ||
|
|
||
| reportLines := { | ||
| "exported: " | toString(#funcs) | " functions, " | toString(#types) | " types, " | toString(#others) | " other symbols", | ||
| "n_tests: " | toString(#inputs), | ||
| "style: " | styleOfTests inputs, | ||
| ""} | | ||
| testSourceLines inputs | | ||
| {"", | ||
| "Report:", | ||
| "" | ||
| } | | ||
| auditListLines("untested functions", untestedFunctions) | | ||
| auditListLines("untested options", untestedOptionLabels) | | ||
| auditListLines("untested methods", untestedMethods) | | ||
| auditListLines("silenced tests", silencedTests) | | ||
| auditListLines("FIXME/TODO markers", fixmeTodos) | | ||
| (if opts.SpeedReport then speedReportLines(pkg, inputs) else {}) | | ||
| (if opts.CommentReport then commentReportLines inputs else {}); | ||
|
|
||
| report := demark(newline, reportLines); | ||
| print report; | ||
| report | ||
| ) | ||
|
|
||
| testAudit String := opts -> pkgname -> testAudit(needsPackage(pkgname, LoadDocumentation => true), opts) |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -295,3 +295,4 @@ MRDI | |
| EliminationTemplates | ||
| WittVectors | ||
| Padic | ||
| TestAudit | ||
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I presume this is redundant with the TestAudit package PR? Which one should be merged first?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes (edited because I misread this originally)