testSystemTools.cxx 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2011 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #include "cmSystemTools.h"
  11. #define cmPassed(m) std::cout << "Passed: " << m << "\n"
  12. #define cmFailed(m) \
  13. std::cout << "FAILED: " << m << "\n"; \
  14. failed = 1
  15. int testSystemTools(int /*unused*/, char* /*unused*/ [])
  16. {
  17. int failed = 0;
  18. // ----------------------------------------------------------------------
  19. // Test cmSystemTools::UpperCase
  20. std::string str = "abc";
  21. std::string strupper = "ABC";
  22. if (cmSystemTools::UpperCase(str) == strupper) {
  23. cmPassed("cmSystemTools::UpperCase is working");
  24. } else {
  25. cmFailed("cmSystemTools::UpperCase is working");
  26. }
  27. return failed;
  28. }