Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_nashorn
提交
fdc0ca7a
D
dragonwell8_nashorn
项目概览
openanolis
/
dragonwell8_nashorn
通知
2
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_nashorn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fdc0ca7a
编写于
5月 08, 2013
作者:
A
attila
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8014225: Rerun only failed 262 tests
Reviewed-by: jlaskey, lagergren
上级
cc337354
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
69 addition
and
16 deletion
+69
-16
make/project.properties
make/project.properties
+2
-0
test/src/jdk/nashorn/internal/test/framework/AbstractScriptRunnable.java
...shorn/internal/test/framework/AbstractScriptRunnable.java
+1
-1
test/src/jdk/nashorn/internal/test/framework/ParallelTestRunner.java
...k/nashorn/internal/test/framework/ParallelTestRunner.java
+44
-15
test/src/jdk/nashorn/internal/test/framework/TestConfig.java
test/src/jdk/nashorn/internal/test/framework/TestConfig.java
+3
-0
test/src/jdk/nashorn/internal/test/framework/TestFinder.java
test/src/jdk/nashorn/internal/test/framework/TestFinder.java
+19
-0
未找到文件。
make/project.properties
浏览文件 @
fdc0ca7a
...
...
@@ -194,6 +194,8 @@ test262-test-sys-prop.test.js.enable.strict.mode=true
test262-test-sys-prop.test.js.exclude.dir
=
\
${test262.suite.dir}/intl402/
test262-test-sys-prop.test.failed.list.file
=
${build.dir}/test/failedTests
# test262 test frameworks
test262-test-sys-prop.test.js.framework
=
\
-timezone=PST
\
...
...
test/src/jdk/nashorn/internal/test/framework/AbstractScriptRunnable.java
浏览文件 @
fdc0ca7a
...
...
@@ -117,7 +117,7 @@ public abstract class AbstractScriptRunnable {
// run this test - compile or compile-and-run depending on option passed
public
void
runTest
()
throws
IOException
{
log
(
toString
());
Thread
.
currentThread
().
setName
(
testFile
.
getPath
());
if
(
shouldRun
)
{
// Analysis of failing tests list -
// if test is in failing list it must fail
...
...
test/src/jdk/nashorn/internal/test/framework/ParallelTestRunner.java
浏览文件 @
fdc0ca7a
...
...
@@ -25,6 +25,7 @@
package
jdk.nashorn.internal.test.framework
;
import
static
jdk
.
nashorn
.
internal
.
test
.
framework
.
TestConfig
.
TEST_FAILED_LIST_FILE
;
import
static
jdk
.
nashorn
.
internal
.
test
.
framework
.
TestConfig
.
TEST_JS_ENABLE_STRICT_MODE
;
import
static
jdk
.
nashorn
.
internal
.
test
.
framework
.
TestConfig
.
TEST_JS_EXCLUDES_FILE
;
import
static
jdk
.
nashorn
.
internal
.
test
.
framework
.
TestConfig
.
TEST_JS_EXCLUDE_LIST
;
...
...
@@ -37,6 +38,7 @@ import java.io.File;
import
java.io.FileInputStream
;
import
java.io.FileOutputStream
;
import
java.io.FileReader
;
import
java.io.FileWriter
;
import
java.io.IOException
;
import
java.io.InputStreamReader
;
import
java.io.OutputStream
;
...
...
@@ -324,7 +326,8 @@ public class ParallelTestRunner {
});
}
public
void
run
()
{
@SuppressWarnings
(
"resource"
)
public
boolean
run
()
throws
IOException
{
final
int
testCount
=
tests
.
size
();
int
passCount
=
0
;
int
doneCount
=
0
;
...
...
@@ -371,6 +374,12 @@ public class ParallelTestRunner {
});
boolean
hasFailed
=
false
;
final
String
failedList
=
System
.
getProperty
(
TEST_FAILED_LIST_FILE
);
final
boolean
hasFailedList
=
failedList
!=
null
;
final
boolean
hadPreviouslyFailingTests
=
hasFailedList
&&
new
File
(
failedList
).
length
()
>
0
;
final
FileWriter
failedFileWriter
=
hasFailedList
?
new
FileWriter
(
failedList
)
:
null
;
try
{
final
PrintWriter
failedListWriter
=
failedFileWriter
==
null
?
null
:
new
PrintWriter
(
failedFileWriter
);
for
(
final
ScriptRunnable
.
Result
result
:
results
)
{
if
(!
result
.
passed
())
{
if
(
hasFailed
==
false
)
{
...
...
@@ -380,6 +389,9 @@ public class ParallelTestRunner {
}
System
.
out
.
println
(
result
.
getTest
());
if
(
failedFileWriter
!=
null
)
{
failedListWriter
.
println
(
result
.
getTest
().
testFile
.
getPath
());
}
if
(
result
.
exception
!=
null
)
{
final
String
exceptionString
=
result
.
exception
instanceof
TestFailedError
?
result
.
exception
.
getMessage
()
:
result
.
exception
.
toString
();
System
.
out
.
print
(
exceptionString
.
endsWith
(
"\n"
)
?
exceptionString
:
exceptionString
+
"\n"
);
...
...
@@ -387,7 +399,11 @@ public class ParallelTestRunner {
}
}
}
}
finally
{
if
(
failedFileWriter
!=
null
)
{
failedFileWriter
.
close
();
}
}
final
double
timeElapsed
=
(
System
.
nanoTime
()
-
startTime
)
/
1
e9
;
// [s]
System
.
out
.
printf
(
"Tests run: %d/%d tests, passed: %d (%.2f%%), failed: %d. Time elapsed: %.0fmin %.0fs.\n"
,
doneCount
,
testCount
,
passCount
,
100
d
*
passCount
/
doneCount
,
doneCount
-
passCount
,
timeElapsed
/
60
,
timeElapsed
%
60
);
System
.
out
.
flush
();
...
...
@@ -397,12 +413,25 @@ public class ParallelTestRunner {
if
(
hasFailed
)
{
throw
new
AssertionError
(
"TEST FAILED"
);
}
if
(
hasFailedList
)
{
new
File
(
failedList
).
delete
();
}
if
(
hadPreviouslyFailingTests
)
{
System
.
out
.
println
();
System
.
out
.
println
(
"Good job on getting all your previously failing tests pass!"
);
System
.
out
.
println
(
"NOW re-running all tests to make sure you haven't caused any NEW test failures."
);
System
.
out
.
println
();
}
return
hadPreviouslyFailingTests
;
}
public
static
void
main
(
final
String
[]
args
)
throws
Exception
{
parseArgs
(
args
);
new
ParallelTestRunner
().
run
(
);
while
(
new
ParallelTestRunner
().
run
()
);
}
private
static
void
parseArgs
(
final
String
[]
args
)
{
...
...
test/src/jdk/nashorn/internal/test/framework/TestConfig.java
浏览文件 @
fdc0ca7a
...
...
@@ -72,4 +72,7 @@ public interface TestConfig {
// shared context mode or not
static
final
String
TEST_JS_SHARED_CONTEXT
=
"test.js.shared.context"
;
// file for storing last run's failed tests
static
final
String
TEST_FAILED_LIST_FILE
=
"test.failed.list.file"
;
}
test/src/jdk/nashorn/internal/test/framework/TestFinder.java
浏览文件 @
fdc0ca7a
...
...
@@ -31,6 +31,7 @@ import static jdk.nashorn.internal.test.framework.TestConfig.OPTIONS_EXPECT_COMP
import
static
jdk
.
nashorn
.
internal
.
test
.
framework
.
TestConfig
.
OPTIONS_EXPECT_RUN_FAIL
;
import
static
jdk
.
nashorn
.
internal
.
test
.
framework
.
TestConfig
.
OPTIONS_IGNORE_STD_ERROR
;
import
static
jdk
.
nashorn
.
internal
.
test
.
framework
.
TestConfig
.
OPTIONS_RUN
;
import
static
jdk
.
nashorn
.
internal
.
test
.
framework
.
TestConfig
.
TEST_FAILED_LIST_FILE
;
import
static
jdk
.
nashorn
.
internal
.
test
.
framework
.
TestConfig
.
TEST_JS_ENABLE_STRICT_MODE
;
import
static
jdk
.
nashorn
.
internal
.
test
.
framework
.
TestConfig
.
TEST_JS_EXCLUDES_FILE
;
import
static
jdk
.
nashorn
.
internal
.
test
.
framework
.
TestConfig
.
TEST_JS_EXCLUDE_DIR
;
...
...
@@ -41,7 +42,9 @@ import static jdk.nashorn.internal.test.framework.TestConfig.TEST_JS_LIST;
import
static
jdk
.
nashorn
.
internal
.
test
.
framework
.
TestConfig
.
TEST_JS_ROOTS
;
import
static
jdk
.
nashorn
.
internal
.
test
.
framework
.
TestConfig
.
TEST_JS_UNCHECKED_DIR
;
import
java.io.BufferedReader
;
import
java.io.File
;
import
java.io.FileReader
;
import
java.io.IOException
;
import
java.nio.file.FileSystem
;
import
java.nio.file.FileSystems
;
...
...
@@ -86,6 +89,22 @@ final class TestFinder {
static
<
T
>
void
findAllTests
(
final
List
<
T
>
tests
,
final
Set
<
String
>
orphans
,
final
TestFactory
<
T
>
testFactory
)
throws
Exception
{
final
String
framework
=
System
.
getProperty
(
TEST_JS_FRAMEWORK
);
final
String
testList
=
System
.
getProperty
(
TEST_JS_LIST
);
final
String
failedTestFileName
=
System
.
getProperty
(
TEST_FAILED_LIST_FILE
);
if
(
failedTestFileName
!=
null
)
{
File
failedTestFile
=
new
File
(
failedTestFileName
);
if
(
failedTestFile
.
exists
()
&&
failedTestFile
.
length
()
>
0L
)
{
try
(
final
BufferedReader
r
=
new
BufferedReader
(
new
FileReader
(
failedTestFile
)))
{
for
(;;)
{
final
String
testFileName
=
r
.
readLine
();
if
(
testFileName
==
null
)
{
break
;
}
handleOneTest
(
framework
,
new
File
(
testFileName
).
toPath
(),
tests
,
orphans
,
testFactory
);
}
}
return
;
}
}
if
(
testList
==
null
||
testList
.
length
()
==
0
)
{
// Run the tests under the test roots dir, selected by the
// TEST_JS_INCLUDES patterns
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录