wren-cli
wren-cli copied to clipboard
(enh) adds Process.exec(cmd, [args], [cwd],[env])
import "os" for Process
Process.exec("echo", ["how","are","you"])
- It's not connected to any input/output streams.
- Return value is the process's exit code.
- This will sleep until the process finishes.
Notes:
Process.exec(binary, args) { exec(binary, args, null, null) } ,
Process.exec(binary, args, cwd) { exec(binary, args, cwd, null) }
Process.exec(binary, args, cwd, env) { exec_ ... }
I think I know what you mean about tests now... I'd wager the python stuff doesn't understand the structure of the Wren code so while you can have the different branches doing slightly different things, the output needs to match for every single platform? Anyways, the tests still feel messy to me, but they cover the most basic cases. Since we don't need absolute paths I wager they likely work on other *nix as well, hence my making isWindows the special case.
We just need to find equivalencies on Windows. All tests pass for me here on OS X.
Issues:
- I had to change the stderr to stdout to get it within the scope of tests. If there is some other way to deal with this I don't know what it is.
- Are these errors that can happen runtime errors? We're not using the
expect errorand I'm not 100% sure when we're suppose to, etc.
I didn't spend too much time trying to understand the python test runner. I stopped when I had the basic tests cases covered. I'm pretty frustrated with the testing tooling and think it'd be much nicer if we picked any one of the Wren testing frameworks instead and switched. Perhaps a topic for another time.
rebased on main
Ruby, inline doesn't seem to work for me here:
Undefined symbols for architecture x86_64:
"_cli_strdup", referenced from:
_processExec in os.o
ld: symbol(s) not found for architecture x86_64
Removing inline allows the compile to proceed normally. Weird. Any ideas?