JafarAbdi / neotest-gtest

Neotest adapter for projects using gtest and cmake
MIT License
2 stars 1 forks source link

Add TEST_P support #6

Closed JafarAbdi closed 2 years ago

JafarAbdi commented 2 years ago

It's kinda hacky, this's an example of an output with --gtest_filter='*TrajectoryControllerTestParameterized.check_interface_names_with_command_joints*'

{
  "tests": 9,
  "failures": 0,
  "disabled": 0,
  "errors": 0,
  "timestamp": "2022-08-24T17:50:52Z",
  "time": "2.408s",
  "name": "AllTests",
  "testsuites": [
    {
      "name": "PositionTrajectoryControllers\/TrajectoryControllerTestParameterized",
      "tests": 3,
      "failures": 0,
      "disabled": 0,
      "errors": 0,
      "timestamp": "2022-08-24T17:50:52Z",
      "time": "0.811s",
      "testsuite": [
        {
          "name": "cleanup\/0",
          "value_param": "({ \"position\" }, { \"position\" })",
          "status": "RUN",
          "result": "COMPLETED",
          "timestamp": "2022-08-24T17:50:52Z",
          "time": "0.279s",
          "classname": "PositionTrajectoryControllers\/TrajectoryControllerTestParameterized"
        },
        {
          "name": "cleanup\/1",
          "value_param": "({ \"position\" }, { \"position\", \"velocity\" })",
          "status": "RUN",
          "result": "COMPLETED",
          "timestamp": "2022-08-24T17:50:52Z",
          "time": "0.267s",
          "classname": "PositionTrajectoryControllers\/TrajectoryControllerTestParameterized"
        },
        {
          "name": "cleanup\/2",
          "value_param": "({ \"position\" }, { \"position\", \"velocity\", \"acceleration\" })",
          "status": "RUN",
          "result": "COMPLETED",
          "timestamp": "2022-08-24T17:50:53Z",
          "time": "0.265s",
          "classname": "PositionTrajectoryControllers\/TrajectoryControllerTestParameterized"
        }
      ]
    },
    {
      "name": "PositionVelocityTrajectoryControllers\/TrajectoryControllerTestParameterized",
      "tests": 3,
      "failures": 0,
      "disabled": 0,
      "errors": 0,
      "timestamp": "2022-08-24T17:50:53Z",
      "time": "0.797s",
      "testsuite": [
        {
          "name": "cleanup\/0",
          "value_param": "({ \"position\", \"velocity\" }, { \"position\" })",
          "status": "RUN",
          "result": "COMPLETED",
          "timestamp": "2022-08-24T17:50:53Z",
          "time": "0.266s",
          "classname": "PositionVelocityTrajectoryControllers\/TrajectoryControllerTestParameterized"
        },
        {
          "name": "cleanup\/1",
          "value_param": "({ \"position\", \"velocity\" }, { \"position\", \"velocity\" })",
          "status": "RUN",
          "result": "COMPLETED",
          "timestamp": "2022-08-24T17:50:53Z",
          "time": "0.265s",
          "classname": "PositionVelocityTrajectoryControllers\/TrajectoryControllerTestParameterized"
        },
        {
          "name": "cleanup\/2",
          "value_param": "({ \"position\", \"velocity\" }, { \"position\", \"velocity\", \"acceleration\" })",
          "status": "RUN",
          "result": "COMPLETED",
          "timestamp": "2022-08-24T17:50:53Z",
          "time": "0.266s",
          "classname": "PositionVelocityTrajectoryControllers\/TrajectoryControllerTestParameterized"
        }
      ]
    },
    {
      "name": "PositionVelocityAccelerationTrajectoryControllers\/TrajectoryControllerTestParameterized",
      "tests": 3,
      "failures": 0,
      "disabled": 0,
      "errors": 0,
      "timestamp": "2022-08-24T17:50:54Z",
      "time": "0.794s",
      "testsuite": [
        {
          "name": "cleanup\/0",
          "value_param": "({ \"position\", \"velocity\", \"acceleration\" }, { \"position\" })",
          "status": "RUN",
          "result": "COMPLETED",
          "timestamp": "2022-08-24T17:50:54Z",
          "time": "0.265s",
          "classname": "PositionVelocityAccelerationTrajectoryControllers\/TrajectoryControllerTestParameterized"
        },
        {
          "name": "cleanup\/1",
          "value_param": "({ \"position\", \"velocity\", \"acceleration\" }, { \"position\", \"velocity\" })",
          "status": "RUN",
          "result": "COMPLETED",
          "timestamp": "2022-08-24T17:50:54Z",
          "time": "0.265s",
          "classname": "PositionVelocityAccelerationTrajectoryControllers\/TrajectoryControllerTestParameterized"
        },
        {
          "name": "cleanup\/2",
          "value_param": "({ \"position\", \"velocity\", \"acceleration\" }, { \"position\", \"velocity\", \"acceleration\" })",
          "status": "RUN",
          "result": "COMPLETED",
          "timestamp": "2022-08-24T17:50:54Z",
          "time": "0.264s",
          "classname": "PositionVelocityAccelerationTrajectoryControllers\/TrajectoryControllerTestParameterized"
        }
      ]
    }
  ]
}
JafarAbdi commented 2 years ago

