diff --git a/docs/locale/en/LC_MESSAGES/user_guide/environment_variables.po b/docs/locale/en/LC_MESSAGES/user_guide/environment_variables.po index 82014ef36..ed184d7be 100644 --- a/docs/locale/en/LC_MESSAGES/user_guide/environment_variables.po +++ b/docs/locale/en/LC_MESSAGES/user_guide/environment_variables.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Parallel Programming Course \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-26 10:22+0200\n" +"POT-Creation-Date: 2025-05-29 19:31+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language: en\n" @@ -32,20 +32,27 @@ msgstr "" #: ../../../../docs/user_guide/environment_variables.rst:6 msgid "" -"``PPC_NUM_PROC``: Specifies the number of processes to launch. " -"Default: ``1``" +"``PPC_NUM_PROC``: Specifies the number of processes to launch. Default: " +"``1``" msgstr "" #: ../../../../docs/user_guide/environment_variables.rst:9 msgid "" -"``PPC_NUM_THREADS``: Specifies the number of threads to use. Default:" -" ``1``" +"``PPC_NUM_THREADS``: Specifies the number of threads to use. Default: " +"``1``" msgstr "" #: ../../../../docs/user_guide/environment_variables.rst:12 msgid "" -"``PPC_ASAN_RUN``: Specifies that application is compiler with " -"sanitizers. Used by ``scripts/run_tests.py`` to skip ``valgrind`` runs. " -"Default: ``0``" +"``PPC_ASAN_RUN``: Specifies that application is compiler with sanitizers." +" Used by ``scripts/run_tests.py`` to skip ``valgrind`` runs. Default: " +"``0``" +msgstr "" + +#: ../../../../docs/user_guide/environment_variables.rst:15 +msgid "" +"``PPC_IGNORE_TEST_TIME_LIMIT``: Specifies that test time limits are " +"ignored. Used by ``scripts/run_tests.py`` to disable time limit " +"enforcement. Default: ``0``" msgstr "" diff --git a/docs/locale/ru/LC_MESSAGES/user_guide/environment_variables.po b/docs/locale/ru/LC_MESSAGES/user_guide/environment_variables.po index f892e2202..a192129fe 100644 --- a/docs/locale/ru/LC_MESSAGES/user_guide/environment_variables.po +++ b/docs/locale/ru/LC_MESSAGES/user_guide/environment_variables.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Parallel Programming Course \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-26 10:22+0200\n" +"POT-Creation-Date: 2025-05-29 19:31+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language: ru\n" @@ -29,24 +29,44 @@ msgstr "Переменные окружения" msgid "" "The following environment variables can be used to configure the " "project's runtime behavior:" -msgstr "Следующие переменные окружения могут использоваться для настройки поведения программы во время выполнения:" +msgstr "" +"Следующие переменные окружения могут использоваться для настройки " +"поведения программы во время выполнения:" #: ../../../../docs/user_guide/environment_variables.rst:6 msgid "" -"``PPC_NUM_PROC``: Specifies the number of processes to launch. " -"Default: ``1``" -msgstr "``PPC_NUM_PROC``: задаёт количество запускаемых процессов. По умолчанию: ``1``" +"``PPC_NUM_PROC``: Specifies the number of processes to launch. Default: " +"``1``" +msgstr "" +"``PPC_NUM_PROC``: задаёт количество запускаемых процессов. По умолчанию: " +"``1``" #: ../../../../docs/user_guide/environment_variables.rst:9 msgid "" -"``PPC_NUM_THREADS``: Specifies the number of threads to use. Default:" -" ``1``" -msgstr "``PPC_NUM_THREADS``: задаёт количество используемых потоков. По умолчанию: ``1``" +"``PPC_NUM_THREADS``: Specifies the number of threads to use. Default: " +"``1``" +msgstr "" +"``PPC_NUM_THREADS``: задаёт количество используемых потоков. По " +"умолчанию: ``1``" #: ../../../../docs/user_guide/environment_variables.rst:12 msgid "" -"``PPC_ASAN_RUN``: Specifies that application is compiler with " -"sanitizers. Used by ``scripts/run_tests.py`` to skip ``valgrind`` runs. " -"Default: ``0``" -msgstr "``PPC_ASAN_RUN``: указывает, что приложение собрано с санитайзерами. Используется в ``scripts/run_tests.py`` для пропуска запусков под ``valgrind``. По умолчанию: ``0``" +"``PPC_ASAN_RUN``: Specifies that application is compiler with sanitizers." +" Used by ``scripts/run_tests.py`` to skip ``valgrind`` runs. Default: " +"``0``" +msgstr "" +"``PPC_ASAN_RUN``: указывает, что приложение собрано с санитайзерами. " +"Используется в ``scripts/run_tests.py`` для пропуска запусков под " +"``valgrind``. По умолчанию: ``0``" + +#: ../../../../docs/user_guide/environment_variables.rst:15 +#, fuzzy +msgid "" +"``PPC_IGNORE_TEST_TIME_LIMIT``: Specifies that test time limits are " +"ignored. Used by ``scripts/run_tests.py`` to disable time limit " +"enforcement. Default: ``0``" +msgstr "" +"``PPC_IGNORE_TEST_TIME_LIMIT``: указывает, что ограничения по времени выполнения тестов игнорируются. " +"Используется в ``scripts/run_tests.py`` для отключения контроля ограничений по времени. " +"По умолчанию: ``0``" diff --git a/docs/user_guide/environment_variables.rst b/docs/user_guide/environment_variables.rst index 8dfeb9b6f..63d6291ed 100644 --- a/docs/user_guide/environment_variables.rst +++ b/docs/user_guide/environment_variables.rst @@ -11,3 +11,6 @@ The following environment variables can be used to configure the project's runti - ``PPC_ASAN_RUN``: Specifies that application is compiler with sanitizers. Used by ``scripts/run_tests.py`` to skip ``valgrind`` runs. Default: ``0`` + +- ``PPC_IGNORE_TEST_TIME_LIMIT``: Specifies that test time limits are ignored. Used by ``scripts/run_tests.py`` to disable time limit enforcement. + Default: ``0`` diff --git a/modules/core/task/src/task.cpp b/modules/core/task/src/task.cpp index fe2bdc11d..0ad309aa1 100644 --- a/modules/core/task/src/task.cpp +++ b/modules/core/task/src/task.cpp @@ -1,3 +1,4 @@ +#define _CRT_SECURE_NO_WARNINGS #include "core/task/include/task.hpp" #include @@ -69,7 +70,9 @@ void ppc::core::Task::InternalTimeTest(const std::string &str) { auto diff = static_cast(duration) * 1e-9; std::stringstream err_msg; - if (diff < kMaxTestTime) { + if (auto env = std::getenv("PPC_IGNORE_TEST_TIME_LIMIT"); env != nullptr && std::string(env) == "1") { + err_msg << "Test time:" << std::fixed << std::setprecision(10) << diff << " (no time limit)" << '\n'; + } else if (diff < kMaxTestTime) { err_msg << "Test time:" << std::fixed << std::setprecision(10) << diff << '\n'; } else { err_msg << "\nTask execute time need to be: ";