[qmtest] ShellScriptTest under Windows?

Andrew Funk afunk at ll.mit.edu
Fri Feb 13 14:35:47 UTC 2004


Hi guys,

Thanks for the advice.  From what you both have said, it sounds like I
may want to go with a Python test class.  Since I need Python to run
QMTest anyway, that seems like a reasonable approach.

Not to beat a dead horse, but I just want to make sure I understand
something.  I understand that I can't expect any arbitrary Unix shell
script to run under Windows, but I think the one I used for a test "echo
Hello World!" should work on both, no?  I guess what I'm asking is, is
there any possible ShellScriptTest that would work under Windows?

Thanks,
Andy

-----Original Message-----
From: Mark Mitchell [mailto:mark at codesourcery.com] 
Sent: Friday, February 13, 2004 12:17 AM
To: Andrew Funk
Cc: 'Scott Lowrey'; qmtest at codesourcery.com
Subject: Re: [qmtest] ShellScriptTest under Windows?


Andrew Funk wrote:

>Hi,
>
>I did read that documentation in the code and I thought about editing 
>the context to use a different shell.  However I guess what I would 
>like is for QMTest to have the same behavior under Unix and Windows out

>of the box, or if not then to know exactly what are the limitations so 
>that I can design my tests for both OS.
>  
>
I think it depends on what you mean by "the same behavior".  To us, 
"running the native shell, whatever it may be" is "the same behavior".  
It sounds like to you, "running the same shell, preferably a POSIX 
Bourne shell" would be "the same behavior."

Of course, there's no way (in general) to run a Bourne shell under 
Windows; such a thing is not always installed.

If you want that level of portability, I can see a few choices:

* Require that your users install a Bourne shell and then either set the

QMTest context variable to use that shell, or, alternatively, subclass 
ShellScriptTest so that it explicitly uses a Bourne shell.

* Encode the logic you would normally express in the shell script 
directly in Python, depending on the portability you get that way, 
rather than trying to use a shell script.

* Have your test database pick different shell scripts depending on the 
host OS, magically substituting DOS commands for Bourne shell commands 
when on Windows.

Best,

-- 
Mark Mitchell
CodeSourcery, LLC
(916) 791-8304
mark at codesourcery.com





More information about the qmtest mailing list