Manual DOS CLI Testing
This page is for manual internal command line interface (the shell, the builtin commands, packaged "external" programs, etc.) tests. Unit tests are generally preferred, but sometimes manual tests are required either due to the inherent nature of the tests, or the implementation not being in a testable state.
- Run
CONFIG -GET VER
-
SET CONFIG
should display the currently set DOS version - Reset the variable with
SET CONFIG=
- Run
CONFIG -GET DOS VER
-
SET CONFIG
should display the currently set DOS version
- Run
SET DIRCMD=
to clear the environment variable - Run
DIR
and note how it displays timestamps - Run
DIR /B
and note how it does not display timestamps - Run
SET DIRCMD=/B
- Run
DIR
again and note how there are no timestamps, as withDIR /B
- Create two files with the following contents in the same directory:
:: file1.bat
echo off
file2.bat
:: file2.bat
REM THIS SHOULDN'T BE PRINTED VIA FILE1.BAT
- Run
ECHO ON
- Upon running
FILE1.BAT
, the contents ofFILE2.BAT
should not be printed
Ensure that any instances of wildcards (* and ?) in the for command's string set properly expand to the expected files in the current directory.
Examples:
FOR %C IN (*.TXT) DO ECHO %C
-> Echoes all .TXT files in the current directory.
FOR %C IN (A??.*) DO ECHO %C
-> Echoes all files in the current directory which start with 'A', and which have a name of at MOST 3 characters and an extension.
The output of PATH
and SET PATH
should display the same contents, except that the PATH
command doesn't display the preceeding PATH=
before the directories
Wildcards are handled in both source and target of the rename. For the source, it collects a list of all files that match the wildcard in a fairly obvious manner (should be identical to the FOR command above).
Wildcards are expanded separately for the name and the extension.
It's a little tricky to explain how it expands the target wildcards so best to show examples.
Examples (these have been tested in both Dosbox Staging and real MS-DOS 6.22 via 86Box):
ren gamemaps.a test*.b
-> file gets renamed to testmaps.b
ren *.a *.b
-> changes extensions of all .a files to .b
ren a.exe test*
-> file gets renamed to test
(the a
gets dropped since test
is longer. the extension also gets dropped because there was no .
in the target).
ren gamemaps.a test*foo.c
-> file gets renamed to testmaps.c
(anything after a *
(foo
in this case) gets ignored, extension gets changed as that is expanded separately from the name).
ren gamemaps.a ?test?.*
-> file gets renamed to gtesta.a
(?
expands to a single character from the source in the same position. .*
keeps the file extension the same).
Add a variable
- Enter
SET EXAMPLE=VALUE
- Entering
SET EXAMPLE
should displayEXAMPLE=VALUE
- Entering
SET
should display all environment variables, includingEXAMPLE
Remove a variable
- Enter
SET EXAMPLE=
- Entering
SET EXAMPLE
should display a message sayingEXAMPLE
is not defined - Entering
SET
should display all environment variables andEXAMPLE
should no longer be listed
The following should display an error message
SETVER X
SETVER /B BAD ARGS
Testing to make sure that these environment variables work involves looking at access timestamps for the relevant directories. This is because temporary files are deleted after they are used, so there are no traces of the file left to verify.
- Create a new temporary directory with
MKDIR TEMPDIR
- Run
SET TEMP=TEMPDIR
- Wait one minute to allow the directory timestamp to go out of date
- Run
A | PAUSE
- Run
DIR
and make sure the timestamp ofTEMPDIR
is set to when the previous command was run - Run
SET TMP=TEMPDIR
, thenSET TEMP=
, then repeat the prevous three steps
expand_shell_variable = false
in config
- Run
ECHO ECHO %PATH% > PRNTPTH.BAT
-
PRNTPTH.BAT
should print the contents of thePATH
environment variable
expand_shell_variable = true
in config
-
ECHO %PATH%
should print the contents of thePATH
environment variable
- Run
KEYB US
- Run
ECHO é
(é -> ALT+130) - Reset DOSBox
- Run
KEYB US
- The most recent command should be
ECHO é
No Read
- Navigate to
$DOSBOX_CONFIG/shell_history.txt
- Remove the file's read permissions
-
- (Linux)
chmod u-r
- (Linux)
- Start DOSBox
- Apart from having no history, DOSBox should be working as expected
No Write
- Navigate to
$DOSBOX_CONFIG/shell_history.txt
- Remove the file's write permissions
-
- (Linux)
chmod u-w
- (Linux)
- Start DOSBox
- Shell history should still be visible (press up key to check)
- Navigate to
$DOSBOX_CONFIG/shell_history.txt
- Fill it with over 500 non-empty lines
-
- (Bash)
for i in `seq 1 501`; do echo $i >> $DOSBOX_CONFIG/shell_history.txt; done
- (Bash)
- Open DOSBox, then close it.
- Shell history file should only contain the 500 most recent lines
Exit
- Run
COMMAND
- Run
EXIT
- Pressing the up arrow should give
COMMAND
Consectutive Repetition
- Run
ECHO 1
- Run
ECHO 2
three times - Pressing the up arrow should give
ECHO 2
- Pressing up again should give
ECHO 1
- Check that DOSBox is not open
- Delete
$DOSBOX_CONFIG/shell_history.txt
- Open DOSBox
- Close DOSBox
- Check that a new
$DOSBOX_CONFIG/shell_history.txt
has been made
- Adding utilities
- Config file examples
- Dual-mouse gaming
- Getting started
- Instant launch
- Joysticks and Gamepads
- Keymapper
- Multiplayer & serial ports
- Windows
- AUTOTYPE candidates
- CDDA / GUS / MIDI games
- DOS/32A compatibility
- Dual OPL2 games
- Games with enhanced Tandy & PCjr graphics and sound
- Shaders
- Special keys
- Audio mixer signal flow diagram
- Configuration recommendations
- GUS enhancements
- MIDI
- Sound cards
- True 16-bit audio games