Marvinette
An easy-to-use functional testing framework
|
$HOME
folder (or a directory where you wouldn't want to move the repository)Warning If installation fails, try installation using sudo
PATH
environment variableWarning: Once you executed the command, you must not move the Marvinette folder. If you do, you'll have to execute the install command again
Your tests are ready to be executed!
You will be asked to choose which test to execute
Use the framework using the following command-line instructions:
The framework's configuration file, Marvinette.json
, holds the following information:
name
: The name of the projectbinary name
: the name of the binary/script to executebinary path
: the path to the binary/scriptinterpreter
: the interpreter of the script (for example: python3 for a python script, or nothing for binary executables)tests folder
: the path to the tests' folderIf you do not want to use the command-line interface to configure your project, use the --create-sample-project
. It will create a sample configuration file and you change the values by yourself
Upon test creation, several files are generated in the testFolder
/testName
folder:
config.json
file, holding the following values:commandLineArguments
: holds the arguments which will be passed to the program.interpreterArguments
: holds the arguments which will be passed to the program's interpreter. The arguments will be read only if an interpreter is set in the Marvinette.json
file.expectedReturnCode
: the returned code expected from the program's execution (if the field's value is not a number, the comparison will be scrapped).stdoutFilter
: the standard output the command will be piped onto.stderrFilter
: the error output the command will be piped onto.emptyEnv
: if true, the test command will be executed within an empty environment.setup
: this command will be executed before the program is launched.teardown
: this command will be executed after the program is launched.Any of the fields can be null. If that's the case, the described action will not be executed.
stdinput
: if the file exists, the content of the file will be standard input to the program.expectedStdout
: if the file exists, the (filtered) standard output will be compared to the file's content. If there is no such file, no comparison will be done.expectedStderr
: if the file exists, the (filtered) error output will be compared to the file's content. If there is no such file, no comparison will be done.If a setup
, stdout/stderrFilter
or teardown
command doesn't return 0, the test will fail.
Upon creation, feel free to change the files' content by yourself. Be careful not to leave any useless line breaks of trailing spaces
You can use Marvinette on an Unix-based OS or on Windows!
Also, you'll need PHP >= 7.4. No other library needed (the vendor
folder and composer configuration file are used for Marvinette's unit tests)