Skip to content
This repository has been archived by the owner on Sep 19, 2018. It is now read-only.

Added support for test flags to per-test metadata #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions testharness.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ policies and contribution forms [3].
* author - Name and contact information for the author of the test in the
* format: "Name <email_addr>" or "Name http://contact/url"
*
* flags - space separated list of test flags in addition to any present in
* the head metadata
*
* == Asynchronous Tests ==
*
* Testing asynchronous features is somewhat more complex since the result of
Expand Down
8 changes: 6 additions & 2 deletions testharnessreport.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var metadata_generator = {

currentMetadata: {},
cachedMetadata: false,
metadataProperties: ['help', 'assert', 'author'],
metadataProperties: ['help', 'assert', 'author', 'flags'],

error: function(message) {
var messageElement = document.createElement('p');
Expand Down Expand Up @@ -77,7 +77,7 @@ var metadata_generator = {
for (var metaIndex = 0; metaIndex < this.metadataProperties.length;
metaIndex++) {
var meta = this.metadataProperties[metaIndex];
if (test.properties.hasOwnProperty(meta)) {
if (test.properties.hasOwnProperty(meta) && test.properties[meta]) {
if ('author' == meta) {
this.validateContact(test, meta);
}
Expand Down Expand Up @@ -338,6 +338,10 @@ var metadata_generator = {
showSource = true;
}
}
else if (1 < tests.length) {
// message = 'Cached metadata not present. ';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this line commented out?

Copy link
Member Author

@plinss plinss Apr 15, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those two lines were originally removed by Ms2ger as (s)he found the warning message annoying. I re-added the code but left the message disabled so those that wanted it could easily re-enable.

I'm working on an alternative system for gathering the metadata through Shepherd's API. So we may be able to remove the manual adding of the metadata cache soon (if it works out), although having it won't hurt anyway.

showSource = true;
}
}

if (message) {
Expand Down