From 5cb93fdb773cb88940e25c69d7ae7a833032203c Mon Sep 17 00:00:00 2001 From: Kosta Date: Mon, 5 Aug 2013 12:40:33 +0200 Subject: [PATCH 01/14] initial checkin of cmake and travis config files --- .travis.yml | 19 +++++++++++++++ projects/CMake/CMakeLists.txt | 46 +++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 .travis.yml create mode 100644 projects/CMake/CMakeLists.txt diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..a86af1b3 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,19 @@ +language: cpp + +compiler: + - clang + - gcc + +env: + - BUILD_TYPE=Debug + - BUILD_TYPE=Release + +install: + - cmake -Hprojects/CMake -BBuild -DCMAKE_BUILD_TYPE=$BUILD_TYPE + - cd Build + - make + - cd .. + +script: + - cd Build + - ctest diff --git a/projects/CMake/CMakeLists.txt b/projects/CMake/CMakeLists.txt new file mode 100644 index 00000000..9584c19b --- /dev/null +++ b/projects/CMake/CMakeLists.txt @@ -0,0 +1,46 @@ +cmake_minimum_required(VERSION 2.8) + +project(Catch C CXX) +message("configure: Catch/SelfTest") + +# switch to the right compiler +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +if(APPLE) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") +endif(APPLE) + +# define some folders +set(CATCH_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../") +set(SELF_TEST_DIR ${CATCH_DIR}/projects/SelfTest) +set(SCRIPTS_DIR ${CATCH_DIR}/scripts/) + +# define the sources of the self test +set( + SOURCES + ${SELF_TEST_DIR}/ApproxTests.cpp + ${SELF_TEST_DIR}/BDDTests.cpp + ${SELF_TEST_DIR}/catch_self_test.cpp + ${SELF_TEST_DIR}/ClassTests.cpp + ${SELF_TEST_DIR}/CmdLineTests.cpp + ${SELF_TEST_DIR}/ConditionTests.cpp + ${SELF_TEST_DIR}/ExceptionTests.cpp + ${SELF_TEST_DIR}/GeneratorTests.cpp + ${SELF_TEST_DIR}/MessageTests.cpp + ${SELF_TEST_DIR}/MiscTests.cpp + ${SELF_TEST_DIR}/SectionTrackerTests.cpp + ${SELF_TEST_DIR}/TestMain.cpp + ${SELF_TEST_DIR}/TrickyTests.cpp + ${SELF_TEST_DIR}/VariadicMacrosTests.cpp +) + +# configure the executable +include_directories(${CATCH_DIR}/include/) +add_executable(SelfTest ${SOURCES}) + +# configure unit tests via ctest +enable_testing() +add_test(NAME SelfTest_run COMMAND python ${SCRIPTS_DIR}/approvalTests.py "${CATCH_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/SelfTest") + +#add_custom_target(SelfTest_scripts ALL +# COMMAND ${CMAKE_COMMAND} -E create_symlink \"${CMAKE_CURRENT_SOURCE_DIR}/../../../Data/Resources/mentor2wkt.json\" \"${CMAKE_CURRENT_BINARY_DIR}/mentor2wkt.json\" +#) From ce441a9ba5136ebd8e8c6bcf37013407db3a4f0b Mon Sep 17 00:00:00 2001 From: Kosta Date: Mon, 5 Aug 2013 12:40:33 +0200 Subject: [PATCH 02/14] initial checkin of cmake and travis config files --- .travis.yml | 19 +++++++++++++++ projects/CMake/CMakeLists.txt | 46 +++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 .travis.yml create mode 100644 projects/CMake/CMakeLists.txt diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..dbe73718 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,19 @@ +language: cpp + +compiler: + - clang + - gcc + +env: + - BUILD_TYPE=Debug + - BUILD_TYPE=Release + +install: + - cmake -Hprojects/CMake -BBuild -DCMAKE_BUILD_TYPE=$BUILD_TYPE + - cd Build + - make + - cd .. + +script: + - cd Build + - ctest -VV diff --git a/projects/CMake/CMakeLists.txt b/projects/CMake/CMakeLists.txt new file mode 100644 index 00000000..9584c19b --- /dev/null +++ b/projects/CMake/CMakeLists.txt @@ -0,0 +1,46 @@ +cmake_minimum_required(VERSION 2.8) + +project(Catch C CXX) +message("configure: Catch/SelfTest") + +# switch to the right compiler +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +if(APPLE) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") +endif(APPLE) + +# define some folders +set(CATCH_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../") +set(SELF_TEST_DIR ${CATCH_DIR}/projects/SelfTest) +set(SCRIPTS_DIR ${CATCH_DIR}/scripts/) + +# define the sources of the self test +set( + SOURCES + ${SELF_TEST_DIR}/ApproxTests.cpp + ${SELF_TEST_DIR}/BDDTests.cpp + ${SELF_TEST_DIR}/catch_self_test.cpp + ${SELF_TEST_DIR}/ClassTests.cpp + ${SELF_TEST_DIR}/CmdLineTests.cpp + ${SELF_TEST_DIR}/ConditionTests.cpp + ${SELF_TEST_DIR}/ExceptionTests.cpp + ${SELF_TEST_DIR}/GeneratorTests.cpp + ${SELF_TEST_DIR}/MessageTests.cpp + ${SELF_TEST_DIR}/MiscTests.cpp + ${SELF_TEST_DIR}/SectionTrackerTests.cpp + ${SELF_TEST_DIR}/TestMain.cpp + ${SELF_TEST_DIR}/TrickyTests.cpp + ${SELF_TEST_DIR}/VariadicMacrosTests.cpp +) + +# configure the executable +include_directories(${CATCH_DIR}/include/) +add_executable(SelfTest ${SOURCES}) + +# configure unit tests via ctest +enable_testing() +add_test(NAME SelfTest_run COMMAND python ${SCRIPTS_DIR}/approvalTests.py "${CATCH_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/SelfTest") + +#add_custom_target(SelfTest_scripts ALL +# COMMAND ${CMAKE_COMMAND} -E create_symlink \"${CMAKE_CURRENT_SOURCE_DIR}/../../../Data/Resources/mentor2wkt.json\" \"${CMAKE_CURRENT_BINARY_DIR}/mentor2wkt.json\" +#) From f8d24b1d50c62264fd98dad5348c88009ef8a2f7 Mon Sep 17 00:00:00 2001 From: Kosta Date: Mon, 5 Aug 2013 12:53:36 +0200 Subject: [PATCH 03/14] Calling SelfTest exe directly --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index dbe73718..ca651c50 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,4 +16,5 @@ install: script: - cd Build + - ./SelfTest - ctest -VV From 5553a538c520aaf1d1adb9c42166a71f3ea62105 Mon Sep 17 00:00:00 2001 From: Kosta Date: Mon, 5 Aug 2013 12:57:29 +0200 Subject: [PATCH 04/14] tweak CMakeLists.txt --- projects/CMake/CMakeLists.txt | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/projects/CMake/CMakeLists.txt b/projects/CMake/CMakeLists.txt index 9584c19b..c79059bf 100644 --- a/projects/CMake/CMakeLists.txt +++ b/projects/CMake/CMakeLists.txt @@ -3,16 +3,10 @@ cmake_minimum_required(VERSION 2.8) project(Catch C CXX) message("configure: Catch/SelfTest") -# switch to the right compiler -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") -if(APPLE) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") -endif(APPLE) - # define some folders -set(CATCH_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../") +set(CATCH_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../..") set(SELF_TEST_DIR ${CATCH_DIR}/projects/SelfTest) -set(SCRIPTS_DIR ${CATCH_DIR}/scripts/) +set(SCRIPTS_DIR ${CATCH_DIR}/scripts) # define the sources of the self test set( @@ -34,13 +28,9 @@ set( ) # configure the executable -include_directories(${CATCH_DIR}/include/) +include_directories(${CATCH_DIR}/include) add_executable(SelfTest ${SOURCES}) # configure unit tests via ctest enable_testing() add_test(NAME SelfTest_run COMMAND python ${SCRIPTS_DIR}/approvalTests.py "${CATCH_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/SelfTest") - -#add_custom_target(SelfTest_scripts ALL -# COMMAND ${CMAKE_COMMAND} -E create_symlink \"${CMAKE_CURRENT_SOURCE_DIR}/../../../Data/Resources/mentor2wkt.json\" \"${CMAKE_CURRENT_BINARY_DIR}/mentor2wkt.json\" -#) From 3f2e2bdb25de271351c807f2f676677d1caa576c Mon Sep 17 00:00:00 2001 From: Kosta Date: Mon, 5 Aug 2013 13:10:24 +0200 Subject: [PATCH 05/14] printing the executable into the console window --- scripts/approvalTests.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/approvalTests.py b/scripts/approvalTests.py index 5cdac57d..62727d4f 100644 --- a/scripts/approvalTests.py +++ b/scripts/approvalTests.py @@ -20,6 +20,8 @@ if len(sys.argv) == 2: else: cmdPath = os.path.join( catchPath, 'projects/XCode4/CatchSelfTest/DerivedData/CatchSelfTest/Build/Products/Debug/CatchSelfTest' ) +print "Using executable: " + cmdPath + f = open( rawResultsPath, 'w' ) subprocess.call([ cmdPath, "~dummy", "-r", "console" ], stdout=f, stderr=f ) subprocess.call([ cmdPath, "~dummy", "-s", "-w", "NoAssertions", "-r", "console" ], stdout=f, stderr=f ) From a5c423183a25bc31c0bd1307070b294927c9b5d1 Mon Sep 17 00:00:00 2001 From: Kosta Date: Mon, 5 Aug 2013 13:16:34 +0200 Subject: [PATCH 06/14] debugging arguments passed to the approvalTests script --- scripts/approvalTests.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/approvalTests.py b/scripts/approvalTests.py index 62727d4f..a5c24a9d 100644 --- a/scripts/approvalTests.py +++ b/scripts/approvalTests.py @@ -15,6 +15,10 @@ baselinesPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/approvedRe rawResultsPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/_rawResults.tmp' ) filteredResultsPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/unapprovedResults.txt' ) +print "len(sys.argv) = " + len(sys.argv) +print "sys.argv[0] = " + sys.argv[0] +print "sys.argv[1] = " + sys.argv[1] + if len(sys.argv) == 2: cmdPath = sys.argv[1] else: From f3119b0fcf6108771350f959f418ec92beb87b19 Mon Sep 17 00:00:00 2001 From: Kosta Date: Mon, 5 Aug 2013 13:22:23 +0200 Subject: [PATCH 07/14] more debugging --- scripts/approvalTests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/approvalTests.py b/scripts/approvalTests.py index a5c24a9d..a06518d5 100644 --- a/scripts/approvalTests.py +++ b/scripts/approvalTests.py @@ -15,7 +15,7 @@ baselinesPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/approvedRe rawResultsPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/_rawResults.tmp' ) filteredResultsPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/unapprovedResults.txt' ) -print "len(sys.argv) = " + len(sys.argv) +print "len(sys.argv) = " + str(len(sys.argv)) print "sys.argv[0] = " + sys.argv[0] print "sys.argv[1] = " + sys.argv[1] From 0c8ad55a5bc40cafd859bff167a6e3f9b84ff89c Mon Sep 17 00:00:00 2001 From: Kosta Date: Mon, 5 Aug 2013 13:25:39 +0200 Subject: [PATCH 08/14] more debugging --- scripts/approvalTests.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/approvalTests.py b/scripts/approvalTests.py index a06518d5..f4fa0164 100644 --- a/scripts/approvalTests.py +++ b/scripts/approvalTests.py @@ -16,8 +16,9 @@ rawResultsPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/_rawResul filteredResultsPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/unapprovedResults.txt' ) print "len(sys.argv) = " + str(len(sys.argv)) -print "sys.argv[0] = " + sys.argv[0] -print "sys.argv[1] = " + sys.argv[1] +print "sys.argv[0] = |" + sys.argv[0] + "|" +print "sys.argv[1] = |" + sys.argv[1] + "|" +print "sys.argv[2] = |" + sys.argv[2] + "|" if len(sys.argv) == 2: cmdPath = sys.argv[1] From c4863842c86d0daa578d2a616e1db8ee0a2d4852 Mon Sep 17 00:00:00 2001 From: Kosta Date: Mon, 5 Aug 2013 13:29:42 +0200 Subject: [PATCH 09/14] more approval tests script debugging --- .travis.yml | 3 +-- projects/CMake/CMakeLists.txt | 2 +- scripts/approvalTests.py | 7 +------ 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index ca651c50..cda2ad27 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,5 +16,4 @@ install: script: - cd Build - - ./SelfTest - - ctest -VV + - ctest -V diff --git a/projects/CMake/CMakeLists.txt b/projects/CMake/CMakeLists.txt index c79059bf..39e3e4f1 100644 --- a/projects/CMake/CMakeLists.txt +++ b/projects/CMake/CMakeLists.txt @@ -33,4 +33,4 @@ add_executable(SelfTest ${SOURCES}) # configure unit tests via ctest enable_testing() -add_test(NAME SelfTest_run COMMAND python ${SCRIPTS_DIR}/approvalTests.py "${CATCH_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/SelfTest") +add_test(NAME SelfTest_run COMMAND python ${SCRIPTS_DIR}/approvalTests.py "${CMAKE_CURRENT_BINARY_DIR}/SelfTest") diff --git a/scripts/approvalTests.py b/scripts/approvalTests.py index f4fa0164..0eda5933 100644 --- a/scripts/approvalTests.py +++ b/scripts/approvalTests.py @@ -15,12 +15,7 @@ baselinesPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/approvedRe rawResultsPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/_rawResults.tmp' ) filteredResultsPath = os.path.join( catchPath, 'projects/SelfTest/Baselines/unapprovedResults.txt' ) -print "len(sys.argv) = " + str(len(sys.argv)) -print "sys.argv[0] = |" + sys.argv[0] + "|" -print "sys.argv[1] = |" + sys.argv[1] + "|" -print "sys.argv[2] = |" + sys.argv[2] + "|" - -if len(sys.argv) == 2: +if len(sys.argv) >= 2: cmdPath = sys.argv[1] else: cmdPath = os.path.join( catchPath, 'projects/XCode4/CatchSelfTest/DerivedData/CatchSelfTest/Build/Products/Debug/CatchSelfTest' ) From ba24e513062a9820fe7332c8bf83236351959af3 Mon Sep 17 00:00:00 2001 From: Kosta Date: Mon, 5 Aug 2013 13:44:37 +0200 Subject: [PATCH 10/14] cmake: call SelfTest exe instead of approvalTests script Just call the SelfTest executable directly for testing, since there seems to be a problem with the approval tests python script right now. --- projects/CMake/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/projects/CMake/CMakeLists.txt b/projects/CMake/CMakeLists.txt index 39e3e4f1..cff62616 100644 --- a/projects/CMake/CMakeLists.txt +++ b/projects/CMake/CMakeLists.txt @@ -33,4 +33,5 @@ add_executable(SelfTest ${SOURCES}) # configure unit tests via ctest enable_testing() -add_test(NAME SelfTest_run COMMAND python ${SCRIPTS_DIR}/approvalTests.py "${CMAKE_CURRENT_BINARY_DIR}/SelfTest") +add_test(NAME SelfTest_run COMMAND SelfTest) +#add_test(NAME SelfTest_run COMMAND python ${SCRIPTS_DIR}/approvalTests.py "${CMAKE_CURRENT_BINARY_DIR}/SelfTest") From 7fcde92561c96244e65996f26e8d42658df10d98 Mon Sep 17 00:00:00 2001 From: Kosta Date: Mon, 5 Aug 2013 14:50:14 +0200 Subject: [PATCH 11/14] added travis status to the readme --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index b7dcefcb..5b95583d 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,9 @@ *v1.0 build 6 (master branch)* +[![Build Status](https://travis-ci.org/AIM360/Catch.png?branch=master)](https://travis-ci.org/AIM360/Catch) Travis CI build status for the `master` branch of this fork +[![Build Status](https://travis-ci.org/AIM360/Catch.png?branch=Integration)](https://travis-ci.org/AIM360/Catch) Travis CI build status for the `Integration` branch of this fork + # New release with significant changes [Please see this page for details - including some breaking changes](docs/whats-changed.md) From cd9a5939f4f8ea2cf5abd8d88b2b285aaa88624d Mon Sep 17 00:00:00 2001 From: Kosta Date: Mon, 5 Aug 2013 14:52:05 +0200 Subject: [PATCH 12/14] fixed formatting of travis status icons --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5b95583d..3f3f643b 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ *v1.0 build 6 (master branch)* [![Build Status](https://travis-ci.org/AIM360/Catch.png?branch=master)](https://travis-ci.org/AIM360/Catch) Travis CI build status for the `master` branch of this fork + [![Build Status](https://travis-ci.org/AIM360/Catch.png?branch=Integration)](https://travis-ci.org/AIM360/Catch) Travis CI build status for the `Integration` branch of this fork # New release with significant changes From af36d932cbe1907f3fb5f7cec80f6f4a0cbb3b64 Mon Sep 17 00:00:00 2001 From: Kosta Date: Tue, 6 Aug 2013 11:14:54 +0200 Subject: [PATCH 13/14] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3f3f643b..090d4110 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ *v1.0 build 6 (master branch)* -[![Build Status](https://travis-ci.org/AIM360/Catch.png?branch=master)](https://travis-ci.org/AIM360/Catch) Travis CI build status for the `master` branch of this fork +[![Build Status](http://travis-ci.org/AIM360/Catch.png?branch=master)](http://travis-ci.org/AIM360/Catch) Travis CI build status for the `master` branch of this fork -[![Build Status](https://travis-ci.org/AIM360/Catch.png?branch=Integration)](https://travis-ci.org/AIM360/Catch) Travis CI build status for the `Integration` branch of this fork +[![Build Status](http://travis-ci.org/AIM360/Catch.png?branch=Integration)](http://travis-ci.org/AIM360/Catch) Travis CI build status for the `Integration` branch of this fork # New release with significant changes From d8f93f75525545721d750c76d89714ebb1b2aadb Mon Sep 17 00:00:00 2001 From: Kosta Date: Tue, 6 Aug 2013 11:16:19 +0200 Subject: [PATCH 14/14] Update README.md --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 090d4110..1a59bada 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,7 @@ *v1.0 build 6 (master branch)* -[![Build Status](http://travis-ci.org/AIM360/Catch.png?branch=master)](http://travis-ci.org/AIM360/Catch) Travis CI build status for the `master` branch of this fork - -[![Build Status](http://travis-ci.org/AIM360/Catch.png?branch=Integration)](http://travis-ci.org/AIM360/Catch) Travis CI build status for the `Integration` branch of this fork +[![Build Status](https://travis-ci.org/AIM360/Catch.png)](https://travis-ci.org/AIM360/Catch) Travis CI build status for this fork # New release with significant changes