Skip to content

Commit ed8629c

Browse files
authored
Remove all c++ simulated tests (#3676)
* Remove all c++ simulated tests * Remove c++ simulated test fixtures and validations * Resolve issue #2581 TODOs * Remove simulated test args from gtest main * Remove TODO * Remove visualizing c++ test flags from thunderscope and tbots.py * Update iterfzf version * Revert iterfzf version change * Re-add new pytest targets
1 parent e0db5b2 commit ed8629c

102 files changed

Lines changed: 8 additions & 5976 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/getting-started.md

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -280,24 +280,12 @@ Now that you're setup, if you can run it on the command line, you can run it in
280280
- Xbox control allows us to use a connected Xbox controller to control the robots
281281
4. Run our SimulatedPlayTests in Thunderscope
282282
- This will launch the visualizer and simulate AI Plays, allowing us to visually see the robots acting according to their roles.
283-
1. For legacy C++ tests (#2581) with the visualizer:
284-
1. First run Thunderscope configured for receiving protobufs over unix sockets correctly: `./tbots.py run thunderscope_main --visualize_cpp_test`
285-
2. Then run `./tbots.py test [some_target_here] --run_sim_in_realtime`
286-
2. For PyTests:
287-
- With the visualizer: `./tbots.py test [some_target_here] -t`
288-
- Without the visualizer: `./tbots.py test [some_target_here]`
289-
3. For legacy C++ tests (#2581) without the visualizer:
290-
- `./tbots.py test [some_target_here]`
283+
- With the visualizer: `./tbots.py test [some_target_here] -t`
284+
- Without the visualizer: `./tbots.py test [some_target_here]`
291285
5. Run our SimulatedTacticTests in Thunderscope:
292286
- This will launch the visualizer and simulate an AI Tactic on a single robot
293-
1. For legacy C++ tests (#2581) with the visualizer:
294-
- First, run Thunderscope configured for receiving protobufs over unix sockets correctly: `./tbots.py run thunderscope_main --visualize_cpp_test`
295-
- Then run `./tbots.py test [some_target_here] --run_sim_in_realtime`
296-
2. For PyTests:
297-
- With the visualizer: `./tbots.py test [some_target_here] -t`
298-
- Without the visualizer: `./tbots.py test [some_target_here]`
299-
3. For legacy C++ tests (#2581) without the visualizer:
300-
- `./tbots.py test [some_target_here]`
287+
- With the visualizer: `./tbots.py test [some_target_here] -t`
288+
- Without the visualizer: `./tbots.py test [some_target_here]`
301289

302290
## Debugging
303291

src/cli/cli_params.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ class DebugBinary(str, Enum):
8686
]
8787

8888
EnableThunderscopeOption = Annotated[bool, Option("-t", "--enable_thunderscope")]
89-
EnableVisualizerOption = Annotated[bool, Option("-v", "--enable_visualizer")]
9089
StopAIOnStartOption = Annotated[bool, Option("-s", "--stop_ai_on_start")]
9190

9291
JobsOption = Annotated[str, Option("-j", "--jobs")]

src/shared/test_util/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ cc_library(
1818
name = "tbots_gtest_main",
1919
testonly = True,
2020
srcs = ["tbots_gtest_main.cpp"],
21-
hdrs = ["tbots_gtest_main.h"],
2221
deps = [
2322
"//software/logger",
2423
"@boost//:program_options",
Lines changed: 4 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,16 @@
1-
#include "shared/test_util/tbots_gtest_main.h"
2-
31
#include <fenv.h>
2+
#include <gtest/gtest.h>
43

5-
#include <boost/program_options.hpp>
6-
7-
#include "proto/parameters.pb.h"
84
#include "software/logger/logger.h"
95

10-
bool TbotsGtestMain::help = false;
11-
bool TbotsGtestMain::enable_visualizer = false;
12-
bool TbotsGtestMain::run_sim_in_realtime = false;
13-
bool TbotsGtestMain::stop_ai_on_start = false;
14-
std::string TbotsGtestMain::runtime_dir = "/tmp/tbots/yellow_test";
15-
double TbotsGtestMain::test_speed = 1.0;
16-
6+
std::string runtime_dir = "/tmp/tbots/yellow_test";
177

188
int main(int argc, char** argv)
199
{
2010
testing::InitGoogleTest(&argc, argv);
2111
feenableexcept(FE_INVALID | FE_OVERFLOW);
2212

23-
boost::program_options::options_description desc{"Options"};
24-
25-
// TODO #(2510) Remove this once we port over to simulated pytests entirely
26-
desc.add_options()("help,h",
27-
boost::program_options::bool_switch(&TbotsGtestMain::help),
28-
"Help screen");
29-
desc.add_options()(
30-
"enable_visualizer",
31-
boost::program_options::bool_switch(&TbotsGtestMain::enable_visualizer),
32-
"Displays simulated test on visualizer");
33-
desc.add_options()(
34-
"run_sim_in_realtime",
35-
boost::program_options::bool_switch(&TbotsGtestMain::run_sim_in_realtime),
36-
"Runs simulation in realtime, useful to look at simulated C++ tests in "
37-
"thunderscope without running ThreadedFullsystemGUI");
38-
desc.add_options()(
39-
"stop_ai_on_start",
40-
boost::program_options::bool_switch(&TbotsGtestMain::stop_ai_on_start),
41-
"If enable_visualizer is true, then stops the AI when the test starts");
42-
desc.add_options()(
43-
"runtime_dir",
44-
boost::program_options::value<std::string>(&TbotsGtestMain::runtime_dir),
45-
"The directory to output logs to. Absolute paths are recommended as the "
46-
"working directory is inside the bazel-out directory.");
47-
desc.add_options()(
48-
"test_speed", boost::program_options::value<double>(&TbotsGtestMain::test_speed),
49-
"The speed adjustment factor. Values in the range [0.1, 1) will play the"
50-
"test slower than realtime, and values in the range (1, 10] will play the"
51-
"test faster than realtime i.e. 0.1 would be 10X slower than realtime, "
52-
"and 10 would be 10X faster than realtime. Default value is 1.");
53-
54-
boost::program_options::variables_map vm;
55-
boost::program_options::store(parse_command_line(argc, argv, desc), vm);
56-
boost::program_options::notify(vm);
57-
58-
if (!TbotsGtestMain::help)
59-
{
60-
LoggerSingleton::initializeLogger(TbotsGtestMain::runtime_dir, nullptr);
13+
LoggerSingleton::initializeLogger(runtime_dir, nullptr);
6114

62-
if (TbotsGtestMain::enable_visualizer || TbotsGtestMain::run_sim_in_realtime)
63-
{
64-
// disable floating point errors when using visualizer due to potential
65-
// floating point errors in QT
66-
fedisableexcept(FE_INVALID | FE_OVERFLOW);
67-
}
68-
return RUN_ALL_TESTS();
69-
}
70-
else
71-
{
72-
std::cout << desc << std::endl;
73-
return 0;
74-
}
15+
return RUN_ALL_TESTS();
7516
}

src/shared/test_util/tbots_gtest_main.h

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/software/ai/hl/stp/play/BUILD

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -87,21 +87,6 @@ py_test(
8787
],
8888
)
8989

90-
cc_test(
91-
name = "stop_play_cpp_test",
92-
srcs = ["stop_play_test.cpp"],
93-
deps = [
94-
"//shared/test_util:tbots_gtest_main",
95-
"//software/ai/hl/stp/play:stop_play",
96-
"//software/simulated_tests:simulated_er_force_sim_play_test_fixture",
97-
"//software/simulated_tests/cpp_validation:validation_function",
98-
"//software/simulated_tests/non_terminating_validation_functions",
99-
"//software/test_util",
100-
"//software/time:duration",
101-
"//software/world",
102-
],
103-
)
104-
10590
py_test(
10691
name = "stop_play_test",
10792
srcs = [

src/software/ai/hl/stp/play/crease_defense/BUILD

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,6 @@ py_test(
4444
],
4545
)
4646

47-
cc_test(
48-
name = "crease_defense_play_cpp_test",
49-
srcs = ["crease_defense_play_test.cpp"],
50-
deps = [
51-
":crease_defense_play",
52-
"//shared/test_util:tbots_gtest_main",
53-
"//software/simulated_tests:simulated_er_force_sim_play_test_fixture",
54-
"//software/simulated_tests/cpp_validation:validation_function",
55-
"//software/simulated_tests/non_terminating_validation_functions",
56-
"//software/simulated_tests/terminating_validation_functions",
57-
"//software/test_util",
58-
],
59-
)
60-
6147
cc_test(
6248
name = "crease_defense_play_fsm_test",
6349
srcs = ["crease_defense_play_fsm_test.cpp"],

src/software/ai/hl/stp/play/crease_defense/crease_defense_play_test.cpp

Lines changed: 0 additions & 68 deletions
This file was deleted.

src/software/ai/hl/stp/play/example/BUILD

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,6 @@ cc_library(
2222
alwayslink = True,
2323
)
2424

25-
cc_test(
26-
name = "example_play_cpp_test",
27-
srcs = ["example_play_test.cpp"],
28-
deps = [
29-
"//shared/test_util:tbots_gtest_main",
30-
"//software/ai/hl/stp/play/example:example_play",
31-
"//software/simulated_tests:simulated_er_force_sim_play_test_fixture",
32-
"//software/simulated_tests/cpp_validation:validation_function",
33-
"//software/test_util",
34-
"//software/time:duration",
35-
"//software/world",
36-
],
37-
)
38-
3925
cc_test(
4026
name = "example_play_fsm_test",
4127
srcs = ["example_play_fsm_test.cpp"],

src/software/ai/hl/stp/play/example/example_play_test.cpp

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)