You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1314,10 +1314,10 @@ Arguments:
1314
1314
- `CODE_FILE`: The filename of the code file to be tested.
1315
1315
1316
1316
Options:
1317
-
- `--output LOCATION`: Specify where to save the generated test file. The default file name is `test_<basename>.<language_file_extension>`.
1317
+
- `--output LOCATION`: Specify where to save the generated test file. The default file name is `test_<basename>.<language_file_extension>`. If an output file with the specified name already exists, a new file with a numbered suffix (e.g., `test_calculator_1.py`) will be created instead of overwriting.
1318
1318
- `--language`: Specify the programming language. Defaults to the language specified by the prompt file name.
1319
1319
- `--coverage-report PATH`: Path to the coverage report file for existing tests. When provided, generates additional tests to improve coverage.
1320
-
- `--existing-tests PATH`: Path to the existing unit test file. Required when using --coverage-report.
1320
+
- `--existing-tests PATH [PATH...]`: Path(s) to the existing unit test file(s). Required when using --coverage-report. Multiple paths can be provided.
1321
1321
- `--target-coverage FLOAT`: Desired code coverage percentage to achieve (default is 90.0).
1322
1322
- `--merge`: When used with --existing-tests, merges new tests with existing test file instead of creating a separate file.
1323
1323
@@ -1346,9 +1346,9 @@ could influence the output of the `pdd test` command when run in the same direct
1346
1346
pdd [GLOBAL OPTIONS] test --output tests/test_factorial_calculator.py factorial_calculator_python.prompt src/factorial_calculator.py
1347
1347
```
1348
1348
1349
-
2. Generate additional tests to improve coverage:
1349
+
2. Generate additional tests to improve coverage (with multiple existing test files):
- `PROMPT_FILE`: The filename of the prompt file that generated the code under test.
1467
1467
- `CODE_FILE`: The filename of the code file to be fixed.
1468
-
- `UNIT_TEST_FILE`: The filename of the unit test file.
1468
+
- `UNIT_TEST_FILES`: The filename(s) of the unit test file(s). Multiple files can be provided, and each will be processed individually.
1469
1469
- `ERROR_FILE`: The filename containing the unit test runtime error messages. Optional and does not need to exist when used with the `--loop` command.
1470
1470
1471
1471
Options:
1472
-
- `--output-test LOCATION`: Specify where to save the fixed unit test file. The default file name is `test_<basename>_fixed.<language_file_extension>`. If an environment variable `PDD_FIX_TEST_OUTPUT_PATH` is set, the file will be saved in that path unless overridden by this option.
1472
+
- `--output-test LOCATION`: Specify where to save the fixed unit test file. The default file name is `test_<basename>_fixed.<language_file_extension>`. **Warning: If multiple `UNIT_TEST_FILES` are provided along with this option, only the fixed content of the last processed test file will be saved to this location, overwriting previous results. For individual fixed files, omit this option.**
1473
1473
- `--output-code LOCATION`: Specify where to save the fixed code file. The default file name is `<basename>_fixed.<language_file_extension>`. If an environment variable `PDD_FIX_CODE_OUTPUT_PATH` is set, the file will be saved in that path unless overridden by this option.
1474
1474
- `--output-results LOCATION`: Specify where to save the results of the error fixing process. The default file name is `<basename>_fix_results.log`. If an environment variable `PDD_FIX_RESULTS_OUTPUT_PATH` is set, the file will be saved in that path unless overridden by this option.
1475
1475
- `--loop`: Enable iterative fixing process.
@@ -1481,8 +1481,8 @@ Options:
1481
1481
When the `--loop` option is used, the fix command will attempt to fix errors through multiple iterations. It will use the specified verification program to check if the code runs correctly after each fix attempt. The process will continue until either the errors are fixed, the maximum number of attempts is reached, or the budget is exhausted.
1482
1482
1483
1483
Outputs:
1484
-
- Fixed unit test file
1485
-
- Fixed code file
1484
+
- Fixed unit test file(s).
1485
+
- Fixed code file.
1486
1486
- Results file containing the LLM model's output with unit test results.
1487
1487
- Print out of results when using '--loop' containing:
In this example, `factorial_calculator_python.prompt` is the prompt file that originally generated the code under test.
1497
+
In this example, `pdd fix` will be run for each test file, and the fixed test files will be saved as `tests/test_factorial_calculator_fixed.py` and `tests/test_factorial_calculator_edge_cases_fixed.py`.
1498
1498
1499
1499
1500
1500
#### Agentic Fallback Mode
@@ -1784,7 +1784,7 @@ Arguments:
1784
1784
- `DESIRED_OUTPUT_FILE`: File containing the desired (correct) output of the program.
1785
1785
1786
1786
Options:
1787
-
- `--output LOCATION`: Specify where to save the generated unit test. The default file name is `test_<basename>_bug.<language_extension>`.
1787
+
- `--output LOCATION`: Specify where to save the generated unit test. The default file name is `test_<basename>_bug.<language_extension>`. If an output file with the specified name already exists, a new file with a numbered suffix (e.g., `test_calculator_bug_1.py`) will be created instead of overwriting.
1788
1788
- `--language`: Specify the programming language for the unit test (default is "Python").
0 commit comments