20string getEnvVarValue(
string name) {
23 const char* ptr = std::getenv(name.c_str());
24 return (ptr ==
nullptr)?
"" : std::string(ptr);
27int getIntEnvVarValueOrDefault(
string name,
int defaultValue) {
29 string strValue = getEnvVarValue(name);
30 int intValue = defaultValue;
34 intValue = std::stoi(strValue);
36 catch (
const std::out_of_range&) { }
37 catch (
const std::invalid_argument&) { }
48int getNumQubitsInUnitTestedQuregs() {
50 static int value = getIntEnvVarValueOrDefault(
"TEST_NUM_QUBITS_IN_QUREG", 6);
54int getMaxNumTestedQubitPermutations() {
56 static int value = getIntEnvVarValueOrDefault(
"TEST_MAX_NUM_QUBIT_PERMUTATIONS", 0);
60int getMaxNumTestedSuperoperatorTargets() {
62 static int value = getIntEnvVarValueOrDefault(
"TEST_MAX_NUM_SUPEROP_TARGETS", 4);
66int getNumTestedMixedDeploymentRepetitions() {
68 static int value = getIntEnvVarValueOrDefault(
"TEST_NUM_MIXED_DEPLOYMENT_REPETITIONS", 10);
72bool getWhetherToTestAllDeployments() {
74 static bool value = getIntEnvVarValueOrDefault(
"TEST_ALL_DEPLOYMENTS", 1);