Skip to content

Commit

Permalink
Merge testing into dev (#597)
Browse files Browse the repository at this point in the history
* Updated the cmake version to 3.10

* Adding configurations for gtest

* Tweaking things for gtest

* Got gtest working and made a small example test

* Updated the cmake version to be 3.10 or greater

* Added initial Angle test refactor to use gtest

* Add IException and QDebug tests

* Added the rest of the IException tests

* Added test file discovery support and seperated the main into another file

* Added more tests for FileName

* Updated with the new testing guidelines and added new tests.

* Added Spectel unittest for gtest environment

* Added gmock

* Forgot to save a file

* PixelTest (#536)

* initial Pixel test

* Add more test cases for Pixel

* testing parameterization in Pixel test

* testing function parameterization

* parameterize static vs object methods

* basic PixelTests implementation

* clean up and more static tests

* update PixelTests with float/dbl expects

* Added Endian unit test.

* Angle test refactor to use gtest (#529)

* Added initial Angle test refactor to use gtest

* Add IException and QDebug tests

* Added the rest of the IException tests

* Update Angle to make private methods public and add tests

* Made changes for review comments

* Cleanup and addition of streaming the actual errors thrown to the EXPECT_TRUE macro

* FileName gtest conversion (#568)

* Made two methods private as they are only used within FileName

* Added more tests

* Added more tests

* Update FileNameTests.cpp

* BundleSettings unit test (#538)

* added build to git ignore

* Fixed duplicate main in FileNameTests

* Added parameterized test example

* Added more tests

* Mored BundleSettings tests

* Even more tests

* Added mocked targetbody settings for BundleSettings test

* Added BundleSettings save tests

* Fixed BundleSetting save tests to just use a QString

* Added default and copy constructor tests and asignment

* Update FileName test and merge dev into testing (#598)

* Update CMakeLists.txt with version 3.6.0 (patch 1)

* Update cmake/CMakeLists.txt library version

* Updated the Installation instructions based on user feedback.  Also fixed a problem with the isis3VarInit.py script.

* Updates made in accordance with requests made on this PR by other developers.

* Fix tgo cassis unit test correctly

* Fix tgo cassis unit test correctly (#544)

* Fixed two bug with AutoReg. One occurs with one dimensional pattern cubes and the other causes the revious registration sample/line to be returned on sub-pixel registration failure.

* Fix tgo cassis camera truth again (#554)

* Update docsys Makefile to support wwwdoc (#559)

The documentation is installed under `docs`, not `doc`, so this file has been updated.
`setisis isis3.6.0` and running `make wwwdoc` in `$ISISROOT/../isis/src/docsys` will properly sync the documentation to our web server.

* Update isis3VarInit.py

Unnecessary 'touch'ing, the '>' redirect will create the file if it doesn't exist.
Also, the first redirect should be the single '>'.  Otherwise, multiple runs of this program will continue appending to these files.  They still work, its just a lot of setting and unsetting for no good reason.

* Fixed isis3Startup scripts

* Removed unneeded LineEquation include

* Make this program more pythonic (#589)

* Updated documentation, user interaction, and made the file and directory
handling more 'pythonic'.

* Correcting for PR comments.

* Fixed broken links in the Installation instructions due to the hyperlinks to our GitHub wiki changing.

* Removed unused Parabola class

* Removed old license, added new unlicense (#594)

* Tweaked FileName test to use ISISROOT variable

* App to callable function conversion rough draft (#530)

* adjusted Process to support lambdas with captures, updated crop app

* now compiling with colocated funcs and apps and duplicated symbols accross apps removed

* removed debug prints in cmake scripts

* changes as requested from review

* hapke comment

* Added Distance unit tests (#585)

* Added Distance unit tests.

* Changed EXPECT_FLOAT_EQ to EXPECT_DOUBLE_EQ and changed Solar Radii test to use one solar radii.

* Changed unneeded EXPECT_DOUBLE_EQ to EXPECT_EQ.

* Fixed toString test.

* Adding gtests for Color and Matrix (#532)

* Adding gtests for Color and Matrix

* Updating gtest for Matrix

* More work to ColorTests.cpp and MatrixTests.cpp

* Added test for constructor making use of TNT:Array2D in MatrixTests

* Update isis/tests/MatrixTests.cpp

Co-Authored-By: SgStapleton <[email protected]>

* Update isis/tests/MatrixTests.cpp

Co-Authored-By: SgStapleton <[email protected]>

* Making recommended changes

* Fixing odd GitHub behavior...

There were suggested changes made in PR that were not playing nicely. Could not push correct version for whatever reason.

* Add Utilities, clean up testing (#604)

* Update CMakeLists.txt with version 3.6.0 (patch 1)

* Update cmake/CMakeLists.txt library version

* Updated the Installation instructions based on user feedback.  Also fixed a problem with the isis3VarInit.py script.

* Updates made in accordance with requests made on this PR by other developers.

* Fix tgo cassis unit test correctly

* Fix tgo cassis unit test correctly (#544)

* Fixed two bug with AutoReg. One occurs with one dimensional pattern cubes and the other causes the revious registration sample/line to be returned on sub-pixel registration failure.

* Fix tgo cassis camera truth again (#554)

* Update docsys Makefile to support wwwdoc (#559)

The documentation is installed under `docs`, not `doc`, so this file has been updated.
`setisis isis3.6.0` and running `make wwwdoc` in `$ISISROOT/../isis/src/docsys` will properly sync the documentation to our web server.

* Update isis3VarInit.py

Unnecessary 'touch'ing, the '>' redirect will create the file if it doesn't exist.
Also, the first redirect should be the single '>'.  Otherwise, multiple runs of this program will continue appending to these files.  They still work, its just a lot of setting and unsetting for no good reason.

* Fixed isis3Startup scripts

* Removed unneeded LineEquation include

* Make this program more pythonic (#589)

* Updated documentation, user interaction, and made the file and directory
handling more 'pythonic'.

* Correcting for PR comments.

* Fixed broken links in the Installation instructions due to the hyperlinks to our GitHub wiki changing.

* Removed unused Parabola class

* Removed old license, added new unlicense (#594)

* Fixed issue with the License change (#599)

* Removed old license, added new unlicense

* Fixed cmake looking for license in the wrong place

* Added TestUtilities and used in Color tests

* Fixed an issue where app xmls were not being copied

* Tweaked IException test failure messages

* Updating TestUtilities.h and associated files to account for AssertIException to be broken into AssertIExceptionMessage and AssertIExceptionError
  • Loading branch information
jessemapel authored and SgStapleton committed Nov 21, 2018
1 parent 74c0c8c commit 53af27e
Show file tree
Hide file tree
Showing 474 changed files with 4,458 additions and 7,121 deletions.
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,38 @@ print.prt
*/tsts/*/truth/*
*/tsts/*/output/*
*/build/
build/
*/install/

# Created by https://www.gitignore.io/api/macos
# Edit at https://www.gitignore.io/?templates=macos

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# End of https://www.gitignore.io/api/macos
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "gtest"]
path = gtest
url = [email protected]:google/googletest.git
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies:
- bullet==2.86.1=0
- bz2file==0.98
- bzip2==1.0.6=1
- cmake==3.9.1=0
- cmake>=3.10
- cspice==66=h470a237_3
- curl==7.60.0=0
- doxygen==1.8.14=0
Expand Down
2 changes: 1 addition & 1 deletion environment_gcc4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies:
- bullet==2.86.1=0
- bz2file==0.98
- bzip2==1.0.6=1
- cmake==3.9.1=0
- cmake>=3.10
- cspice==66=h470a237_3
- curl==7.60.0=0
- doxygen==1.8.14=0
Expand Down
1 change: 1 addition & 0 deletions gtest
Submodule gtest added at 529c2c
20 changes: 19 additions & 1 deletion isis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,22 @@

# Specify the required version of CMake. If your machine does not
# have this, it should be easy to build from https://cmake.org/download/
cmake_minimum_required(VERSION 3.4)
cmake_minimum_required(VERSION 3.10)

# Point cmake to our other CMake files.
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")

# set(CMAKE_FIND_FRAMEWORK LAST)
set(CMAKE_FRAMEWORK_PATH /System/Library/Frameworks/)

set(CMAKE_FIND_FRAMEWORK LAST)

include(AddIsisModule)
include(Utilities)
include(TestSetup)
include(InstallThirdParty)
include(cmake/gtest.cmake)
include(GoogleTest)

#===============================================================================
#===============================================================================
Expand Down Expand Up @@ -244,6 +249,13 @@ find_package(PNG REQUIRED)
find_package(Kakadu)
find_package(Geos 3.5.0 REQUIRED)
find_package(Armadillo REQUIRED)
find_package(Threads)


# Im this case, we specify the version numbers being searched for in the non-traditional installs.
if(APPLE)
find_package(OpenGL REQUIRED)
endif(APPLE)

if(pybindings)
find_package(Python REQUIRED)
Expand Down Expand Up @@ -458,3 +470,9 @@ install(DIRECTORY ${CMAKE_SOURCE_DIR}/scripts DESTINATION ${CMAKE_INSTA
# the end of this file containing a CMakeLists.txt file which includes all of
# the desired post-install commands inside.
add_subdirectory(cmake)
option (BUILD_TESTS "Build tests" ON)
if(BUILD_TESTS)
include(CTest)
enable_testing()
add_subdirectory(tests)
endif()
22 changes: 13 additions & 9 deletions isis/cmake/AddIsisModule.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ function(add_isis_app folder libDependencies)
get_filename_component(appName ${folder} NAME)
set(internalAppName ${appName}_app)

# Get the source and header files
file(GLOB headers "${folder}/*.h" "${folder}/*.hpp")
file(GLOB sources "${folder}/*.c" "${folder}/*.cpp")
# Get the main and xml files
file(GLOB sources "${folder}/main.cpp")
file(GLOB xmlFiles "${folder}/*.xml")

# All the XML files need to be copied to the install directory
Expand Down Expand Up @@ -62,7 +61,10 @@ endfunction(add_isis_app)

# Set up the lone unit test in an obj folder
function(make_obj_unit_test moduleName testFile truthFile reqLibs pluginLibs)

if(NOT ${testFile})
# Skip if no unitest
return()
endif()
# Get the object name (last folder part)
get_filename_component(folder ${testFile} DIRECTORY)
get_filename_component(filename ${folder} NAME)
Expand Down Expand Up @@ -99,10 +101,13 @@ function(add_isis_obj folder reqLibs)

# Find the source and header files
file(GLOB headers "${folder}/*.h" "${folder}/*.hpp")
# ignore app.cpp
file(GLOB sources "${folder}/*.c" "${folder}/*.cpp")
file(GLOB truths "${folder}/*.truth")
file(GLOB plugins "${folder}/*.plugin")

list(REMOVE_ITEM sources "${folder}/main.cpp")

# Generate protobuf, ui, and moc files if needed.
generate_protobuf_files(protoFiles ${folder})
generate_ui_files(uiFiles ${folder})
Expand Down Expand Up @@ -203,29 +208,28 @@ function(add_isis_module name)
foreach(f ${topFolders})

# Folders: apps, lib, tests
set(objsDir "${CMAKE_CURRENT_LIST_DIR}/${f}/objs")
set(appsDir "${CMAKE_CURRENT_LIST_DIR}/${f}/apps")
set(objsDir "${CMAKE_CURRENT_LIST_DIR}/${f}/objs")
set(tstsDir "${CMAKE_CURRENT_LIST_DIR}/${f}/tsts")

# Start with the objs folder
get_subdirectory_list(${objsDir} thisObjFolders)
get_subdirectory_list(${appsDir} thisAppFolders)
get_subdirectory_list(${tstsDir} thisTstFolders)

set(objFolders ${objFolders} ${thisObjFolders})
set(objFolders ${objFolders} ${thisObjFolders} ${thisAppFolders})
set(appFolders ${appFolders} ${thisAppFolders})
set(tstFolders ${tstFolders} ${thisTstFolders})

endforeach()

# Now that we have the library info, call function to add it to the build!
# - Base module depends on 3rd party libs, other libs also depend on base.
# - Only the base module gets both a static and shared library.
if(${name} STREQUAL ${CORE_LIB_NAME})
set(reqLibs ${ALLLIBS})
set(reqLibs "${ALLLIBS};gtest;gmock;${CMAKE_THREAD_LIBS_INIT}")
set(alsoStatic ON)
else()
set(reqLibs "${CORE_LIB_NAME};${ALLLIBS}")
set(reqLibs "${CORE_LIB_NAME};${ALLLIBS};gtest;gmock;${CMAKE_THREAD_LIBS_INIT}")
set(alsoStatic OFF)
endif()

Expand Down
39 changes: 39 additions & 0 deletions isis/cmake/gtest.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
if (NOT TARGET gtest)
set(GOOGLETEST_ROOT ${CMAKE_SOURCE_DIR}/../gtest/googletest CACHE STRING "Google Test source root")

include_directories(SYSTEM
${GOOGLETEST_ROOT}
${GOOGLETEST_ROOT}/include
)

set(GOOGLETEST_SOURCES
${GOOGLETEST_ROOT}/src/gtest-all.cc
${GOOGLETEST_ROOT}/src/gtest_main.cc
)

foreach(_source ${GOOGLETEST_SOURCES})
set_source_files_properties(${_source} PROPERTIES GENERATED 1)
endforeach()

add_library(gtest ${GOOGLETEST_SOURCES})
endif()

if (NOT TARGET gmock)
set(GOOGLEMOCK_ROOT ${CMAKE_SOURCE_DIR}/../gtest/googlemock CACHE STRING "Google Mock source root")

include_directories(SYSTEM
${GOOGLEMOCK_ROOT}
${GOOGLEMOCK_ROOT}/include
)

set(GOOGLEMOCK_SOURCES
${GOOGLEMOCK_ROOT}/src/gmock-all.cc
${GOOGLEMOCK_ROOT}/src/gmock_main.cc
)

foreach(_source ${GOOGLEMOCK_SOURCES})
set_source_files_properties(${_source} PROPERTIES GENERATED 1)
endforeach()

add_library(gmock ${GOOGLEMOCK_SOURCES})
endif()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
30 changes: 14 additions & 16 deletions isis/src/base/apps/ckwriter/CkKernelWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include "IString.h"
#include "NaifStatus.h"
#include "Pvl.h"
#include "SpiceSegment.h"
#include "CkSpiceSegment.h"
#include "TextFile.h"

using namespace std;
Expand Down Expand Up @@ -105,7 +105,7 @@ namespace Isis {
return;
}

void CkKernelWriter::write(const SpiceSegment &segment) const {
void CkKernelWriter::write(const CkSpiceSegment &segment) const {
switch ( _ckType ) {
case 1:
writeCk1(segment);
Expand Down Expand Up @@ -175,10 +175,10 @@ namespace Isis {
return;
}

void CkKernelWriter::writeCk1(const SpiceSegment &segment) const {
void CkKernelWriter::writeCk1(const CkSpiceSegment &segment) const {

const SpiceSegment::SVector &sclks = segment.SCLKTimes();
const SpiceSegment::SMatrix &quats = segment.Quaternions();
const CkSpiceSegment::SVector &sclks = segment.SCLKTimes();
const CkSpiceSegment::SMatrix &quats = segment.Quaternions();
ConstSpiceDouble *avvs(0);
SpiceBoolean hasAvvs(SPICEFALSE);
if ( segment.hasAngularVelocities() ) {
Expand All @@ -198,28 +198,28 @@ namespace Isis {
return;
}

void CkKernelWriter::writeCk2(const SpiceSegment &segment) const {
void CkKernelWriter::writeCk2(const CkSpiceSegment &segment) const {

if ( !segment.hasAngularVelocities() ) {
QString mess = "Type 2 CK kernels require angular velocities";
throw IException(IException::User, mess, _FILEINFO_);
}

const SpiceSegment::SVector &sclks = segment.SCLKTimes();
const SpiceSegment::SMatrix &quats = segment.Quaternions();
const SpiceSegment::SMatrix &avvs = segment.AngularVelocities();
const CkSpiceSegment::SVector &sclks = segment.SCLKTimes();
const CkSpiceSegment::SMatrix &quats = segment.Quaternions();
const CkSpiceSegment::SMatrix &avvs = segment.AngularVelocities();

QString refFrame = segment.ReferenceFrame();
QString segId = segment.Id();

int nrecs = segment.size();

SpiceSegment::SVector stops(nrecs);
CkSpiceSegment::SVector stops(nrecs);
for ( int i = 0 ; i < nrecs-1 ; i++) {
stops[i] = sclks[i+1];
}
stops[nrecs-1] = sclks[nrecs-1];
SpiceSegment::SVector rates(nrecs, segment.TickRate());
CkSpiceSegment::SVector rates(nrecs, segment.TickRate());
NaifStatus::CheckErrors();
ckw02_c(_handle, sclks[0], sclks[nrecs-1], segment.InstCode(),
refFrame.toLatin1().data(), segId.toLatin1().data(), nrecs, &sclks[0],
Expand All @@ -229,10 +229,10 @@ namespace Isis {
}


void CkKernelWriter::writeCk3(const SpiceSegment &segment) const {
void CkKernelWriter::writeCk3(const CkSpiceSegment &segment) const {

const SpiceSegment::SVector &sclks = segment.SCLKTimes();
const SpiceSegment::SMatrix &quats = segment.Quaternions();
const CkSpiceSegment::SVector &sclks = segment.SCLKTimes();
const CkSpiceSegment::SMatrix &quats = segment.Quaternions();
ConstSpiceDouble *avvs(0);
SpiceBoolean hasAvvs(SPICEFALSE);
if ( segment.hasAngularVelocities() ) {
Expand All @@ -257,5 +257,3 @@ namespace Isis {


}; // namespace Isis


Loading

0 comments on commit 53af27e

Please sign in to comment.