Using tmc-langs and the tmc-csharp-runner requires you have installed the following:
The C#-fork of tmc-langs can be cloned from https://github.com/TMC-CSharp/tmc-langs.
Build the project with mvn clean package -DskipTests in the tmc-langs root folder. Tests are broken and skipped for now. Install the dependency to your local Maven repository with mvn clean install -U.
The tmc-langs cli (command line interface) can be used to run tests for an exercise.
Using the cli requires you have built the CSharp runner and have set the environment variable TMC_CSHARP_BOOTSTRAP_PATH (See the tmc-csharp-runner section below).
To run tests for an exercise, use the command java -jar target\tmc-langs-cli-0.7.17-SNAPSHOT.jar run-tests --exercisePath [full path to exercise root folder] --outputPath testResults.txt in the langs root folder.
This will run tests for the exercise and save the test results to the file testResults.txt.
The runner can be cloned from https://github.com/TMC-CSharp/tmc-csharp-runner.
Build the runner with dotnet build in the runner root folder.
Using the runner with tmc-langs requires you to set the full path to the compiled Bootstrap.dll file into the environment variable TMC_CSHARP_BOOTSTRAP_PATH. The Bootstrap.dll file is contained in the folder [tmc runner root]/Bootstrap/bin/Debug/netcoreapp3.1/. If on Windows, use double backslashes as folder separators in the path. For example C:\\whatever\\tmc-csharp-runner\\Bootstrap\\bin\\Debug\\netcoreapp3.1\\Bootstrap.dll.
The runner can be used standalone to build and run tests for an exercise.
To test an exercise, use the command dotnet [path to Bootstrap.dll] -t --project-dir [path to exercise root folder]. This will generate a (hidden) file called .tmc_test_results.json in the exercise root folder containing the test results in json form.
- Open terminal in the project root folder
- Run "
bash GetTestReport" - Go to direcotry Tests -> coveragereport
- Open index.htm on your internet browser