Output for TEST/TEST_F

{
  "tests": 8,
  "failures": 0,
  "disabled": 0,
  "errors": 0,
  "timestamp": "2022-08-24T17:48:47Z",
  "time": "0s",
  "name": "AllTests",
  "testsuites": [
    {
      "name": "TestTrajectory",
      "tests": 8,
      "failures": 0,
      "disabled": 0,
      "errors": 0,
      "timestamp": "2022-08-24T17:48:47Z",
      "time": "0s",
      "testsuite": [
        {
          "name": "initialize_trajectory",
          "status": "RUN",
          "result": "COMPLETED",
          "timestamp": "2022-08-24T17:48:47Z",
          "time": "0s",
          "classname": "TestTrajectory"
        },
        {
          "name": "sample_trajectory_positions",
          "status": "RUN",
          "result": "COMPLETED",
          "timestamp": "2022-08-24T17:48:47Z",
          "time": "0s",
          "classname": "TestTrajectory"
        },
        {
          "name": "interpolation_pos_vel",
          "status": "RUN",
          "result": "COMPLETED",
          "timestamp": "2022-08-24T17:48:47Z",
          "time": "0s",
          "classname": "TestTrajectory"
        },
        {
          "name": "interpolation_pos_vel_accel",
          "status": "RUN",
          "result": "COMPLETED",
          "timestamp": "2022-08-24T17:48:47Z",
          "time": "0s",
          "classname": "TestTrajectory"
        },
        {
          "name": "sample_trajectory_velocity_with_interpolation",
          "status": "RUN",
          "result": "COMPLETED",
          "timestamp": "2022-08-24T17:48:47Z",
          "time": "0s",
          "classname": "TestTrajectory"
        },
        {
          "name": "sample_trajectory_velocity_with_interpolation_strange_without_vel",
          "status": "RUN",
          "result": "COMPLETED",
          "timestamp": "2022-08-24T17:48:47Z",
          "time": "0s",
          "classname": "TestTrajectory"
        },
        {
          "name": "sample_trajectory_acceleration_with_interpolation",
          "status": "RUN",
          "result": "COMPLETED",
          "timestamp": "2022-08-24T17:48:47Z",
          "time": "0s",
          "classname": "TestTrajectory"
        },
        {
          "name": "skip_interpolation",
          "status": "RUN",
          "result": "COMPLETED",
          "timestamp": "2022-08-24T17:48:47Z",
          "time": "0s",
          "classname": "TestTrajectory"
        }
      ]
    }
  ]
}