Skip to content
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

echo command fails on Windows (testProjectExec unit tests) #422

Closed
brunobowden opened this issue Aug 26, 2015 · 3 comments
Closed

echo command fails on Windows (testProjectExec unit tests) #422

brunobowden opened this issue Aug 26, 2015 · 3 comments
Assignees
Milestone

Comments

@brunobowden
Copy link
Contributor

The echo command is used in a number of unit tests, particularly the testProjectExec unit tests in UtilsTest.groovy. This command isn't supported on Windows. The tests are currently disabled on Windows but should be enabled once an alternative is established to the echo command. Current exception:

org.gradle.process.internal.ExecException: A problem occurred starting process 'command 'echo''

@brunobowden
Copy link
Contributor Author

@gocursor - it would be a great help to have your insights on this. I don't have a Windows machine, so this is much harder for me to fix. Can you figure out what command can be used to do something like echo for Windows? Echo works on Mac / Linux but for some reason it give the error seen in the description.

cc @advayDev1

Probably the easiest test to work with is testProjectExec_StdOut. Modify line 565 onwards to remove the return and uncomment the line before. The trick will be to replace the ???? section with a command that works. For example:

String executableCmd = 'echo'
if (Utils.isWindowsNoFake()) {
    executableCmd = 'WORKING_COMMAND'
}

@advayDev1
Copy link
Contributor

i guess echo is not a binary, but a built-in of the shell. try:
executableCmd = 'cmd'
and prepend '/C' as the first arg. (and everything else the same)

http://stackoverflow.com/questions/515309/what-does-cmd-c-mean

@brunobowden
Copy link
Contributor Author

That did the trick. I'm close to getting those tests to pass now.

On Tue, Aug 25, 2015 at 11:07 PM Advay Mengle [email protected]
wrote:

i guess echo is not a binary, but a built-in of the shell. try:
executableCmd = 'cmd'
and prepend '/C' as the first arg. (and everything else the same)

http://stackoverflow.com/questions/515309/what-does-cmd-c-mean


Reply to this email directly or view it on GitHub
#422 (comment)
.

brunobowden added a commit to brunobowden/j2objc-gradle that referenced this issue Aug 26, 2015
Major:
- Fix j2objc-contrib#402 - Windows 37 unit tests failures
- Fix j2objc-contrib#422 - echo command fails on Windows
- Disabled only failing test on Windows: j2objc-contrib#374

Minor:
- Fake OS specific file and path separators
- Explicit setFakeOS methods, e.g. setFakeOSWindows()
- Default to using native OS rather than fake OS for most unit tests
- Small number of unit tests use fakeOSName
- ‘inTestMustFakeOS’ setting removed
brunobowden added a commit to brunobowden/j2objc-gradle that referenced this issue Aug 26, 2015
Major:
- Fix j2objc-contrib#402 - Windows 37 unit tests failures
- Fix j2objc-contrib#422 - echo command fails on Windows
- Disabled only failing test on Windows: j2objc-contrib#374

Minor:
- Fake OS specific file and path separators
- Explicit setFakeOS methods, e.g. setFakeOSWindows()
- Default to using native OS rather than fake OS for most unit tests
- Small number of unit tests use fakeOSName
- ‘inTestMustFakeOS’ setting removed
brunobowden added a commit to brunobowden/j2objc-gradle that referenced this issue Aug 26, 2015
Major:
- Fix j2objc-contrib#402 - Windows 37 unit tests failures
- Fix j2objc-contrib#422 - echo command fails on Windows
- Disabled only failing test on Windows: j2objc-contrib#374

Minor:
- Fake OS specific file and path separators
- Explicit setFakeOS methods, e.g. setFakeOSWindows()
- Default to using native OS rather than fake OS for most unit tests
- Small number of unit tests use fakeOSName
- ‘inTestMustFakeOS’ setting removed
brunobowden added a commit to brunobowden/j2objc-gradle that referenced this issue Aug 26, 2015
Major:
- Fix j2objc-contrib#402 - Windows 37 unit tests failures
- Fix j2objc-contrib#422 - echo command fails on Windows
- Disabled only failing test on Windows: j2objc-contrib#374

Minor:
- Fake OS specific file and path separators
- Explicit setFakeOS methods, e.g. setFakeOSWindows()
- Default to using native OS rather than fake OS for most unit tests
- Small number of unit tests use fakeOSName
- ‘inTestMustFakeOS’ setting removed
@brunobowden brunobowden added this to the 0.5 Release milestone Aug 26, 2015
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

No branches or pull requests

2 participants