# Command Line Usage

To facilitate automated testing, the test vector feature can be run from the command line:

> `logisim --test-vector <circuit_name> <test_vector_file> <project.circ>`

Or using the JAR file:

> `java -jar logisim-evolution.jar --test-vector <circuit_name> <test_vector_file> <project.circ>`

## Arguments

- <circuit_name>: The name of the circuit to test (must match a circuit in the project file)
- <test_vector_file>: Path to the test vector file (e.g., `TestsDLatch.txt`)
- <project.circ>: Path to the Logisim project file containing the circuit

## Example

> `java -jar logisim-evolution.jar --test-vector dlatch TestsRegisterFile.txt /home/user/Computer.circ`

## What the Command Does

The command will:

1. Load the specified circuit from the project file
2. Load and parse the test vector file
3. Run all tests (respecting sequential execution rules)
4. Print results showing passed and failed tests
5. Exit with status code 0 on success, non-zero on failure

## Command Output Examples

The result of a successful test will be sent to standard output (stdout), for example:

    Loading test vector "testv1b.txt" ...
    Running 4 vectors ...
    1
    2
    3
    4

    Passed : 4, Failed : 0

And in case of failure:

    Loading test vector "testv1a.txt" ...
    Running 4 vectors ...
    1
    2
    3

      ob = 0 (expected 1)
    4

      ob = 1 (expected 0)

    Passed : 2, Failed : 2

Note: In the error output (stderr) you will read:

    Error on test vector 3:
    Error on test vector 4:

Previous: Sequential Testing | Next: Tips and Best Practices.