532
532
// HardwareAbstractionLayerFixture.time_to_first_fix_cold_start_with_supl_benchmark_requires_hardware
533
533
TEST_F(HardwareAbstractionLayerFixture, time_to_first_fix_cold_start_with_supl_benchmark_requires_hardware)
535
using namespace core::posix;
535
537
typedef boost::accumulators::accumulator_set<
537
539
boost::accumulators::stats<
582
584
location::Position ref_pos
584
location::wgs84::Latitude{51.444670 * location::units::Degrees},
585
location::wgs84::Longitude{7.210852 * location::units::Degrees}
586
location::wgs84::Latitude
588
std::stod(this_process::env::get(
589
"GPS_SUPL_BENCHMARK_REF_LAT", "51.444670")) * location::units::Degrees
591
location::wgs84::Longitude
593
std::stod(this_process::env::get(
594
"GPS_SUPL_BENCHMARK_REF_LON", "7.210852")) * location::units::Degrees
587
ref_pos.accuracy.horizontal = 10 * location::units::Meters;
591
auto s = core::posix::this_process::env::get_or_throw("GPS_SUPL_BENCHMARK_REF_LAT");
592
ref_pos.latitude = location::wgs84::Latitude{std::stod(s) * location::units::Degrees};
593
} catch(const std::exception& e)
595
std::cerr << e.what() << std::endl;
600
auto s = core::posix::this_process::env::get_or_throw("GPS_SUPL_BENCHMARK_REF_LON");
601
ref_pos.longitude = location::wgs84::Longitude{std::stod(s) * location::units::Degrees};
602
} catch(const std::exception& e)
604
std::cerr << e.what() << std::endl;
609
auto s = core::posix::this_process::env::get_or_throw("GPS_SUPL_BENCHMARK_REF_ACCURACY");
610
ref_pos.accuracy.horizontal = std::stod(s) * location::units::Meters;
611
} catch(const std::exception& e)
613
std::cerr << e.what() << std::endl;
598
ref_pos.accuracy.horizontal
599
= std::stod(this_process::env::get(
600
"GPS_SUPL_BENCHMARK_REF_ACCURACY", "10")) * location::units::Meters;
616
602
// We wire up our state to position updates from the hal.
617
603
hal->position_updates().connect([&state](const location::Position& pos)
621
607
// This will throw if the env variable is not set.
622
core::posix::this_process::env::get(enable_harvesting_key);
608
core::posix::this_process::env::get_or_throw(enable_harvesting_key);
624
the_harvester().report_position_update(location::Update<location::Position>
626
pos, location::Clock::now()
610
the_harvester().report_position_update(
611
location::Update<location::Position>
613
pos, location::Clock::now()