AgeCommit message (Collapse)AuthorLines
Hold the index tests to a working pageBryce Kwon-17/+23
The index requests passed on any answer short of a crash. The checks for the missing tree and log links read a page an earlier test wrote, so run alone they passed with no page at all. The description and summary link checks matched their text anywhere on the page rather than in foo's row.
Check that the outermost avatar brackets come offBryce Kwon-0/+4
With one pair of brackets, matching the innermost pair would have passed the old check as well.
Say why the Lua search paths reach the testsBryce Kwon-1/+4
Give the harness cgit's print and its other sinksBryce Kwon-2/+35
Lua's own print wrote outside the collected output, so a stray print in a filter passed every check while under cgit it lands on the page. html_url_arg and html_include were missing, which only a filter using them would have found.
Compare link-trailers output wholeBryce Kwon-1/+5
A short object name was checked only for a missing anchor, and the value that passes through untouched never held the entities cgit escapes it with, so escaping it again would have passed.
Compare link-commits output wholeBryce Kwon-8/+13
Four checks only looked for a missing anchor, which output with the text dropped also passes, and no message held the entities cgit escapes it with.
Time the other filters at two lengths as wellBryce Kwon-26/+59
The avatar checks held a 40000 byte address to half a second, twenty times tighter than the readme budget that already failed on a slow host, and in stub mode nearly all of that time went on the fake digest. Link-commits and link-trailers had no check on a long input at all. The readme checks' method moves into the harness so all four share it. A single timing of each length let a busy host that took the CPU away during the longer one make a linear pass look quadratic. The lengths now take turns and the fastest timing of each counts, since a busy host can slow one timing but rarely all five. A ratio under six ends the turns at once, so only one near the bound of ten waits for all five.
Hold the avatar stub checks to an absolute hashBryce Kwon-7/+28
The stub mode checks only compared hashes with each other, and the stand-in digest took any algorithm name, so md5, a misspelt sha256 or hex in capitals passed everywhere luaossl is missing, which is every machine here. The comparisons also passed with no hash found on either side.
Cover how link-trailers applies its rulesBryce Kwon-0/+26
Skipping a malformed rule, a rule without a key, the switch for bare urls and the shipped CVE example were untested, and the only url kept from linking was one holding a quote, so a broader scheme check would have let javascript:// through.
Cover how link-commits applies its rulesBryce Kwon-0/+41
Skipping a malformed rule, the tie between two rules, the scan past an empty match, a rule with no capture and the switch for object names were all untested, and none of the shipped examples beyond the issue rule had ever been loaded.
Check that the blame view is highlightedBryce Kwon-0/+7
Blame runs the same source filter, and only the tree view had ever been rendered through it.
Cover the rest of syntax-highlight's outputBryce Kwon-4/+33
No token ever took hl-type or hl-comment, so a typo in either row, or a rule gone from the stylesheet, passed. Nothing fed the filter a NUL byte or a blob of exactly the size cap either.
Check the lexer modules the filter cannot useBryce Kwon-3/+54
A module called lexer that is not Scintillua, a Scintillua older than 6.0 without detect(), lexers that cannot load lpeg and a lexer that returns no token list were all documented and none was tried.
Drop the section labels from the readme checksBryce Kwon-4/+0
Check the site readme and a repository without oneBryce Kwon-0/+32
The site readme reaches about-render with no tree, where only the scheme check stands between a javascript: link and the page, and no test rendered one. The redirect for a repository without a readme line was checked only with no about-filter set, while the header of about-render says the filter alone makes no about page.
Cover the rest of the man macrosBryce Kwon-0/+25
Cover the rest of the markdown grammarBryce Kwon-0/+53
The changelog for 2.12.0 says a list split by a code block keeps counting, and only the split by a blank line was checked.
Pair each readme absence check with what rendersBryce Kwon-2/+6
Four checks only looked for something missing, which a dropped or plain text rendering also satisfies, and the spacing macro check missed a 0 drawn at the start of a line.
Never give two headings the same anchorBryce Kwon-0/+10
A repeat's count was keyed on the bare text, so a heading whose text already ended in that count took the same anchor, as "Twice 1" did after two of "Twice", and "About 1" after "About". A link to either then landed on the first. The count now goes on up past any anchor already handed out, the way GitHub's slugger does.
Check what the nesting rules actually renderBryce Kwon-3/+6
The emphasis bomb checked only that the output was not empty, which it never is, and its input never nests. No input reaches the ceiling on inline nesting either, since an emphasis cannot hold its own kind, so the check now proves the nesting that does happen. Past the quote ceiling only the innermost text was looked for, and any x passed.
Check the two fallbacks around rendering a readmeBryce Kwon-0/+13
Check the log line for lexers that are not foundBryce Kwon-18/+60
Every check set CGIT_SCINTILLUA_PATH, which the filter takes as given, so the line for a server with no Scintillua at all never ran and deleting it passed. The harness can now clear a variable and hide the directories the filter probes. A lexer.lua anywhere on LUA_PATH also loaded in place of the missing one, so the fallback runs now keep every Lua module out of reach.
Check both avatar filters through cgitBryce Kwon-1/+11
Only email-gravatar ever ran inside cgit, and nothing there checked that the icon is fetched without a Referer.
Prove the avatar fallback on any machineBryce Kwon-14/+14
The page without icons was checked only where cgit's Lua lacked luaossl, so a machine that has it never ran the fallback. It now runs with every Lua search path pointed at an empty directory, and the log line is compared whole. Writing the config needs no Lua, so that step runs everywhere too.
Prove the about page fallback on any machineBryce Kwon-15/+43
The fallback through cgit ran only where cgit's own Lua lacked lpeg, and every machine the suite runs on has it, so the test never ran. With every Lua search path pointed at an empty directory it runs anywhere. It now also checks that the readme's markup is escaped, as its title said, and compares the whole log line.
Fail a unit check run that made no checkBryce Kwon-0/+5
Decide every unit check skip in the shellBryce Kwon-38/+64
Where a standalone Lua had no lpeg, the harness skipped the markdown and man checks itself, behind a note the test library hides, and the test passed on the six checks left. The real luaossl checks were left out the same way. Each now shows as a skip under a prerequisite named for the interpreter, and a misspelt mode fails rather than running the default.
Show unit checks as skipped when no Lua is foundBryce Kwon-38/+41
With no standalone interpreter on the path the unit checks were never registered, so they counted as neither run nor skipped, and a fault in the version probe dropped them all behind one line of output. The test bodies now expand their paths as they run, so a quote in a path no longer breaks them.
Run each standalone Lua version onceBryce Kwon-14/+36
A plain lua is usually one of the versioned names again, as lua and lua5.5 are here, so every 5.5 check ran twice, while names such as lua54 and lua-5.4 were never looked for. A test now names the version that ran, since "under lua" did not say which one it was.
Stop the run when the Lua probe failsBryce Kwon-2/+14
The probe piped cgit into grep, so a crash or a sanitizer abort while probing read as a missing module, and t0501, t0504 and t0505 then expected the fallback on a machine that has the module.
Check that link-trailers encodes a rule captureBryce Kwon-0/+7
As in link-commits, every capture was hex or digits. A string replacement there would also raise outside the pcall that guards the pattern and take the whole page down.
Check that link-commits encodes a rule captureBryce Kwon-0/+7
Every capture the checks used was hex or digits, which encoding leaves alone, so the filter passed with url_encode gone and a broader rule could then have broken out of the href.
Check that markup inside a token is escapedBryce Kwon-2/+6
Every escape the checks looked at sat between tokens or in the tail a lexer left untagged, so a filter that escaped only those would have passed with a string literal reaching the page raw.
Check the whole page in the extension testsBryce Kwon-36/+40
A page that died part way through, or logged an error, passed as long as the text grepped for came before the failure. Four tests also read the page an earlier test had fetched, so none of them could run alone.
Time each hostile readme at two lengthsBryce Kwon-17/+48
One ten second budget covered several inputs, so a failure did not say which had regressed, and it allowed ten times the second a readme is held to while leaving a slow host little room. A linear render costs four times as much at four times the length and a quadratic one sixteen, whatever the host. The cap on unclosed brackets had no check at all, and the line of \h' escapes timed nothing that is bounded.
Check that a link's fragment is escapedBryce Kwon-0/+3
Prove a control byte cannot hide a link's schemeBryce Kwon-2/+9
The old check split the scheme with a newline, which ends the line before a link can form, so it passed with the strip removed.
Check a warning raised inside an included fileBryce Kwon-0/+1
The include run checked only the line in the outer file, so a warning from the included one could have named the outer file and passed.
Match logged paths as fixed stringsBryce Kwon-12/+12
The messages hold the trash directory's path and were matched as patterns, so a checkout path holding a bracket or a star would break them.
Measure the clamped query without grep -oBryce Kwon-1/+7
grep -o is not in POSIX, while awk's match is.
Skip the perl helper tests where perl will not runBryce Kwon-3/+9
The PERL prerequisite comes from NO_PERL in the build options, not from an interpreter being there, so a host without perl and with the chain linter off failed these tests instead of skipping them.
Describe what the cache tests coverBryce Kwon-2/+5
Drop the locale the test library already setsBryce Kwon-2/+2
test-lib exports LC_ALL=C for every test, so the two sorted checks said it again for nothing.
Test DOS line endings and stray lines in cgitrcBryce Kwon-0/+15
Without the fold of a carriage return before a newline, repo.path keeps a trailing one and the repository cannot be opened, and no test had a file saved that way. Semicolon comments and a line with no equals sign were untested too.
Test the include nesting limitBryce Kwon-0/+28
Nothing reached the guard that stops a file including itself, so its loss would have gone unseen until a site's own cgitrc recursed until the stack gave out.
Check that a ref page lists from its offsetBryce Kwon-9/+18
Both paging tests would have passed with the listing ignoring ofs, since the prev link comes from ofs alone.
Test a content filter that exits non-zeroBryce Kwon-0/+12
cgit takes no notice of how an about, commit, source or email filter exits, and nothing showed that a failing one still leaves the page whole.
Test the robots tag on ordinary pagesBryce Kwon-0/+20
Only the login page's tag was checked, so printing noindex everywhere would have taken every site out of the search engines and passed.
Render the page each markup test readsBryce Kwon-0/+2
Two tests read the page an earlier test left in tmp, so a test put in between would have had them check some other page.
Make the stylesheet and script checks able to failBryce Kwon-4/+5
The negated greps passed on a missing or renamed file, and the old hooks were matched with an alternation POSIX leaves undefined in a basic expression, so a grep that read the bars literally never matched anything.