kitty
kitty copied to clipboard
Clean up compilation build files
Either automatically delete the file at exe_path or add a post_test-like command to the config (command that runs after a test is complete).
do we have to add this in Github Actions?
do we have to add this in Github Actions?
No, this would be something that kitty does while/after running kitty test. The two solutions I suggest would be as follows:
Proposal 1
A after_test_command field can be added to each language in the kitty.yml file. Assume we use Java - it would be nice to automatically remove any built .class file. An example config could be
- name: Java
file_extension: java
compile_command: javac $SRC_PATH
run_command: java -cp $DIR_PATH $SRC_FILE_NAME_NO_EXT
# Below is new (not implemented)
after_test_command: find . -name "*.class" -type f -delete
Proposal 2
The code automatically removes the file at EXE_PATH (whose value is generated when parsing the config file) after the test runner has completed.
I prefer proposal 1, because it makes it far easier to customise on a per-language basis.