Skip to main content

detcore_model/
canonical_test_epoch.rs

1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 * All rights reserved.
4 *
5 * This source code is licensed under the BSD-style license found in the
6 * LICENSE file in the root directory of this source tree.
7 */
8
9//! The one virtual-time epoch tests and E2E cells pass when they need a fixed
10//! one, as `--epoch` or `HERMIT_EPOCH`: `hermit run --strict` refuses a run
11//! whose epoch would come from the host clock. Bump it here and nowhere else.
12//!
13//! This file has no dependencies, so a rust-script that renders Hermit
14//! commands includes it with `#[path]` rather than depending on this crate.
15
16/// The canonical test epoch as a string literal, for `concat!`.
17#[macro_export]
18macro_rules! canonical_test_epoch {
19    () => {
20        "2026-01-01T00:00:00Z"
21    };
22}
23
24/// [`canonical_test_epoch!`] as a value.
25pub const CANONICAL_TEST_EPOCH: &str = canonical_test_epoch!();
26
27/// [`canonical_test_epoch!`] as the `hermit run` option that passes it.
28pub const CANONICAL_TEST_EPOCH_ARG: &str = concat!("--epoch=", canonical_test_epoch!());