[asl] 160/177: Provide required input files
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Thu Aug 27 09:22:50 UTC 2015
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to branch master
in repository asl.
commit 99b03d1f9e28f9f1bd584d8b04f98ad6c1554f90
Author: Avtech Scientific <AvtechScientific at users.noreply.github.com>
Date: Sun Aug 16 15:31:48 2015 +0300
Provide required input files
---
CMakeLists.txt | 15 +++++++++------
test/testACL/CMakeLists.txt | 14 ++++++++------
test/testAGL/CMakeLists.txt | 4 +++-
test/testAGL/testVTK_IO.cc | 22 ++++++++++++----------
test/testMath/CMakeLists.txt | 2 ++
5 files changed, 34 insertions(+), 23 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fad7863..288b2fa 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -68,11 +68,14 @@ if (WITH_API_DOC)
add_subdirectory(doc)
endif()
-if (WITH_TESTS)
- # Input/Output tests are labled "IO" and may require input files
- # Performance tests are labled "Performance"
- # Run them: ctest [-C Release|Debug] -L Performance
- # Exclude them: ctest [-C Release|Debug] -LE Performance
+if (WITH_TESTS)
+ # Test labels:
+ # DoublePrecision - tests that use double precision (will fail if device does not support it)
+ # IO - Input/Output tests (may require input files)
+ # Performance - performance tests
+ #
+ # Run them e.g.: `ctest [-C Release|Debug] -L Performance`
+ # Exclude some of them: `ctest -LE DoublePrecision -LE Performance`
enable_testing()
add_subdirectory(test)
endif()
@@ -167,4 +170,4 @@ install(FILES
${CMAKE_CURRENT_BINARY_DIR}/ASL.pc
DESTINATION
${CMAKE_INSTALL_LIBDIR}/pkgconfig
-)
+)
\ No newline at end of file
diff --git a/test/testACL/CMakeLists.txt b/test/testACL/CMakeLists.txt
index 4d86778..28a9fc0 100644
--- a/test/testACL/CMakeLists.txt
+++ b/test/testACL/CMakeLists.txt
@@ -29,15 +29,17 @@ add_test(NAME testVectorOfElements COMMAND testVectorOfElements)
add_executable(testMatrixOfElements testMatrixOfElements.cc)
target_link_libraries(testMatrixOfElements asl aslacl aslcommon)
add_test(NAME testMatrixOfElements COMMAND testMatrixOfElements)
-
-add_executable(testPerformance testPerformance.cc)
-target_link_libraries(testPerformance aslacl)
-add_test(NAME testPerformance COMMAND testPerformance)
-set_tests_properties(testPerformance PROPERTIES LABELS Performance)
+
+# This test needs to be updated.
+# add_executable(testPerformance testPerformance.cc)
+# target_link_libraries(testPerformance aslacl)
+# add_test(NAME testPerformance COMMAND testPerformance)
+# set_tests_properties(testPerformance PROPERTIES LABELS Performance)
add_executable(testKernel testKernel.cc)
target_link_libraries(testKernel aslacl)
-add_test(NAME testKernel COMMAND testKernel)
+add_test(NAME testKernel COMMAND testKernel)
+set_tests_properties(testKernel PROPERTIES LABELS DoublePrecision)
add_executable(testOperators testOperators.cc)
target_link_libraries(testOperators aslacl)
diff --git a/test/testAGL/CMakeLists.txt b/test/testAGL/CMakeLists.txt
index 4d41df1..e65827a 100644
--- a/test/testAGL/CMakeLists.txt
+++ b/test/testAGL/CMakeLists.txt
@@ -25,4 +25,6 @@ include_directories(${CMAKE_SOURCE_DIR}/src)
add_executable(testVTK_IO testVTK_IO.cc)
target_link_libraries(testVTK_IO aslnum aslvtk asl)
add_test(NAME testVTK_IO COMMAND testVTK_IO)
-set_tests_properties(testVTK_IO PROPERTIES LABELS IO)
+set_tests_properties(testVTK_IO PROPERTIES LABELS IO)
+# Hardcode the path to the required input file `bus.stl`
+target_compile_definitions(testVTK_IO PRIVATE "INPUT_DATA_DIR=\"${CMAKE_SOURCE_DIR}/examples/input_data/\"")
\ No newline at end of file
diff --git a/test/testAGL/testVTK_IO.cc b/test/testAGL/testVTK_IO.cc
index 6fdb69e..8c12b37 100644
--- a/test/testAGL/testVTK_IO.cc
+++ b/test/testAGL/testVTK_IO.cc
@@ -25,15 +25,15 @@
\example testVTK_IO.cc
*/
-#include <writers/aslVTKFormatWriters.h>
-#include <readers/aslVTKFormatReaders.h>
-#include <aslGenerators.h>
-#include <num/aslDataResampling.h>
-#include <data/aslDataWithGhostNodes.h>
+#include "writers/aslVTKFormatWriters.h"
+#include "readers/aslVTKFormatReaders.h"
+#include "aslGenerators.h"
+#include "num/aslDataResampling.h"
+#include "data/aslDataWithGhostNodes.h"
void testMINC()
{
- cout << "Test of MINC files reader..." << flush;
+ cout << "Test of MINC files reader..." << endl;
auto data(asl::read("subject04_crisp_v.mnc", 0));
@@ -44,7 +44,7 @@ void testMINC()
void testMINCplus()
{
- cout << "Test of MINC files reader +..." << flush;
+ cout << "Test of MINC files reader +..." << endl;
auto data(asl::read("subject04_crisp_v.mnc", 0));
@@ -59,9 +59,11 @@ void testMINCplus()
void testSurfaceSTL()
{
- cout << "Test of Surface STL files reader..." << flush;
+ cout << "Test of Surface STL files reader..." << endl;
- auto data(asl::readSurface("bus.stl", 5));
+ // INPUT_DATA_DIR will be expanded by the preprocessor to e.g. "/path/to/dir/"
+ // and the compiler will merge adjacent string literals
+ auto data(asl::readSurface(INPUT_DATA_DIR "bus.stl", 5));
// auto data(asl::readSurface("xx.vtp", .01));
asl::writeVTKXML("dataSurfaceSTL.vti",
@@ -77,4 +79,4 @@ int main()
// testMINCplus();
testSurfaceSTL();
return 0;
-}
+}
\ No newline at end of file
diff --git a/test/testMath/CMakeLists.txt b/test/testMath/CMakeLists.txt
index 7dd6bda..115aebb 100644
--- a/test/testMath/CMakeLists.txt
+++ b/test/testMath/CMakeLists.txt
@@ -29,7 +29,9 @@ add_test(NAME testASLData COMMAND testASLData)
add_executable(testDistanceFunction testDistanceFunction.cc)
target_link_libraries(testDistanceFunction aslvtk aslnum asl)
add_test(NAME testDistanceFunction COMMAND testDistanceFunction)
+set_tests_properties(testDistanceFunction PROPERTIES LABELS DoublePrecision)
add_executable(testReductionFunction testReductionFunction.cc)
target_link_libraries(testReductionFunction asl)
add_test(NAME testReductionFunction COMMAND testReductionFunction)
+set_tests_properties(testReductionFunction PROPERTIES LABELS DoublePrecision)
\ No newline at end of file
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/asl.git
More information about the debian-science-commits
mailing list