Skip to content

test added to BashScriptsTests to verify script.path property #13132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 28, 2021
Merged

test added to BashScriptsTests to verify script.path property #13132

merged 3 commits into from
Jul 28, 2021

Conversation

philwalk
Copy link
Contributor

@philwalk philwalk commented Jul 22, 2021

Adding 2 new tests to verify behavior of scripts called via bash -c command line.
It's failing Dotty / test due to script file not having execute permission, not sure how best to work around this problem:

/usr/bin/bash: /.../scala-3.0.3-RC1-bin-SNAPSHOT-nonbootstrapped/test-classes/scripting/scriptPath.sc: Permission denied

I modified the 2 new script tests in BashScriptTests to only fail if the script runs successfully AND the expected output is as expected.

@philwalk philwalk requested a review from liufengyun July 22, 2021 23:49
@philwalk philwalk mentioned this pull request Jul 22, 2021
@@ -56,8 +56,7 @@ class ClasspathTests:
printf("bash is [%s]\n", bashExe)

if packBinScalaExists then
val echoTest = "" // "SCALAC_ECHO_TEST=1"
val bashCmdline = s"SCALA_OPTS= $echoTest ${scalaCopy.norm} -classpath '$wildcardEntry' $relpath"
val bashCmdline = s"SCALA_OPTS= ${scalaCopy.norm} -classpath '$wildcardEntry' $relpath"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why scala script path is part of SCALA_OPTS?

Copy link
Contributor Author

@philwalk philwalk Jul 27, 2021

Choose a reason for hiding this comment

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

The purpose of prefixing the bash command line with SCALA_OPTS= is to unset SCALA_OPTS, to insure that it doesn't influence the command line args seen by dist/bin/scala. (there's a space following the equal sign, effectively unsetting SCALA_OPTS)

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh yeah, I was curious about the blank space too, but now it makes sense

@philwalk philwalk merged commit d7d70c0 into scala:master Jul 28, 2021
@philwalk philwalk deleted the fix-script-path-verify-test branch July 28, 2021 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants