Commit 9e87fabc authored by Eric Cano's avatar Eric Cano
Browse files

Added initial system tests for cta-taped (command line tests).

parent 7f89589a
......@@ -135,12 +135,14 @@ The shared libraries
Summary: CERN Tape Archive: unit and system tests with virtual tape drives
Group: Application/CTA
Requires: valgrind >= 3.8.1
Requires: cta-taped = %{ctaVersion}-%{ctaRelease}%{mydist}
%description -n cta-systemtests
CERN Tape Archive:
Unit tests and system tests with virtual tape drives
%files -n cta-systemtests
%attr(0755,root,root) %{_bindir}/cta-systemTests
%attr(0755,root,root) %{_libdir}/libsystemTestHelperTests.so
%attr(0755,root,root) %{_libdir}/libcta-tapedSystemTests.so
%attr(0755,root,root) %{_bindir}/cta-unitTests
%attr(0755,root,root) %{_bindir}/cta-valgrindUnitTests.sh
%attr(0755,root,root) %{_bindir}/cta-unitPlusSystemTests.sh
......
......@@ -11,3 +11,13 @@ add_executable (cta-taped cta-taped.cpp)
target_link_libraries(cta-taped
ctatapedaemon ctacommon protobuf)
install (TARGETS cta-taped DESTINATION usr/bin)
# CTA's cta-taped system tests.
add_library(cta-tapedSystemTests SHARED
cta-tapedSystemtests.cpp)
target_link_libraries(cta-tapedSystemTests
systemTestHelper
ctacommon)
install(TARGETS cta-tapedSystemTests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
\ No newline at end of file
/*
* The CERN Tape Archive (CTA) project
* Copyright (C) 2015 CERN
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "tests/Subprocess.hpp"
#include <gtest/gtest.h>
namespace systemTests {
TEST(cta_taped, InvocationTests) {
// Do we get help with -h or --help?
Subprocess spHelpShort("cta-taped", std::list<std::string>({"cta-taped", "-h"}));
spHelpShort.wait();
ASSERT_NE(std::string::npos, spHelpShort.stdout().find("Usage"));
ASSERT_TRUE(spHelpShort.stderr().empty());
ASSERT_EQ(EXIT_SUCCESS, spHelpShort.exitValue());
Subprocess spHelpLong("cta-taped", std::list<std::string>({"cta-taped", "--help"}));
spHelpLong.wait();
ASSERT_NE(std::string::npos, spHelpLong.stdout().find("Usage: cta-taped [options]"));
ASSERT_TRUE(spHelpLong.stderr().empty());
ASSERT_EQ(EXIT_SUCCESS, spHelpLong.exitValue());
}
}
\ No newline at end of file
......@@ -64,6 +64,7 @@ add_executable(cta-systemTests
target_link_libraries(cta-systemTests
systemTestHelper
systemTestHelperTests
cta-tapedSystemTests
gtest
pthread)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment