blob: d5bd6ba173ef2134f15ec159e41268c8f1d71dba [file] [log] [blame]
Milo Lin0ddb7782022-08-17 20:40:43 -07001#include <chrono>
milind-uc6e437a2023-03-01 23:40:40 -08002
Milo Lin0ddb7782022-08-17 20:40:43 -07003#include "aos/configuration.h"
4#include "aos/events/logging/log_reader.h"
5#include "aos/events/logging/log_writer.h"
6#include "aos/events/simulated_event_loop.h"
7#include "aos/init.h"
8#include "aos/json_to_flatbuffer.h"
9#include "aos/network/team_number.h"
10#include "gflags/gflags.h"
11#include "gtest/gtest.h"
12
milind-uc6e437a2023-03-01 23:40:40 -080013DEFINE_string(config, "", "Name of the config file to replay using.");
Milo Lin0ddb7782022-08-17 20:40:43 -070014/* This binary is used to validate that all of the
15 needed remote timestamps channels are in the config
16 to log the timestamps.
17 Future versions of the validator will provide the option
18 to confirm that the timestamps in the config are able to
19 replay all of the data in the log
20 This can be done by getting a list of all of the nodes and
milind-uc6e437a2023-03-01 23:40:40 -080021 iterating through it with a for loop creating a logger for
22 each one
Milo Lin0ddb7782022-08-17 20:40:43 -070023 Reference superstructure_lib_test.cc*/
24TEST(ConfigValidatorTest, ReadConfig) {
25 ASSERT_TRUE(!FLAGS_config.empty());
26 const aos::FlatbufferDetachedBuffer<aos::Configuration> config =
27 aos::configuration::ReadConfig(FLAGS_config);
28
29 aos::SimulatedEventLoopFactory factory(&config.message());
30
31 factory.RunFor(std::chrono::seconds(1));
32}
milind-uc6e437a2023-03-01 23:40:40 -080033
34// TODO(milind): add more tests, the above one doesn't
35// catch an error like forgetting to add a forwarded message to
36// the destination node's config.