On 6/7/2017 6:42 AM, Johan Kuuse wrote:
Thanks for the input.
"fossil test-http" did the trick:

webpage=/setup
printf "GET $webpage HTTP/1.0\n\n" | fossil test-http

My purposes for parsing the built-in web pages are basically two:

1. I want to hack the Fossil code:
     a. I parse and save the HTML from the builtin pages (excluding
pages where the output makes no sense, for example /zip)
     b. I modify the source code (related to one or more web pages)
     c. I parse the same pages again to check that I have changed only
the web page output I intended to change. A kind of self test before
committing.

This WoW is obviously only helpful for a developer changing the Fossil
source code of one single (official) commit.
It does not make sense to save the output for later use and compare it
between commits, as the content/structure may change.

Take a look at the test harness in the test folder of the repository. It's in Tcl, and has pretty good coverage of the internals despite a lack of dedicated test developers. Most of the tests drive the CLI. Even the tests for fossil json largely drive the CLI instead of /json URLs via HTTP, but there are examples in there.

Naturally, I'd love to see the test suite expand to further coverage of the web face. So if you have thoughts about that, chime in here, or on the fossil-dev list where chatter about things like test harnesses won't distract the end users.

For building tools to generally interact with a repo, take a look at the JSON support. It's (still) not compiled in by default, but builds easily if requested by ./configure --json.

2. I want to validate the web pages: Validate the HTML, check for
broken links, etc, using for example the W3C validation tools.

This kind of validation could be used both to find existing, and to
avoid introducing new invalid HTML.
Could possibly be useful both for programmers and for skin-makers.

A test case that validates all of the HTML output would be great. That should be content agnostic, of course, so that it can be maintained without requiring a lot of work for new versions.


--
Ross Berteig                               r...@cheshireeng.com
Cheshire Engineering Corp.           http://www.CheshireEng.com/
+1 626 303 1602

_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to