diff --git a/Tests/CMakeLib/CMakeLists.txt b/Tests/CMakeLib/CMakeLists.txt index 41bf03437..4e819f470 100644 --- a/Tests/CMakeLib/CMakeLists.txt +++ b/Tests/CMakeLib/CMakeLists.txt @@ -5,6 +5,8 @@ include_directories( ) set(CMakeLib_TESTS + testGeneratedFileStream + testSystemTools testUTF8 testXMLParser testXMLSafe diff --git a/Tests/CMakeLib/testGeneratedFileStream.cxx b/Tests/CMakeLib/testGeneratedFileStream.cxx new file mode 100644 index 000000000..f8ca4af94 --- /dev/null +++ b/Tests/CMakeLib/testGeneratedFileStream.cxx @@ -0,0 +1,100 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2000-2011 Kitware, Inc., Insight Software Consortium + + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. + + This software is distributed WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the License for more information. +============================================================================*/ +#include "cmGeneratedFileStream.h" +#include "cmSystemTools.h" + +#define cmFailed(m1, m2) \ + std::cout << "FAILED: " << m1 << m2 << "\n"; failed=1 + +int testGeneratedFileStream(int, char*[]) +{ + int failed = 0; + cmGeneratedFileStream gm; + std::string file1 = "generatedFile1"; + std::string file2 = "generatedFile2"; + std::string file3 = "generatedFile3"; + std::string file4 = "generatedFile4"; + std::string file1tmp = file1 + ".tmp"; + std::string file2tmp = file2 + ".tmp"; + std::string file3tmp = file3 + ".tmp"; + std::string file4tmp = file4 + ".tmp"; + gm.Open(file1.c_str()); + gm << "This is generated file 1"; + gm.Close(); + gm.Open(file2.c_str()); + gm << "This is generated file 2"; + gm.Close(); + gm.Open(file3.c_str()); + gm << "This is generated file 3"; + gm.Close(); + gm.Open(file4.c_str()); + gm << "This is generated file 4"; + gm.Close(); + if ( cmSystemTools::FileExists(file1.c_str()) ) + { + if ( cmSystemTools::FileExists(file2.c_str()) ) + { + if ( cmSystemTools::FileExists(file3.c_str()) ) + { + if ( cmSystemTools::FileExists(file4.c_str()) ) + { + if ( cmSystemTools::FileExists(file1tmp.c_str()) ) + { + cmFailed("Something wrong with cmGeneratedFileStream. Temporary file is still here: ", file1tmp.c_str()); + } + else if ( cmSystemTools::FileExists(file2tmp.c_str()) ) + { + cmFailed("Something wrong with cmGeneratedFileStream. Temporary file is still here: ", file2tmp.c_str()); + } + else if ( cmSystemTools::FileExists(file3tmp.c_str()) ) + { + cmFailed("Something wrong with cmGeneratedFileStream. Temporary file is still here: ", file3tmp.c_str()); + } + else if ( cmSystemTools::FileExists(file4tmp.c_str()) ) + { + cmFailed("Something wrong with cmGeneratedFileStream. Temporary file is still here: ", file4tmp.c_str()); + } + else + { + std::cout << "cmGeneratedFileStream works\n"; + } + } + else + { + cmFailed("Something wrong with cmGeneratedFileStream. Cannot find file: ", file4.c_str()); + } + } + else + { + cmFailed("Something wrong with cmGeneratedFileStream. Found file: ", file3.c_str()); + } + } + else + { + cmFailed("Something wrong with cmGeneratedFileStream. Cannot find file: ", file2.c_str()); + } + } + else + { + cmFailed("Something wrong with cmGeneratedFileStream. Cannot find file: ", file1.c_str()); + } + cmSystemTools::RemoveFile(file1.c_str()); + cmSystemTools::RemoveFile(file2.c_str()); + cmSystemTools::RemoveFile(file3.c_str()); + cmSystemTools::RemoveFile(file4.c_str()); + cmSystemTools::RemoveFile(file1tmp.c_str()); + cmSystemTools::RemoveFile(file2tmp.c_str()); + cmSystemTools::RemoveFile(file3tmp.c_str()); + cmSystemTools::RemoveFile(file4tmp.c_str()); + + return failed; +} diff --git a/Tests/CMakeLib/testSystemTools.cxx b/Tests/CMakeLib/testSystemTools.cxx new file mode 100644 index 000000000..9309ae332 --- /dev/null +++ b/Tests/CMakeLib/testSystemTools.cxx @@ -0,0 +1,33 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2000-2011 Kitware, Inc., Insight Software Consortium + + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. + + This software is distributed WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the License for more information. +============================================================================*/ +#include "cmSystemTools.h" + +#define cmPassed(m) std::cout << "Passed: " << m << "\n" +#define cmFailed(m) std::cout << "FAILED: " << m << "\n"; failed=1 + +int testSystemTools(int, char*[]) +{ + int failed = 0; + // ---------------------------------------------------------------------- + // Test cmSystemTools::UpperCase + std::string str = "abc"; + std::string strupper = "ABC"; + if(cmSystemTools::UpperCase(str) == strupper) + { + cmPassed("cmSystemTools::UpperCase is working"); + } + else + { + cmFailed("cmSystemTools::UpperCase is working"); + } + return failed; +} diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 42b3ef79b..00c9ac726 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -772,13 +772,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ SET(COMPILER_IS_COMO 1) ENDIF(CMAKE_BASE_NAME MATCHES "^como$") IF(NOT COMPILER_IS_COMO) - SET(COMPLEX_TEST_CMAKELIB 1) - IF(CMAKE_TEST_DIFFERENT_GENERATOR OR CMAKE_TEST_SYSTEM_LIBRARIES) - SET(COMPLEX_TEST_CMAKELIB 0) - ENDIF(CMAKE_TEST_DIFFERENT_GENERATOR OR CMAKE_TEST_SYSTEM_LIBRARIES) - IF(BORLAND) - SET(COMPLEX_TEST_CMAKELIB 0) - ENDIF(BORLAND) ADD_TEST(complex ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Complex" @@ -790,7 +783,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-exe-dir "${CMake_BINARY_DIR}/Tests/Complex/bin" --build-options - -DCOMPLEX_TEST_CMAKELIB:BOOL=${COMPLEX_TEST_CMAKELIB} -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} --test-command complex ) @@ -805,7 +797,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-exe-dir "${CMake_BINARY_DIR}/Tests/ComplexOneConfig/bin" --build-options - -DCOMPLEX_TEST_CMAKELIB:BOOL=${COMPLEX_TEST_CMAKELIB} -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} --test-command complex) LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ComplexOneConfig") @@ -824,18 +815,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ # --build-project ConvLibrary # --test-command bartest) - -# ADD_TEST(complexRelativePaths ${CMAKE_CTEST_COMMAND} -# --build-and-test -# "${CMake_SOURCE_DIR}/Tests/ComplexRelativePaths" -# "${CMake_BINARY_DIR}/Tests/ComplexRelativePaths" -# --build-generator ${CMAKE_TEST_GENERATOR} -# --build-project complex -# --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} -# --build-exe-dir "${CMake_BINARY_DIR}/Tests/ComplexRelativePaths/bin" -# --build-options -DCMAKE_USE_RELATIVE_PATHS:BOOL=ON -# --test-command complex) - ENDIF(NOT COMPILER_IS_COMO) ADD_TEST(Example ${CMAKE_CTEST_COMMAND} diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt index 8d6029a9f..b50501905 100644 --- a/Tests/Complex/CMakeLists.txt +++ b/Tests/Complex/CMakeLists.txt @@ -17,9 +17,6 @@ ENDIF(POLICY CMP0003) # Test building without per-rule echo lines in Makefiles. SET_PROPERTY(GLOBAL PROPERTY RULE_MESSAGES OFF) -# Choose whether to test CMakeLib. -OPTION(COMPLEX_TEST_CMAKELIB "Test CMakeLib" OFF) - SET(CPACK_SOURCE_IGNORE_FILES "~$;\\.cvsignore$;^C:/hoffman/My Builds/testcase.*/CVS/;^C:/hoffman/My Builds/testcase.*/\\.svn/;^C:/hoffman/My Builds/testcase.*/sweigart/;^C:/hoffman/My Builds/testcase/www/eospaper/solution/eos2001/;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_tables_new/;^C:/hoffman/My Builds/testcase/COPYING$;^C:/hoffman/My Builds/testcase/INSTALL$;^C:/hoffman/My Builds/testcase/Makefile$;^C:/hoffman/My Builds/testcase/Makefile\\.in$;^C:/hoffman/My Builds/testcase/.*\\.lo$;^C:/hoffman/My Builds/testcase/.*\\.la$;^C:/hoffman/My Builds/testcase/mkinstalldirs$;^C:/hoffman/My Builds/testcase/missing$;^C:/hoffman/My Builds/testcase/ltmain\\.sh$;^C:/hoffman/My Builds/testcase/libtool$;^C:/hoffman/My Builds/testcase/install-sh$;^C:/hoffman/My Builds/testcase/configure$;^C:/hoffman/My Builds/testcase/config\\.sub$;^C:/hoffman/My Builds/testcase/config\\.status$;^C:/hoffman/My Builds/testcase/config\\.log$;^C:/hoffman/My Builds/testcase/config\\.guess$;^C:/hoffman/My Builds/testcase/autom4te\\.cache$;^C:/hoffman/My Builds/testcase/aclocal\\.m4$;^C:/hoffman/My Builds/testcase/depcomp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.075\\.model_cassisi_eos1_10$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.075\\.model_cassisi_eos1_10_corr$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model_cassisi_eos1$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model_cassisi_scvh$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.3\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.rgbtip\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.zahb\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.085\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.mem$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.tex\\.bak$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j10\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j12\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j16\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j20\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j22\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j26\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j30\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j32\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j36\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k10\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k12\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k20\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k22\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k30\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k32\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/1_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/1_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/2_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/2_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/linear_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/linear_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/noexchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/noexchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/nr_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/nr_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/series_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/series_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_JNR_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_Jseries_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_KNR_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_Kseries_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check34_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check35_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check36_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check43_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check44_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check45_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check46_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check47_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check48_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/Makefile$;^C:/hoffman/My Builds/testcase/www/Makefile\\.in$;^C:/hoffman/My Builds/testcase/src/.*\\.flc$;^C:/hoffman/My Builds/testcase/src/Makefile$;^C:/hoffman/My Builds/testcase/src/Makefile\\.in$;^C:/hoffman/My Builds/testcase/src/\\.deps$;^C:/hoffman/My Builds/testcase/src/\\.libs$;^C:/hoffman/My Builds/testcase/src/.*\\.la$;^C:/hoffman/My Builds/testcase/src/.*\\.lo$;^C:/hoffman/My Builds/testcase/src/make\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/statef.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_15$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_rel$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/hot_post_agb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgb_tip\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/start_shellflash\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/white_dwarf\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/15gamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/15lnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/23gamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/23lnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/thermodynamic_consistency/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/thermodynamic_consistency/.*\\.results$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/3order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/5order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/8order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check8_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check5_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/effo_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/effoo_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda15gamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda15lnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda23gamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda23lnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/thermodynamic_consistency/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/thermodynamic_consistency/tc\\.results$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_compare_model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_compare_solar\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_solar\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_solar_1995\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/statef_opal_model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/statef_opal_model_1995\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/include/Makefile\\.in$;^C:/hoffman/My Builds/testcase/include/Makefile$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/0\\.1\\.model_pteh$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/1\\.0\\.model_eos1a-eos1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/1\\.0\\.model_pteh$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_0\\.1\\.model_pteh\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_1\\.0\\.model_eos1a-eos1\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_1\\.0\\.model_pteh\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/contour\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/eos_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/statef_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/thermodynamic_consistency/fort\\.91$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/thermodynamic_consistency/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/context$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/oldversion_grid$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/2005Ap&SS\\.298\\.\\.135S\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/2007Ap&SS\\.307\\.\\.263C\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/astro-ph\\.9909168_eprint_submitted_to_High_Press\\.Res\\.16,331\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/.*ps.*$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/statef_grid-newversion$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/old$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/make\\.out.*$;^C:/hoffman/My Builds/testcase/utils/.*\\.flc$;^C:/hoffman/My Builds/testcase/utils/Makefile$;^C:/hoffman/My Builds/testcase/utils/Makefile\\.in$;^C:/hoffman/My Builds/testcase/utils/\\.deps$;^C:/hoffman/My Builds/testcase/utils/\\.libs$;^C:/hoffman/My Builds/testcase/utils/.*\\.la$;^C:/hoffman/My Builds/testcase/utils/.*\\.lo$;^C:/hoffman/My Builds/testcase/utils/free_eos_test$;^C:/hoffman/My Builds/testcase/utils/test_rosenbrock$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check1\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check5\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check8\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_checknr\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/effo_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/effoo_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence_20070613$;^C:/hoffman/My Builds/testcase/www/eospaper/text$;^C:/hoffman/My Builds/testcase/www/eospaper/cassisi_book_fig$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.1\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/2\\.0\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.2\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.3\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.4\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.5\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.6\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/figures$;^C:/hoffman/My Builds/testcase/www/eospaper/old$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/.*\\.ps.*$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_JNR\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_Jseries\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_KNR\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_Kseries\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check34\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check35\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check36\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check44\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check45\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check46\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_1_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_2_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_linear_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_noexchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_nr_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_series_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/1_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/noexchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/nr_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/series_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/series_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/linear_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/2_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/nr_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/linear_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/noexchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/1_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/2_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_0\\.1\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_0\\.3\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_linear\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_noexchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_nr\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.rgbtip\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.zahb\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.zahb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.rgbtip\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_linear$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_noexchange$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_nr$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/contour\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/eos_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/statef_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/delta\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/m0085eos1gong\\.ascii$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/m0085eos2gong\\.ascii$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb_adjust/coulomb_adjust\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/rtc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/make\\.out.*$") # @@ -119,8 +116,6 @@ ENDIF(${fooCACHE_TEST_VAR2} MATCHES bar) # INCLUDE_DIRECTORIES( Library - ${Complex_SOURCE_DIR}/../../Source - ${Complex_BINARY_DIR}/../../Source ) INCLUDE_DIRECTORIES(BEFORE diff --git a/Tests/Complex/Executable/A.cxx b/Tests/Complex/Executable/A.cxx index 0cc995af0..fb3eb0819 100644 --- a/Tests/Complex/Executable/A.cxx +++ b/Tests/Complex/Executable/A.cxx @@ -1,7 +1,9 @@ // Include code from a header that should not be compiled separately. #include "A.hh" +#include int main() { - return A(); + printf("#define A_VALUE %d\n", A()); + return 0; } diff --git a/Tests/Complex/Executable/CMakeLists.txt b/Tests/Complex/Executable/CMakeLists.txt index 08cc7d45b..345836257 100644 --- a/Tests/Complex/Executable/CMakeLists.txt +++ b/Tests/Complex/Executable/CMakeLists.txt @@ -5,25 +5,6 @@ CMAKE_MINIMUM_REQUIRED(VERSION 1.3) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTEST_CXX_FLAGS") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS") -IF(COMPLEX_TEST_CMAKELIB) - # Link to CMake lib - LINK_DIRECTORIES(${Complex_BINARY_DIR}/../../Source) - LINK_DIRECTORIES(${Complex_BINARY_DIR}/../../Source/kwsys) - LINK_DIRECTORIES(${Complex_BINARY_DIR}/../../Utilities/cmexpat) - LINK_DIRECTORIES(${Complex_BINARY_DIR}/../../Utilities/cmzlib) - # prefer the new curl if it is around - IF(EXISTS ${Complex_BINARY_DIR}/../../Utilities/cmcurl-7.19.0) - LINK_DIRECTORIES(${Complex_BINARY_DIR}/../../Utilities/cmcurl-7.19.0/lib) - ENDIF(EXISTS ${Complex_BINARY_DIR}/../../Utilities/cmcurl-7.19.0) - IF(EXISTS ${Complex_BINARY_DIR}/../../Utilities/cmcurl) - LINK_DIRECTORIES(${Complex_BINARY_DIR}/../../Utilities/cmcurl) - ENDIF(EXISTS ${Complex_BINARY_DIR}/../../Utilities/cmcurl) - LINK_DIRECTORIES( - ${Complex_BINARY_DIR}/../../Utilities/cmlibarchive/libarchive - ${Complex_BINARY_DIR}/../../Utilities/cmbzip2 - ) -ENDIF(COMPLEX_TEST_CMAKELIB) - # Create an imported target for if(TARGET) test below. ADD_LIBRARY(ExeImportedTarget UNKNOWN IMPORTED) @@ -55,14 +36,13 @@ SET_SOURCE_FILES_PROPERTIES(complex_nobuild.cxx PROPERTIES SET_SOURCE_FILES_PROPERTIES(complex_nobuild.c PROPERTIES HEADER_FILE_ONLY 1) +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) ADD_EXECUTABLE(A A.cxx A.hh A.h A.txt) -ADD_EXECUTABLE(complex complex testcflags.c ) +ADD_CUSTOM_COMMAND(OUTPUT Aout.h COMMAND A > Aout.h VERBATIM) +ADD_EXECUTABLE(complex complex testcflags.c Aout.h) # Sub1/NameConflictTest.c Sub2/NameConflictTest.c) ADD_EXECUTABLE(complex.file complex.file.cxx complex_nobuild.cxx complex_nobuild.c) -IF(COMPLEX_TEST_CMAKELIB) - TARGET_LINK_LIBRARIES(complex CMakeLib cmsys cmexpat cmzlib cmlibarchive cmbzip2 cmcurl) -ENDIF(COMPLEX_TEST_CMAKELIB) IF (UNIX) TARGET_LINK_LIBRARIES(complex ${CMAKE_DL_LIBS}) diff --git a/Tests/Complex/Executable/complex.cxx b/Tests/Complex/Executable/complex.cxx index 0ecd8fe2e..1901d9914 100644 --- a/Tests/Complex/Executable/complex.cxx +++ b/Tests/Complex/Executable/complex.cxx @@ -3,23 +3,21 @@ #include "cmTestGeneratedHeader.h" #include "cmVersion.h" #include "ExtraSources/file1.h" +#include "Aout.h" #include "file2.h" #include "sharedFile.h" extern "C" { #include "testConly.h" } -#ifdef COMPLEX_TEST_CMAKELIB -#include "cmStandardIncludes.h" -#include "cmSystemTools.h" -#include "cmDynamicLoader.h" -#include "cmSystemTools.h" -#include "cmGeneratedFileStream.h" -#include -#else #include #include #include #include + +#include +#include +#if !defined(S_ISDIR) +# define S_ISDIR(mode) ((mode) & _S_IFDIR) #endif #ifdef COMPLEX_TEST_LINK_STATIC @@ -67,18 +65,18 @@ void cmPassed(const char* Message, const char* m2="") # error Per-configuration directory-level definition not inherited. #endif -#ifdef COMPLEX_TEST_CMAKELIB // ====================================================================== void TestAndRemoveFile(const char* filename) { - if (!cmSystemTools::FileExists(filename)) + struct stat st; + if(stat(filename, &st) < 0) { cmFailed("Could not find file: ", filename); } else { - if (!cmSystemTools::RemoveFile(filename)) + if (remove(filename) < 0) { cmFailed("Unable to remove file. It does not imply that this test failed, but it *will* be corrupted thereafter if this file is not removed: ", filename); } @@ -93,105 +91,17 @@ void TestAndRemoveFile(const char* filename) void TestDir(const char* filename) { - if (!cmSystemTools::FileExists(filename)) + struct stat st; + if(stat(filename, &st) < 0 || !S_ISDIR(st.st_mode)) { cmFailed("Could not find dir: ", filename); } else { - if (!cmSystemTools::FileIsDirectory(filename)) - { - cmFailed("Unable to check if file is a directory: ", filename); - } - else - { - cmPassed("Find dir: ", filename); - } + cmPassed("Find dir: ", filename); } } -// ====================================================================== - -void TestCMGeneratedFileSTream() -{ - cmGeneratedFileStream gm; - std::string file1 = std::string(BINARY_DIR) + std::string("/generatedFile1"); - std::string file2 = std::string(BINARY_DIR) + std::string("/generatedFile2"); - std::string file3 = std::string(BINARY_DIR) + std::string("/generatedFile3"); - std::string file4 = std::string(BINARY_DIR) + std::string("/generatedFile4"); - std::string file1tmp = file1 + ".tmp"; - std::string file2tmp = file2 + ".tmp"; - std::string file3tmp = file3 + ".tmp"; - std::string file4tmp = file4 + ".tmp"; - gm.Open(file1.c_str()); - gm << "This is generated file 1"; - gm.Close(); - gm.Open(file2.c_str()); - gm << "This is generated file 2"; - gm.Close(); - gm.Open(file3.c_str()); - gm << "This is generated file 3"; - gm.Close(); - gm.Open(file4.c_str()); - gm << "This is generated file 4"; - gm.Close(); - if ( cmSystemTools::FileExists(file1.c_str()) ) - { - if ( cmSystemTools::FileExists(file2.c_str()) ) - { - if ( cmSystemTools::FileExists(file3.c_str()) ) - { - if ( cmSystemTools::FileExists(file4.c_str()) ) - { - if ( cmSystemTools::FileExists(file1tmp.c_str()) ) - { - cmFailed("Something wrong with cmGeneratedFileStream. Temporary file is still here: ", file1tmp.c_str()); - } - else if ( cmSystemTools::FileExists(file2tmp.c_str()) ) - { - cmFailed("Something wrong with cmGeneratedFileStream. Temporary file is still here: ", file2tmp.c_str()); - } - else if ( cmSystemTools::FileExists(file3tmp.c_str()) ) - { - cmFailed("Something wrong with cmGeneratedFileStream. Temporary file is still here: ", file3tmp.c_str()); - } - else if ( cmSystemTools::FileExists(file4tmp.c_str()) ) - { - cmFailed("Something wrong with cmGeneratedFileStream. Temporary file is still here: ", file4tmp.c_str()); - } - else - { - cmPassed("cmGeneratedFileStream works."); - } - } - else - { - cmFailed("Something wrong with cmGeneratedFileStream. Cannot find file: ", file4.c_str()); - } - } - else - { - cmFailed("Something wrong with cmGeneratedFileStream. Found file: ", file3.c_str()); - } - } - else - { - cmFailed("Something wrong with cmGeneratedFileStream. Cannot find file: ", file2.c_str()); - } - } - else - { - cmFailed("Something wrong with cmGeneratedFileStream. Cannot find file: ", file1.c_str()); - } - cmSystemTools::RemoveFile(file1.c_str()); - cmSystemTools::RemoveFile(file2.c_str()); - cmSystemTools::RemoveFile(file3.c_str()); - cmSystemTools::RemoveFile(file1tmp.c_str()); - cmSystemTools::RemoveFile(file2tmp.c_str()); - cmSystemTools::RemoveFile(file3tmp.c_str()); -} -#endif - // Here is a stupid function that tries to use std::string methods // so that the dec cxx compiler will instantiate the stuff that // we are using from the CMakeLib library.... @@ -232,113 +142,6 @@ extern "C" int NameConflictTest2(); int main() { - std::string lib = BINARY_DIR; - lib += "/lib/"; -#ifdef CMAKE_INTDIR - lib += CMAKE_INTDIR; - lib += "/"; -#endif - std::string exe = BINARY_DIR; - exe += "/bin/"; -#ifdef CMAKE_INTDIR - exe += CMAKE_INTDIR; - exe += "/"; -#endif - -#ifdef COMPLEX_TEST_CMAKELIB - // Test a single character executable to test a: in makefiles - exe += "A"; - exe += cmSystemTools::GetExecutableExtension(); - int ret; - std::string errorMessage; - exe = cmSystemTools::ConvertToRunCommandPath(exe.c_str()); - if(cmSystemTools::RunSingleCommand(exe.c_str(), 0, &ret)) - { - if(ret != 10) - { - errorMessage += exe; - errorMessage += " did not return 10"; - } - } - else - { - errorMessage += exe; - errorMessage += ": failed to run."; - } - if(errorMessage.size()) - { - cmFailed(errorMessage.c_str()); - } - else - { - cmPassed("run Single Character executable A returned 10 as expected."); - } - - lib += CMAKE_SHARED_MODULE_PREFIX; - lib += "CMakeTestModule"; - lib += CMAKE_SHARED_MODULE_SUFFIX; - cmsys::DynamicLoader::LibraryHandle handle = cmDynamicLoader::OpenLibrary(lib.c_str()); - if(!handle) - { - std::string err = "Can not open CMakeTestModule:\n"; - err += lib; - cmFailed(err.c_str()); - } - else - { - cmsys::DynamicLoader::SymbolPointer fun = - cmsys::DynamicLoader::GetSymbolAddress(handle, "ModuleFunction"); - if(!fun) - { - fun = cmsys::DynamicLoader::GetSymbolAddress(handle, "_ModuleFunction"); - } - typedef int (*TEST_FUNCTION)(); - TEST_FUNCTION testFun = (TEST_FUNCTION)fun; - if(!testFun) - { - cmFailed("Could not find symbol ModuleFunction in library "); - } - else - { - int ret = (*testFun)(); - if(!ret) - { - cmFailed("ModuleFunction call did not return valid return."); - } - cmPassed("Module loaded and ModuleFunction called correctly."); - } - } - cmDynamicLoader::FlushCache(); // fix memory leaks - if(sharedFunction() != 1) - { - cmFailed("Call to sharedFunction from shared library failed."); - } - else - { - cmPassed("Call to sharedFunction from shared library worked."); - } - if(CsharedFunction() != 1) - { - cmFailed("Call to C sharedFunction from shared library failed."); - } - else - { - cmPassed("Call to C sharedFunction from shared library worked."); - } - - // ---------------------------------------------------------------------- - // Test cmSystemTools::UpperCase - std::string str = "abc"; - std::string strupper = "ABC"; - if(cmSystemTools::UpperCase(str) == strupper) - { - cmPassed("cmSystemTools::UpperCase is working"); - } - else - { - cmFailed("cmSystemTools::UpperCase is working"); - } -#endif #if 0 if(NameConflictTest1() == 0 && NameConflictTest2() == 0) { @@ -839,8 +642,7 @@ int main() "FILENAME_VAR_PATH_NAME is not defined."); #else if((strcmp(FILENAME_VAR_PATH_NAME, "Complex") == 0) || - (strcmp(FILENAME_VAR_PATH_NAME, "ComplexOneConfig") == 0) || - (strcmp(FILENAME_VAR_PATH_NAME, "ComplexRelativePaths") == 0)) + (strcmp(FILENAME_VAR_PATH_NAME, "ComplexOneConfig") == 0)) { cmPassed("FILENAME_VAR_PATH_NAME == ", FILENAME_VAR_PATH_NAME); } @@ -901,8 +703,7 @@ int main() "PATH_VAR_NAME is not defined."); #else if((strcmp(PATH_VAR_NAME, "Complex") == 0) || - (strcmp(PATH_VAR_NAME, "ComplexOneConfig") == 0) || - (strcmp(PATH_VAR_NAME, "ComplexRelativePaths") == 0)) + (strcmp(PATH_VAR_NAME, "ComplexOneConfig") == 0)) { cmPassed("PATH_VAR_NAME == ", PATH_VAR_NAME); } @@ -984,7 +785,6 @@ int main() } #endif -#ifdef COMPLEX_TEST_CMAKELIB // ---------------------------------------------------------------------- // Some pre-build/pre-link/post-build custom-commands have been // attached to the lib (see Library/). @@ -1030,7 +830,6 @@ int main() // only created during a build. TestAndRemoveFile(BINARY_DIR "/Executable/Temp/complex-required.txt"); -#endif // ---------------------------------------------------------------------- // Test FIND_LIBRARY @@ -1197,11 +996,6 @@ int main() cmPassed("CMake SET CACHE FORCE"); #endif -#ifdef COMPLEX_TEST_CMAKELIB - // Test the generated file stream. - TestCMGeneratedFileSTream(); -#endif - #ifdef COMPLEX_TEST_LINK_STATIC if(TestLinkGetType()) { @@ -1213,6 +1007,12 @@ int main() } #endif +#if defined(A_VALUE) && A_VALUE == 10 + cmPassed("Single-character executable A worked."); +#else + cmFailed("Single-character executable A failed."); +#endif + // ---------------------------------------------------------------------- // Summary diff --git a/Tests/Complex/Library/CMakeLists.txt b/Tests/Complex/Library/CMakeLists.txt index 281e48a55..c8efc3022 100644 --- a/Tests/Complex/Library/CMakeLists.txt +++ b/Tests/Complex/Library/CMakeLists.txt @@ -43,7 +43,6 @@ ENDIF(WIN32) # SET(SharedLibrarySources sharedFile) ADD_LIBRARY(CMakeTestLibraryShared SHARED ${SharedLibrarySources}) -ADD_LIBRARY(CMakeTestModule MODULE moduleFile.c) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS") ADD_LIBRARY(CMakeTestCLibraryShared SHARED testConly.c) DEFINE_PROPERTY( diff --git a/Tests/Complex/Library/moduleFile.c b/Tests/Complex/Library/moduleFile.c deleted file mode 100644 index 608d750f1..000000000 --- a/Tests/Complex/Library/moduleFile.c +++ /dev/null @@ -1,6 +0,0 @@ -#include "moduleFile.h" - -int ModuleFunction() -{ - return 1; -} diff --git a/Tests/Complex/Library/moduleFile.h b/Tests/Complex/Library/moduleFile.h deleted file mode 100644 index 6b561e109..000000000 --- a/Tests/Complex/Library/moduleFile.h +++ /dev/null @@ -1,12 +0,0 @@ -#if defined(_WIN32) || defined(WIN32) /* Win32 version */ -#ifdef CMakeTestModule_EXPORTS -# define CMakeTest_EXPORT __declspec(dllexport) -#else -# define CMakeTest_EXPORT __declspec(dllimport) -#endif -#else -/* unix needs nothing */ -#define CMakeTest_EXPORT -#endif - -CMakeTest_EXPORT int ModuleFunction(); diff --git a/Tests/Complex/cmTestConfigure.h.in b/Tests/Complex/cmTestConfigure.h.in index d7952da1e..7741b6fd5 100644 --- a/Tests/Complex/cmTestConfigure.h.in +++ b/Tests/Complex/cmTestConfigure.h.in @@ -4,8 +4,6 @@ #cmakedefine ONE_VAR_IS_DEFINED #cmakedefine ZERO_VAR -#cmakedefine COMPLEX_TEST_CMAKELIB - #define STRING_VAR "${STRING_VAR}" // Test FOREACH diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt index 8d6029a9f..b50501905 100644 --- a/Tests/ComplexOneConfig/CMakeLists.txt +++ b/Tests/ComplexOneConfig/CMakeLists.txt @@ -17,9 +17,6 @@ ENDIF(POLICY CMP0003) # Test building without per-rule echo lines in Makefiles. SET_PROPERTY(GLOBAL PROPERTY RULE_MESSAGES OFF) -# Choose whether to test CMakeLib. -OPTION(COMPLEX_TEST_CMAKELIB "Test CMakeLib" OFF) - SET(CPACK_SOURCE_IGNORE_FILES "~$;\\.cvsignore$;^C:/hoffman/My Builds/testcase.*/CVS/;^C:/hoffman/My Builds/testcase.*/\\.svn/;^C:/hoffman/My Builds/testcase.*/sweigart/;^C:/hoffman/My Builds/testcase/www/eospaper/solution/eos2001/;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_tables_new/;^C:/hoffman/My Builds/testcase/COPYING$;^C:/hoffman/My Builds/testcase/INSTALL$;^C:/hoffman/My Builds/testcase/Makefile$;^C:/hoffman/My Builds/testcase/Makefile\\.in$;^C:/hoffman/My Builds/testcase/.*\\.lo$;^C:/hoffman/My Builds/testcase/.*\\.la$;^C:/hoffman/My Builds/testcase/mkinstalldirs$;^C:/hoffman/My Builds/testcase/missing$;^C:/hoffman/My Builds/testcase/ltmain\\.sh$;^C:/hoffman/My Builds/testcase/libtool$;^C:/hoffman/My Builds/testcase/install-sh$;^C:/hoffman/My Builds/testcase/configure$;^C:/hoffman/My Builds/testcase/config\\.sub$;^C:/hoffman/My Builds/testcase/config\\.status$;^C:/hoffman/My Builds/testcase/config\\.log$;^C:/hoffman/My Builds/testcase/config\\.guess$;^C:/hoffman/My Builds/testcase/autom4te\\.cache$;^C:/hoffman/My Builds/testcase/aclocal\\.m4$;^C:/hoffman/My Builds/testcase/depcomp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.075\\.model_cassisi_eos1_10$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.075\\.model_cassisi_eos1_10_corr$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model_cassisi_eos1$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model_cassisi_scvh$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.3\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.rgbtip\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.zahb\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.085\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.mem$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.tex\\.bak$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j10\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j12\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j16\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j20\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j22\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j26\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j30\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j32\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j36\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k10\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k12\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k20\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k22\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k30\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k32\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/1_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/1_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/2_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/2_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/linear_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/linear_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/noexchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/noexchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/nr_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/nr_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/series_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/series_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_JNR_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_Jseries_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_KNR_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_Kseries_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check34_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check35_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check36_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check43_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check44_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check45_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check46_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check47_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check48_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/Makefile$;^C:/hoffman/My Builds/testcase/www/Makefile\\.in$;^C:/hoffman/My Builds/testcase/src/.*\\.flc$;^C:/hoffman/My Builds/testcase/src/Makefile$;^C:/hoffman/My Builds/testcase/src/Makefile\\.in$;^C:/hoffman/My Builds/testcase/src/\\.deps$;^C:/hoffman/My Builds/testcase/src/\\.libs$;^C:/hoffman/My Builds/testcase/src/.*\\.la$;^C:/hoffman/My Builds/testcase/src/.*\\.lo$;^C:/hoffman/My Builds/testcase/src/make\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/statef.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_15$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_rel$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/hot_post_agb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgb_tip\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/start_shellflash\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/white_dwarf\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/15gamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/15lnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/23gamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/23lnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/thermodynamic_consistency/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/thermodynamic_consistency/.*\\.results$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/3order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/5order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/8order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check8_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check5_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/effo_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/effoo_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda15gamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda15lnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda23gamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda23lnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/thermodynamic_consistency/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/thermodynamic_consistency/tc\\.results$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_compare_model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_compare_solar\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_solar\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_solar_1995\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/statef_opal_model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/statef_opal_model_1995\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/include/Makefile\\.in$;^C:/hoffman/My Builds/testcase/include/Makefile$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/0\\.1\\.model_pteh$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/1\\.0\\.model_eos1a-eos1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/1\\.0\\.model_pteh$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_0\\.1\\.model_pteh\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_1\\.0\\.model_eos1a-eos1\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_1\\.0\\.model_pteh\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/contour\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/eos_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/statef_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/thermodynamic_consistency/fort\\.91$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/thermodynamic_consistency/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/context$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/oldversion_grid$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/2005Ap&SS\\.298\\.\\.135S\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/2007Ap&SS\\.307\\.\\.263C\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/astro-ph\\.9909168_eprint_submitted_to_High_Press\\.Res\\.16,331\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/.*ps.*$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/statef_grid-newversion$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/old$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/make\\.out.*$;^C:/hoffman/My Builds/testcase/utils/.*\\.flc$;^C:/hoffman/My Builds/testcase/utils/Makefile$;^C:/hoffman/My Builds/testcase/utils/Makefile\\.in$;^C:/hoffman/My Builds/testcase/utils/\\.deps$;^C:/hoffman/My Builds/testcase/utils/\\.libs$;^C:/hoffman/My Builds/testcase/utils/.*\\.la$;^C:/hoffman/My Builds/testcase/utils/.*\\.lo$;^C:/hoffman/My Builds/testcase/utils/free_eos_test$;^C:/hoffman/My Builds/testcase/utils/test_rosenbrock$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check1\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check5\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check8\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_checknr\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/effo_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/effoo_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence_20070613$;^C:/hoffman/My Builds/testcase/www/eospaper/text$;^C:/hoffman/My Builds/testcase/www/eospaper/cassisi_book_fig$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.1\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/2\\.0\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.2\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.3\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.4\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.5\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.6\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/figures$;^C:/hoffman/My Builds/testcase/www/eospaper/old$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/.*\\.ps.*$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_JNR\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_Jseries\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_KNR\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_Kseries\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check34\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check35\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check36\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check44\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check45\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check46\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_1_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_2_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_linear_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_noexchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_nr_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_series_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/1_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/noexchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/nr_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/series_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/series_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/linear_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/2_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/nr_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/linear_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/noexchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/1_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/2_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_0\\.1\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_0\\.3\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_linear\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_noexchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_nr\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.rgbtip\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.zahb\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.zahb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.rgbtip\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_linear$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_noexchange$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_nr$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/contour\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/eos_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/statef_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/delta\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/m0085eos1gong\\.ascii$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/m0085eos2gong\\.ascii$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb_adjust/coulomb_adjust\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/rtc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/make\\.out.*$") # @@ -119,8 +116,6 @@ ENDIF(${fooCACHE_TEST_VAR2} MATCHES bar) # INCLUDE_DIRECTORIES( Library - ${Complex_SOURCE_DIR}/../../Source - ${Complex_BINARY_DIR}/../../Source ) INCLUDE_DIRECTORIES(BEFORE diff --git a/Tests/ComplexOneConfig/Executable/A.cxx b/Tests/ComplexOneConfig/Executable/A.cxx index 0cc995af0..fb3eb0819 100644 --- a/Tests/ComplexOneConfig/Executable/A.cxx +++ b/Tests/ComplexOneConfig/Executable/A.cxx @@ -1,7 +1,9 @@ // Include code from a header that should not be compiled separately. #include "A.hh" +#include int main() { - return A(); + printf("#define A_VALUE %d\n", A()); + return 0; } diff --git a/Tests/ComplexOneConfig/Executable/CMakeLists.txt b/Tests/ComplexOneConfig/Executable/CMakeLists.txt index 98b29bbf2..345836257 100644 --- a/Tests/ComplexOneConfig/Executable/CMakeLists.txt +++ b/Tests/ComplexOneConfig/Executable/CMakeLists.txt @@ -5,25 +5,6 @@ CMAKE_MINIMUM_REQUIRED(VERSION 1.3) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTEST_CXX_FLAGS") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS") -IF(COMPLEX_TEST_CMAKELIB) - # Link to CMake lib - LINK_DIRECTORIES(${Complex_BINARY_DIR}/../../Source) - LINK_DIRECTORIES(${Complex_BINARY_DIR}/../../Source/kwsys) - LINK_DIRECTORIES(${Complex_BINARY_DIR}/../../Utilities/cmexpat) - LINK_DIRECTORIES(${Complex_BINARY_DIR}/../../Utilities/cmzlib) - # prefer the new curl if it is around - IF(EXISTS ${Complex_BINARY_DIR}/../../Utilities/cmcurl-7.19.0) - LINK_DIRECTORIES(${Complex_BINARY_DIR}/../../Utilities/cmcurl-7.19.0/lib) - ENDIF(EXISTS ${Complex_BINARY_DIR}/../../Utilities/cmcurl-7.19.0) - IF(EXISTS ${Complex_BINARY_DIR}/../../Utilities/cmcurl) - LINK_DIRECTORIES(${Complex_BINARY_DIR}/../../Utilities/cmcurl) - ENDIF(EXISTS ${Complex_BINARY_DIR}/../../Utilities/cmcurl) - LINK_DIRECTORIES( - ${Complex_BINARY_DIR}/../../Utilities/cmlibarchive/libarchive - ${Complex_BINARY_DIR}/../../Utilities/cmbzip2 - ) -ENDIF(COMPLEX_TEST_CMAKELIB) - # Create an imported target for if(TARGET) test below. ADD_LIBRARY(ExeImportedTarget UNKNOWN IMPORTED) @@ -49,13 +30,19 @@ LINK_LIBRARIES(${COMPLEX_LIBS}) SET_SOURCE_FILES_PROPERTIES(complex_nobuild.cxx PROPERTIES HEADER_FILE_ONLY 1) +# Test forcing a .c file to not build. +# This makes sure a mixed language library is created +# with header file only sources +SET_SOURCE_FILES_PROPERTIES(complex_nobuild.c PROPERTIES + HEADER_FILE_ONLY 1) + +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) ADD_EXECUTABLE(A A.cxx A.hh A.h A.txt) -ADD_EXECUTABLE(complex complex testcflags.c ) +ADD_CUSTOM_COMMAND(OUTPUT Aout.h COMMAND A > Aout.h VERBATIM) +ADD_EXECUTABLE(complex complex testcflags.c Aout.h) # Sub1/NameConflictTest.c Sub2/NameConflictTest.c) -ADD_EXECUTABLE(complex.file complex.file.cxx complex_nobuild.cxx) -IF(COMPLEX_TEST_CMAKELIB) - TARGET_LINK_LIBRARIES(complex CMakeLib cmsys cmexpat cmzlib cmlibarchive cmbzip2 cmcurl) -ENDIF(COMPLEX_TEST_CMAKELIB) +ADD_EXECUTABLE(complex.file complex.file.cxx complex_nobuild.cxx + complex_nobuild.c) IF (UNIX) TARGET_LINK_LIBRARIES(complex ${CMAKE_DL_LIBS}) diff --git a/Tests/ComplexOneConfig/Executable/complex.cxx b/Tests/ComplexOneConfig/Executable/complex.cxx index 0ecd8fe2e..1901d9914 100644 --- a/Tests/ComplexOneConfig/Executable/complex.cxx +++ b/Tests/ComplexOneConfig/Executable/complex.cxx @@ -3,23 +3,21 @@ #include "cmTestGeneratedHeader.h" #include "cmVersion.h" #include "ExtraSources/file1.h" +#include "Aout.h" #include "file2.h" #include "sharedFile.h" extern "C" { #include "testConly.h" } -#ifdef COMPLEX_TEST_CMAKELIB -#include "cmStandardIncludes.h" -#include "cmSystemTools.h" -#include "cmDynamicLoader.h" -#include "cmSystemTools.h" -#include "cmGeneratedFileStream.h" -#include -#else #include #include #include #include + +#include +#include +#if !defined(S_ISDIR) +# define S_ISDIR(mode) ((mode) & _S_IFDIR) #endif #ifdef COMPLEX_TEST_LINK_STATIC @@ -67,18 +65,18 @@ void cmPassed(const char* Message, const char* m2="") # error Per-configuration directory-level definition not inherited. #endif -#ifdef COMPLEX_TEST_CMAKELIB // ====================================================================== void TestAndRemoveFile(const char* filename) { - if (!cmSystemTools::FileExists(filename)) + struct stat st; + if(stat(filename, &st) < 0) { cmFailed("Could not find file: ", filename); } else { - if (!cmSystemTools::RemoveFile(filename)) + if (remove(filename) < 0) { cmFailed("Unable to remove file. It does not imply that this test failed, but it *will* be corrupted thereafter if this file is not removed: ", filename); } @@ -93,105 +91,17 @@ void TestAndRemoveFile(const char* filename) void TestDir(const char* filename) { - if (!cmSystemTools::FileExists(filename)) + struct stat st; + if(stat(filename, &st) < 0 || !S_ISDIR(st.st_mode)) { cmFailed("Could not find dir: ", filename); } else { - if (!cmSystemTools::FileIsDirectory(filename)) - { - cmFailed("Unable to check if file is a directory: ", filename); - } - else - { - cmPassed("Find dir: ", filename); - } + cmPassed("Find dir: ", filename); } } -// ====================================================================== - -void TestCMGeneratedFileSTream() -{ - cmGeneratedFileStream gm; - std::string file1 = std::string(BINARY_DIR) + std::string("/generatedFile1"); - std::string file2 = std::string(BINARY_DIR) + std::string("/generatedFile2"); - std::string file3 = std::string(BINARY_DIR) + std::string("/generatedFile3"); - std::string file4 = std::string(BINARY_DIR) + std::string("/generatedFile4"); - std::string file1tmp = file1 + ".tmp"; - std::string file2tmp = file2 + ".tmp"; - std::string file3tmp = file3 + ".tmp"; - std::string file4tmp = file4 + ".tmp"; - gm.Open(file1.c_str()); - gm << "This is generated file 1"; - gm.Close(); - gm.Open(file2.c_str()); - gm << "This is generated file 2"; - gm.Close(); - gm.Open(file3.c_str()); - gm << "This is generated file 3"; - gm.Close(); - gm.Open(file4.c_str()); - gm << "This is generated file 4"; - gm.Close(); - if ( cmSystemTools::FileExists(file1.c_str()) ) - { - if ( cmSystemTools::FileExists(file2.c_str()) ) - { - if ( cmSystemTools::FileExists(file3.c_str()) ) - { - if ( cmSystemTools::FileExists(file4.c_str()) ) - { - if ( cmSystemTools::FileExists(file1tmp.c_str()) ) - { - cmFailed("Something wrong with cmGeneratedFileStream. Temporary file is still here: ", file1tmp.c_str()); - } - else if ( cmSystemTools::FileExists(file2tmp.c_str()) ) - { - cmFailed("Something wrong with cmGeneratedFileStream. Temporary file is still here: ", file2tmp.c_str()); - } - else if ( cmSystemTools::FileExists(file3tmp.c_str()) ) - { - cmFailed("Something wrong with cmGeneratedFileStream. Temporary file is still here: ", file3tmp.c_str()); - } - else if ( cmSystemTools::FileExists(file4tmp.c_str()) ) - { - cmFailed("Something wrong with cmGeneratedFileStream. Temporary file is still here: ", file4tmp.c_str()); - } - else - { - cmPassed("cmGeneratedFileStream works."); - } - } - else - { - cmFailed("Something wrong with cmGeneratedFileStream. Cannot find file: ", file4.c_str()); - } - } - else - { - cmFailed("Something wrong with cmGeneratedFileStream. Found file: ", file3.c_str()); - } - } - else - { - cmFailed("Something wrong with cmGeneratedFileStream. Cannot find file: ", file2.c_str()); - } - } - else - { - cmFailed("Something wrong with cmGeneratedFileStream. Cannot find file: ", file1.c_str()); - } - cmSystemTools::RemoveFile(file1.c_str()); - cmSystemTools::RemoveFile(file2.c_str()); - cmSystemTools::RemoveFile(file3.c_str()); - cmSystemTools::RemoveFile(file1tmp.c_str()); - cmSystemTools::RemoveFile(file2tmp.c_str()); - cmSystemTools::RemoveFile(file3tmp.c_str()); -} -#endif - // Here is a stupid function that tries to use std::string methods // so that the dec cxx compiler will instantiate the stuff that // we are using from the CMakeLib library.... @@ -232,113 +142,6 @@ extern "C" int NameConflictTest2(); int main() { - std::string lib = BINARY_DIR; - lib += "/lib/"; -#ifdef CMAKE_INTDIR - lib += CMAKE_INTDIR; - lib += "/"; -#endif - std::string exe = BINARY_DIR; - exe += "/bin/"; -#ifdef CMAKE_INTDIR - exe += CMAKE_INTDIR; - exe += "/"; -#endif - -#ifdef COMPLEX_TEST_CMAKELIB - // Test a single character executable to test a: in makefiles - exe += "A"; - exe += cmSystemTools::GetExecutableExtension(); - int ret; - std::string errorMessage; - exe = cmSystemTools::ConvertToRunCommandPath(exe.c_str()); - if(cmSystemTools::RunSingleCommand(exe.c_str(), 0, &ret)) - { - if(ret != 10) - { - errorMessage += exe; - errorMessage += " did not return 10"; - } - } - else - { - errorMessage += exe; - errorMessage += ": failed to run."; - } - if(errorMessage.size()) - { - cmFailed(errorMessage.c_str()); - } - else - { - cmPassed("run Single Character executable A returned 10 as expected."); - } - - lib += CMAKE_SHARED_MODULE_PREFIX; - lib += "CMakeTestModule"; - lib += CMAKE_SHARED_MODULE_SUFFIX; - cmsys::DynamicLoader::LibraryHandle handle = cmDynamicLoader::OpenLibrary(lib.c_str()); - if(!handle) - { - std::string err = "Can not open CMakeTestModule:\n"; - err += lib; - cmFailed(err.c_str()); - } - else - { - cmsys::DynamicLoader::SymbolPointer fun = - cmsys::DynamicLoader::GetSymbolAddress(handle, "ModuleFunction"); - if(!fun) - { - fun = cmsys::DynamicLoader::GetSymbolAddress(handle, "_ModuleFunction"); - } - typedef int (*TEST_FUNCTION)(); - TEST_FUNCTION testFun = (TEST_FUNCTION)fun; - if(!testFun) - { - cmFailed("Could not find symbol ModuleFunction in library "); - } - else - { - int ret = (*testFun)(); - if(!ret) - { - cmFailed("ModuleFunction call did not return valid return."); - } - cmPassed("Module loaded and ModuleFunction called correctly."); - } - } - cmDynamicLoader::FlushCache(); // fix memory leaks - if(sharedFunction() != 1) - { - cmFailed("Call to sharedFunction from shared library failed."); - } - else - { - cmPassed("Call to sharedFunction from shared library worked."); - } - if(CsharedFunction() != 1) - { - cmFailed("Call to C sharedFunction from shared library failed."); - } - else - { - cmPassed("Call to C sharedFunction from shared library worked."); - } - - // ---------------------------------------------------------------------- - // Test cmSystemTools::UpperCase - std::string str = "abc"; - std::string strupper = "ABC"; - if(cmSystemTools::UpperCase(str) == strupper) - { - cmPassed("cmSystemTools::UpperCase is working"); - } - else - { - cmFailed("cmSystemTools::UpperCase is working"); - } -#endif #if 0 if(NameConflictTest1() == 0 && NameConflictTest2() == 0) { @@ -839,8 +642,7 @@ int main() "FILENAME_VAR_PATH_NAME is not defined."); #else if((strcmp(FILENAME_VAR_PATH_NAME, "Complex") == 0) || - (strcmp(FILENAME_VAR_PATH_NAME, "ComplexOneConfig") == 0) || - (strcmp(FILENAME_VAR_PATH_NAME, "ComplexRelativePaths") == 0)) + (strcmp(FILENAME_VAR_PATH_NAME, "ComplexOneConfig") == 0)) { cmPassed("FILENAME_VAR_PATH_NAME == ", FILENAME_VAR_PATH_NAME); } @@ -901,8 +703,7 @@ int main() "PATH_VAR_NAME is not defined."); #else if((strcmp(PATH_VAR_NAME, "Complex") == 0) || - (strcmp(PATH_VAR_NAME, "ComplexOneConfig") == 0) || - (strcmp(PATH_VAR_NAME, "ComplexRelativePaths") == 0)) + (strcmp(PATH_VAR_NAME, "ComplexOneConfig") == 0)) { cmPassed("PATH_VAR_NAME == ", PATH_VAR_NAME); } @@ -984,7 +785,6 @@ int main() } #endif -#ifdef COMPLEX_TEST_CMAKELIB // ---------------------------------------------------------------------- // Some pre-build/pre-link/post-build custom-commands have been // attached to the lib (see Library/). @@ -1030,7 +830,6 @@ int main() // only created during a build. TestAndRemoveFile(BINARY_DIR "/Executable/Temp/complex-required.txt"); -#endif // ---------------------------------------------------------------------- // Test FIND_LIBRARY @@ -1197,11 +996,6 @@ int main() cmPassed("CMake SET CACHE FORCE"); #endif -#ifdef COMPLEX_TEST_CMAKELIB - // Test the generated file stream. - TestCMGeneratedFileSTream(); -#endif - #ifdef COMPLEX_TEST_LINK_STATIC if(TestLinkGetType()) { @@ -1213,6 +1007,12 @@ int main() } #endif +#if defined(A_VALUE) && A_VALUE == 10 + cmPassed("Single-character executable A worked."); +#else + cmFailed("Single-character executable A failed."); +#endif + // ---------------------------------------------------------------------- // Summary diff --git a/Tests/ComplexRelativePaths/Executable/complex_nobuild.cxx b/Tests/ComplexOneConfig/Executable/complex_nobuild.c similarity index 100% rename from Tests/ComplexRelativePaths/Executable/complex_nobuild.cxx rename to Tests/ComplexOneConfig/Executable/complex_nobuild.c diff --git a/Tests/ComplexOneConfig/Library/CMakeLists.txt b/Tests/ComplexOneConfig/Library/CMakeLists.txt index 281e48a55..c8efc3022 100644 --- a/Tests/ComplexOneConfig/Library/CMakeLists.txt +++ b/Tests/ComplexOneConfig/Library/CMakeLists.txt @@ -43,7 +43,6 @@ ENDIF(WIN32) # SET(SharedLibrarySources sharedFile) ADD_LIBRARY(CMakeTestLibraryShared SHARED ${SharedLibrarySources}) -ADD_LIBRARY(CMakeTestModule MODULE moduleFile.c) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS") ADD_LIBRARY(CMakeTestCLibraryShared SHARED testConly.c) DEFINE_PROPERTY( diff --git a/Tests/ComplexOneConfig/Library/moduleFile.c b/Tests/ComplexOneConfig/Library/moduleFile.c deleted file mode 100644 index 608d750f1..000000000 --- a/Tests/ComplexOneConfig/Library/moduleFile.c +++ /dev/null @@ -1,6 +0,0 @@ -#include "moduleFile.h" - -int ModuleFunction() -{ - return 1; -} diff --git a/Tests/ComplexOneConfig/Library/moduleFile.h b/Tests/ComplexOneConfig/Library/moduleFile.h deleted file mode 100644 index 6b561e109..000000000 --- a/Tests/ComplexOneConfig/Library/moduleFile.h +++ /dev/null @@ -1,12 +0,0 @@ -#if defined(_WIN32) || defined(WIN32) /* Win32 version */ -#ifdef CMakeTestModule_EXPORTS -# define CMakeTest_EXPORT __declspec(dllexport) -#else -# define CMakeTest_EXPORT __declspec(dllimport) -#endif -#else -/* unix needs nothing */ -#define CMakeTest_EXPORT -#endif - -CMakeTest_EXPORT int ModuleFunction(); diff --git a/Tests/ComplexOneConfig/cmTestConfigure.h.in b/Tests/ComplexOneConfig/cmTestConfigure.h.in index d7952da1e..7741b6fd5 100644 --- a/Tests/ComplexOneConfig/cmTestConfigure.h.in +++ b/Tests/ComplexOneConfig/cmTestConfigure.h.in @@ -4,8 +4,6 @@ #cmakedefine ONE_VAR_IS_DEFINED #cmakedefine ZERO_VAR -#cmakedefine COMPLEX_TEST_CMAKELIB - #define STRING_VAR "${STRING_VAR}" // Test FOREACH diff --git a/Tests/ComplexRelativePaths/CMakeLists.txt b/Tests/ComplexRelativePaths/CMakeLists.txt deleted file mode 100644 index 8d6029a9f..000000000 --- a/Tests/ComplexRelativePaths/CMakeLists.txt +++ /dev/null @@ -1,381 +0,0 @@ -# -# A more complex test case -# -SET(CMAKE_BACKWARDS_COMPATIBILITY 1.4) -PROJECT (Complex) - -# Try setting a new policy. The IF test is for coverage. -IF(POLICY CMP0003) - CMAKE_POLICY(SET CMP0003 NEW) - - CMAKE_POLICY(GET CMP0003 P3) - IF(NOT "${P3}" STREQUAL "NEW") - MESSAGE(FATAL_ERROR "CMAKE_POLICY(GET) did not report NEW!") - ENDIF(NOT "${P3}" STREQUAL "NEW") -ENDIF(POLICY CMP0003) - -# Test building without per-rule echo lines in Makefiles. -SET_PROPERTY(GLOBAL PROPERTY RULE_MESSAGES OFF) - -# Choose whether to test CMakeLib. -OPTION(COMPLEX_TEST_CMAKELIB "Test CMakeLib" OFF) - -SET(CPACK_SOURCE_IGNORE_FILES "~$;\\.cvsignore$;^C:/hoffman/My Builds/testcase.*/CVS/;^C:/hoffman/My Builds/testcase.*/\\.svn/;^C:/hoffman/My Builds/testcase.*/sweigart/;^C:/hoffman/My Builds/testcase/www/eospaper/solution/eos2001/;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_tables_new/;^C:/hoffman/My Builds/testcase/COPYING$;^C:/hoffman/My Builds/testcase/INSTALL$;^C:/hoffman/My Builds/testcase/Makefile$;^C:/hoffman/My Builds/testcase/Makefile\\.in$;^C:/hoffman/My Builds/testcase/.*\\.lo$;^C:/hoffman/My Builds/testcase/.*\\.la$;^C:/hoffman/My Builds/testcase/mkinstalldirs$;^C:/hoffman/My Builds/testcase/missing$;^C:/hoffman/My Builds/testcase/ltmain\\.sh$;^C:/hoffman/My Builds/testcase/libtool$;^C:/hoffman/My Builds/testcase/install-sh$;^C:/hoffman/My Builds/testcase/configure$;^C:/hoffman/My Builds/testcase/config\\.sub$;^C:/hoffman/My Builds/testcase/config\\.status$;^C:/hoffman/My Builds/testcase/config\\.log$;^C:/hoffman/My Builds/testcase/config\\.guess$;^C:/hoffman/My Builds/testcase/autom4te\\.cache$;^C:/hoffman/My Builds/testcase/aclocal\\.m4$;^C:/hoffman/My Builds/testcase/depcomp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.075\\.model_cassisi_eos1_10$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.075\\.model_cassisi_eos1_10_corr$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model_cassisi_eos1$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model_cassisi_scvh$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.3\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.rgbtip\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.zahb\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.085\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.mem$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.tex\\.bak$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j10\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j12\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j16\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j20\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j22\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j26\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j30\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j32\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j36\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k10\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k12\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k20\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k22\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k30\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k32\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/1_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/1_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/2_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/2_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/linear_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/linear_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/noexchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/noexchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/nr_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/nr_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/series_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/series_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_JNR_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_Jseries_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_KNR_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_Kseries_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check34_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check35_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check36_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check43_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check44_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check45_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check46_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check47_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check48_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/Makefile$;^C:/hoffman/My Builds/testcase/www/Makefile\\.in$;^C:/hoffman/My Builds/testcase/src/.*\\.flc$;^C:/hoffman/My Builds/testcase/src/Makefile$;^C:/hoffman/My Builds/testcase/src/Makefile\\.in$;^C:/hoffman/My Builds/testcase/src/\\.deps$;^C:/hoffman/My Builds/testcase/src/\\.libs$;^C:/hoffman/My Builds/testcase/src/.*\\.la$;^C:/hoffman/My Builds/testcase/src/.*\\.lo$;^C:/hoffman/My Builds/testcase/src/make\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/statef.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_15$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_rel$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/hot_post_agb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgb_tip\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/start_shellflash\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/white_dwarf\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/15gamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/15lnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/23gamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/23lnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/thermodynamic_consistency/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/thermodynamic_consistency/.*\\.results$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/3order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/5order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/8order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check8_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check5_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/effo_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/effoo_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda15gamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda15lnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda23gamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda23lnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/thermodynamic_consistency/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/thermodynamic_consistency/tc\\.results$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_compare_model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_compare_solar\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_solar\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_solar_1995\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/statef_opal_model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/statef_opal_model_1995\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/include/Makefile\\.in$;^C:/hoffman/My Builds/testcase/include/Makefile$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/0\\.1\\.model_pteh$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/1\\.0\\.model_eos1a-eos1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/1\\.0\\.model_pteh$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_0\\.1\\.model_pteh\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_1\\.0\\.model_eos1a-eos1\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_1\\.0\\.model_pteh\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/contour\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/eos_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/statef_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/thermodynamic_consistency/fort\\.91$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/thermodynamic_consistency/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/context$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/oldversion_grid$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/2005Ap&SS\\.298\\.\\.135S\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/2007Ap&SS\\.307\\.\\.263C\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/astro-ph\\.9909168_eprint_submitted_to_High_Press\\.Res\\.16,331\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/.*ps.*$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/statef_grid-newversion$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/old$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/make\\.out.*$;^C:/hoffman/My Builds/testcase/utils/.*\\.flc$;^C:/hoffman/My Builds/testcase/utils/Makefile$;^C:/hoffman/My Builds/testcase/utils/Makefile\\.in$;^C:/hoffman/My Builds/testcase/utils/\\.deps$;^C:/hoffman/My Builds/testcase/utils/\\.libs$;^C:/hoffman/My Builds/testcase/utils/.*\\.la$;^C:/hoffman/My Builds/testcase/utils/.*\\.lo$;^C:/hoffman/My Builds/testcase/utils/free_eos_test$;^C:/hoffman/My Builds/testcase/utils/test_rosenbrock$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check1\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check5\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check8\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_checknr\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/effo_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/effoo_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence_20070613$;^C:/hoffman/My Builds/testcase/www/eospaper/text$;^C:/hoffman/My Builds/testcase/www/eospaper/cassisi_book_fig$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.1\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/2\\.0\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.2\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.3\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.4\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.5\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.6\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/figures$;^C:/hoffman/My Builds/testcase/www/eospaper/old$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/.*\\.ps.*$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_JNR\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_Jseries\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_KNR\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_Kseries\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check34\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check35\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check36\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check44\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check45\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check46\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_1_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_2_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_linear_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_noexchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_nr_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_series_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/1_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/noexchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/nr_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/series_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/series_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/linear_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/2_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/nr_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/linear_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/noexchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/1_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/2_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_0\\.1\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_0\\.3\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_linear\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_noexchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_nr\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.rgbtip\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.zahb\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.zahb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.rgbtip\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_linear$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_noexchange$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_nr$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/contour\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/eos_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/statef_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/delta\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/m0085eos1gong\\.ascii$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/m0085eos2gong\\.ascii$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb_adjust/coulomb_adjust\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/rtc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/make\\.out.*$") - -# -# Define a macro -# -MACRO(ASSERT value msg) - IF (NOT ${value}) - MESSAGE ("Assertion failure:" ${msg} ) - ENDIF (NOT ${value}) -ENDMACRO(ASSERT) - -# invoke the macro -ASSERT(Complex_BINARY_DIR "The PROJECT command is broken") - -# -# Define a var args macro, it must take two or four args -# -MACRO(TEST_ARGC value1 value2) - ADD_DEFINITIONS(${value1} ${value2}) - IF (${ARGC} MATCHES 4) - ADD_DEFINITIONS(${ARGV2} ${ARGV3}) - ENDIF (${ARGC} MATCHES 4) -ENDMACRO(TEST_ARGC) - -# invoke the macro -TEST_ARGC(-DCMAKE_ARGV1 -DCMAKE_ARGV2 -DCMAKE_ARGV3 -DCMAKE_ARGV4) - -MACRO(TEST_VAR_ARG fa) - IF("${ARGV}" MATCHES "^1;2;3$") - MESSAGE(STATUS "ARGV works") - ELSE("${ARGV}" MATCHES "^1;2;3$") - MESSAGE(FATAL_ERROR "ARGV does not work; got \"${ARGV}\" instead of \"1;2;3\"") - ENDIF("${ARGV}" MATCHES "^1;2;3$") - IF("${ARGN}" MATCHES "^2;3$") - MESSAGE(STATUS "ARGN works") - ELSE("${ARGN}" MATCHES "^2;3$") - MESSAGE(FATAL_ERROR "ARGV does not work; got \"${ARGN}\" instead of \"2;3\"") - ENDIF("${ARGN}" MATCHES "^2;3$") -ENDMACRO(TEST_VAR_ARG) - -TEST_VAR_ARG(1 2 3) - -# Floating-point comparison test. -IF(2.4 LESS 2.4) - MESSAGE(FATAL_ERROR "Failed: 2.4 LESS 2.4") -ENDIF(2.4 LESS 2.4) -IF(2.4 GREATER 2.4) - MESSAGE(FATAL_ERROR "Failed: 2.4 GREATER 2.4") -ENDIF(2.4 GREATER 2.4) -IF(NOT 2.4 EQUAL 2.4) - MESSAGE(FATAL_ERROR "Failed: NOT 2.4 EQUAL 2.4") -ENDIF(NOT 2.4 EQUAL 2.4) - -IF(CMAKE_SYSTEM MATCHES "OSF1-V.*") - IF(NOT CMAKE_COMPILER_IS_GNUCXX) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ") - ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX) -ENDIF(CMAKE_SYSTEM MATCHES "OSF1-V.*") - - -ADD_DEFINITIONS(-DCMAKE_IS_FUN) -ADD_DEFINITIONS(-DCMAKE_IS_REALLY_FUN) -SET_PROPERTY(DIRECTORY - PROPERTY COMPILE_DEFINITIONS_RELEASE - CMAKE_IS_FUN_IN_RELEASE_MODE - ) - -SET(TEST_SEP "a b c") -SEPARATE_ARGUMENTS(TEST_SEP) - - -# -# Include vars from a file and from a cache -# -IF (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) - INCLUDE(${Complex_SOURCE_DIR}/VarTests.cmake) -ENDIF (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) -INCLUDE(fileshouldnotbehere OPTIONAL) -LOAD_CACHE(${Complex_SOURCE_DIR}/Cache - EXCLUDE - CACHE_TEST_VAR_EXCLUDED - INCLUDE_INTERNALS - CACHE_TEST_VAR_INTERNAL) - -LOAD_CACHE(${Complex_SOURCE_DIR}/Cache READ_WITH_PREFIX foo CACHE_TEST_VAR2) -IF(${fooCACHE_TEST_VAR2} MATCHES bar) - MESSAGE("Load cache worked: ${fooCACHE_TEST_VAR2}") -ELSE(${fooCACHE_TEST_VAR2} MATCHES bar) - MESSAGE(FATAL_ERROR "Load cache with prefix failed: ${fooCACHE_TEST_VAR2}") -ENDIF(${fooCACHE_TEST_VAR2} MATCHES bar) - - - -# -# Specify include and lib dirs -# (BEFORE is for coverage) -# -INCLUDE_DIRECTORIES( - Library - ${Complex_SOURCE_DIR}/../../Source - ${Complex_BINARY_DIR}/../../Source -) - -INCLUDE_DIRECTORIES(BEFORE - ${Complex_BINARY_DIR} -) -INCLUDE_DIRECTORIES(SYSTEM Library/SystemDir) - -INCLUDE_REGULAR_EXPRESSION("^(cmTest|file|sharedFile|test).*$" "^cmMissing") - -LINK_DIRECTORIES( - ${Complex_BINARY_DIR}/Library -) - -# -# check for SET CACHE FORCE -# -SET(FORCE_TEST 1 CACHE STRING "a test") -SET(FORCE_TEST 0 CACHE STRING "a test" FORCE) - -# -# Lib and exe path -# -SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/lib/static") -SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/lib") -SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/bin") - -MESSAGE (Test " " escape " " semi-colon " " \; \;) -# -# Exec program (TODO: test a result) -# Increase coverage. -# -MESSAGE("\nIgnore this message") -OPTION(NO_EXEC_PROGRAM "Do not test EXEC_PROGRAM" 0) -IF (NOT NO_EXEC_PROGRAM) - EXEC_PROGRAM(${CMAKE_COMMAND} ARGS -E echo NO_EXEC_PROGRAM "${Complex_BINARY_DIR}") -ELSE (NOT NO_EXEC_PROGRAM) - MESSAGE("Set this option ON") -ENDIF (NOT NO_EXEC_PROGRAM) - -MARK_AS_ADVANCED(NO_EXEC_PROGRAM) -MARK_AS_ADVANCED(CLEAR NO_EXEC_PROGRAM) - -# Execute a process. Add coverage for this command. -EXECUTE_PROCESS( - COMMAND ${CMAKE_COMMAND} -E echo "ABCDEFG" - OUTPUT_VARIABLE TEST_OUT - ) -IF("${TEST_OUT}" MATCHES "^ABCDEFG\n$") -ELSE("${TEST_OUT}" MATCHES "^ABCDEFG\n$") - MESSAGE(SEND_ERROR "EXECUTE_PROCESS output test failed: [${TEST_OUT}]") -ENDIF("${TEST_OUT}" MATCHES "^ABCDEFG\n$") - -# This test has some problems on UNIX systems. Disabling for now. -# -# EXECUTE_PROCESS( -# COMMAND ${CMAKE_COMMAND} -E echo "ABCDEFG" -# COMMAND /process/does/not/exist -# OUTPUT_QUIET -# ERROR_QUIET -# RESULT_VARIABLE RESULT -# ) -# IF("${RESULT}" MATCHES "^0$") -# MESSAGE(SEND_ERROR -# "EXECUTE_PROCESS result test failed with RESULT=[${RESULT}]") -# ELSE("${RESULT}" MATCHES "^0$") -# MESSAGE(STATUS "EXECUTE_PROCESS result test passed with RESULT=[${RESULT}]") -# ENDIF("${RESULT}" MATCHES "^0$") - -# -# Create directory. -# The 'complex' executable will then test if this dir exists, -# sadly it won't be able to remove it. -# -MAKE_DIRECTORY("${Complex_BINARY_DIR}/make_dir") - -# -# Test FIND_LIBARY -# Create a dummy empty lib -# -CONFIGURE_FILE( - ${Complex_SOURCE_DIR}/Library/dummy - ${Complex_BINARY_DIR}/Library/dummylib.lib - COPYONLY IMMEDIATE) -FOREACH (ext ${CMAKE_SHLIB_SUFFIX};.so;.a;.sl) - CONFIGURE_FILE( - ${Complex_SOURCE_DIR}/Library/dummy - ${Complex_BINARY_DIR}/Library/libdummylib${ext} - COPYONLY IMMEDIATE) -ENDFOREACH (ext) - -FIND_LIBRARY(FIND_DUMMY_LIB - dummylib - PATHS - ${Complex_BINARY_DIR}/Library DOC "find dummy lib") - -FIND_LIBRARY(FIND_DUMMY_LIB - NAMES dummylib dummylib2 - PATHS - ${Complex_BINARY_DIR}/Library DOC "find dummy lib") - -# -# Test SET_SOURCE_FILES_PROPERTIES -# -SET_SOURCE_FILES_PROPERTIES(nonexisting_file2 - GENERATED - ABSTRACT - WRAP_EXCLUDE - COMPILE_FLAGS "-foo -bar") - -GET_SOURCE_FILE_PROPERTY(FILE_HAS_ABSTRACT nonexisting_file2 ABSTRACT) -GET_SOURCE_FILE_PROPERTY(FILE_HAS_WRAP_EXCLUDE nonexisting_file2 WRAP_EXCLUDE) -GET_SOURCE_FILE_PROPERTY(FILE_COMPILE_FLAGS nonexisting_file2 COMPILE_FLAGS) - -SET_SOURCE_FILES_PROPERTIES(nonexisting_file3 PROPERTIES - GENERATED 1 - ABSTRACT 1 - WRAP_EXCLUDE 1 - COMPILE_FLAGS "-foo -bar") -GET_SOURCE_FILE_PROPERTY(FILE_HAS_ABSTRACT nonexisting_file3 ABSTRACT) -GET_SOURCE_FILE_PROPERTY(FILE_HAS_WRAP_EXCLUDE nonexisting_file3 WRAP_EXCLUDE) -GET_SOURCE_FILE_PROPERTY(FILE_COMPILE_FLAGS nonexisting_file3 COMPILE_FLAGS) - -# -# Test registry (win32) -# Create a file, put its path in a registry key, try to find the file in that -# path using that registry key, then remove the file and the key -# -IF (WIN32) - IF (NOT UNIX) - SET(dir "${Complex_BINARY_DIR}/registry_dir") - SET(file "registry_test_dummy") - SET(hkey "HKEY_CURRENT_USER\\Software\\Kitware\\CMake\\Tests\\Complex;registry_test") - CONFIGURE_FILE( - ${Complex_SOURCE_DIR}/Library/dummy - "${dir}/${file}" - COPYONLY IMMEDIATE) - EXEC_PROGRAM(${CMAKE_COMMAND} ARGS "-E write_regv \"${hkey}\" \"${dir}\"") - FIND_PATH(REGISTRY_TEST_PATH - ${file} - "[${hkey}]" DOC "Registry_Test_Path") - EXEC_PROGRAM(${CMAKE_COMMAND} ARGS "-E delete_regv \"${hkey}\"") - EXEC_PROGRAM(${CMAKE_COMMAND} ARGS "-E remove \"${dir}/${file}\"") - ENDIF (NOT UNIX) -ENDIF (WIN32) - -# -# Test a set and a remove -# -SET(REMOVE_STRING a b c d e f) -SET(removeVar1 c e) -REMOVE(REMOVE_STRING ${removeVar1} f) - -# -# Test an IF inside a FOREACH. -# -FOREACH(x "a") - IF(${x} MATCHES "a") - # Should always execute. - SET(IF_INSIDE_FOREACH_THEN_EXECUTED 1) - ELSE(${x} MATCHES "a") - # Should never execute. - SET(IF_INSIDE_FOREACH_ELSE_EXECUTED 1) - ENDIF(${x} MATCHES "a") -ENDFOREACH(x) - -# test WHILE command -SET (while_var 1) -WHILE (while_var LESS 1000) - SET(while_var ${while_var}0) -ENDWHILE(while_var LESS 1000) - -SET(SHOULD_BE_ZERO ) -SET(SHOULD_BE_ONE 1) - -# test elseif functionality, the mess below tries to catch problem -# of clauses being executed early or late etc -set (RESULT 3) -if (RESULT EQUAL 1) - if (RESULT EQUAL 2) - set (ELSEIF_RESULT 1) - elseif (RESULT EQUAL 3) - set (ELSEIF_RESULT 1) - endif (RESULT EQUAL 2) -elseif (RESULT EQUAL 2) - set (ELSEIF_RESULT 1) -elseif (RESULT EQUAL 3) - if (RESULT EQUAL 2) - set (ELSEIF_RESULT 1) - elseif (RESULT EQUAL 3) - if (NOT ELSEIF_RESULT EQUAL 1) - set (ELSEIF_RESULT 2) - endif (NOT ELSEIF_RESULT EQUAL 1) - endif (RESULT EQUAL 2) -elseif (RESULT EQUAL 4) - if (RESULT EQUAL 2) - set (ELSEIF_RESULT 1) - elseif (RESULT EQUAL 3) - set (ELSEIF_RESULT 1) - endif (RESULT EQUAL 2) -else (RESULT EQUAL 1) - if (RESULT EQUAL 2) - set (ELSEIF_RESULT 1) - elseif (RESULT EQUAL 3) - set (ELSEIF_RESULT 1) - endif (RESULT EQUAL 2) -endif (RESULT EQUAL 1) - -if (NOT ELSEIF_RESULT EQUAL 2) - set (ELSEIF_RESULT 0) -endif (NOT ELSEIF_RESULT EQUAL 2) - -# test handling of parenthetical groups in conditionals -if (2 GREATER 1 AND (4 LESS 3 OR 5 LESS 6) AND NOT (7 GREATER 8)) - set(CONDITIONAL_PARENTHESES 1) -endif() - - -# -# Configure file -# (plug vars to #define so that they can be tested) -# -CONFIGURE_FILE( - ${Complex_SOURCE_DIR}/cmTestConfigure.h.in - ${Complex_BINARY_DIR}/cmTestConfigure.h) - -SET(STRING_WITH_QUOTES "\"hello world\"") -# test CONFIGURE_FILE with ESCAPE_QUOTES on -CONFIGURE_FILE( - ${Complex_SOURCE_DIR}/cmTestConfigureEscape.h.in - ${Complex_BINARY_DIR}/cmTestConfigureEscape.h ESCAPE_QUOTES) - -# Test regular expression commands. -STRING(REGEX MATCH "b" RESULT "abc") -IF(NOT RESULT) - MESSAGE(SEND_ERROR "STRING(REGEX MATCH ... ) test failed.") -ENDIF(NOT RESULT) -STRING(REGEX MATCHALL "b" RESULT "abcb") -IF(NOT RESULT) - MESSAGE(SEND_ERROR "STRING(REGEX MATCHALL ... ) test failed.") -ENDIF(NOT RESULT) -STRING(REGEX REPLACE ".([bd])." "[\\1]" RESULT "a(b)c(d)e") -IF("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$") - SET(STRING_REGEX_PASSED 1) -ENDIF("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$") -IF(NOT STRING_REGEX_PASSED) - MESSAGE(SEND_ERROR - "STRING(REGEX REPLACE ... ) test failed (\"${RESULT}\" v. \"a[b]c[d]e\")") -ENDIF(NOT STRING_REGEX_PASSED) - - -# -# Create the libs and the main exe -# -ADD_SUBDIRECTORY(Library) -ADD_SUBDIRECTORY(Executable) -SUBDIR_DEPENDS(Executable Library) -EXPORT_LIBRARY_DEPENDENCIES(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake) -INCLUDE(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake OPTIONAL) diff --git a/Tests/ComplexRelativePaths/Cache/CMakeCache.txt b/Tests/ComplexRelativePaths/Cache/CMakeCache.txt deleted file mode 100644 index 17c55aa01..000000000 --- a/Tests/ComplexRelativePaths/Cache/CMakeCache.txt +++ /dev/null @@ -1,34 +0,0 @@ -# This is the CMakeCache file. -# For build in directory: d:/build/kitware/cmake/CMake-nmake/Tests/Complex -# You can edit this file to change values found and used by cmake. -# If you do not want to change any of the values, simply exit the editor. -# If you do want to change a value, simply edit, save, and exit the editor. -# The syntax for the file is as follows: -# KEY:TYPE=VALUE -# KEY is the name of a varible in the cache. -# TYPE is a hint to GUI's for the type of VALUE, DO NOT EDIT TYPE!. -# VALUE is the current value for the KEY. - -######################## -# EXTERNAL cache entries -######################## - -//A var. -CACHE_TEST_VAR1:STRING=foo - -//A var. -CACHE_TEST_VAR2:FILEPATH=bar - -//A var. -CACHE_TEST_VAR3:BOOL=1 - -//A var. -CACHE_TEST_VAR_EXCLUDED:BOOL=1 - - -######################## -# INTERNAL cache entries -######################## - -//A var. -CACHE_TEST_VAR_INTERNAL:INTERNAL=bar diff --git a/Tests/ComplexRelativePaths/Executable/A.cxx b/Tests/ComplexRelativePaths/Executable/A.cxx deleted file mode 100644 index 0cc995af0..000000000 --- a/Tests/ComplexRelativePaths/Executable/A.cxx +++ /dev/null @@ -1,7 +0,0 @@ -// Include code from a header that should not be compiled separately. -#include "A.hh" - -int main() -{ - return A(); -} diff --git a/Tests/ComplexRelativePaths/Executable/A.h b/Tests/ComplexRelativePaths/Executable/A.h deleted file mode 100644 index 25c45fcbf..000000000 --- a/Tests/ComplexRelativePaths/Executable/A.h +++ /dev/null @@ -1,4 +0,0 @@ -// This header should not be compiled directly but through inclusion -// in A.cxx through A.hh. -extern int A(); -int A() { return 10; } diff --git a/Tests/ComplexRelativePaths/Executable/A.hh b/Tests/ComplexRelativePaths/Executable/A.hh deleted file mode 100644 index e6bab022e..000000000 --- a/Tests/ComplexRelativePaths/Executable/A.hh +++ /dev/null @@ -1,2 +0,0 @@ -// This header should not be compiled directly but through inclusion in A.cxx -#include "A.h" diff --git a/Tests/ComplexRelativePaths/Executable/A.txt b/Tests/ComplexRelativePaths/Executable/A.txt deleted file mode 100644 index 8ee9462be..000000000 --- a/Tests/ComplexRelativePaths/Executable/A.txt +++ /dev/null @@ -1 +0,0 @@ -This file should not be compiled! diff --git a/Tests/ComplexRelativePaths/Executable/CMakeLists.txt b/Tests/ComplexRelativePaths/Executable/CMakeLists.txt deleted file mode 100644 index 98b29bbf2..000000000 --- a/Tests/ComplexRelativePaths/Executable/CMakeLists.txt +++ /dev/null @@ -1,183 +0,0 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 1.3) -# -# Create exe. -# -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTEST_CXX_FLAGS") -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS") - -IF(COMPLEX_TEST_CMAKELIB) - # Link to CMake lib - LINK_DIRECTORIES(${Complex_BINARY_DIR}/../../Source) - LINK_DIRECTORIES(${Complex_BINARY_DIR}/../../Source/kwsys) - LINK_DIRECTORIES(${Complex_BINARY_DIR}/../../Utilities/cmexpat) - LINK_DIRECTORIES(${Complex_BINARY_DIR}/../../Utilities/cmzlib) - # prefer the new curl if it is around - IF(EXISTS ${Complex_BINARY_DIR}/../../Utilities/cmcurl-7.19.0) - LINK_DIRECTORIES(${Complex_BINARY_DIR}/../../Utilities/cmcurl-7.19.0/lib) - ENDIF(EXISTS ${Complex_BINARY_DIR}/../../Utilities/cmcurl-7.19.0) - IF(EXISTS ${Complex_BINARY_DIR}/../../Utilities/cmcurl) - LINK_DIRECTORIES(${Complex_BINARY_DIR}/../../Utilities/cmcurl) - ENDIF(EXISTS ${Complex_BINARY_DIR}/../../Utilities/cmcurl) - LINK_DIRECTORIES( - ${Complex_BINARY_DIR}/../../Utilities/cmlibarchive/libarchive - ${Complex_BINARY_DIR}/../../Utilities/cmbzip2 - ) -ENDIF(COMPLEX_TEST_CMAKELIB) - -# Create an imported target for if(TARGET) test below. -ADD_LIBRARY(ExeImportedTarget UNKNOWN IMPORTED) - -# Test if(TARGET) command. -IF(NOT TARGET CMakeTestLibrary) - MESSAGE(FATAL_ERROR "IF(NOT TARGET CMakeTestLibrary) returned true!") -ENDIF(NOT TARGET CMakeTestLibrary) -IF(NOT TARGET ExeImportedTarget) - MESSAGE(FATAL_ERROR "IF(NOT TARGET ExeImportedTarget) returned true!") -ENDIF(NOT TARGET ExeImportedTarget) -IF(TARGET LibImportedTarget) - MESSAGE(FATAL_ERROR "IF(TARGET LibImportedTarget) returned true!") -ENDIF(TARGET LibImportedTarget) -IF(TARGET NotATarget) - MESSAGE(FATAL_ERROR "IF(TARGET NotATarget) returned true!") -ENDIF(TARGET NotATarget) - - # Use LINK_LIBRARIES instead of TARGET_LINK_LIBRARIES to -SET(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared) -LINK_LIBRARIES(${COMPLEX_LIBS}) - -# Test forcing a .cxx file to not build. -SET_SOURCE_FILES_PROPERTIES(complex_nobuild.cxx PROPERTIES - HEADER_FILE_ONLY 1) - -ADD_EXECUTABLE(A A.cxx A.hh A.h A.txt) -ADD_EXECUTABLE(complex complex testcflags.c ) -# Sub1/NameConflictTest.c Sub2/NameConflictTest.c) -ADD_EXECUTABLE(complex.file complex.file.cxx complex_nobuild.cxx) -IF(COMPLEX_TEST_CMAKELIB) - TARGET_LINK_LIBRARIES(complex CMakeLib cmsys cmexpat cmzlib cmlibarchive cmbzip2 cmcurl) -ENDIF(COMPLEX_TEST_CMAKELIB) - -IF (UNIX) - TARGET_LINK_LIBRARIES(complex ${CMAKE_DL_LIBS}) -ELSE(UNIX) - IF (NOT BORLAND) - IF(NOT MINGW) - TARGET_LINK_LIBRARIES(complex rpcrt4.lib) - ENDIF(NOT MINGW) - ENDIF(NOT BORLAND) -ENDIF (UNIX) - -# Test linking to static lib when a shared lib has the same name. -IF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) - ADD_DEFINITIONS(-DCOMPLEX_TEST_LINK_STATIC) - TARGET_LINK_LIBRARIES(complex CMakeTestLinkStatic) -ENDIF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) - -# can we get the path to a source file -GET_SOURCE_FILE_PROPERTY(A_LOCATION A.cxx LOCATION) -IF ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx") - ADD_DEFINITIONS(-DCMAKE_FOUND_ACXX) -ENDIF ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx") - -# get the directory parent -GET_DIRECTORY_PROPERTY(P_VALUE PARENT_DIRECTORY) -IF ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}") - ADD_DEFINITIONS(-DCMAKE_FOUND_PARENT) -ENDIF ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}") - -# get the stack of listfiles -INCLUDE(Included.cmake) -IF ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake") - ADD_DEFINITIONS(-DCMAKE_FOUND_LISTFILE_STACK) -ENDIF ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake") - -# Test add/remove definitions. -ADD_DEFINITIONS( - -DCOMPLEX_DEFINED_PRE - -DCOMPLEX_DEFINED - -DCOMPLEX_DEFINED_POST - -DCOMPLEX_DEFINED - ) -REMOVE_DEFINITIONS(-DCOMPLEX_DEFINED) - -# Test pre-build/pre-link/post-build rules for an executable. -ADD_CUSTOM_COMMAND(TARGET complex PRE_BUILD - COMMAND ${CREATE_FILE_EXE} - ARGS "${Complex_BINARY_DIR}/Executable/prebuild.txt") -ADD_CUSTOM_COMMAND(TARGET complex PRE_BUILD - COMMAND ${CREATE_FILE_EXE} - ARGS "${Complex_BINARY_DIR}/Executable/prelink.txt") -ADD_CUSTOM_COMMAND(TARGET complex POST_BUILD - COMMAND ${CREATE_FILE_EXE} - ARGS "${Complex_BINARY_DIR}/Executable/postbuild.txt") -ADD_CUSTOM_COMMAND(TARGET complex POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy - "${Complex_BINARY_DIR}/Executable/postbuild.txt" - "${Complex_BINARY_DIR}/Executable/postbuild2.txt") - -SET_SOURCE_FILES_PROPERTIES(complex - COMPILE_FLAGS - "-DFILE_HAS_EXTRA_COMPILE_FLAGS" - #" -DFILE_DEFINE_STRING=\\\"hello\\\"" - OBJECT_DEPENDS ${Complex_BINARY_DIR}/cmTestGeneratedHeader.h -) -SET_TARGET_PROPERTIES(complex PROPERTIES COMPILE_FLAGS "-DCOMPLEX_TARGET_FLAG") -ADD_CUSTOM_COMMAND( - TARGET complex - SOURCE ${Complex_SOURCE_DIR}/cmTestGeneratedHeader.h.in - COMMAND ${CMAKE_COMMAND} - ARGS -E copy ${Complex_SOURCE_DIR}/cmTestGeneratedHeader.h.in - ${Complex_BINARY_DIR}/cmTestGeneratedHeader.h - OUTPUTS ${Complex_BINARY_DIR}/cmTestGeneratedHeader.h - DEPENDS ${CMAKE_COMMAND} -) - -# Test creating an executable that is not built by default. -ADD_EXECUTABLE(notInAllExe EXCLUDE_FROM_ALL notInAllExe.cxx) -TARGET_LINK_LIBRARIES(notInAllExe notInAllLib) - -# Test user-value flag mapping for the VS IDE. -IF(MSVC) - SET_TARGET_PROPERTIES(notInAllExe PROPERTIES - LINK_FLAGS "/NODEFAULTLIB:LIBC;LIBCMT;MSVCRT") -ENDIF(MSVC) - -# Test creating a custom target that builds not-in-all targets. -ADD_CUSTOM_TARGET(notInAllCustom) -ADD_DEPENDENCIES(notInAllCustom notInAllExe) - -# -# Output the files required by 'complex' to a file. -# -# This test has been moved to the 'required' subdir so that it -# has no side-effects on the current Makefile (duplicated source file -# due to source list expansion done twice). -# -ADD_SUBDIRECTORY(Temp) - -IF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX) - ADD_EXECUTABLE(testSystemDir testSystemDir.cxx) - SET_TARGET_PROPERTIES(testSystemDir PROPERTIES COMPILE_FLAGS "-Werror") -ENDIF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX) - -# -# Extra coverage.Not used. -# -INSTALL_TARGETS(/tmp complex) -INSTALL_PROGRAMS(/tmp complex) - -CONFIGURE_FILE( - ${Complex_SOURCE_DIR}/Executable/cmVersion.h.in - ${Complex_BINARY_DIR}/cmVersion.h) - -SOURCE_GROUP(A_GROUP ".cxx") -SOURCE_GROUP(B_GROUP REGULAR_EXPRESSION "cxx") -SOURCE_GROUP(C_GROUP FILES complex.cxx) - -FILE(WRITE ${Complex_BINARY_DIR}/A/libA.a "test") -FILE(WRITE ${Complex_BINARY_DIR}/A/libC.a "test") -FILE(WRITE ${Complex_BINARY_DIR}/B/libB.a "test") -FILE(WRITE ${Complex_BINARY_DIR}/B/libA.a "test") -FILE(WRITE ${Complex_BINARY_DIR}/C/libC.a "test") -FILE(WRITE ${Complex_BINARY_DIR}/C/libB.a "test") diff --git a/Tests/ComplexRelativePaths/Executable/Included.cmake b/Tests/ComplexRelativePaths/Executable/Included.cmake deleted file mode 100644 index 2d1ea3e8c..000000000 --- a/Tests/ComplexRelativePaths/Executable/Included.cmake +++ /dev/null @@ -1,2 +0,0 @@ -GET_DIRECTORY_PROPERTY(LF_VALUE LISTFILE_STACK) - diff --git a/Tests/ComplexRelativePaths/Executable/Sub1/NameConflictTest.c b/Tests/ComplexRelativePaths/Executable/Sub1/NameConflictTest.c deleted file mode 100644 index 87203861f..000000000 --- a/Tests/ComplexRelativePaths/Executable/Sub1/NameConflictTest.c +++ /dev/null @@ -1,4 +0,0 @@ -int NameConflictTest1() -{ - return 0; -} diff --git a/Tests/ComplexRelativePaths/Executable/Sub2/NameConflictTest.c b/Tests/ComplexRelativePaths/Executable/Sub2/NameConflictTest.c deleted file mode 100644 index 4a3257255..000000000 --- a/Tests/ComplexRelativePaths/Executable/Sub2/NameConflictTest.c +++ /dev/null @@ -1,4 +0,0 @@ -int NameConflictTest2() -{ - return 0; -} diff --git a/Tests/ComplexRelativePaths/Executable/Temp/CMakeLists.txt b/Tests/ComplexRelativePaths/Executable/Temp/CMakeLists.txt deleted file mode 100644 index f00955029..000000000 --- a/Tests/ComplexRelativePaths/Executable/Temp/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -# -# Output the files required by 'complex' to a file. -# The 'complex' executable will then test if this file exists and remove it. -# The contents of this file is not tested (absolute paths). -# -OUTPUT_REQUIRED_FILES( - ${Complex_SOURCE_DIR}/Executable/complex.cxx - ${Complex_BINARY_DIR}/Executable/Temp/complex-required.txt) diff --git a/Tests/ComplexRelativePaths/Executable/cmVersion.h.in b/Tests/ComplexRelativePaths/Executable/cmVersion.h.in deleted file mode 100644 index de7522d1d..000000000 --- a/Tests/ComplexRelativePaths/Executable/cmVersion.h.in +++ /dev/null @@ -1 +0,0 @@ -#define CMAKE_MINIMUM_REQUIRED_VERSION "${CMAKE_MINIMUM_REQUIRED_VERSION}" diff --git a/Tests/ComplexRelativePaths/Executable/complex.cxx b/Tests/ComplexRelativePaths/Executable/complex.cxx deleted file mode 100644 index 0ecd8fe2e..000000000 --- a/Tests/ComplexRelativePaths/Executable/complex.cxx +++ /dev/null @@ -1,1226 +0,0 @@ -#include "cmTestConfigure.h" -#include "cmTestConfigureEscape.h" -#include "cmTestGeneratedHeader.h" -#include "cmVersion.h" -#include "ExtraSources/file1.h" -#include "file2.h" -#include "sharedFile.h" -extern "C" { -#include "testConly.h" -} -#ifdef COMPLEX_TEST_CMAKELIB -#include "cmStandardIncludes.h" -#include "cmSystemTools.h" -#include "cmDynamicLoader.h" -#include "cmSystemTools.h" -#include "cmGeneratedFileStream.h" -#include -#else -#include -#include -#include -#include -#endif - -#ifdef COMPLEX_TEST_LINK_STATIC -extern "C" -{ - int TestLinkGetType(); -} -#endif - -int cm_passed = 0; -int cm_failed = 0; -// ====================================================================== - -void cmFailed(const char* Message, const char* m2= "", const char* m3 = "") -{ - std::cout << "FAILED: " << Message << m2 << m3 << "\n"; - cm_failed++; -} - -// ====================================================================== - -void cmPassed(const char* Message, const char* m2="") -{ - std::cout << "Passed: " << Message << m2 << "\n"; - cm_passed++; -} - -#ifndef COMPLEX_DEFINED_PRE -# error "COMPLEX_DEFINED_PRE not defined!" -#endif - -#ifdef COMPLEX_DEFINED -# error "COMPLEX_DEFINED is defined but it should not!" -#endif - -#ifndef COMPLEX_DEFINED_POST -# error "COMPLEX_DEFINED_POST not defined!" -#endif - -#ifndef CMAKE_IS_REALLY_FUN -# error This is a problem. Looks like ADD_DEFINITIONS and REMOVE_DEFINITIONS does not work -#endif - -#if defined(NDEBUG) && !defined(CMAKE_IS_FUN_IN_RELEASE_MODE) -# error Per-configuration directory-level definition not inherited. -#endif - -#ifdef COMPLEX_TEST_CMAKELIB -// ====================================================================== - -void TestAndRemoveFile(const char* filename) -{ - if (!cmSystemTools::FileExists(filename)) - { - cmFailed("Could not find file: ", filename); - } - else - { - if (!cmSystemTools::RemoveFile(filename)) - { - cmFailed("Unable to remove file. It does not imply that this test failed, but it *will* be corrupted thereafter if this file is not removed: ", filename); - } - else - { - cmPassed("Find and remove file: ", filename); - } - } -} - -// ====================================================================== - -void TestDir(const char* filename) -{ - if (!cmSystemTools::FileExists(filename)) - { - cmFailed("Could not find dir: ", filename); - } - else - { - if (!cmSystemTools::FileIsDirectory(filename)) - { - cmFailed("Unable to check if file is a directory: ", filename); - } - else - { - cmPassed("Find dir: ", filename); - } - } -} - -// ====================================================================== - -void TestCMGeneratedFileSTream() -{ - cmGeneratedFileStream gm; - std::string file1 = std::string(BINARY_DIR) + std::string("/generatedFile1"); - std::string file2 = std::string(BINARY_DIR) + std::string("/generatedFile2"); - std::string file3 = std::string(BINARY_DIR) + std::string("/generatedFile3"); - std::string file4 = std::string(BINARY_DIR) + std::string("/generatedFile4"); - std::string file1tmp = file1 + ".tmp"; - std::string file2tmp = file2 + ".tmp"; - std::string file3tmp = file3 + ".tmp"; - std::string file4tmp = file4 + ".tmp"; - gm.Open(file1.c_str()); - gm << "This is generated file 1"; - gm.Close(); - gm.Open(file2.c_str()); - gm << "This is generated file 2"; - gm.Close(); - gm.Open(file3.c_str()); - gm << "This is generated file 3"; - gm.Close(); - gm.Open(file4.c_str()); - gm << "This is generated file 4"; - gm.Close(); - if ( cmSystemTools::FileExists(file1.c_str()) ) - { - if ( cmSystemTools::FileExists(file2.c_str()) ) - { - if ( cmSystemTools::FileExists(file3.c_str()) ) - { - if ( cmSystemTools::FileExists(file4.c_str()) ) - { - if ( cmSystemTools::FileExists(file1tmp.c_str()) ) - { - cmFailed("Something wrong with cmGeneratedFileStream. Temporary file is still here: ", file1tmp.c_str()); - } - else if ( cmSystemTools::FileExists(file2tmp.c_str()) ) - { - cmFailed("Something wrong with cmGeneratedFileStream. Temporary file is still here: ", file2tmp.c_str()); - } - else if ( cmSystemTools::FileExists(file3tmp.c_str()) ) - { - cmFailed("Something wrong with cmGeneratedFileStream. Temporary file is still here: ", file3tmp.c_str()); - } - else if ( cmSystemTools::FileExists(file4tmp.c_str()) ) - { - cmFailed("Something wrong with cmGeneratedFileStream. Temporary file is still here: ", file4tmp.c_str()); - } - else - { - cmPassed("cmGeneratedFileStream works."); - } - } - else - { - cmFailed("Something wrong with cmGeneratedFileStream. Cannot find file: ", file4.c_str()); - } - } - else - { - cmFailed("Something wrong with cmGeneratedFileStream. Found file: ", file3.c_str()); - } - } - else - { - cmFailed("Something wrong with cmGeneratedFileStream. Cannot find file: ", file2.c_str()); - } - } - else - { - cmFailed("Something wrong with cmGeneratedFileStream. Cannot find file: ", file1.c_str()); - } - cmSystemTools::RemoveFile(file1.c_str()); - cmSystemTools::RemoveFile(file2.c_str()); - cmSystemTools::RemoveFile(file3.c_str()); - cmSystemTools::RemoveFile(file1tmp.c_str()); - cmSystemTools::RemoveFile(file2tmp.c_str()); - cmSystemTools::RemoveFile(file3tmp.c_str()); -} -#endif - -// Here is a stupid function that tries to use std::string methods -// so that the dec cxx compiler will instantiate the stuff that -// we are using from the CMakeLib library.... -void ForceStringUse() -{ - std::vector v; - std::vector v2; - v = v2; - std::string cachetest = CACHE_TEST_VAR_INTERNAL; - v.push_back(cachetest); - v2 = v; - std::string x(5,'x'); - char buff[5]; - x.copy(buff, 1, 0); - x[0] = 'a'; - std::string::size_type pos = 0; - x.replace(pos, pos, pos, 'x'); - std::string copy = cachetest; - cachetest.find("bar"); - cachetest.rfind("bar"); - copy.append(cachetest); - copy = cachetest.substr(0, cachetest.size()); -} - - -// defined in testcflags.c -extern "C" int TestCFlags(char* m); -extern "C" int TestTargetCompileFlags(char* m); - -#if 0 -// defined in Sub1/NameConflictTest.c -extern "C" int NameConflictTest1(); -// defined in Sub2/NameConflictTest.c -extern "C" int NameConflictTest2(); -#endif - -// ====================================================================== - -int main() -{ - std::string lib = BINARY_DIR; - lib += "/lib/"; -#ifdef CMAKE_INTDIR - lib += CMAKE_INTDIR; - lib += "/"; -#endif - std::string exe = BINARY_DIR; - exe += "/bin/"; -#ifdef CMAKE_INTDIR - exe += CMAKE_INTDIR; - exe += "/"; -#endif - -#ifdef COMPLEX_TEST_CMAKELIB - // Test a single character executable to test a: in makefiles - exe += "A"; - exe += cmSystemTools::GetExecutableExtension(); - int ret; - std::string errorMessage; - exe = cmSystemTools::ConvertToRunCommandPath(exe.c_str()); - if(cmSystemTools::RunSingleCommand(exe.c_str(), 0, &ret)) - { - if(ret != 10) - { - errorMessage += exe; - errorMessage += " did not return 10"; - } - } - else - { - errorMessage += exe; - errorMessage += ": failed to run."; - } - if(errorMessage.size()) - { - cmFailed(errorMessage.c_str()); - } - else - { - cmPassed("run Single Character executable A returned 10 as expected."); - } - - lib += CMAKE_SHARED_MODULE_PREFIX; - lib += "CMakeTestModule"; - lib += CMAKE_SHARED_MODULE_SUFFIX; - cmsys::DynamicLoader::LibraryHandle handle = cmDynamicLoader::OpenLibrary(lib.c_str()); - if(!handle) - { - std::string err = "Can not open CMakeTestModule:\n"; - err += lib; - cmFailed(err.c_str()); - } - else - { - cmsys::DynamicLoader::SymbolPointer fun = - cmsys::DynamicLoader::GetSymbolAddress(handle, "ModuleFunction"); - if(!fun) - { - fun = cmsys::DynamicLoader::GetSymbolAddress(handle, "_ModuleFunction"); - } - typedef int (*TEST_FUNCTION)(); - TEST_FUNCTION testFun = (TEST_FUNCTION)fun; - if(!testFun) - { - cmFailed("Could not find symbol ModuleFunction in library "); - } - else - { - int ret = (*testFun)(); - if(!ret) - { - cmFailed("ModuleFunction call did not return valid return."); - } - cmPassed("Module loaded and ModuleFunction called correctly."); - } - } - cmDynamicLoader::FlushCache(); // fix memory leaks - if(sharedFunction() != 1) - { - cmFailed("Call to sharedFunction from shared library failed."); - } - else - { - cmPassed("Call to sharedFunction from shared library worked."); - } - if(CsharedFunction() != 1) - { - cmFailed("Call to C sharedFunction from shared library failed."); - } - else - { - cmPassed("Call to C sharedFunction from shared library worked."); - } - - // ---------------------------------------------------------------------- - // Test cmSystemTools::UpperCase - std::string str = "abc"; - std::string strupper = "ABC"; - if(cmSystemTools::UpperCase(str) == strupper) - { - cmPassed("cmSystemTools::UpperCase is working"); - } - else - { - cmFailed("cmSystemTools::UpperCase is working"); - } -#endif -#if 0 - if(NameConflictTest1() == 0 && NameConflictTest2() == 0) - { - cmPassed("Sub dir with same named source works"); - } - else - { - cmFailed("Sub dir with same named source fails"); - } -#endif - if(file1() != 1) - { - cmFailed("Call to file1 function from library failed."); - } - else - { - cmPassed("Call to file1 function returned 1."); - } -#ifndef COMPLEX_TARGET_FLAG - cmFailed("COMPILE_FLAGS did not work with SET_TARGET_PROPERTIES"); -#else - cmPassed("COMPILE_FLAGS did work with SET_TARGET_PROPERTIES"); -#endif - -#ifdef ELSEIF_RESULT - cmPassed("ELSEIF did work"); -#else - cmFailed("ELSEIF did not work"); -#endif - -#ifdef CONDITIONAL_PARENTHESES - cmPassed("CONDITIONAL_PARENTHESES did work"); -#else - cmFailed("CONDITIONAL_PARENTHESES did not work"); -#endif - - if(file2() != 1) - { - cmFailed("Call to file2 function from library failed."); - } - else - { - cmPassed("Call to file2 function returned 1."); - } -#ifndef TEST_CXX_FLAGS - cmFailed("CMake CMAKE_CXX_FLAGS is not being passed to the compiler!"); -#else - cmPassed("CMake CMAKE_CXX_FLAGS is being passed to the compiler."); -#endif - std::string gen = CMAKE_GENERATOR; - // visual studio is currently broken for c flags - char msg[1024]; - if(gen.find("Visual") == gen.npos) - { -#ifdef TEST_C_FLAGS - cmFailed("CMake CMAKE_C_FLAGS are being passed to c++ files the compiler!"); -#else - cmPassed("CMake CMAKE_C_FLAGS are not being passed to c++ files."); -#endif - if(TestCFlags(msg)) - { - cmPassed( - "CMake CMAKE_C_FLAGS are being passed to c files and CXX flags are not."); - } - else - { - cmFailed(msg); - } - } - if(TestTargetCompileFlags(msg)) - { - cmPassed(msg); - } - else - { - cmFailed(msg); - } - - // ---------------------------------------------------------------------- - // Test ADD_DEFINITIONS - -#ifndef CMAKE_IS_FUN - cmFailed("CMake is not fun, so it is broken and should be fixed."); -#else - cmPassed("CMAKE_IS_FUN is defined."); -#endif - -#if defined(CMAKE_ARGV1) && defined(CMAKE_ARGV2) && defined(CMAKE_ARGV3) && defined(CMAKE_ARGV4) - cmPassed("Variable args for MACROs are working."); -#else - cmFailed("Variable args for MACROs are failing."); -#endif - - // ---------------------------------------------------------------------- - // Test GET_SOURCE_FILE_PROPERTY for location -#ifndef CMAKE_FOUND_ACXX - cmFailed("CMake did not get the location of A.cxx correctly"); -#else - cmPassed("CMake found A.cxx properly"); -#endif - - // ---------------------------------------------------------------------- - // Test GET_DIRECTORY_PROPERTY for parent -#ifndef CMAKE_FOUND_PARENT - cmFailed("CMake did not get the location of the parent directory properly"); -#else - cmPassed("CMake found the parent directory properly"); -#endif - - // ---------------------------------------------------------------------- - // Test GET_DIRECTORY_PROPERTY for listfiles -#ifndef CMAKE_FOUND_LISTFILE_STACK - cmFailed("CMake did not get the listfile stack properly"); -#else - cmPassed("CMake found the listfile stack properly"); -#endif - - // ---------------------------------------------------------------------- - // Test SET, VARIABLE_REQUIRES - -#ifdef SHOULD_NOT_BE_DEFINED - cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED is defined."); -#else - cmPassed("SHOULD_NOT_BE_DEFINED is not defined."); -#endif - -#ifndef SHOULD_BE_DEFINED - cmFailed("IF or SET is broken, SHOULD_BE_DEFINED is not defined.\n"); -#else - cmPassed("SHOULD_BE_DEFINED is defined."); -#endif - -#ifndef ONE_VAR - cmFailed("cmakedefine is broken, ONE_VAR is not defined."); -#else - cmPassed("ONE_VAR is defined."); -#endif - -#ifndef ONE_VAR_IS_DEFINED - cmFailed("cmakedefine, SET or VARIABLE_REQUIRES is broken, " - "ONE_VAR_IS_DEFINED is not defined."); -#else - cmPassed("ONE_VAR_IS_DEFINED is defined."); -#endif - -#ifdef ZERO_VAR - cmFailed("cmakedefine is broken, ZERO_VAR is defined."); -#else - cmPassed("ZERO_VAR is not defined."); -#endif - -#ifndef STRING_VAR - cmFailed("the CONFIGURE_FILE command is broken, STRING_VAR is not defined."); -#else - if(strcmp(STRING_VAR, "CMake is great") != 0) - { - cmFailed("the SET or CONFIGURE_FILE command is broken. STRING_VAR == ", - STRING_VAR); - } - else - { - cmPassed("STRING_VAR == ", STRING_VAR); - } -#endif - - // ---------------------------------------------------------------------- - // Test various IF/ELSE combinations - -#ifdef SHOULD_NOT_BE_DEFINED_NOT - cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_NOT is defined."); -#else - cmPassed("SHOULD_NOT_BE_DEFINED_NOT is not defined."); -#endif - -#ifndef SHOULD_BE_DEFINED_NOT - cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_NOT is not defined.\n"); -#else - cmPassed("SHOULD_BE_DEFINED_NOT is defined."); -#endif - -#ifdef SHOULD_NOT_BE_DEFINED_NOT2 - cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_NOT2 is defined."); -#else - cmPassed("SHOULD_NOT_BE_DEFINED_NOT2 is not defined."); -#endif - -#ifndef SHOULD_BE_DEFINED_NOT2 - cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_NOT2 is not defined.\n"); -#else - cmPassed("SHOULD_BE_DEFINED_NOT2 is defined."); -#endif - -#ifdef SHOULD_NOT_BE_DEFINED_AND - cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_AND is defined."); -#else - cmPassed("SHOULD_NOT_BE_DEFINED_AND is not defined."); -#endif - -#ifndef SHOULD_BE_DEFINED_AND - cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_AND is not defined.\n"); -#else - cmPassed("SHOULD_BE_DEFINED_AND is defined."); -#endif - -#ifdef SHOULD_NOT_BE_DEFINED_AND2 - cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_AND2 is defined."); -#else - cmPassed("SHOULD_NOT_BE_DEFINED_AND2 is not defined."); -#endif - -#ifndef SHOULD_BE_DEFINED_AND2 - cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_AND2 is not defined.\n"); -#else - cmPassed("SHOULD_BE_DEFINED_AND2 is defined."); -#endif - -#ifdef SHOULD_NOT_BE_DEFINED_OR - cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_OR is defined."); -#else - cmPassed("SHOULD_NOT_BE_DEFINED_OR is not defined."); -#endif - -#ifndef SHOULD_BE_DEFINED_OR - cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_OR is not defined.\n"); -#else - cmPassed("SHOULD_BE_DEFINED_OR is defined."); -#endif - -#ifdef SHOULD_NOT_BE_DEFINED_OR2 - cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_OR2 is defined."); -#else - cmPassed("SHOULD_NOT_BE_DEFINED_OR2 is not defined."); -#endif - -#ifndef SHOULD_BE_DEFINED_OR2 - cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_OR2 is not defined.\n"); -#else - cmPassed("SHOULD_BE_DEFINED_OR2 is defined."); -#endif - -#ifdef SHOULD_NOT_BE_DEFINED_MATCHES - cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_MATCHES is defined."); -#else - cmPassed("SHOULD_NOT_BE_DEFINED_MATCHES is not defined."); -#endif - -#ifndef SHOULD_BE_DEFINED_MATCHES - cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_MATCHES is not defined.\n"); -#else - cmPassed("SHOULD_BE_DEFINED_MATCHES is defined."); -#endif - -#ifdef SHOULD_NOT_BE_DEFINED_MATCHES2 - cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_MATCHES2 is defined."); -#else - cmPassed("SHOULD_NOT_BE_DEFINED_MATCHES2 is not defined."); -#endif - -#ifndef SHOULD_BE_DEFINED_MATCHES2 - cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_MATCHES2 is not defined.\n"); -#else - cmPassed("SHOULD_BE_DEFINED_MATCHES2 is defined."); -#endif - -#ifdef SHOULD_NOT_BE_DEFINED_COMMAND - cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_COMMAND is defined."); -#else - cmPassed("SHOULD_NOT_BE_DEFINED_COMMAND is not defined."); -#endif - -#ifndef SHOULD_BE_DEFINED_COMMAND - cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_COMMAND is not defined.\n"); -#else - cmPassed("SHOULD_BE_DEFINED_COMMAND is defined."); -#endif - -#ifdef SHOULD_NOT_BE_DEFINED_COMMAND2 - cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_COMMAND2 is defined."); -#else - cmPassed("SHOULD_NOT_BE_DEFINED_COMMAND2 is not defined."); -#endif - -#ifndef SHOULD_BE_DEFINED_COMMAND2 - cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_COMMAND2 is not defined.\n"); -#else - cmPassed("SHOULD_BE_DEFINED_COMMAND2 is defined."); -#endif - -#ifdef SHOULD_NOT_BE_DEFINED_EXISTS - cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_EXISTS is defined."); -#else - cmPassed("SHOULD_NOT_BE_DEFINED_EXISTS is not defined."); -#endif - -#ifndef SHOULD_BE_DEFINED_EXISTS - cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_EXISTS is not defined.\n"); -#else - cmPassed("SHOULD_BE_DEFINED_EXISTS is defined."); -#endif - -#ifdef SHOULD_NOT_BE_DEFINED_EXISTS2 - cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_EXISTS2 is defined."); -#else - cmPassed("SHOULD_NOT_BE_DEFINED_EXISTS2 is not defined."); -#endif - -#ifndef SHOULD_BE_DEFINED_EXISTS2 - cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_EXISTS2 is not defined.\n"); -#else - cmPassed("SHOULD_BE_DEFINED_EXISTS2 is defined."); -#endif - -#ifndef SHOULD_BE_DEFINED_IS_DIRECTORY - cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_IS_DIRECTORY is not defined.\n"); -#else - cmPassed("SHOULD_BE_DEFINED_IS_DIRECTORY is defined."); -#endif - -#ifndef SHOULD_BE_DEFINED_IS_DIRECTORY2 - cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_IS_DIRECTORY2 is not defined.\n"); -#else - cmPassed("SHOULD_BE_DEFINED_IS_DIRECTORY2 is defined."); -#endif - -#ifdef SHOULD_NOT_BE_DEFINED_LESS - cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_LESS is defined."); -#else - cmPassed("SHOULD_NOT_BE_DEFINED_LESS is not defined."); -#endif - -#ifndef SHOULD_BE_DEFINED_LESS - cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_LESS is not defined.\n"); -#else - cmPassed("SHOULD_BE_DEFINED_LESS is defined."); -#endif - -#ifdef SHOULD_NOT_BE_DEFINED_LESS2 - cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_LESS2 is defined."); -#else - cmPassed("SHOULD_NOT_BE_DEFINED_LESS2 is not defined."); -#endif - -#ifndef SHOULD_BE_DEFINED_LESS2 - cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_LESS2 is not defined.\n"); -#else - cmPassed("SHOULD_BE_DEFINED_LESS2 is defined."); -#endif - -#ifdef SHOULD_NOT_BE_DEFINED_GREATER - cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_GREATER is defined."); -#else - cmPassed("SHOULD_NOT_BE_DEFINED_GREATER is not defined."); -#endif - -#ifdef SHOULD_NOT_BE_DEFINED_EQUAL - cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_EQUAL is defined."); -#else - cmPassed("SHOULD_NOT_BE_DEFINED_EQUAL is not defined."); -#endif - -#ifndef SHOULD_BE_DEFINED_EQUAL - cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_EQUAL is not defined.\n"); -#else - cmPassed("SHOULD_BE_DEFINED_EQUAL is defined."); -#endif - -#ifndef SHOULD_BE_DEFINED_GREATER - cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_GREATER is not defined.\n"); -#else - cmPassed("SHOULD_BE_DEFINED_GREATER is defined."); -#endif - -#ifdef SHOULD_NOT_BE_DEFINED_GREATER2 - cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_GREATER2 is defined."); -#else - cmPassed("SHOULD_NOT_BE_DEFINED_GREATER2 is not defined."); -#endif - -#ifndef SHOULD_BE_DEFINED_GREATER2 - cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_GREATER2 is not defined.\n"); -#else - cmPassed("SHOULD_BE_DEFINED_GREATER2 is defined."); -#endif - -#ifdef SHOULD_NOT_BE_DEFINED_STRLESS - cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_STRLESS is defined."); -#else - cmPassed("SHOULD_NOT_BE_DEFINED_STRLESS is not defined."); -#endif - -#ifndef SHOULD_BE_DEFINED_STRLESS - cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_STRLESS is not defined.\n"); -#else - cmPassed("SHOULD_BE_DEFINED_STRLESS is defined."); -#endif - -#ifdef SHOULD_NOT_BE_DEFINED_STRLESS2 - cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_STRLESS2 is defined."); -#else - cmPassed("SHOULD_NOT_BE_DEFINED_STRLESS2 is not defined."); -#endif - -#ifndef SHOULD_BE_DEFINED_STRLESS2 - cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_STRLESS2 is not defined.\n"); -#else - cmPassed("SHOULD_BE_DEFINED_STRLESS2 is defined."); -#endif - -#ifdef SHOULD_NOT_BE_DEFINED_STRGREATER - cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_STRGREATER is defined."); -#else - cmPassed("SHOULD_NOT_BE_DEFINED_STRGREATER is not defined."); -#endif - -#ifndef SHOULD_BE_DEFINED_STRGREATER - cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_STRGREATER is not defined.\n"); -#else - cmPassed("SHOULD_BE_DEFINED_STRGREATER is defined."); -#endif - -#ifdef SHOULD_NOT_BE_DEFINED_STRGREATER2 - cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_STRGREATER2 is defined."); -#else - cmPassed("SHOULD_NOT_BE_DEFINED_STRGREATER2 is not defined."); -#endif - -#ifndef SHOULD_BE_DEFINED_STRGREATER2 - cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_STRGREATER2 is not defined.\n"); -#else - cmPassed("SHOULD_BE_DEFINED_STRGREATER2 is defined."); -#endif - - // ---------------------------------------------------------------------- - // Test FOREACH - -#ifndef FOREACH_VAR1 - cmFailed("the FOREACH, SET or CONFIGURE_FILE command is broken, " - "FOREACH_VAR1 is not defined."); -#else - if(strcmp(FOREACH_VAR1, "VALUE1") != 0) - { - cmFailed("the FOREACH, SET or CONFIGURE_FILE command is broken, " - "FOREACH_VAR1 == ", FOREACH_VAR1); - } - else - { - cmPassed("FOREACH_VAR1 == ", FOREACH_VAR1); - } -#endif - -#ifndef FOREACH_VAR2 - cmFailed("the FOREACH, SET or CONFIGURE_FILE command is broken, " - "FOREACH_VAR2 is not defined."); -#else - if(strcmp(FOREACH_VAR2, "VALUE2") != 0) - { - cmFailed("the FOREACH, SET or CONFIGURE_FILE command is broken, " - "FOREACH_VAR2 == ", FOREACH_VAR2); - } - else - { - cmPassed("FOREACH_VAR2 == ", FOREACH_VAR2); - } -#endif - -#ifndef FOREACH_CONCAT - cmFailed("the FOREACH, SET or CONFIGURE_FILE command is broken, " - "FOREACH_CONCAT is not defined."); -#else - if(strcmp(FOREACH_CONCAT, "abcdefg") != 0) - { - cmFailed("the FOREACH, SET or CONFIGURE_FILE command is broken, " - "FOREACH_CONCAT == ", FOREACH_CONCAT); - } - else - { - cmPassed("FOREACH_CONCAT == ", FOREACH_CONCAT); - } -#endif - - // ---------------------------------------------------------------------- - // Test WHILE - - if(WHILE_VALUE != 1000) - { - cmFailed("WHILE command is not working"); - } - else - { - cmPassed("WHILE command is working"); - } - - // ---------------------------------------------------------------------- - // Test FIND_FILE, FIND_PATH and various GET_FILENAME_COMPONENT combinations - -#ifndef FILENAME_VAR_PATH_NAME - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "FILENAME_VAR_PATH_NAME is not defined."); -#else - if((strcmp(FILENAME_VAR_PATH_NAME, "Complex") == 0) || - (strcmp(FILENAME_VAR_PATH_NAME, "ComplexOneConfig") == 0) || - (strcmp(FILENAME_VAR_PATH_NAME, "ComplexRelativePaths") == 0)) - { - cmPassed("FILENAME_VAR_PATH_NAME == ", FILENAME_VAR_PATH_NAME); - } - else - { - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "FILENAME_VAR_PATH_NAME == ", FILENAME_VAR_PATH_NAME); - } -#endif - -#ifndef FILENAME_VAR_NAME - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "FILENAME_VAR_NAME is not defined."); -#else - if(strcmp(FILENAME_VAR_NAME, "VarTests.cmake") != 0) - { - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "FILENAME_VAR_NAME == ", FILENAME_VAR_NAME); - } - else - { - cmPassed("FILENAME_VAR_NAME == ", FILENAME_VAR_NAME); - } -#endif - -#ifndef FILENAME_VAR_EXT - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "FILENAME_VAR_EXT is not defined."); -#else - if(strcmp(FILENAME_VAR_EXT, ".cmake") != 0) - { - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "FILENAME_VAR_EXT == ", FILENAME_VAR_EXT); - } - else - { - cmPassed("FILENAME_VAR_EXT == ", FILENAME_VAR_EXT); - } -#endif - -#ifndef FILENAME_VAR_NAME_WE - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "FILENAME_VAR_NAME_WE is not defined."); -#else - if(strcmp(FILENAME_VAR_NAME_WE, "VarTests") != 0) - { - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "FILENAME_VAR_NAME_WE == ", FILENAME_VAR_NAME_WE); - } - else - { - cmPassed("FILENAME_VAR_NAME_WE == ", FILENAME_VAR_NAME_WE); - } -#endif - -#ifndef PATH_VAR_NAME - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "PATH_VAR_NAME is not defined."); -#else - if((strcmp(PATH_VAR_NAME, "Complex") == 0) || - (strcmp(PATH_VAR_NAME, "ComplexOneConfig") == 0) || - (strcmp(PATH_VAR_NAME, "ComplexRelativePaths") == 0)) - { - cmPassed("PATH_VAR_NAME == ", PATH_VAR_NAME); - } - else - { - cmFailed("the FIND_FILE or GET_FILENAME_COMPONENT command is broken, " - "PATH_VAR_NAME == ", PATH_VAR_NAME); - } -#endif - - // ---------------------------------------------------------------------- - // Test LOAD_CACHE - -#ifndef CACHE_TEST_VAR1 - cmFailed("the LOAD_CACHE or CONFIGURE_FILE command is broken, " - "CACHE_TEST_VAR1 is not defined."); -#else - if(strcmp(CACHE_TEST_VAR1, "foo") != 0) - { - cmFailed("the LOAD_CACHE or CONFIGURE_FILE command is broken, " - "CACHE_TEST_VAR1 == ", CACHE_TEST_VAR1); - } - else - { - cmPassed("CACHE_TEST_VAR1 == ", CACHE_TEST_VAR1); - } -#endif - -#ifndef CACHE_TEST_VAR2 - cmFailed("the LOAD_CACHE or CONFIGURE_FILE command is broken, " - "CACHE_TEST_VAR2 is not defined."); -#else - if(strcmp(CACHE_TEST_VAR2, "bar") != 0) - { - cmFailed("the LOAD_CACHE or CONFIGURE_FILE command is broken, " - "CACHE_TEST_VAR2 == ", CACHE_TEST_VAR2); - } - else - { - cmPassed("CACHE_TEST_VAR2 == ", CACHE_TEST_VAR2); - } -#endif - -#ifndef CACHE_TEST_VAR3 - cmFailed("the LOAD_CACHE or CONFIGURE_FILE command is broken, " - "CACHE_TEST_VAR3 is not defined."); -#else - if(strcmp(CACHE_TEST_VAR3, "1") != 0) - { - cmFailed("the LOAD_CACHE or CONFIGURE_FILE command is broken, " - "CACHE_TEST_VAR3 == ", CACHE_TEST_VAR3); - } - else - { - cmPassed("CACHE_TEST_VAR3 == ", CACHE_TEST_VAR3); - } -#endif - -#ifdef CACHE_TEST_VAR_EXCLUDED - cmFailed("the LOAD_CACHE or CONFIGURE_FILE command or cmakedefine is broken, " - "CACHE_TEST_VAR_EXCLUDED is defined (should not have been loaded)."); -#else - cmPassed("CACHE_TEST_VAR_EXCLUDED is not defined."); -#endif - -#ifndef CACHE_TEST_VAR_INTERNAL - cmFailed("the LOAD_CACHE or CONFIGURE_FILE command is broken, " - "CACHE_TEST_VAR_INTERNAL is not defined."); -#else - std::string cachetest = CACHE_TEST_VAR_INTERNAL; - if(cachetest != "bar") - { - cmFailed("the LOAD_CACHE or CONFIGURE_FILE command is broken, " - "CACHE_TEST_VAR_INTERNAL == ", CACHE_TEST_VAR_INTERNAL); - } - else - { - cmPassed("CACHE_TEST_VAR_INTERNAL == ", CACHE_TEST_VAR_INTERNAL); - } -#endif - -#ifdef COMPLEX_TEST_CMAKELIB - // ---------------------------------------------------------------------- - // Some pre-build/pre-link/post-build custom-commands have been - // attached to the lib (see Library/). - // Each runs ${CREATE_FILE_EXE} which will create a file. - // It also copies that file again using cmake -E. - // Similar rules have been added to this executable. - // - // WARNING: if you run 'complex' manually, this *will* fail, because - // the file was removed the last time 'complex' was run, and it is - // only created during a build. - - TestAndRemoveFile(BINARY_DIR "/Library/prebuild.txt"); - TestAndRemoveFile(BINARY_DIR "/Library/prelink.txt"); - TestAndRemoveFile(BINARY_DIR "/Library/postbuild.txt"); - TestAndRemoveFile(BINARY_DIR "/Library/postbuild2.txt"); - TestAndRemoveFile(BINARY_DIR "/Executable/prebuild.txt"); - TestAndRemoveFile(BINARY_DIR "/Executable/prelink.txt"); - TestAndRemoveFile(BINARY_DIR "/Executable/postbuild.txt"); - TestAndRemoveFile(BINARY_DIR "/Executable/postbuild2.txt"); - - // ---------------------------------------------------------------------- - // A custom target has been created (see Library/). - // It runs ${CREATE_FILE_EXE} which will create a file. - // - // WARNING: if you run 'complex' manually, this *will* fail, because - // the file was removed the last time 'complex' was run, and it is - // only created during a build. - - TestAndRemoveFile(BINARY_DIR "/Library/custom_target1.txt"); - - // ---------------------------------------------------------------------- - // A directory has been created. - - TestDir(BINARY_DIR "/make_dir"); - - // ---------------------------------------------------------------------- - // Test OUTPUT_REQUIRED_FILES - // The files required by 'complex' have been output to a file. - // The contents of this file is not tested (absolute paths). - // - // WARNING: if you run 'complex' manually, this *will* fail, because - // the file was removed the last time 'complex' was run, and it is - // only created during a build. - - TestAndRemoveFile(BINARY_DIR "/Executable/Temp/complex-required.txt"); -#endif - - // ---------------------------------------------------------------------- - // Test FIND_LIBRARY - -#ifndef FIND_DUMMY_LIB - cmFailed("the CONFIGURE_FILE command is broken, " - "FIND_DUMMY_LIB is not defined."); -#else - if(strstr(FIND_DUMMY_LIB, "dummylib") == NULL) - { - cmFailed("the FIND_LIBRARY or CONFIGURE_FILE command is broken, " - "FIND_DUMMY_LIB == ", FIND_DUMMY_LIB); - } - else - { - cmPassed("FIND_DUMMY_LIB == ", FIND_DUMMY_LIB); - } -#endif - - // ---------------------------------------------------------------------- - // Test SET_SOURCE_FILES_PROPERTIES - -#ifndef FILE_HAS_EXTRA_COMPILE_FLAGS - cmFailed("SET_SOURCE_FILES_PROPERTIES failed at setting FILE_HAS_EXTRA_COMPILE_FLAGS flag"); -#else - cmPassed("SET_SOURCE_FILES_PROPERTIES succeeded in setting FILE_HAS_EXTRA_COMPILE_FLAGS flag"); -#endif - -#if 0 // Disable until implemented everywhere. -#ifndef FILE_DEFINE_STRING - cmFailed("SET_SOURCE_FILES_PROPERTIES failed at setting FILE_DEFINE_STRING flag"); -#else - if(strcmp(FILE_DEFINE_STRING, "hello") != 0) - { - cmFailed("SET_SOURCE_FILES_PROPERTIES failed at setting FILE_DEFINE_STRING flag correctly"); - } - else - { - cmPassed("SET_SOURCE_FILES_PROPERTIES succeeded in setting FILE_DEFINE_STRING flag"); - } -#endif -#endif - -#ifndef FILE_HAS_ABSTRACT - cmFailed("SET_SOURCE_FILES_PROPERTIES failed at setting ABSTRACT flag"); -#else - cmPassed("SET_SOURCE_FILES_PROPERTIES succeeded in setting ABSTRACT flag"); -#endif - -#ifndef FILE_HAS_WRAP_EXCLUDE - cmFailed("FILE_HAS_WRAP_EXCLUDE failed at setting WRAP_EXCLUDE flag"); -#else - cmPassed("FILE_HAS_WRAP_EXCLUDE succeeded in setting WRAP_EXCLUDE flag"); -#endif - -#ifndef FILE_COMPILE_FLAGS - cmFailed("the CONFIGURE_FILE command is broken, FILE_COMPILE_FLAGS is not defined."); -#else - if(strcmp(FILE_COMPILE_FLAGS, "-foo -bar") != 0) - { - cmFailed("the SET_SOURCE_FILES_PROPERTIES or CONFIGURE_FILE command is broken. FILE_COMPILE_FLAGS == ", - FILE_COMPILE_FLAGS); - } - else - { - cmPassed("SET_SOURCE_FILES_PROPERTIES succeeded in setting extra flags == ", FILE_COMPILE_FLAGS); - } -#endif - - // ---------------------------------------------------------------------- - // Test registry (win32) -#if defined(_WIN32) && !defined(__CYGWIN__) -#ifndef REGISTRY_TEST_PATH - cmFailed("the CONFIGURE_FILE command is broken, REGISTRY_TEST_PATH is not defined."); -#else - std::cout << "REGISTRY_TEST_PATH == " << REGISTRY_TEST_PATH << "\n"; - if(stricmp(REGISTRY_TEST_PATH, BINARY_DIR "/registry_dir") != 0) - { - cmFailed("the 'read registry value' function or CONFIGURE_FILE command is broken. REGISTRY_TEST_PATH == ", - REGISTRY_TEST_PATH, " is not " BINARY_DIR "/registry_dir"); - } - else - { - cmPassed("REGISTRY_TEST_PATH == ", REGISTRY_TEST_PATH); - } -#endif -#endif // defined(_WIN32) && !defined(__CYGWIN__) - - if(strcmp(CMAKE_MINIMUM_REQUIRED_VERSION, "1.3") == 0) - { - cmPassed("CMAKE_MINIMUM_REQUIRED_VERSION is set to 1.3"); - } - else - { - cmFailed("CMAKE_MINIMUM_REQUIRED_VERSION is not set to the expected 1.3"); - } - - // ---------------------------------------------------------------------- - // Test REMOVE command - if (strcmp("a;b;d",REMOVE_STRING) == 0) - { - cmPassed("REMOVE is working"); - } - else - { - cmFailed("REMOVE is not working"); - } - - // ---------------------------------------------------------------------- - // Test SEPARATE_ARGUMENTS - if(strcmp("a;b;c", TEST_SEP) == 0) - { - cmPassed("SEPARATE_ARGUMENTS is working"); - } - else - { - cmFailed("SEPARATE_ARGUMENTS is not working"); - } - - // ---------------------------------------------------------------------- - // Test Escape Quotes - if(strcmp("\"hello world\"", STRING_WITH_QUOTES) == 0) - { - cmPassed("ESCAPE_QUOTES is working"); - } - else - { - cmFailed("ESCAPE_QUOTES is not working"); - } - - - // ---------------------------------------------------------------------- - // Test if IF command inside a FOREACH works. -#if defined(IF_INSIDE_FOREACH_THEN_EXECUTED) && !defined(IF_INSIDE_FOREACH_ELSE_EXECUTED) - cmPassed("IF inside a FOREACH block works"); -#else - cmFailed("IF inside a FOREACH block is broken"); -#endif - -#if defined(GENERATED_HEADER_INCLUDED) - cmPassed("Generated header included by non-generated source works."); -#else - cmFailed("Generated header included by non-generated source failed."); -#endif - if(SHOULD_BE_ZERO == 0) - { - cmPassed("cmakedefine01 is working for 0"); - } - else - { - cmFailed("cmakedefine01 is not working for 0"); - } - if(SHOULD_BE_ONE == 1) - { - cmPassed("cmakedefine01 is working for 1"); - } - else - { - cmFailed("cmakedefine01 is not working for 1"); - } -#ifdef FORCE_TEST - cmFailed("CMake SET CACHE FORCE"); -#else - cmPassed("CMake SET CACHE FORCE"); -#endif - -#ifdef COMPLEX_TEST_CMAKELIB - // Test the generated file stream. - TestCMGeneratedFileSTream(); -#endif - -#ifdef COMPLEX_TEST_LINK_STATIC - if(TestLinkGetType()) - { - cmPassed("Link to static over shared worked."); - } - else - { - cmFailed("Link to static over shared failed."); - } -#endif - - // ---------------------------------------------------------------------- - // Summary - - std::cout << "Passed: " << cm_passed << "\n"; - if(cm_failed) - { - std::cout << "Failed: " << cm_failed << "\n"; - return cm_failed; - } - return 0; -} diff --git a/Tests/ComplexRelativePaths/Executable/complex.file.cxx b/Tests/ComplexRelativePaths/Executable/complex.file.cxx deleted file mode 100644 index e873fa644..000000000 --- a/Tests/ComplexRelativePaths/Executable/complex.file.cxx +++ /dev/null @@ -1,8 +0,0 @@ -#if 0 -#include "cmMissingHeader.h" -#endif - -int main(int , char**) -{ - return 0; -} diff --git a/Tests/ComplexRelativePaths/Executable/notInAllExe.cxx b/Tests/ComplexRelativePaths/Executable/notInAllExe.cxx deleted file mode 100644 index 70275cd51..000000000 --- a/Tests/ComplexRelativePaths/Executable/notInAllExe.cxx +++ /dev/null @@ -1,10 +0,0 @@ -extern int notInAllLibFunc(); - -int main() -{ - return notInAllLibFunc(); -} - -#if 1 -# error "This target should not be compiled by ALL." -#endif diff --git a/Tests/ComplexRelativePaths/Executable/testSystemDir.cxx b/Tests/ComplexRelativePaths/Executable/testSystemDir.cxx deleted file mode 100644 index e4815c679..000000000 --- a/Tests/ComplexRelativePaths/Executable/testSystemDir.cxx +++ /dev/null @@ -1,3 +0,0 @@ -#include - -int main() { return foo(); } diff --git a/Tests/ComplexRelativePaths/Executable/testcflags.c b/Tests/ComplexRelativePaths/Executable/testcflags.c deleted file mode 100644 index f4d584844..000000000 --- a/Tests/ComplexRelativePaths/Executable/testcflags.c +++ /dev/null @@ -1,26 +0,0 @@ -#include - -int TestTargetCompileFlags(char* m) -{ -#ifndef COMPLEX_TARGET_FLAG - strcpy(m, "CMAKE SET_TARGET_PROPERTIES COMPILE_FLAGS did not work"); - return 0; -#endif - strcpy(m, "CMAKE SET_TARGET_PROPERTIES COMPILE_FLAGS worked"); - return 1; -} - -int TestCFlags(char* m) -{ - /* TEST_CXX_FLAGS should not be defined in a c file */ -#ifdef TEST_CXX_FLAGS - strcpy(m, "CMake CMAKE_CXX_FLAGS (TEST_CXX_FLAGS) found in c file."); - return 0; -#endif - /* TEST_C_FLAGS should be defined in a c file */ -#ifndef TEST_C_FLAGS - strcpy(m, "CMake CMAKE_C_FLAGS (TEST_C_FLAGS) not found in c file."); - return 0; -#endif - return 1; -} diff --git a/Tests/ComplexRelativePaths/Library/CMakeLists.txt b/Tests/ComplexRelativePaths/Library/CMakeLists.txt deleted file mode 100644 index 281e48a55..000000000 --- a/Tests/ComplexRelativePaths/Library/CMakeLists.txt +++ /dev/null @@ -1,141 +0,0 @@ -REMOVE_DEFINITIONS(-DCMAKE_IS_REALLY_FUN) - -# -# Small utility used to create file -# UTILITY_SOURCE is used for coverage and for getting the exact name -# of the executable. -# -UTILITY_SOURCE(CREATE_FILE_EXE create_file "." create_file.cxx) -ADD_EXECUTABLE(create_file create_file.cxx) -SET_TARGET_PROPERTIES(create_file PROPERTIES RUNTIME_OUTPUT_DIRECTORY ".") - -# -# Create static library -# SOURCE_FILES_REMOVE is used for Coverage. empty.h is included for coverage -# -AUX_SOURCE_DIRECTORY(ExtraSources LibrarySources) -SET(LibrarySources ${LibrarySources} - file2 - empty - create_file.cxx - GENERATED - nonexisting_file) -REMOVE(LibrarySources create_file.cxx GENERATED nonexisting_file) -ADD_LIBRARY(CMakeTestLibrary ${LibrarySources}) - -IF(WIN32) - IF(NOT CYGWIN) - IF(NOT BORLAND) - IF(NOT MINGW) - TARGET_LINK_LIBRARIES(CMakeTestLibrary - debug - user32.lib) - TARGET_LINK_LIBRARIES(CMakeTestLibrary - optimized - kernel32.lib) - ENDIF(NOT MINGW) - ENDIF(NOT BORLAND) - ENDIF(NOT CYGWIN) -ENDIF(WIN32) - -# -# Create shared library -# -SET(SharedLibrarySources sharedFile) -ADD_LIBRARY(CMakeTestLibraryShared SHARED ${SharedLibrarySources}) -ADD_LIBRARY(CMakeTestModule MODULE moduleFile.c) -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS") -ADD_LIBRARY(CMakeTestCLibraryShared SHARED testConly.c) -DEFINE_PROPERTY( - TARGET PROPERTY FOO - BRIEF_DOCS "a test property" - FULL_DOCS "A simple etst proerty that means nothign and is used for nothing" - ) -SET_TARGET_PROPERTIES(CMakeTestCLibraryShared PROPERTIES FOO BAR) -IF(NOT BEOS AND NOT WIN32) # No libm on BeOS. - SET_TARGET_PROPERTIES(CMakeTestCLibraryShared PROPERTIES LINK_FLAGS "-lm") -ENDIF(NOT BEOS AND NOT WIN32) -GET_TARGET_PROPERTY(FOO_BAR_VAR CMakeTestCLibraryShared FOO) -IF(${FOO_BAR_VAR} MATCHES "BAR") -ELSE(${FOO_BAR_VAR} MATCHES "BAR") - MESSAGE(SEND_ERROR "SET_TARGET_PROPERTIES or GET_TARGET_PROPERTY failed, FOO_BAR_VAR should be BAR, but is ${FOO_BAR_VAR}") -ENDIF(${FOO_BAR_VAR} MATCHES "BAR") - -# Create static and shared lib of same name. -IF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) - ADD_LIBRARY(CMakeTestLinkStatic STATIC TestLink.c) - ADD_LIBRARY(CMakeTestLinkShared SHARED TestLink.c) - SET_TARGET_PROPERTIES(CMakeTestLinkStatic CMakeTestLinkShared - PROPERTIES OUTPUT_NAME CMakeTestLink) -ENDIF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) - -# -# Attach pre-build/pre-link/post-build custom-commands to the lib. -# Each runs ${CREATE_FILE_EXE} which will create a file. -# The 'complex' executable will then test if this file exists and remove it. -# -ADD_DEPENDENCIES(CMakeTestLibraryShared create_file) -MESSAGE("complex bin dir is ${Complex_BINARY_DIR}") -ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared PRE_BUILD - COMMAND ${CREATE_FILE_EXE} - ARGS "${Complex_BINARY_DIR}/Library/prebuild.txt") -ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared PRE_BUILD - COMMAND ${CREATE_FILE_EXE} - ARGS "${Complex_BINARY_DIR}/Library/prelink.txt") -ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared POST_BUILD - COMMAND ${CREATE_FILE_EXE} - ARGS "${Complex_BINARY_DIR}/Library/postbuild.txt") -ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy - "${Complex_BINARY_DIR}/Library/postbuild.txt" - "${Complex_BINARY_DIR}/Library/postbuild2.txt") - -# -# Add a custom target. -# It runs ${CREATE_FILE_EXE} which will create a file. -# The 'complex' executable will then test if this file exists and remove it. -# -ADD_CUSTOM_TARGET(custom_target1 - ALL - ${CREATE_FILE_EXE} - "${Complex_BINARY_DIR}/Library/custom_target1.txt") - -ADD_DEPENDENCIES(custom_target1 create_file) - -# -# Extra coverage -# -SET_SOURCE_FILES_PROPERTIES(file2 PROPERTIES ABSTRACT 1) - -INSTALL_FILES(/tmp .h ${Complex_BINARY_DIR}/cmTestConfigure.h) -INSTALL_FILES(/tmp .cxx ${Complex_BINARY_DIR}/cmTestConfigure.h) - -# Test creating a library that is not built by default. -ADD_LIBRARY(notInAllLib EXCLUDE_FROM_ALL notInAllLib.cxx) - -# Create an imported target for if(TARGET) test in Executable dir. -# That test should not see this target. -ADD_LIBRARY(LibImportedTarget UNKNOWN IMPORTED) - -# Test generation of preprocessed sources. -IF("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM) - IF(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE) - # Skip running this part of the test on certain platforms - # until they are fixed. - SET(MAYBE_ALL ALL) - LIST(LENGTH CMAKE_OSX_ARCHITECTURES ARCH_COUNT) - IF(ARCH_COUNT GREATER 1) - # OSX does not support preprocessing more than one architecture. - SET(MAYBE_ALL) - ENDIF(ARCH_COUNT GREATER 1) - - # Custom target to try preprocessing invocation. - ADD_CUSTOM_TARGET(test_preprocess ${MAYBE_ALL} - COMMAND ${CMAKE_COMMAND} -E remove CMakeFiles/create_file.dir/create_file.i - COMMAND ${CMAKE_MAKE_PROGRAM} create_file.i - COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/test_preprocess.cmake - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - ) - ENDIF(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE) -ENDIF("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM) diff --git a/Tests/ComplexRelativePaths/Library/ExtraSources/file1.cxx b/Tests/ComplexRelativePaths/Library/ExtraSources/file1.cxx deleted file mode 100644 index e22812e51..000000000 --- a/Tests/ComplexRelativePaths/Library/ExtraSources/file1.cxx +++ /dev/null @@ -1,4 +0,0 @@ -int file1() -{ - return 1; -} diff --git a/Tests/ComplexRelativePaths/Library/ExtraSources/file1.h b/Tests/ComplexRelativePaths/Library/ExtraSources/file1.h deleted file mode 100644 index ce0d818a3..000000000 --- a/Tests/ComplexRelativePaths/Library/ExtraSources/file1.h +++ /dev/null @@ -1 +0,0 @@ -int file1(); diff --git a/Tests/ComplexRelativePaths/Library/SystemDir/testSystemDir.h b/Tests/ComplexRelativePaths/Library/SystemDir/testSystemDir.h deleted file mode 100644 index 73be3538e..000000000 --- a/Tests/ComplexRelativePaths/Library/SystemDir/testSystemDir.h +++ /dev/null @@ -1,2 +0,0 @@ -// Purposely leave off the return type to create a warning. -foo() { return 0; } diff --git a/Tests/ComplexRelativePaths/Library/TestLink.c b/Tests/ComplexRelativePaths/Library/TestLink.c deleted file mode 100644 index 25dee082f..000000000 --- a/Tests/ComplexRelativePaths/Library/TestLink.c +++ /dev/null @@ -1,8 +0,0 @@ -int TestLinkGetType() -{ -#ifdef CMakeTestLinkShared_EXPORTS - return 0; -#else - return 1; -#endif -} diff --git a/Tests/ComplexRelativePaths/Library/create_file.cxx b/Tests/ComplexRelativePaths/Library/create_file.cxx deleted file mode 100644 index d41551980..000000000 --- a/Tests/ComplexRelativePaths/Library/create_file.cxx +++ /dev/null @@ -1,28 +0,0 @@ -#include -#include - -int main (int argc, char *argv[]) -{ - if (argc < 2) - { - fprintf(stderr, "Missing name of file to create.\n"); - return EXIT_FAILURE; - } - - FILE *stream = fopen(argv[1], "w"); - if(stream == NULL) - { - fprintf(stderr, "Unable to open %s for writing!\n", argv[1]); - return EXIT_FAILURE; - } - - if(fclose(stream)) - { - fprintf(stderr, "Unable to close %s!\n", argv[1]); - return EXIT_FAILURE; - } - - fprintf(stdout, ">> Creating %s!\n", argv[1]); - - return EXIT_SUCCESS; -} diff --git a/Tests/ComplexRelativePaths/Library/dummy b/Tests/ComplexRelativePaths/Library/dummy deleted file mode 100644 index e69de29bb..000000000 diff --git a/Tests/ComplexRelativePaths/Library/empty.h b/Tests/ComplexRelativePaths/Library/empty.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/Tests/ComplexRelativePaths/Library/file2.cxx b/Tests/ComplexRelativePaths/Library/file2.cxx deleted file mode 100644 index 863fcaa51..000000000 --- a/Tests/ComplexRelativePaths/Library/file2.cxx +++ /dev/null @@ -1,10 +0,0 @@ -#include - -#ifdef CMAKE_IS_REALLY_FUN -This is a problem. Looks like REMOVE_DEFINITION does not work -#endif - -int file2() -{ - return 1; -} diff --git a/Tests/ComplexRelativePaths/Library/file2.h b/Tests/ComplexRelativePaths/Library/file2.h deleted file mode 100644 index dea4b80b1..000000000 --- a/Tests/ComplexRelativePaths/Library/file2.h +++ /dev/null @@ -1 +0,0 @@ -int file2(); diff --git a/Tests/ComplexRelativePaths/Library/moduleFile.c b/Tests/ComplexRelativePaths/Library/moduleFile.c deleted file mode 100644 index 608d750f1..000000000 --- a/Tests/ComplexRelativePaths/Library/moduleFile.c +++ /dev/null @@ -1,6 +0,0 @@ -#include "moduleFile.h" - -int ModuleFunction() -{ - return 1; -} diff --git a/Tests/ComplexRelativePaths/Library/moduleFile.h b/Tests/ComplexRelativePaths/Library/moduleFile.h deleted file mode 100644 index 6b561e109..000000000 --- a/Tests/ComplexRelativePaths/Library/moduleFile.h +++ /dev/null @@ -1,12 +0,0 @@ -#if defined(_WIN32) || defined(WIN32) /* Win32 version */ -#ifdef CMakeTestModule_EXPORTS -# define CMakeTest_EXPORT __declspec(dllexport) -#else -# define CMakeTest_EXPORT __declspec(dllimport) -#endif -#else -/* unix needs nothing */ -#define CMakeTest_EXPORT -#endif - -CMakeTest_EXPORT int ModuleFunction(); diff --git a/Tests/ComplexRelativePaths/Library/notInAllLib.cxx b/Tests/ComplexRelativePaths/Library/notInAllLib.cxx deleted file mode 100644 index 5d928f44a..000000000 --- a/Tests/ComplexRelativePaths/Library/notInAllLib.cxx +++ /dev/null @@ -1,5 +0,0 @@ -int notInAllLibFunc() { return 0; } - -#if 1 -# error "This target should not be compiled by ALL." -#endif diff --git a/Tests/ComplexRelativePaths/Library/sharedFile.cxx b/Tests/ComplexRelativePaths/Library/sharedFile.cxx deleted file mode 100644 index cafac68f4..000000000 --- a/Tests/ComplexRelativePaths/Library/sharedFile.cxx +++ /dev/null @@ -1,6 +0,0 @@ -#include "sharedFile.h" - -int sharedFunction() -{ - return 1; -} diff --git a/Tests/ComplexRelativePaths/Library/sharedFile.h b/Tests/ComplexRelativePaths/Library/sharedFile.h deleted file mode 100644 index 65ac2e2ba..000000000 --- a/Tests/ComplexRelativePaths/Library/sharedFile.h +++ /dev/null @@ -1,12 +0,0 @@ -#if defined(_WIN32) || defined(WIN32) /* Win32 version */ -#ifdef CMakeTestLibraryShared_EXPORTS -# define CMakeTest_EXPORT __declspec(dllexport) -#else -# define CMakeTest_EXPORT __declspec(dllimport) -#endif -#else -/* unix needs nothing */ -#define CMakeTest_EXPORT -#endif - -CMakeTest_EXPORT int sharedFunction(); diff --git a/Tests/ComplexRelativePaths/Library/testConly.c b/Tests/ComplexRelativePaths/Library/testConly.c deleted file mode 100644 index 2d83f778e..000000000 --- a/Tests/ComplexRelativePaths/Library/testConly.c +++ /dev/null @@ -1,13 +0,0 @@ -#include "testConly.h" -#include - -int CsharedFunction() -{ -#ifndef TEST_C_FLAGS - printf("TEST_C_FLAGS failed\n"); - return 0; -#else - printf("Passed: TEST_C_FLAGS passed\n"); -#endif - return 1; -} diff --git a/Tests/ComplexRelativePaths/Library/testConly.h b/Tests/ComplexRelativePaths/Library/testConly.h deleted file mode 100644 index f1470a8d7..000000000 --- a/Tests/ComplexRelativePaths/Library/testConly.h +++ /dev/null @@ -1,13 +0,0 @@ -#if defined(_WIN32) || defined(WIN32) /* Win32 version */ -#ifdef CMakeTestCLibraryShared_EXPORTS -# define CMakeTest_EXPORT __declspec(dllexport) -#else -# define CMakeTest_EXPORT __declspec(dllimport) -#endif -#else -/* unix needs nothing */ -#define CMakeTest_EXPORT -#endif - -CMakeTest_EXPORT int CsharedFunction(); - diff --git a/Tests/ComplexRelativePaths/Library/test_preprocess.cmake b/Tests/ComplexRelativePaths/Library/test_preprocess.cmake deleted file mode 100644 index d2d9fc652..000000000 --- a/Tests/ComplexRelativePaths/Library/test_preprocess.cmake +++ /dev/null @@ -1,7 +0,0 @@ -SET(TEST_FILE CMakeFiles/create_file.dir/create_file.i) -FILE(READ ${TEST_FILE} CONTENTS) -IF("${CONTENTS}" MATCHES "Unable to close") - MESSAGE(STATUS "${TEST_FILE} created successfully!") -ELSE("${CONTENTS}" MATCHES "Unable to close") - MESSAGE(FATAL_ERROR "${TEST_FILE} creation failed!") -ENDIF("${CONTENTS}" MATCHES "Unable to close") diff --git a/Tests/ComplexRelativePaths/VarTests.cmake b/Tests/ComplexRelativePaths/VarTests.cmake deleted file mode 100644 index c146d1be0..000000000 --- a/Tests/ComplexRelativePaths/VarTests.cmake +++ /dev/null @@ -1,198 +0,0 @@ -# -# Test SET -# -SET (ZERO_VAR 0) -SET (ZERO_VAR2 0) - -IF(ZERO_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED) -ELSE(ZERO_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED) -ENDIF(ZERO_VAR) - -SET(ONE_VAR 1) -SET(ONE_VAR2 1) -SET(STRING_VAR "CMake is great" CACHE STRING "test a cache variable") - -# -# Test VARIABLE_REQUIRES -# -VARIABLE_REQUIRES(ONE_VAR - ONE_VAR_IS_DEFINED ONE_VAR) - -# -# Test various IF/ELSE combinations -# -IF(NOT ZERO_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_NOT) -ELSE(NOT ZERO_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_NOT) -ENDIF(NOT ZERO_VAR) - -IF(NOT ONE_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_NOT2) -ELSE(NOT ONE_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_NOT2) -ENDIF(NOT ONE_VAR) - -IF(ONE_VAR AND ONE_VAR2) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_AND) -ELSE(ONE_VAR AND ONE_VAR2) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_AND) -ENDIF(ONE_VAR AND ONE_VAR2) - -IF(ONE_VAR AND ZERO_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_AND2) -ELSE(ONE_VAR AND ZERO_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_AND2) -ENDIF(ONE_VAR AND ZERO_VAR) - -IF(ZERO_VAR OR ONE_VAR2) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_OR) -ELSE(ZERO_VAR OR ONE_VAR2) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_OR) -ENDIF(ZERO_VAR OR ONE_VAR2) - -IF(ZERO_VAR OR ZERO_VAR2) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_OR2) -ELSE(ZERO_VAR OR ZERO_VAR2) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_OR2) -ENDIF(ZERO_VAR OR ZERO_VAR2) - -IF(STRING_VAR MATCHES "^CMake") - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_MATCHES) -ELSE(STRING_VAR MATCHES "^CMake") - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_MATCHES) -ENDIF(STRING_VAR MATCHES "^CMake") - -IF(STRING_VAR MATCHES "^foo") - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_MATCHES2) -ELSE(STRING_VAR MATCHES "^foo") - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_MATCHES2) -ENDIF(STRING_VAR MATCHES "^foo") - -IF(COMMAND "IF") - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_COMMAND) -ELSE(COMMAND "IF") - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_COMMAND) -ENDIF(COMMAND "IF") - -IF(COMMAND "ROQUEFORT") - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_COMMAND2) -ELSE(COMMAND "ROQUEFORT") - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_COMMAND2) -ENDIF(COMMAND "ROQUEFORT") - -IF (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EXISTS) -ELSE(EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EXISTS) -ENDIF (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) - -IF (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EXISTS2) -ELSE(EXISTS ${Complex_SOURCE_DIR}/roquefort.txt) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EXISTS2) -ENDIF (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt) - -IF (IS_DIRECTORY ${Complex_SOURCE_DIR}) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_IS_DIRECTORY) -ENDIF (IS_DIRECTORY ${Complex_SOURCE_DIR}) - -IF (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_IS_DIRECTORY2) -ENDIF (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake) - -SET (SNUM1_VAR "1") -SET (SNUM2_VAR "2") -SET (SNUM3_VAR "1") - - -IF (SNUM1_VAR LESS SNUM2_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_LESS) -ELSE (SNUM1_VAR LESS SNUM2_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_LESS) -ENDIF (SNUM1_VAR LESS SNUM2_VAR) - -IF (SNUM2_VAR LESS SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_LESS2) -ELSE (SNUM2_VAR LESS SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_LESS2) -ENDIF (SNUM2_VAR LESS SNUM1_VAR) - -IF (SNUM2_VAR GREATER SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_GREATER) -ELSE (SNUM2_VAR GREATER SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_GREATER) -ENDIF (SNUM2_VAR GREATER SNUM1_VAR) - -IF (SNUM2_VAR EQUAL SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EQUAL) -ELSE (SNUM2_VAR EQUAL SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EQUAL) -ENDIF (SNUM2_VAR EQUAL SNUM1_VAR) - -IF (SNUM3_VAR EQUAL SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EQUAL) -ELSE (SNUM3_VAR EQUAL SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EQUAL) -ENDIF (SNUM3_VAR EQUAL SNUM1_VAR) - -IF (SNUM1_VAR GREATER SNUM2_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_GREATER2) -ELSE (SNUM1_VAR GREATER SNUM2_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_GREATER2) -ENDIF (SNUM1_VAR GREATER SNUM2_VAR) - -SET (SSTR1_VAR "abc") -SET (SSTR2_VAR "bcd") - -IF (SSTR1_VAR STRLESS SSTR2_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_STRLESS) -ELSE (SSTR1_VAR STRLESS SSTR2_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_STRLESS) -ENDIF (SSTR1_VAR STRLESS SSTR2_VAR) - -IF (SSTR2_VAR STRLESS SSTR1_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_STRLESS2) -ELSE (SSTR2_VAR STRLESS SSTR1_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_STRLESS2) -ENDIF (SSTR2_VAR STRLESS SSTR1_VAR) - -IF (SSTR2_VAR STRGREATER SSTR1_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_STRGREATER) -ELSE (SSTR2_VAR STRGREATER SSTR1_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_STRGREATER) -ENDIF (SSTR2_VAR STRGREATER SSTR1_VAR) - -IF (SSTR1_VAR STRGREATER SSTR2_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_STRGREATER2) -ELSE (SSTR1_VAR STRGREATER SSTR2_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_STRGREATER2) -ENDIF (SSTR1_VAR STRGREATER SSTR2_VAR) - -# -# Test FOREACH -# -FOREACH (INDEX 1 2) - SET(FOREACH_VAR${INDEX} "VALUE${INDEX}") -ENDFOREACH(INDEX) - -SET(FOREACH_CONCAT "") -FOREACH (INDEX a;b;c;d;e;f;g) - SET(FOREACH_CONCAT "${FOREACH_CONCAT}${INDEX}") -ENDFOREACH(INDEX) - -# -# Test FIND_FILE, FIND_PATH and various GET_FILENAME_COMPONENT combinations -# -FIND_FILE(FILENAME_VAR "VarTests.cmake" ${Complex_SOURCE_DIR}) - -GET_FILENAME_COMPONENT(FILENAME_VAR_PATH ${FILENAME_VAR} PATH) -GET_FILENAME_COMPONENT(FILENAME_VAR_PATH_NAME ${FILENAME_VAR_PATH} NAME) -GET_FILENAME_COMPONENT(FILENAME_VAR_NAME ${FILENAME_VAR} NAME) -GET_FILENAME_COMPONENT(FILENAME_VAR_EXT ${FILENAME_VAR} EXT) -GET_FILENAME_COMPONENT(FILENAME_VAR_NAME_WE ${FILENAME_VAR} NAME_WE CACHE) - -FIND_PATH(PATH_VAR "cmTestConfigure.h.in" ${Complex_SOURCE_DIR}) -GET_FILENAME_COMPONENT(PATH_VAR_NAME ${PATH_VAR} NAME) diff --git a/Tests/ComplexRelativePaths/cmTestConfigure.h.in b/Tests/ComplexRelativePaths/cmTestConfigure.h.in deleted file mode 100644 index d7952da1e..000000000 --- a/Tests/ComplexRelativePaths/cmTestConfigure.h.in +++ /dev/null @@ -1,87 +0,0 @@ -// Test SET, VARIABLE_REQUIRES - -#cmakedefine ONE_VAR -#cmakedefine ONE_VAR_IS_DEFINED -#cmakedefine ZERO_VAR - -#cmakedefine COMPLEX_TEST_CMAKELIB - -#define STRING_VAR "${STRING_VAR}" - -// Test FOREACH - -#define FOREACH_VAR1 "${FOREACH_VAR1}" -#define FOREACH_VAR2 "${FOREACH_VAR2}" -#define FOREACH_CONCAT "${FOREACH_CONCAT}" - -// Test WHILE -#define WHILE_VALUE ${while_var} - -// Test FIND_FILE, FIND_PATH and various GET_FILENAME_COMPONENT combinations - -#define FILENAME_VAR_PATH_NAME "${FILENAME_VAR_PATH_NAME}" -#define FILENAME_VAR_NAME "${FILENAME_VAR_NAME}" -#define FILENAME_VAR_EXT "${FILENAME_VAR_EXT}" -#define FILENAME_VAR_NAME_WE "${FILENAME_VAR_NAME_WE}" - -#define PATH_VAR_NAME "${PATH_VAR_NAME}" - -// Test LOAD_CACHE - -#define CACHE_TEST_VAR1 "${CACHE_TEST_VAR1}" -#define CACHE_TEST_VAR2 "${CACHE_TEST_VAR2}" -#define CACHE_TEST_VAR3 "${CACHE_TEST_VAR3}" -#cmakedefine CACHE_TEST_VAR_EXCLUDED -#define CACHE_TEST_VAR_INTERNAL "${CACHE_TEST_VAR_INTERNAL}" - -// Test internal CMake vars from C++ flags - -#cmakedefine CMAKE_NO_STD_NAMESPACE -#cmakedefine CMAKE_NO_ANSI_STREAM_HEADERS -#cmakedefine CMAKE_NO_ANSI_STRING_STREAM -#cmakedefine CMAKE_NO_ANSI_FOR_SCOPE - -#cmakedefine01 SHOULD_BE_ZERO -#cmakedefine01 SHOULD_BE_ONE -// Needed to check for files - -#define BINARY_DIR "${Complex_BINARY_DIR}" - -// Test FIND_LIBRARY - -#define FIND_DUMMY_LIB "${FIND_DUMMY_LIB}" - -// Test SET_SOURCE_FILES_PROPERTIES - -#cmakedefine FILE_HAS_ABSTRACT -#cmakedefine FILE_HAS_WRAP_EXCLUDE -#define FILE_COMPILE_FLAGS "${FILE_COMPILE_FLAGS}" - -#define TEST_SEP "${TEST_SEP}" - -// Test registry read - -#if defined(_WIN32) && !defined(__CYGWIN__) -#define REGISTRY_TEST_PATH "${REGISTRY_TEST_PATH}" -#endif - -// Test Remove command -#define REMOVE_STRING "${REMOVE_STRING}" - -// Test IF inside FOREACH -#cmakedefine IF_INSIDE_FOREACH_THEN_EXECUTED -#cmakedefine IF_INSIDE_FOREACH_ELSE_EXECUTED - -// Test SET CACHE FORCE -#cmakedefine FORCE_TEST -#define CMAKE_GENERATOR "${CMAKE_GENERATOR}" - -#define CMAKE_SHARED_MODULE_PREFIX "${CMAKE_SHARED_MODULE_PREFIX}" -#define CMAKE_SHARED_MODULE_SUFFIX "${CMAKE_SHARED_MODULE_SUFFIX}" - -// test elseif -#cmakedefine ELSEIF_RESULT - -// test parenthesis in conditionals -#cmakedefine CONDITIONAL_PARENTHESES - diff --git a/Tests/ComplexRelativePaths/cmTestConfigureEscape.h.in b/Tests/ComplexRelativePaths/cmTestConfigureEscape.h.in deleted file mode 100644 index 39a8bd627..000000000 --- a/Tests/ComplexRelativePaths/cmTestConfigureEscape.h.in +++ /dev/null @@ -1 +0,0 @@ -#define STRING_WITH_QUOTES "${STRING_WITH_QUOTES}" diff --git a/Tests/ComplexRelativePaths/cmTestGeneratedHeader.h.in b/Tests/ComplexRelativePaths/cmTestGeneratedHeader.h.in deleted file mode 100644 index 0e9dd3ff3..000000000 --- a/Tests/ComplexRelativePaths/cmTestGeneratedHeader.h.in +++ /dev/null @@ -1 +0,0 @@ -#define GENERATED_HEADER_INCLUDED