Add a testing suite for CMD based on CMD scripts.
[reactos.git] / rostests / win32 / cmd / script_testsuite / tests / environment.cmd
1 ::
2 :: PROJECT: ReactOS CMD Testing Suite
3 :: LICENSE: GPL v2 or any later version
4 :: FILE: tests/environment.cmd
5 :: PURPOSE: Tests for the environment (like automatically set variables)
6 :: COPYRIGHT: Copyright 2008 Colin Finck <mail@colinfinck.de>
7 ::
8
9 :: ~0 contains the called path to the current script file
10 call :_testvar %~0 ~0
11
12 :: ~d0 contains the drive of the current script file
13 call :_testvar %~d0 ~d0
14
15 :: ~p0 contains the path of the current script file without the drive letter
16 call :_testvar %~p0 ~p0
17
18 :: ~dp0 contains the path to the current script file with the drive letter
19 call :_testvar %~dp0 ~dp0
20
21 :: ~dpf0 contains the full path to the current script file
22 call :_testvar %~dpf0 ~dpf0
23
24 :: ~n0 contains the name of the current script file without extension
25 call :_testvar %~n0 ~n0
26
27 :: ~x0 contains the extension of the current script file
28 call :_testvar %~x0 ~x0
29
30 :: ~a0 contains the attributes of the current script file
31 call :_testvar %~a0 ~a0
32
33 :: ~t0 contains the date and time of the current script file
34 call :_testvar "%~t0" ~t0
35
36 :: ~z0 contains the file size of the current script file in bytes
37 call :_testvar %~z0 ~z0
38
39 :: ~s0 and ~spf0 contain the short path to the current script file
40 call :_testvar %~s0 ~s0
41 call :_testvar %~s0 ~s0 %~spf0%
42
43 :: Now try to verify that the information is valid
44 set test_path=%~d0%~p0%~n0%~x0
45 call :_testvar %test_path% test_path %~dpf0
46
47 goto :EOF