aboutsummaryrefslogtreecommitdiff
path: root/tests/exec2.test
AgeCommit message (Collapse)AuthorFilesLines
2023-07-04tcltest: rework constraint systemSteve Bennett1-7/+6
Now 'constraint cmd|package' is like 'needs' but sets a constraint The command to 'needs cmd' and 'constraint cmd' can now take a subcommand to check. Add 'constraint|needs eval|expr' to make some constraint checks simpler. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-06tests: exec2: may need to set default SIGPIPE dispositionSteve Bennett1-1/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-06tests: Don't run exec2 in a child interpreterSteve Bennett1-1/+2
Since signals aren't supported there and we need signals for some of these tests. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-07-31tests: Fix SIGPIPE testsSteve Bennett1-9/+3
These tests were only working accidentally (typo >$@w). In fact since open |... already provides a pipe on output there is no need to create one manually, so the first test can run under Tcl too. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-05-08tests: add tests for wait -1Steve Bennett1-0/+7
Only on unix systems, wait for any child process This was broken with a recent commit, so add an explicit test Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-04-14win32: Fix process handle vs pid distinctionSteve Bennett1-1/+1
On win32, a process is identified by a HANDLE, but for identifying a running process we should use GetProcessId() to return a meaningful integer. This means we need to be able to back and forth between a pid and a process handle (phandle). We also need to be careful to get the pid before the process handle closes since it isn't available afterwards. Also call the handle to intptr_t for open_osfhandle() to avoid a compiler warning. Fixes #217 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-01-03bootstrap jimsh: pass all testsSteve Bennett1-6/+13
In order to test bootstrap jimsh, it is very helpful if it can pass all the unit tests. - Set tcl_platform(bootstrap) to 1 for bootstrap jimsh or 0 otherwise - Use getref to determine in we have references, not ref since we implement a poor-man's ref for bootstrap jimsh - bootstrap jimsh package doesn't return a "Can't load package" message if loading the package fails - exec tests using [open |command] need pipe - bootstrap jimsh can't set file times with [file mtime] Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-05-04tests: Fixes to recent tests for windowsSteve Bennett1-2/+2
Mostly just avoiding running certain tests, but also: - rename() won't overwrite an existing file on Windows - ensure that eof returns 0 or 1 - in aio.test, create and read the file in binary mode Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-05-04tests: Add many new additional tests for code coverageSteve Bennett1-3/+67
readdir, tty, utf8, signal, alarm, kill, file, jimsh, posix, aio, history, interp, pack, unpack, eventloop, exec, load, package, regexp, regsub Signed-off-by: Steve Bennett <steveb@workware.net.au>
2019-09-06signal: Add 'signal block' supportSteve Bennett1-7/+25
This allows a signal to be blocked by setting it's handler to SIG_IGN Can be used to block SIGPIPE for exec Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-11-26tests: Make the failing SIGPIPE tests go away on AppVeyorSteve Bennett1-1/+7
Work around the problem by skipping the test Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-11-04tests: exec2-3.2 now passes on OpenBSDSteve Bennett1-3/+3
Reported-by: Stuart Cassoff <stwo@bell.net> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-10-21tests: Use a more explicit approach to test SIGPIPESteve Bennett1-2/+8
Write to a closed pipe in exec2-3.2 to force SIGPIPE Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-10-17tests: Try to fix exec2-3.2 on WindowsSteve Bennett1-2/+2
On some mingw platforms exec2-3.2 isn't producing SIGPIPE Try to make it do so. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-10-17signal, exec, wait, pid: improvements, especially to execSteve Bennett1-0/+26
- fix popen [open "|pipeline ..."] to return meaningful status in close (but note that stderr is not captured) - popen pipelines can now be used as the target of exec redirection - overally improvements to exec on windows. Now crt file descriptors are used throughout - add support for [pid], [wait] and popen on windows - os.wait is now wait, and integrates with [exec ... &] to be able to wait for running background tasks - [socket pipe] is now also [pipe] and is supported on windows - [file tempfile] is supported on windows - move duplicated code between jim-aio.c and jim-exec.c to jimiocompat.c - Fix [exec] on windows to match unix semantics wrt sharing the parent stream unless redirected rather than using /dev/null - On windows redirect to or from /dev/null is automatically converted to NUL: - If signal support is disabled, implement a minimal Jim_SignalId() for exec and wait - aio now supports getfd, to return the underlying file descriptor. This is used by exec to support redirection, and allows popen channels to support exec redirection. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-12-12Restore the environment after tests/exec2.testSteve Bennett1-0/+4
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-09-12Implement full [exec] on mingw/msysSteve Bennett1-8/+8
This also involves some restructuring of the existing implementation to allow for as much reuse as possible. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-11-22Overhaul unit test frameworkSteve Bennett1-2/+5
Much closer to tcltest now, including constraints. Try to get all appropriate tests running under both Jim and Tcl. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Skip tests for features which are not availableSteve Bennett1-0/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Use $::env to build environment for execSteve Bennett1-0/+39
Also, switch to using 'sh -c' for the vfork() implementation because it then allows command line redirection, pipes and setting the environment. Signed-off-by: Steve Bennett <steveb@workware.net.au>