1
0
mirror of https://gitlab.com/klmp200/fish.git synced 2024-11-24 18:14:18 +00:00

Premier test fonctionnel

This commit is contained in:
Antoine Bartuccio 2017-05-16 01:33:36 +02:00
parent 209c36e7fd
commit e9e19fbf61
5 changed files with 18 additions and 20 deletions

View File

@ -44,9 +44,16 @@ include_directories(
"${source_dir}/googlemock/include"
)
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_FLAGS "-Wall -Werror -pedantic -fpic -Wextra -Wshadow")
add_subdirectory(fish_shell)
add_subdirectory(fish_shell_tests)
enable_testing()
add_test(fish_tests fish_shell_tests/fish_tests)
add_test(NAME fish_tests
COMMAND fish_tests
)

View File

@ -4,5 +4,5 @@ project(fish_shell)
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_FLAGS "-Wall -Werror -pedantic -fpic -Wextra -Wshadow")
set(SOURCE_FILES main.c fish_core.c fish_core.h fish_commands.c fish_commands.h fish_types.h fish_utils.c fish_utils.h fish_globbing.c fish_globbing.h)
add_executable(fish ${SOURCE_FILES})
file(GLOB SOURCE_FILES *)
add_executable(fish ${SOURCE_FILES})

View File

@ -4,17 +4,16 @@ project(fish_shell_tests)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -c")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
include_directories(
"${source_dir}/googletest/include"
"${source_dir}/googlemock/include"
)
set(SOURCE_FILES_TESTS main.cpp FishCoreTests.cpp FishCoreTests.h)
file(GLOB SOURCE_FILES_TESTS *)
add_executable(fish_tests ${SOURCE_FILES_TESTS})
target_link_libraries(fish_tests libgtest libgmock)

View File

@ -3,19 +3,17 @@
//
#include "FishCoreTests.h"
//
// Created by Antoine Bartuccio on 15/05/2017.
//
#include "../fish_shell/fish_core.c"
#include "../fish_shell/fish_utils.c"
#include "../fish_shell/fish_commands.c"
#include "../fish_shell/fish_globbing.c"
//TEST_F(FishCoreTests, split){
// ASSERT_TRUE(true);
//}
TEST(simple_split, split){
TEST(command_split, split){
char input[] = "git push --force";
char *output[] = {
(char *) "git",

View File

@ -2,15 +2,9 @@
// Created by Antoine Bartuccio on 15/05/2017.
//
#include <gtest/gtest.h>
#include "gtest/gtest.h"
int main(int argc, char **argv){
printf("Je mange des patates");
::testing::InitGoogleTest(&argc, argv);
int ret = RUN_ALL_TESTS();
return ret;
return RUN_ALL_TESTS();
}