|
From: <kin...@us...> - 2025-09-09 05:20:57
|
Revision: 7375
http://sourceforge.net/p/teem/code/7375
Author: kindlmann
Date: 2025-09-09 05:20:55 +0000 (Tue, 09 Sep 2025)
Log Message:
-----------
still in progress resurrecting CTests
Modified Paths:
--------------
teem/trunk/tests/ctest/CMakeLists.txt
teem/trunk/tests/ctest/air/CMakeLists.txt
teem/trunk/tests/ctest/biff/CMakeLists.txt
teem/trunk/tests/ctest/biff/test.c
teem/trunk/tests/ctest/nrrd/CMakeLists.txt
teem/trunk/tests/ctest/nrrd/macros.c
teem/trunk/tests/ctest/nrrd/sanity.c
teem/trunk/tests/ctest/nrrd/tbspec.c
teem/trunk/tests/ctest/nrrd/tload.c
teem/trunk/tests/ctest/nrrd/trand.c
teem/trunk/tests/ctest/nrrd/tskip.c
teem/trunk/tests/ctest/unrrdu/CMakeLists.txt
teem/trunk/tests/ctest/unrrdu/unulist.c
Modified: teem/trunk/tests/ctest/CMakeLists.txt
===================================================================
--- teem/trunk/tests/ctest/CMakeLists.txt 2025-09-09 04:46:54 UTC (rev 7374)
+++ teem/trunk/tests/ctest/CMakeLists.txt 2025-09-09 05:20:55 UTC (rev 7375)
@@ -32,10 +32,10 @@
###-------------------------------------------------------------------------------------
# Two helper functions for creating and describing tests:
-# teem_create_test_executable: creates the executable test program
+# teem_create_test_bin: creates the executable test program
# teem_add_test: uses the executable to declare a new test
-# teem_create_test_executable(<target> <src> [USE_TMPDIR]):
+# teem_create_test_bin(<target> <src> [USE_TMPDIR]):
# From test program source file <src> create executable, hereafter referred to as
# <target>. If USE_TMPDIR, then create a tmp directory "<target>_tmp" that the test can
# use for writing files. Attach the necessary environment variables to the target, to be
@@ -44,7 +44,7 @@
# the source code of the test program, than the circumstances of how the test executable
# is run.
#
-function(teem_create_test_executable target src)
+function(teem_create_test_bin target src)
set(options USE_TMPDIR)
# this sets TCTE_USE_TMPDIR if "USE_TMPDIR" was passed
cmake_parse_arguments(TCTE "${options}" "" "" ${ARGN})
@@ -65,7 +65,7 @@
# teem_add_test(<target> [NAME <name>] [ARGS <args>...])
# This creates the CTest test via add_test() around the <target> created by
-# teem_create_test_executable above. The NAME option, if used, creates a name for the
+# teem_create_test_bin above. The NAME option, if used, creates a name for the
# test different than ${target} The ARGS option says how to run it on the command-line.
#
function(teem_add_test target)
@@ -105,7 +105,30 @@
endfunction()
###-------------------------------------------------------------------------------------
-# The Tests!
+# The Tests (such as they are)
#
# These are the component libraries that have tests; more added as time permits
+# (TEEM_LIB_LIST) except that most (those yearning for tests) are commented out
add_subdirectory(air)
+# add_subdirectory(hest)
+add_subdirectory(biff)
+add_subdirectory(nrrd)
+# add_subdirectory(ell)
+# add_subdirectory(moss)
+add_subdirectory(unrrdu)
+# add_subdirectory(alan)
+# add_subdirectory(tijk)
+#add_subdirectory(gage) # TOFIX
+# add_subdirectory(dye)
+# add_subdirectory(bane)
+# add_subdirectory(limn)
+# add_subdirectory(echo)
+# add_subdirectory(hoover)
+# add_subdirectory(seek)
+#add_subdirectory(ten) # TOFIX
+# add_subdirectory(elf)
+# add_subdirectory(pull)
+# add_subdirectory(coil)
+# add_subdirectory(push)
+# add_subdirectory(mite)
+#add_subdirectory(meet) # TOFIX
Modified: teem/trunk/tests/ctest/air/CMakeLists.txt
===================================================================
--- teem/trunk/tests/ctest/air/CMakeLists.txt 2025-09-09 04:46:54 UTC (rev 7374)
+++ teem/trunk/tests/ctest/air/CMakeLists.txt 2025-09-09 05:20:55 UTC (rev 7375)
@@ -1,18 +1,18 @@
-teem_create_test_executable(test_miscAir miscAir.c)
-teem_add_test(test_miscAir)
+teem_create_test_bin(air_miscAir miscAir.c)
+teem_add_test(air_miscAir)
-teem_create_test_executable(test_mtrand mtrand.c)
-teem_add_test(test_mtrand)
+teem_create_test_bin(air_mtrand mtrand.c)
+teem_add_test(air_mtrand)
-teem_create_test_executable(test_amath amath.c)
-teem_add_test(test_amath)
+teem_create_test_bin(air_amath amath.c)
+teem_add_test(air_amath)
-teem_create_test_executable(test_string string.c)
-teem_add_test(test_string)
+teem_create_test_bin(air_string string.c)
+teem_add_test(air_string)
-teem_create_test_executable(test_strtok strtok.c)
-teem_add_test(test_strtok)
+teem_create_test_bin(air_strtok strtok.c)
+teem_add_test(air_strtok)
-teem_create_test_executable(test_pptest pptest.c)
-teem_add_test(test_pptest)
+teem_create_test_bin(air_pptest pptest.c)
+teem_add_test(air_pptest)
Modified: teem/trunk/tests/ctest/biff/CMakeLists.txt
===================================================================
--- teem/trunk/tests/ctest/biff/CMakeLists.txt 2025-09-09 04:46:54 UTC (rev 7374)
+++ teem/trunk/tests/ctest/biff/CMakeLists.txt 2025-09-09 05:20:55 UTC (rev 7375)
@@ -1,24 +1,3 @@
-#
-# Teem: Tools to process and visualize scientific data and images
-# Copyright (C) 2009--2019 University of Chicago
-# Copyright (C) 2008, 2007, 2006, 2005 Gordon Kindlmann
-# Copyright (C) 2004, 2003, 2002, 2001, 2000, 1999, 1998 University of Utah
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public License
-# (LGPL) as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-# The terms of redistributing and/or modifying this software also
-# include exceptions to the LGPL that facilitate static linking.
-#
-# This library 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
-# Lesser General Public License for more details.
-# You should have received a copy of the GNU Lesser General Public License
-# along with this library; if not, see <https://www.gnu.org/licenses/>.
-#
-add_executable(test_biff test.c)
-target_link_libraries(test_biff teem)
-add_test(NAME biff COMMAND $<TARGET_FILE:test_biff>)
+teem_create_test_bin(biff_test test.c)
+teem_add_test(biff_test)
Modified: teem/trunk/tests/ctest/biff/test.c
===================================================================
--- teem/trunk/tests/ctest/biff/test.c 2025-09-09 04:46:54 UTC (rev 7374)
+++ teem/trunk/tests/ctest/biff/test.c 2025-09-09 05:20:55 UTC (rev 7375)
@@ -1,27 +1,24 @@
/*
Teem: Tools to process and visualize scientific data and images
- Copyright (C) 2009--2019 University of Chicago
- Copyright (C) 2008, 2007, 2006, 2005 Gordon Kindlmann
- Copyright (C) 2004, 2003, 2002, 2001, 2000, 1999, 1998 University of Utah
+ Copyright (C) 2009--2025 University of Chicago
+ Copyright (C) 2005--2008 Gordon Kindlmann
+ Copyright (C) 1998--2004 University of Utah
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public License
- (LGPL) as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
- The terms of redistributing and/or modifying this software also
- include exceptions to the LGPL that facilitate static linking.
+ This library is free software; you can redistribute it and/or modify it under the terms
+ of the GNU Lesser General Public License (LGPL) as published by the Free Software
+ Foundation; either version 2.1 of the License, or (at your option) any later version.
+ The terms of redistributing and/or modifying this software also include exceptions to
+ the LGPL that facilitate static linking.
- This library 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
- Lesser General Public License for more details.
+ This library 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this library; if not, see <https://www.gnu.org/licenses/>.
*/
+#include <teem/biff.h>
-#include "teem/biff.h"
-
/*
** Tests:
** biffAdd
@@ -60,25 +57,24 @@
biffAdd("bingo", "the third error bingo");
biffAdd("axis", "the third error axis");
{
- char good[] =
- "[bingo] the third error bingo\n"
- "[bingo] the second bll boo boo boo error bingo\n"
- "[bingo] the first error bingo\n"
- "[bingo] [chard] the third error chard\n"
- "[bingo] [chard] the second error chard\n"
- "[bingo] [chard] the first error chard\n"
- "[bingo] zero-eth bingo message\n";
+ char good[] = "[bingo] the third error bingo\n"
+ "[bingo] the second bll boo boo boo error bingo\n"
+ "[bingo] the first error bingo\n"
+ "[bingo] [chard] the third error chard\n"
+ "[bingo] [chard] the second error chard\n"
+ "[bingo] [chard] the first error chard\n"
+ "[bingo] zero-eth bingo message\n";
tmp = biffGet("bingo");
airMopAdd(mop, tmp, airFree, airMopAlways);
/* an ugly macro */
-#define COMPARE(N) \
- airMopAdd(mop, tmp, airFree, airMopAlways); \
- if (strcmp(tmp, good)) { \
- fprintf(stderr, "%s: %d: #%s# != #%s#\n", me, N, tmp, good); \
- airMopError(mop); \
- exit(1); \
- }
+#define COMPARE(N) \
+ airMopAdd(mop, tmp, airFree, airMopAlways); \
+ if (strcmp(tmp, good)) { \
+ fprintf(stderr, "%s: %d: #%s# != #%s#\n", me, N, tmp, good); \
+ airMopError(mop); \
+ exit(1); \
+ }
COMPARE(1);
}
@@ -90,10 +86,9 @@
}
{
- char good[] =
- "[axis] the third error axis\n"
- "[axis] the second error axis\n"
- "[axis] the first error axis\n";
+ char good[] = "[axis] the third error axis\n"
+ "[axis] the second error axis\n"
+ "[axis] the first error axis\n";
tmp = biffGet("axis");
COMPARE(3);
}
@@ -102,10 +97,9 @@
biffAdd("harold", "the second error harold");
biffAdd("harold", "the third error harold");
{
- char good[] =
- "[harold] the third error harold\n"
- "[harold] the second error harold\n"
- "[harold] the first error harold\n";
+ char good[] = "[harold] the third error harold\n"
+ "[harold] the second error harold\n"
+ "[harold] the first error harold\n";
tmp = biffGetDone("harold");
COMPARE(4);
}
@@ -120,12 +114,11 @@
biffAdd("axis", "the fourth error axis");
biffAdd("axis", "the fifth error axis");
{
- char good[] =
- "[axis] the fifth error axis\n"
- "[axis] the fourth error axis\n"
- "[axis] the third error axis\n"
- "[axis] the second error axis\n"
- "[axis] the first error axis\n";
+ char good[] = "[axis] the fifth error axis\n"
+ "[axis] the fourth error axis\n"
+ "[axis] the third error axis\n"
+ "[axis] the second error axis\n"
+ "[axis] the first error axis\n";
tmp = biffGetDone("axis");
COMPARE(5);
}
@@ -140,9 +133,8 @@
biffAddf("test2", "%s: this is a test of biffAddf %d %g", "me", 1, 4.2);
biffMovef("test3", "test2", "%s: testing biffMove %d.", "me", 1729);
{
- char good[] =
- "[test3] me: testing biffMove 1729.\n"
- "[test3] [test2] me: this is a test of biffAddf 1 4.2\n";
+ char good[] = "[test3] me: testing biffMove 1729.\n"
+ "[test3] [test2] me: this is a test of biffAddf 1 4.2\n";
tmp = biffGet("test3");
COMPARE(7);
}
Modified: teem/trunk/tests/ctest/nrrd/CMakeLists.txt
===================================================================
--- teem/trunk/tests/ctest/nrrd/CMakeLists.txt 2025-09-09 04:46:54 UTC (rev 7374)
+++ teem/trunk/tests/ctest/nrrd/CMakeLists.txt 2025-09-09 05:20:55 UTC (rev 7375)
@@ -1,50 +1,23 @@
-#
-# Teem: Tools to process and visualize scientific data and images
-# Copyright (C) 2009--2019 University of Chicago
-# Copyright (C) 2008, 2007, 2006, 2005 Gordon Kindlmann
-# Copyright (C) 2004, 2003, 2002, 2001, 2000, 1999, 1998 University of Utah
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public License
-# (LGPL) as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-# The terms of redistributing and/or modifying this software also
-# include exceptions to the LGPL that facilitate static linking.
-#
-# This library 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
-# Lesser General Public License for more details.
-# You should have received a copy of the GNU Lesser General Public License
-# along with this library; if not, see <https://www.gnu.org/licenses/>.
-#
+teem_create_test_bin(nrrd_sanity sanity.c)
+teem_add_test(nrrd_sanity)
-add_executable(test_trand trand.c)
-target_link_libraries(test_trand teem)
-add_test(NAME trand COMMAND $<TARGET_FILE:test_trand>)
+teem_create_test_bin(nrrd_trand trand.c USE_TMPDIR)
+teem_add_test(nrrd_trand)
-add_executable(test_tload tload.c)
-target_link_libraries(test_tload teem)
-add_test(NAME tload COMMAND $<TARGET_FILE:test_tload>)
+teem_create_test_bin(nrrd_tload tload.c USE_TMPDIR)
+teem_add_test(nrrd_tload)
-add_executable(test_tskip tskip.c)
-target_link_libraries(test_tskip teem)
-# Note the different file names; tests are run in parallel
-add_test(NAME tskip11p COMMAND $<TARGET_FILE:test_tskip> -s 101 102 103 -p 66 81 -o tsA.raw tsA.nhdr)
-add_test(NAME tskip11n COMMAND $<TARGET_FILE:test_tskip> -s 101 102 103 -p 66 81 -ns -o tsB.raw tsB.nhdr)
-add_test(NAME tskip01p COMMAND $<TARGET_FILE:test_tskip> -s 101 102 103 -p 0 99 -o tsC.raw tsC.nhdr)
-add_test(NAME tskip01n COMMAND $<TARGET_FILE:test_tskip> -s 101 102 103 -p 0 99 -ns -o tsD.raw tsD.nhdr)
-add_test(NAME tskip10p COMMAND $<TARGET_FILE:test_tskip> -s 101 102 103 -p 77 0 -o tsE.raw tsE.nhdr)
-add_test(NAME tskip10n COMMAND $<TARGET_FILE:test_tskip> -s 101 102 103 -p 77 0 -ns -o tsF.raw tsF.nhdr)
+teem_create_test_bin(nrrd_tskip tskip.c USE_TMPDIR)
+teem_add_test(nrrd_tskip NAME tskip11p ARGS -s 101 102 103 -p 66 81 -o tsA.raw tsA.nhdr)
+teem_add_test(nrrd_tskip NAME tskip11n ARGS -s 101 102 103 -p 66 81 -ns -o tsB.raw tsB.nhdr)
+teem_add_test(nrrd_tskip NAME tskip01p ARGS -s 101 102 103 -p 0 99 -o tsC.raw tsC.nhdr)
+teem_add_test(nrrd_tskip NAME tskip01n ARGS -s 101 102 103 -p 0 99 -ns -o tsD.raw tsD.nhdr)
+teem_add_test(nrrd_tskip NAME tskip10p ARGS -s 101 102 103 -p 77 0 -o tsE.raw tsE.nhdr)
+teem_add_test(nrrd_tskip NAME tskip10n ARGS -s 101 102 103 -p 77 0 -ns -o tsF.raw tsF.nhdr)
-add_executable(test_sanity sanity.c)
-target_link_libraries(test_sanity teem)
-add_test(NAME sanity COMMAND $<TARGET_FILE:test_sanity>)
+teem_create_test_bin(nrrd_macros macros.c)
+teem_add_test(nrrd_macros)
-add_executable(test_macros macros.c)
-target_link_libraries(test_macros teem)
-add_test(NAME macros COMMAND $<TARGET_FILE:test_macros>)
-
-add_executable(test_bspec tbspec.c)
-target_link_libraries(test_bspec teem)
-add_test(NAME bspec COMMAND $<TARGET_FILE:test_bspec> -bs bleed wrap pad:42)
+teem_create_test_bin(nrrd_bspec tbspec.c)
+teem_add_test(nrrd_bspec ARGS -bs bleed wrap pad:42)
+# HEY why not more nrrd_bspec tests?
Modified: teem/trunk/tests/ctest/nrrd/macros.c
===================================================================
--- teem/trunk/tests/ctest/nrrd/macros.c 2025-09-09 04:46:54 UTC (rev 7374)
+++ teem/trunk/tests/ctest/nrrd/macros.c 2025-09-09 05:20:55 UTC (rev 7375)
@@ -1,20 +1,18 @@
/*
Teem: Tools to process and visualize scientific data and images
- Copyright (C) 2009--2019 University of Chicago
- Copyright (C) 2008, 2007, 2006, 2005 Gordon Kindlmann
- Copyright (C) 2004, 2003, 2002, 2001, 2000, 1999, 1998 University of Utah
+ Copyright (C) 2009--2025 University of Chicago
+ Copyright (C) 2005--2008 Gordon Kindlmann
+ Copyright (C) 1998--2004 University of Utah
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public License
- (LGPL) as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
- The terms of redistributing and/or modifying this software also
- include exceptions to the LGPL that facilitate static linking.
+ This library is free software; you can redistribute it and/or modify it under the terms
+ of the GNU Lesser General Public License (LGPL) as published by the Free Software
+ Foundation; either version 2.1 of the License, or (at your option) any later version.
+ The terms of redistributing and/or modifying this software also include exceptions to
+ the LGPL that facilitate static linking.
- This library 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
- Lesser General Public License for more details.
+ This library 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this library; if not, see <https://www.gnu.org/licenses/>.
*/
Modified: teem/trunk/tests/ctest/nrrd/sanity.c
===================================================================
--- teem/trunk/tests/ctest/nrrd/sanity.c 2025-09-09 04:46:54 UTC (rev 7374)
+++ teem/trunk/tests/ctest/nrrd/sanity.c 2025-09-09 05:20:55 UTC (rev 7375)
@@ -1,20 +1,18 @@
/*
Teem: Tools to process and visualize scientific data and images
- Copyright (C) 2009--2019 University of Chicago
- Copyright (C) 2008, 2007, 2006, 2005 Gordon Kindlmann
- Copyright (C) 2004, 2003, 2002, 2001, 2000, 1999, 1998 University of Utah
+ Copyright (C) 2009--2025 University of Chicago
+ Copyright (C) 2005--2008 Gordon Kindlmann
+ Copyright (C) 1998--2004 University of Utah
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public License
- (LGPL) as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
- The terms of redistributing and/or modifying this software also
- include exceptions to the LGPL that facilitate static linking.
+ This library is free software; you can redistribute it and/or modify it under the terms
+ of the GNU Lesser General Public License (LGPL) as published by the Free Software
+ Foundation; either version 2.1 of the License, or (at your option) any later version.
+ The terms of redistributing and/or modifying this software also include exceptions to
+ the LGPL that facilitate static linking.
- This library 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
- Lesser General Public License for more details.
+ This library 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this library; if not, see <https://www.gnu.org/licenses/>.
*/
Modified: teem/trunk/tests/ctest/nrrd/tbspec.c
===================================================================
--- teem/trunk/tests/ctest/nrrd/tbspec.c 2025-09-09 04:46:54 UTC (rev 7374)
+++ teem/trunk/tests/ctest/nrrd/tbspec.c 2025-09-09 05:20:55 UTC (rev 7375)
@@ -1,25 +1,23 @@
/*
Teem: Tools to process and visualize scientific data and images
- Copyright (C) 2009--2019 University of Chicago
- Copyright (C) 2008, 2007, 2006, 2005 Gordon Kindlmann
- Copyright (C) 2004, 2003, 2002, 2001, 2000, 1999, 1998 University of Utah
+ Copyright (C) 2009--2025 University of Chicago
+ Copyright (C) 2005--2008 Gordon Kindlmann
+ Copyright (C) 1998--2004 University of Utah
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public License
- (LGPL) as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
- The terms of redistributing and/or modifying this software also
- include exceptions to the LGPL that facilitate static linking.
+ This library is free software; you can redistribute it and/or modify it under the terms
+ of the GNU Lesser General Public License (LGPL) as published by the Free Software
+ Foundation; either version 2.1 of the License, or (at your option) any later version.
+ The terms of redistributing and/or modifying this software also include exceptions to
+ the LGPL that facilitate static linking.
- This library 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
- Lesser General Public License for more details.
+ This library 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this library; if not, see <https://www.gnu.org/licenses/>.
*/
-#include "teem/nrrd.h"
+#include <teem/nrrd.h>
/*
** Tests:
Modified: teem/trunk/tests/ctest/nrrd/tload.c
===================================================================
--- teem/trunk/tests/ctest/nrrd/tload.c 2025-09-09 04:46:54 UTC (rev 7374)
+++ teem/trunk/tests/ctest/nrrd/tload.c 2025-09-09 05:20:55 UTC (rev 7375)
@@ -1,26 +1,24 @@
/*
Teem: Tools to process and visualize scientific data and images
- Copyright (C) 2009--2019 University of Chicago
- Copyright (C) 2008, 2007, 2006, 2005 Gordon Kindlmann
- Copyright (C) 2004, 2003, 2002, 2001, 2000, 1999, 1998 University of Utah
+ Copyright (C) 2009--2025 University of Chicago
+ Copyright (C) 2005--2008 Gordon Kindlmann
+ Copyright (C) 1998--2004 University of Utah
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public License
- (LGPL) as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
- The terms of redistributing and/or modifying this software also
- include exceptions to the LGPL that facilitate static linking.
+ This library is free software; you can redistribute it and/or modify it under the terms
+ of the GNU Lesser General Public License (LGPL) as published by the Free Software
+ Foundation; either version 2.1 of the License, or (at your option) any later version.
+ The terms of redistributing and/or modifying this software also include exceptions to
+ the LGPL that facilitate static linking.
- This library 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
- Lesser General Public License for more details.
+ This library 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this library; if not, see <https://www.gnu.org/licenses/>.
*/
-#include "teem/nrrd.h"
-#include <testDataPath.h>
+#include <teem/nrrd.h>
+#include <testutil.h>
/*
** Tests:
@@ -41,7 +39,7 @@
nin = nrrdNew();
airMopAdd(mop, nin, (airMopper)nrrdNuke, airMopAlways);
- fullname = testDataPathPrefix("fmob-c4h.nrrd");
+ fullname = teemTestDataPath("fmob-c4h.nrrd");
airMopAdd(mop, fullname, airFree, airMopAlways);
if (nrrdLoad(nin, fullname, NULL)) {
char *err;
@@ -110,7 +108,9 @@
airMopError(mop);
return 1;
}
- if (nrrdSave("tloadTest.nrrd", nin, NULL) || nrrdLoad(ncopy, "tloadTest.nrrd", NULL)
+ char *tmpPath = teemTestTmpPath("tloadTest.nrrd");
+ airMopAdd(mop, tmpPath, airFree, airMopAlways);
+ if (nrrdSave(tmpPath, nin, NULL) || nrrdLoad(ncopy, tmpPath, NULL)
|| nrrdCompare(nin, ncopy, AIR_FALSE /* onlyData */, 0.0 /* epsilon */, &differ,
explain)) {
char *err;
Modified: teem/trunk/tests/ctest/nrrd/trand.c
===================================================================
--- teem/trunk/tests/ctest/nrrd/trand.c 2025-09-09 04:46:54 UTC (rev 7374)
+++ teem/trunk/tests/ctest/nrrd/trand.c 2025-09-09 05:20:55 UTC (rev 7375)
@@ -1,26 +1,24 @@
/*
Teem: Tools to process and visualize scientific data and images
- Copyright (C) 2009--2019 University of Chicago
- Copyright (C) 2008, 2007, 2006, 2005 Gordon Kindlmann
- Copyright (C) 2004, 2003, 2002, 2001, 2000, 1999, 1998 University of Utah
+ Copyright (C) 2009--2025 University of Chicago
+ Copyright (C) 2005--2008 Gordon Kindlmann
+ Copyright (C) 1998--2004 University of Utah
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public License
- (LGPL) as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
- The terms of redistributing and/or modifying this software also
- include exceptions to the LGPL that facilitate static linking.
+ This library is free software; you can redistribute it and/or modify it under the terms
+ of the GNU Lesser General Public License (LGPL) as published by the Free Software
+ Foundation; either version 2.1 of the License, or (at your option) any later version.
+ The terms of redistributing and/or modifying this software also include exceptions to
+ the LGPL that facilitate static linking.
- This library 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
- Lesser General Public License for more details.
+ This library 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this library; if not, see <https://www.gnu.org/licenses/>.
*/
-#include "teem/nrrd.h"
-#include <testDataPath.h>
+#include <teem/nrrd.h>
+#include <testutil.h>
/*
** Tests:
@@ -41,17 +39,19 @@
main(int argc, const char *argv[]) {
const char *me;
size_t vi, ii, qvalLen;
- Nrrd *nval, *nhist, *nimg, *nread, *ncorr, *ninmem[3];
+ Nrrd *nval, *nhist, *nimg, *nmine, *ncorr, *ninmem[3];
double aa, bb, *val;
airArray *mop;
- char *name, explain[AIR_STRLEN_LARGE + 1];
+ char explain[AIR_STRLEN_LARGE + 1];
#define VALS 0
#define HIST 1
#define IMAG 2
/* PGM image since this Teem build might not support PNG */
- static const char *const mine[3] = {"vals.nrrd", "histo.nrrd", "histo.pgm"};
- static const char *const corr[3] = {"test/trandvals.nrrd", "test/trandhisto.nrrd",
- "test/trandhisto.pgm"};
+ static const char *const mineFile[3] = {"vals.nrrd", "histo.nrrd", "histo.pgm"};
+ char *minePath[3];
+ static const char *const corrFile[3] = {"test/trandvals.nrrd", "test/trandhisto.nrrd",
+ "test/trandhisto.pgm"};
+ char *corrPath[3];
static const char *const what[3] = {"value", "histogram", "histogram image"};
int differ, wi;
@@ -59,6 +59,15 @@
me = argv[0];
mop = airMopNew();
+ for (unsigned int fidx = 0; fidx < 3; fidx++) {
+ // generate (and mop) string holding path to my tmp files
+ minePath[fidx] = teemTestTmpPath(mineFile[fidx]);
+ airMopAdd(mop, minePath[fidx], airFree, airMopAlways);
+ // generate (and mop) string holding path to correct files to compare with
+ corrPath[fidx] = teemTestDataPath(corrFile[fidx]);
+ airMopAdd(mop, corrPath[fidx], airFree, airMopAlways);
+ }
+
qvalLen = 10 * BINS;
nrrdAlloc_va(nval = nrrdNew(), nrrdTypeDouble, 1, 4 * qvalLen);
airMopAdd(mop, nval, (airMopper)nrrdNuke, airMopAlways);
@@ -68,16 +77,15 @@
airMopAdd(mop, nhist, (airMopper)nrrdNuke, airMopAlways);
nimg = nrrdNew();
airMopAdd(mop, nimg, (airMopper)nrrdNuke, airMopAlways);
- nread = nrrdNew();
- airMopAdd(mop, nread, (airMopper)nrrdNuke, airMopAlways);
+ nmine = nrrdNew();
+ airMopAdd(mop, nmine, (airMopper)nrrdNuke, airMopAlways);
ncorr = nrrdNew();
airMopAdd(mop, ncorr, (airMopper)nrrdNuke, airMopAlways);
airSrandMT(999);
vi = 0;
- /* without first casting to float, the platform-dependent
- differences in the values from airNormalRand() would
- lead to testing errors, e.g.:
+ /* without first casting to float, the platform-dependent differences in the values
+ from airNormalRand() would lead to testing errors, e.g.:
correct (test/trandvals.nrrd) and generated values differ:
valA[0]=0.36654774192269141 < valB[0]=0.36654774192269146 by 5.55112e-17
Would be nice to figure out exactly what the origin of that is ... */
@@ -95,11 +103,11 @@
val[vi++] = AIR_CAST(float, bb);
}
- if (nrrdSave(mine[VALS], nval, NULL)
+ if (nrrdSave(minePath[VALS], nval, NULL)
|| nrrdHisto(nhist, nval, NULL, NULL, BINS, nrrdTypeInt)
- || nrrdSave(mine[HIST], nhist, NULL)
+ || nrrdSave(minePath[HIST], nhist, NULL)
|| nrrdHistoDraw(nimg, nhist, HGHT, AIR_TRUE, 0.0)
- || nrrdSave(mine[IMAG], nimg, NULL)) {
+ || nrrdSave(minePath[IMAG], nimg, NULL)) {
char *err;
airMopAdd(mop, err = biffGetDone(NRRD), airFree, airMopAlways);
fprintf(stderr, "%s: trouble:\n%s", me, err);
@@ -107,13 +115,11 @@
return 1;
}
- ninmem[VALS] = nval;
+ ninmem[VALS] = nval; // these were mopped above
ninmem[HIST] = nhist;
ninmem[IMAG] = nimg;
for (wi = 0; wi < 3; wi++) {
- name = testDataPathPrefix(corr[wi]);
- airMopAdd(mop, name, airFree, airMopAlways);
- if (nrrdLoad(ncorr, name, NULL) || nrrdLoad(nread, mine[wi], NULL)) {
+ if (nrrdLoad(nmine, minePath[wi], NULL) || nrrdLoad(ncorr, corrPath[wi], NULL)) {
char *err;
airMopAdd(mop, err = biffGetDone(NRRD), airFree, airMopAlways);
fprintf(stderr, "%s: trouble reading %s:\n%s", me, err, what[wi]);
@@ -120,7 +126,7 @@
airMopError(mop);
return 1;
}
- if (nrrdCompare(ninmem[wi], nread, AIR_FALSE /* onlyData */, 0.0 /* epsilon */,
+ if (nrrdCompare(ninmem[wi], nmine, AIR_FALSE /* onlyData */, 0.0 /* epsilon */,
&differ, explain)) {
char *err;
airMopAdd(mop, err = biffGetDone(NRRD), airFree, airMopAlways);
@@ -130,7 +136,7 @@
return 1;
}
if (differ) {
- fprintf(stderr, "%s: in-mem and from-disk (%s) %ss differ: %s\n", me, mine[wi],
+ fprintf(stderr, "%s: in-mem and from-disk (%s) %ss differ: %s\n", me, minePath[wi],
what[wi], explain);
airMopError(mop);
return 1;
@@ -137,7 +143,7 @@
} else {
printf("%s: good: in-mem and from-disk %ss same\n", me, what[wi]);
}
- if (nrrdCompare(ncorr, nread, AIR_FALSE /* onlyData */, 0.0 /* epsilon */, &differ,
+ if (nrrdCompare(ncorr, nmine, AIR_FALSE /* onlyData */, 0.0 /* epsilon */, &differ,
explain)) {
char *err;
airMopAdd(mop, err = biffGetDone(NRRD), airFree, airMopAlways);
@@ -147,8 +153,8 @@
return 1;
}
if (differ) {
- fprintf(stderr, "%s: correct (%s) and generated %ss differ: %s\n", me, corr[wi],
- what[wi], explain);
+ fprintf(stderr, "%s: correct (%s) and generated %ss differ: %s\n", me,
+ corrPath[wi], what[wi], explain);
airMopError(mop);
return 1;
} else {
Modified: teem/trunk/tests/ctest/nrrd/tskip.c
===================================================================
--- teem/trunk/tests/ctest/nrrd/tskip.c 2025-09-09 04:46:54 UTC (rev 7374)
+++ teem/trunk/tests/ctest/nrrd/tskip.c 2025-09-09 05:20:55 UTC (rev 7375)
@@ -1,25 +1,24 @@
/*
Teem: Tools to process and visualize scientific data and images
- Copyright (C) 2009--2019 University of Chicago
- Copyright (C) 2008, 2007, 2006, 2005 Gordon Kindlmann
- Copyright (C) 2004, 2003, 2002, 2001, 2000, 1999, 1998 University of Utah
+ Copyright (C) 2009--2025 University of Chicago
+ Copyright (C) 2005--2008 Gordon Kindlmann
+ Copyright (C) 1998--2004 University of Utah
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public License
- (LGPL) as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
- The terms of redistributing and/or modifying this software also
- include exceptions to the LGPL that facilitate static linking.
+ This library is free software; you can redistribute it and/or modify it under the terms
+ of the GNU Lesser General Public License (LGPL) as published by the Free Software
+ Foundation; either version 2.1 of the License, or (at your option) any later version.
+ The terms of redistributing and/or modifying this software also include exceptions to
+ the LGPL that facilitate static linking.
- This library 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
- Lesser General Public License for more details.
+ This library 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this library; if not, see <https://www.gnu.org/licenses/>.
*/
-#include "teem/nrrd.h"
+#include <teem/nrrd.h>
+#include <testutil.h>
#define BKEY "tskip"
@@ -49,7 +48,7 @@
Nrrd *nref, *nin;
size_t *size, ii, nn, tick, pad[2];
unsigned int axi, refCRC, gotCRC, sizeNum;
- char *berr, *outS[2], stmp[AIR_STRLEN_SMALL + 1], doneStr[AIR_STRLEN_SMALL + 1];
+ char *berr, *outSbase[2], stmp[AIR_STRLEN_SMALL + 1], doneStr[AIR_STRLEN_SMALL + 1];
airRandMTState *rng;
unsigned int seed, *rdata, printbytes;
unsigned char *dataUC;
@@ -72,7 +71,7 @@
hestOptAdd(&hopt, "pb", "print", airTypeUInt, 1, 1, &printbytes, "0",
"bytes to print at beginning and end of data, to help "
"debug problems");
- hestOptAdd(&hopt, "o", "out.data out.nhdr", airTypeString, 2, 2, outS, NULL,
+ hestOptAdd(&hopt, "o", "out.data out.nhdr", airTypeString, 2, 2, outSbase, NULL,
"output filenames of data and header");
hestParseOrDie(hopt, argc - 1, argv + 1, hparm, me, tskipInfo, AIR_TRUE, AIR_TRUE,
AIR_TRUE);
@@ -123,6 +122,10 @@
refCRC = nrrdCRC32(nref, airEndianBig);
fprintf(stderr, "%u\n", refCRC);
+ char *outS[2];
+ airMopAdd(mop, outS[0] = teemTestTmpPath(outSbase[0]), airFree, airMopAlways);
+ airMopAdd(mop, outS[1] = teemTestTmpPath(outSbase[1]), airFree, airMopAlways);
+
/* write data, with padding */
fprintf(stderr, "saving data . . . ");
fflush(stderr);
Modified: teem/trunk/tests/ctest/unrrdu/CMakeLists.txt
===================================================================
--- teem/trunk/tests/ctest/unrrdu/CMakeLists.txt 2025-09-09 04:46:54 UTC (rev 7374)
+++ teem/trunk/tests/ctest/unrrdu/CMakeLists.txt 2025-09-09 05:20:55 UTC (rev 7375)
@@ -1,24 +1,3 @@
-#
-# Teem: Tools to process and visualize scientific data and images
-# Copyright (C) 2009--2019 University of Chicago
-# Copyright (C) 2008, 2007, 2006, 2005 Gordon Kindlmann
-# Copyright (C) 2004, 2003, 2002, 2001, 2000, 1999, 1998 University of Utah
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public License
-# (LGPL) as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-# The terms of redistributing and/or modifying this software also
-# include exceptions to the LGPL that facilitate static linking.
-#
-# This library 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
-# Lesser General Public License for more details.
-# You should have received a copy of the GNU Lesser General Public License
-# along with this library; if not, see <https://www.gnu.org/licenses/>.
-#
-add_executable(test_unulist unulist.c)
-target_link_libraries(test_unulist teem)
-add_test(NAME unulist COMMAND $<TARGET_FILE:test_unulist>)
+teem_create_test_bin(unrrdu_unulist unulist.c)
+teem_add_test(unrrdu_unulist)
Modified: teem/trunk/tests/ctest/unrrdu/unulist.c
===================================================================
--- teem/trunk/tests/ctest/unrrdu/unulist.c 2025-09-09 04:46:54 UTC (rev 7374)
+++ teem/trunk/tests/ctest/unrrdu/unulist.c 2025-09-09 05:20:55 UTC (rev 7375)
@@ -1,6 +1,6 @@
/*
Teem: Tools to process and visualize scientific data and images
- Copyright (C) 2009--2023 University of Chicago
+ Copyright (C) 2009--2025 University of Chicago
Copyright (C) 2005--2008 Gordon Kindlmann
Copyright (C) 1998--2004 University of Utah
@@ -17,10 +17,10 @@
along with this library; if not, see <https://www.gnu.org/licenses/>.
*/
-#include "teem/unrrdu.h"
+#include <teem/unrrdu.h>
/*
-** Tests:
+** Exercises (not quite testing, yet) unrrduUsageUnu, unrrduCmdList[]->main
*/
int
@@ -40,11 +40,12 @@
hparm = hestParmNew();
airMopAdd(mop, hparm, (airMopper)hestParmFree, airMopAlways);
- /* This just generates all the usage information for unu itself, and then
- for all the unu sub-commands. The purpose is to exercise hest's
- generation of usage info for all the options, and to make sure (by human
- inspection now, later by something automated) that the use of stderr vs
- stdout, and return values, is consistent across all commands */
+ /* This just generates all the usage information for unu itself, and
+ then for all the unu sub-commands. The purpose is to exercise
+ hest's generation of usage info for all the options, and to make
+ sure (by human inspection now, later by something automated) that
+ the use of stderr vs stdout, and return values, is consistent
+ across all commands */
fprintf(out, "%s: ################### BEGIN unu\n", me);
unrrduUsageUnu("unu", hparm, AIR_TRUE /* alsoHidden */);
@@ -52,9 +53,10 @@
uci = 0;
do {
- fprintf(out, "%s: ################### BEGIN unu %s\n", me, unrrduCmdList[uci]->name);
+ fprintf(out, "%s: ################### BEGIN (%u) unu %s\n", me, uci,
+ unrrduCmdList[uci]->name);
ret = unrrduCmdList[uci]->main(0, NULL, unrrduCmdList[uci]->name, hparm);
- fprintf(out, "%s: ################### END unu %s (ret=%d)\n", me,
+ fprintf(out, "%s: ################### END (%u) unu %s (ret=%d)\n", me, uci,
unrrduCmdList[uci]->name, ret);
uci++;
} while (unrrduCmdList[uci]);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|