GildedRose-Refactoring-Kata/Java/texttest_rig.py
emily 755ed77692 Improve texttest documentation
Specifically make it easier to test the Java version.
Added a test rig so you can use gradle to run the java version
2023-11-03 10:32:29 +01:00

15 lines
553 B
Python

#!/usr/bin/env python
"""
This script uses Gradle to execute the TexttestFixture.
It is designed to be used by TextTest and specified in the file 'texttests/config.gr' in this repo.
It is more convenient for TextTest to use since Gradle needs
several arguments in addition to the one the TextTest fixture needs.
"""
import os
import subprocess
import sys
args = " ".join(sys.argv[1:])
TEXTTEST_HOME = os.environ.get("TEXTTEST_HOME", os.getcwd())
subprocess.run(f"{TEXTTEST_HOME}/Java/gradlew -p {TEXTTEST_HOME}/Java -q text --args {args}", shell=True)