| Copyright | (c) 2026 |
|---|---|
| License | MIT |
| Maintainer | your.email@example.com |
| Safe Haskell | None |
| Language | Haskell2010 |
Test.Hspec.BenchGolden.Arch
Description
This module provides functions for detecting the current machine's architecture, which is used to create architecture-specific golden files.
The architecture identifier includes:
- CPU architecture (x86_64, aarch64, etc.)
- Operating system (darwin, linux, windows)
- CPU model when available (Apple M1, Intel Core i7, etc.)
Synopsis
- detectArchitecture :: IO ArchConfig
- getArchId :: IO Text
- getArchFromEnv :: IO (Maybe Text)
- sanitizeForFilename :: Text -> Text
Architecture Detection
detectArchitecture :: IO ArchConfig Source #
Detect the current machine's architecture.
This function queries the system for CPU architecture, OS, and CPU model.
The resulting ArchConfig can be used to generate architecture-specific
golden file paths.
The architecture can be overridden by setting the GOLDS_GYM_ARCH
environment variable.
Get the architecture identifier string.
This is a convenience function that returns just the ID string suitable for use in file paths.
Environment Overrides
getArchFromEnv :: IO (Maybe Text) Source #
Check for architecture override from environment.
Users can set GOLDS_GYM_ARCH to force a specific architecture
identifier, useful for CI environments with consistent hardware.
Utilities
sanitizeForFilename :: Text -> Text Source #
Sanitize a string for use in filenames.
Replaces spaces with underscores and removes problematic characters.