# GTest Stage for Test Case-based testing via Google Test. - Kind: Grading Stage - Behavior: Compiles and runs test cases written with Google Test framework. ## Config ``` gTest: srcInput: [String] # list of files containing the program source code testInput: [String] # list of files containing the Google Test cases testOut: String? # test executable name [default: a.out] compileArgs: [String]? # compilation arguments for the test executable [default: ["-pedantic", "-Wall", "-Wextra", "-g"]] srcCompileArgs: [String]? # compilation arguments for `srcInput` testCompileArgs: [String]? # compilation arguments for `testInput` runArgs: [String]? # runtime arguments for the test executable [default: []] version: String? # Google Test library version to use [default: "1.10.0"] score: Double? # Total Score of this stage treatDenormalScore: DenormalPolicy? # Policy to use when resulting score is NaN scoreWeighting: ScoreWeighting? # Weighting policy of this stage ``` - Regardless of the value of `_settings.language`, `testInput` is always compiled using the C++ compiler. - This is necessary since GTest is a C++ test framework and therefore its sources must be compiled using C++. - This stage implements *Total-Based Scorable* and *Weighted Scorable*. - The scorable policies are mutually exclusive; Enabling both is an error. - See [Scorable.md](../Scorable.md) for more information on `score`, `treatDenormalScore`, and `scoreWeighting`. - See [XUnit.md](XUnit.md) for more information on the predicates available for `scoreWeighting`. ### Example ``` gTest: srcInput: ["main.cpp"] testInput: ["main-test.cpp"] testOut: "a.out" compileArgs: ["-pedantic", "-Wall", "-Wextra", "-g"] runArgs: [] version: "1.10.0" ``` ## Report See [XUnit report](XUnit.md).