mirror of
https://github.com/usatiuk/backup.git
synced 2025-10-26 17:37:47 +01:00
proper cmake
This commit is contained in:
15
tests/clitests/CMakeLists.txt
Normal file
15
tests/clitests/CMakeLists.txt
Normal file
@@ -0,0 +1,15 @@
|
||||
cmake_minimum_required(VERSION 3.22)
|
||||
|
||||
|
||||
add_executable(
|
||||
CLITests
|
||||
srcs/CLITestWrapper.cpp
|
||||
)
|
||||
add_dependencies(CLITests backup)
|
||||
|
||||
target_link_libraries(
|
||||
CLITests PRIVATE
|
||||
GTest::gtest_main testUtils
|
||||
)
|
||||
gtest_discover_tests(CLITests)
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
TESTSIZE=16
|
||||
|
||||
CMD=./sembackup
|
||||
# TODO: Don't hardcode this
|
||||
CMD="../../src/backup"
|
||||
|
||||
rm -rf testdata
|
||||
rm -rf testdir
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
CMD=./sembackup
|
||||
# TODO: Don't hardcode this
|
||||
CMD="../../src/backup"
|
||||
|
||||
rm -rf testdata
|
||||
rm -rf testdir
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
CMD=./sembackup
|
||||
# TODO: Don't hardcode this
|
||||
CMD="../../src/backup"
|
||||
|
||||
rm -rf testdata
|
||||
rm -rf testdir
|
||||
23
tests/clitests/srcs/CLITestWrapper.cpp
Normal file
23
tests/clitests/srcs/CLITestWrapper.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// Created by Stepan Usatiuk on 10.05.2023.
|
||||
//
|
||||
|
||||
#include "Cleaner.h"
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
//TODO: Don't hardcode scripts
|
||||
|
||||
TEST(CLITest, Backup) {
|
||||
int ret = system("../../../tests/clitests/scripts/backup.sh");
|
||||
EXPECT_EQ(WEXITSTATUS(ret), 0);
|
||||
}
|
||||
|
||||
TEST(CLITest, Ignore) {
|
||||
int ret = system("../../../tests/clitests/scripts/ignore.sh");
|
||||
EXPECT_EQ(WEXITSTATUS(ret), 0);
|
||||
}
|
||||
|
||||
TEST(CLITest, Diff) {
|
||||
int ret = system("../../../tests/clitests/scripts/diff.sh");
|
||||
EXPECT_EQ(WEXITSTATUS(ret), 0);
|
||||
}
|
||||
Reference in New Issue
Block a user