Reputation: 1420
We have an API which is used in a class via an exposed interface. The API is meant for UNIX family and assumes, that every UNIX has /bin/sh. Thus when running the junit test under win32 we get:
Cannot run program "/bin/sh"
Is it a catch-22 situation or there is a chance to work it out? Maybe some framework other than junit exists that can be easily run under UNIX. Thanks.
update:
The code is portable and meant to be run on several OSes (java). I want to write some unit tests (which is my own initiative) and parts of code are exposed to me as apis (being tested in another department). Now when I run tests for my own code, since it is dependent on the apis code it does some magic behind, like calling shell scripts, which do not exist under virgin win32 (we do our development using win32+ssh).
Switching to Linux is not an option at the moment. Installing Eclipse onto unix + gui via nx client can be an option though. Hope it clarifies a bit.
Upvotes: 0
Views: 1711
Reputation: 570595
Is it a catch-22 situation or there is a chance to work it out?
If I may, if your code isn't mean to be portable (I won't discuss this), why do you build it on Windows? Maybe you could add a check of the platform to avoid calling the "Unix" API when running on Windows though. Or maybe you could install cygwin to make sh
available on Windows too.
Maybe some framework other than junit exists that can be easily run under UNIX. Thanks.
Huh? Maybe I didn't get it but my understanding is that you have a problem with your code, not with JUnit. Please clarify your expectations if I'm wrong.
Upvotes: 0
Reputation: 83635
Your question is unclear. Obviously, if the code is meant for Unix it will not work under Win32, so it's natural (and OK) for the unit test to fail. Why are you testing code meant for Unix under Win32?
If you cannot test under Unix (or rewrite the code to be platform-independent), some options would be:
But you really should clear up first how you want to test your platform-specific functionality.
Upvotes: 1