Skip to content

Commit

Permalink
Merge pull request #371 from timkpaine/better_cpp_test_dir
Browse files Browse the repository at this point in the history
reorganize cpp test directory for better organization
  • Loading branch information
texodus authored Jan 8, 2019
2 parents f039081 + c04c39f commit 853aa0d
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 2 deletions.
11 changes: 9 additions & 2 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
add_executable(psp_test psp.cpp)
set (TEST_FILES
cpp/psp.cpp
cpp/simple.cpp
)

include_directories("include")
add_executable(psp_test ${TEST_FILES})

target_link_libraries(psp_test gtest_main tbb psp)
add_test(NAME psptest COMMAND psp_test)
add_test(NAME psptest COMMAND psp_test)
18 changes: 18 additions & 0 deletions test/cpp/psp.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/******************************************************************************
*
* Copyright (c) 2017, the Perspective Authors.
*
* This file is part of the Perspective library, distributed under the terms of
* the Apache License 2.0. The full license can be found in the LICENSE file.
*
*/

#include <gtest/gtest.h>

int
main(int argc, char** argv)
{
::testing::InitGoogleTest(&argc, argv);
int ret = RUN_ALL_TESTS();
return ret;
}
20 changes: 20 additions & 0 deletions test/cpp/simple.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/******************************************************************************
*
* Copyright (c) 2017, the Perspective Authors.
*
* This file is part of the Perspective library, distributed under the terms of
* the Apache License 2.0. The full license can be found in the LICENSE file.
*
*/

#include <perspective/table.h>
#include <gtest/gtest.h>

using namespace perspective;

TEST(TABLE_TEST, simplest_test) {
t_table tbl(t_schema({"a", "b"}, {DTYPE_INT64, DTYPE_FLOAT64}), 5);
tbl.init();
tbl.reserve(5);
}

20 changes: 20 additions & 0 deletions test/include/perspective/test_utils.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/******************************************************************************
*
* Copyright (c) 2017, the Perspective Authors.
*
* This file is part of the Perspective library, distributed under the terms of
* the Apache License 2.0. The full license can be found in the LICENSE file.
*
*/

#pragma once
#include <perspective/first.h>
#include <perspective/table.h>
#include <perspective/config.h>
#include <cstdint>

namespace perspective
{


} // end namespace perspective

0 comments on commit 853aa0d

Please sign in to comment.