Skip to content

Conversation

@Sviftel
Copy link

@Sviftel Sviftel commented Oct 8, 2023

Добавляю прогон тестов в окружении CI, который используется в домашках и дорешках

Сейчас в них производится только компиляция, без запуска. Надо дочинить и включить запуск и понапихать какие-то более адекватные проверки

@Sviftel Sviftel requested review from eaniconer and nickolaym October 8, 2023 21:31
std::vector<int> xs;
xs.reserve(100500);
xs.clear();
EXPECT_CMP(xs.capacity(), ==, 0) << " ahaha ? ahaha!";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Я перенёс и отрефакторил этот файл, пожалуйста, отребейзься на свежий мастер

{
"name": "just_simple_test",
"setup": "",
"run": "CI=1 cmake . && make just_simple_test",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Лучше, наверно, не через окружение (мало ли, будет конфликтовать), а через дефайны комстроки?
cmake . -Ddisable_gtest=1 && .....

{
"tests": [
{
"name": "just_simple_test",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Я сделал семейство заведомо позитивных и заведомо негативных тестовых файлов.
Нужно как-то учесть это в скрипте CI.

#### Arguments

```
```c++
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Здесь баш, а не C++

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -Wextra-semi -O1 -g -fsanitize=address -fno-omit-frame-pointer")
endif()

if(DEFINED ENV{CI})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Лучше не через ENV управлять, наверное.

А также можно попробовать сделать локальную сборку GTest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants