Skip to content
This repository was archived by the owner on Sep 8, 2022. It is now read-only.

Fix test failure problem in non-English environment #44

Merged
merged 1 commit into from
Jan 23, 2016

Conversation

kmizu
Copy link

@kmizu kmizu commented Jan 3, 2016

  • For example, tests which expect some javac's error messages fail in Japanese environment
    since the error messages are localized in such a environment

@lyricallogical
Copy link

Some additional explanations...

Currently, A neg test "neg/t6289" is checked by a javac's error message. It depend locale of user's environment. It is necessary to fix a javac's error message to english.
JDK tools uses system properties instead of environment variables for locale, e.g. LANG, LC_CTYPE, and LC_ALL.
Ok, in partest, java commands run with options "-Duser.lanugage=en -Duser.country=US".

"-Duser.language=en",
"-Duser.country=US"

Unfortunately, the javac command does not.
def javac(files: List[File]): TestState = {
// compile using command-line javac compiler
val args = Seq(
javacCmdPath,
"-d",
outDir.getAbsolutePath,
"-classpath",
joinPaths(outDir :: testClassPath)
) ++ files.map(_.getAbsolutePath)
pushTranscript(args mkString " ")
val captured = StreamCapture(runCommand(args, logFile))
if (captured.result) genPass() else {
logFile appendAll captured.stderr
genFail("java compilation failed")
}
}

In current implementation, there is no smart way for passing options to javac that run for tests.

Please fix this for contributors in outside of english language regions.

@kmizu
Copy link
Author

kmizu commented Jan 19, 2016

@SethTisue Please review this pull request.

@SethTisue
Copy link
Member

@szeiger you've been up in partest recently, would you mind reviewing this one?

joinPaths(outDir :: testClassPath)
joinPaths(outDir :: testClassPath),
"-J-Duser.language=en",
"-J-Duser.country=us"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this needs to be US. Language codes are lowercase, country codes are upper case (like in propertyOptions in the same file)

@kmizu
Copy link
Author

kmizu commented Jan 21, 2016

@szeiger Thanks for reviewing. I fixed the mistake you point out

@szeiger
Copy link
Contributor

szeiger commented Jan 21, 2016

Great, LGTM otherwise. Please squash the commits (no need to wait for the current build of the separate commit).

@kmizu kmizu force-pushed the fix-non-english-environment-problem branch from 0679fb5 to b6725fd Compare January 23, 2016 12:04
@kmizu
Copy link
Author

kmizu commented Jan 23, 2016

@szeiger Thanks. I squashed the commits.

SethTisue added a commit that referenced this pull request Jan 23, 2016
Fix test failure problem in non-English environment
@SethTisue SethTisue merged commit c4ab64f into scala:master Jan 23, 2016
@SethTisue
Copy link
Member

good catch — thank you for the fix!

lrytz pushed a commit to lrytz/scala-partest that referenced this pull request May 9, 2018
…oblem

Fix test failure problem in non-English environment
lrytz pushed a commit to lrytz/scala-partest that referenced this pull request May 9, 2018
…oblem

Fix test failure problem in non-English environment
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants