build: добавлены модульные тесты для персонального варианта

main
Artyom (StepanovAV) 1 год назад
Родитель f1d40277ae
Сommit 48de4476ce

@ -0,0 +1,11 @@
Yes
n0ne
overLINE
underline
No
Yes
0verline
UNDERLINE
none

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="personal_unittest" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Debug">
<Option output="bin/Debug/personal_unittest" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Debug/" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-g" />
</Compiler>
</Target>
<Target title="Release">
<Option output="bin/Release/personal_unittest" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Release/" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-O2" />
</Compiler>
<Linker>
<Add option="-s" />
</Linker>
</Target>
</Build>
<Compiler>
<Add option="-Wall" />
</Compiler>
<Extensions />
</Project>
</CodeBlocks_project_file>

@ -0,0 +1,22 @@
#define DOCTEST_CONFIG_NO_MULTITHREADING
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
#include "doctest.h"
#include "styled_text_func_internal.h"
#include <iostream>
#include <fstream>
TEST_CASE("Some mistakes in words") {
std::string text_style = styled_text_func ();
std::ifstream f ("Tests.txt");
CHECK(text_style == "underline");
}
TEST_CASE("Not using any style") {
std::string text_style = styled_text_func ();
std::ifstream f ("Tests.txt");
CHECK(text_style == "none");
}
TEST_CASE("Using 'none' as style after answering 'Yes'") {
std::string text_style = styled_text_func ();
std::ifstream f ("Tests.txt");
CHECK(text_style == "none");
}

@ -0,0 +1,5 @@
#pragma once
#include <iostream>
std::string
styled_text_func ();
Загрузка…
Отмена
Сохранить