=?UTF-8?Q?Fr=C3=A9d=C3=A9ric=20Delanoy=20?=: cmd: Show that windows doesn' t lock/prevent access to batch file during execution.
Alexandre Julliard
julliard at winehq.org
Mon Sep 12 11:43:00 CDT 2011
Module: wine
Branch: master
Commit: cb63445b5e0249b9bf31b9749b94cea76d78413e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=cb63445b5e0249b9bf31b9749b94cea76d78413e
Author: Frédéric Delanoy <frederic.delanoy at gmail.com>
Date: Sun Sep 11 17:14:54 2011 +0200
cmd: Show that windows doesn't lock/prevent access to batch file during execution.
---
programs/cmd/tests/test_builtins.cmd | 21 +++++++++++++++++++++
programs/cmd/tests/test_builtins.cmd.exp | 5 +++++
2 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd
index c5f4bd9..88265f7 100644
--- a/programs/cmd/tests/test_builtins.cmd
+++ b/programs/cmd/tests/test_builtins.cmd
@@ -1256,6 +1256,27 @@ echo echo non-builtin dir> dir.cmd
call dir /b
cd .. & rd /s/q foobar
+echo ------------ Testing cmd invocation ------------
+rem FIXME: only a stub ATM
+echo ... a batch file can delete itself ...
+echo del foo.cmd>foo.cmd
+cmd /q /c foo.cmd
+if not exist foo.cmd (
+ echo file correctly deleted
+) else (
+ echo file should be deleted!
+ del foo.cmd
+)
+echo ... a batch file can alter itself ...
+echo echo bar^>foo.cmd>foo.cmd
+cmd /q /c foo.cmd > NUL 2>&1
+if exist foo.cmd (
+ type foo.cmd
+ del foo.cmd
+) else (
+ echo file not created!
+)
+
echo ------------ Testing setlocal/endlocal ------------
call :setError 0
rem Note: setlocal EnableDelayedExtension already tested in the variable delayed expansion test section
diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp
index 7dd6207..5c022ff 100644
--- a/programs/cmd/tests/test_builtins.cmd.exp
+++ b/programs/cmd/tests/test_builtins.cmd.exp
@@ -723,6 +723,11 @@ foo ''
@todo_wine at 1
@todo_wine at 1
non-builtin dir
+------------ Testing cmd invocation ------------
+... a batch file can delete itself ...
+ at todo_wine@file correctly deleted
+... a batch file can alter itself ...
+ at todo_wine@bar
------------ Testing setlocal/endlocal ------------
...enable/disable extensions
@todo_wine at ErrLev:@space@
More information about the wine-cvs
mailing list