golds-gym-0.2.0.0: Golden testing framework for performance benchmarks
Copyright(c) 2026
LicenseMIT
Maintaineryour.email@example.com
Safe HaskellNone
LanguageHaskell2010

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

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.

getArchId :: IO Text Source #

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.