Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CodeMirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Moritz Aurel Pascal Schubotz
CodeMirror
Commits
03f8aaed
Commit
03f8aaed
authored
12 years ago
by
Marijn Haverbeke
Browse files
Options
Downloads
Patches
Plain Diff
Make the tester accurately report total test count
Even when a subset is selected.
parent
a2ad87f2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/driver.js
+14
-10
14 additions, 10 deletions
test/driver.js
test/index.html
+1
-3
1 addition, 3 deletions
test/index.html
with
15 additions
and
13 deletions
test/driver.js
+
14
−
10
View file @
03f8aaed
...
...
@@ -48,10 +48,6 @@ function runTests(callback) {
}
if
(
debug
.
length
<
1
)
{
debug
=
null
;
}
else
{
if
(
totalTests
>
debug
.
length
)
{
totalTests
=
debug
.
length
;
}
}
}
var
totalTime
=
0
;
...
...
@@ -67,7 +63,7 @@ function runTests(callback) {
// Remove from array for reporting incorrect tests later
debug
.
splice
(
debugIndex
,
1
);
}
else
{
var
wildcardName
=
test
.
name
.
split
(
"
_
"
)
.
shift
()
+
"
_*
"
;
var
wildcardName
=
test
.
name
.
split
(
"
_
"
)
[
0
]
+
"
_*
"
;
debugIndex
=
indexOf
(
debug
,
wildcardName
);
if
(
debugIndex
!==
-
1
)
{
// Remove from array for reporting incorrect tests later
...
...
@@ -75,11 +71,7 @@ function runTests(callback) {
debugUsed
.
push
(
wildcardName
);
}
else
{
debugIndex
=
indexOf
(
debugUsed
,
wildcardName
);
if
(
debugIndex
!==
-
1
)
{
totalTests
++
;
}
else
{
return
step
(
i
+
1
);
}
if
(
debugIndex
==
-
1
)
return
step
(
i
+
1
);
}
}
}
...
...
@@ -132,3 +124,15 @@ function eqPos(a, b, msg) {
function
is
(
a
,
msg
)
{
if
(
!
a
)
throw
new
Failure
(
label
(
"
assertion failed
"
,
msg
));
}
function
countTests
()
{
if
(
!
debug
)
return
tests
.
length
;
var
sum
=
0
;
for
(
var
i
=
0
;
i
<
tests
.
length
;
++
i
)
{
var
name
=
tests
[
i
].
name
;
if
(
indexOf
(
debug
,
name
)
!=
-
1
||
indexOf
(
debug
,
name
.
split
(
"
_
"
)[
0
]
+
"
_*
"
)
!=
-
1
)
++
sum
;
}
return
sum
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
test/index.html
+
1
−
3
View file @
03f8aaed
...
...
@@ -107,7 +107,7 @@
bad
=
""
;
verbose
=
false
;
debugUsed
=
Array
();
totalTests
=
tests
.
length
;
totalTests
=
countTests
()
;
progressTotal
.
nodeValue
=
"
of
"
+
totalTests
;
progressRan
.
nodeValue
=
count
;
output
.
innerHTML
=
''
;
...
...
@@ -141,8 +141,6 @@
var
message
=
"
???
"
;
if
(
type
!=
"
done
"
)
++
count
;
progress
.
style
.
width
=
(
count
*
(
progress
.
parentNode
.
clientWidth
-
2
)
/
totalTests
)
+
"
px
"
;
progressTotal
.
nodeValue
=
"
of
"
+
totalTests
+
(
debugUsed
.
length
&&
type
!=
"
done
"
?
"
+
"
:
""
);
progressRan
.
nodeValue
=
count
;
if
(
type
==
"
ok
"
)
{
message
=
"
Test '
"
+
name
+
"
' succeeded
"
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment