Utility for testing a program that runs file operations.
- TypeScript 84.7%
- Shell 15.3%
| example | ||
| package | ||
| src | ||
| .gitignore | ||
| build | ||
| deno.json | ||
| deno.lock | ||
| filecase.ts | ||
| LICENSE | ||
| README.md | ||
| VERSION | ||
Filecase
Utility for testing a program that runs file operations.
Usage
filecase --help
# filecase 1.0.0 - Utility for testing a program that runs file operations.
# Usage :
# filecase [options...] <suites...>
#
# Options :
# -h, --help Prints this message.
# --version Prints the version of this software.
# -c, --capture Captures stdout and stderr from the scenario.
#
# Description :
# Runs a set of test suites, each suite contains test cases. They are
# composed of a workdir directory, a scenario executable and an expects
# directory.
#
# While a test is run, the workdir is copied to a temporary directory, the
# scenario is ran with the current working dirrectory being set inside this
# temporary directory. Finally, the content of the temporary directory is
# compared with the content of the expects directory.
#
# A test case fails if the scenario fails at some point or if there are
# differences between the temporary directory and the expected directory
# after the execution of the scenario.
Example
Design
This program runs all cases in the suites given as arguments, reporting test case failures and summarizing overall success.
Suite
A test suite is a directory containing test cases. The name of the directory is the name of the test suite.
Case
A case is a directory containing :
./scenarioAn executable that performs some file operations../workdir/*A directory with the initial file state../expects/*A directory with the expected result.
When a case is run, its ./workdir/ is copied to a temporary directory (tempdir/), then the scenario is run as a new
process with its current working directory set to the tempdir/. Finally, the content of the tempdir/ is compared
with the content of the ./expects/ directory.
A case fails if :
- The execution of
./scenariohas exited with a non-zero status code. - The content of
tempdir/differs from the content of./expects/.
The name of the case is the name of the case directory.
Licensing
Copyright © 2026 Matthieu Jolimaitre. Licensed under the EUPL
