mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-27 23:11:18 -08:00
tests: add external process API suite
This commit is contained in:
parent
ee0152431c
commit
0d3ef482cf
3 changed files with 32 additions and 2 deletions
|
|
@ -22,7 +22,8 @@
|
|||
:default-component-class asdf:cl-source-file.lsp
|
||||
:components
|
||||
((:file "external-formats" :if-feature :unicode)
|
||||
(:file "ieee-fp" :if-feature :ieee-floating-point)))))
|
||||
(:file "ieee-fp" :if-feature :ieee-floating-point)
|
||||
(:file "external-process")))))
|
||||
|
||||
(asdf:defsystem #:ecl-tests/stress
|
||||
:serial t
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
(suite 'make-check
|
||||
'(features/eformat
|
||||
features/ieee-fp
|
||||
features/eprocess
|
||||
regressions/ansi+
|
||||
regressions/mixed
|
||||
regressions/cmp
|
||||
|
|
@ -47,7 +48,8 @@
|
|||
|
||||
(suite 'features
|
||||
'(features/eformat
|
||||
features/ieee-fp))
|
||||
features/ieee-fp
|
||||
features/eprocess))
|
||||
|
||||
|
||||
;;; Some syntactic sugar for 2am
|
||||
|
|
|
|||
27
src/tests/features/external-process.lsp
Normal file
27
src/tests/features/external-process.lsp
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
;;;; -*- Mode: Lisp; Syntax: Common-Lisp; indent-tabs-mode: nil -*-
|
||||
;;;; vim: set filetype=lisp tabstop=8 shiftwidth=2 expandtab:
|
||||
|
||||
;;;; Author: Daniel Kochmański
|
||||
;;;; Created: 2016-09-07
|
||||
;;;; Contains: External process interaction API
|
||||
;;;;
|
||||
|
||||
(in-package :cl-test)
|
||||
|
||||
(suite 'features/eprocess)
|
||||
|
||||
(test external-process.0001.run-program/wait/terminate
|
||||
(let ((p (nth-value 2 (ext:run-program #-windows "sleep"
|
||||
#+windows "timeout"
|
||||
(list "3") :wait nil))))
|
||||
(is (eql :running (ext:external-process-wait p nil))
|
||||
"process doesn't run")
|
||||
(ext:terminate-process p)
|
||||
(sleep 1)
|
||||
(multiple-value-bind (status code)
|
||||
(ext:external-process-wait p nil)
|
||||
(is (eql :signaled status)
|
||||
"status is ~s, should be ~s" status :signalled)
|
||||
(is (eql ext:+sigterm+ code)
|
||||
"signal code is ~s, should be ~s" code ext:+sigterm+))
|
||||
(finishes (ext:terminate-process p))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue