From f511a0e56e5520f9e6b3507e77284a2f8bc07e65 Mon Sep 17 00:00:00 2001 From: Bassem Girgis Date: Sat, 22 Dec 2018 14:19:29 -0600 Subject: [PATCH] Remove unneeded noarchs --- .../TestDef.py => bin/.gitignore} | 0 noarch/bin/cpythonbuild | 21 - noarch/bin/cpythonbuild.bat | 20 - noarch/bin/cpythonbuild.py | 159 - .../TestDef.py => .gitignore} | 0 noarch/lib/py/cxxtest/COPYING | 165 -- noarch/lib/py/cxxtest/README | 44 - noarch/lib/py/cxxtest/Versions | 192 -- noarch/lib/py/cxxtest/admin/announcement | 19 - noarch/lib/py/cxxtest/admin/cloudbees_cxxtest | 41 - noarch/lib/py/cxxtest/admin/cxxtest.spec | 37 - noarch/lib/py/cxxtest/admin/jenkins_cxxtest | 85 - noarch/lib/py/cxxtest/admin/virtualenv.py | 2581 ----------------- noarch/lib/py/cxxtest/admin/virtualenv_1.7.py | 2102 -------------- noarch/lib/py/cxxtest/bin/cxxtestgen | 18 - noarch/lib/py/cxxtest/bin/cxxtestgen.bat | 3 - .../lib/py/cxxtest/build_tools/SCons/AUTHORS | 19 - .../py/cxxtest/build_tools/SCons/cxxtest.py | 400 --- .../build_tools/SCons/test/default_env/README | 2 - .../SCons/test/default_env/SConstruct | 10 - .../SCons/test/default_env/TestDef.py | 17 - .../SCons/test/empty_source_list/README | 2 - .../SCons/test/empty_source_list/SConstruct | 4 - .../SCons/test/empty_source_list/TestDef.py | 10 - .../test/empty_source_list/requirement.hpp | 12 - .../SCons/test/empty_source_list/test_bar.t.h | 23 - .../SCons/test/empty_source_list/test_foo.t.h | 23 - .../build_tools/SCons/test/eprouvette.py | 212 -- .../build_tools/SCons/test/expanding_#/README | 3 - .../SCons/test/expanding_#/SConstruct | 10 - .../SCons/test/expanding_#/TestDef.py | 10 - .../build_tools/SCons/test/globbing/README | 2 - .../SCons/test/globbing/SConstruct | 3 - .../SCons/test/globbing/TestDef.py | 10 - .../SCons/test/globbing/src/requirement.cpp | 14 - .../SCons/test/globbing/src/requirement.h | 14 - .../SCons/test/globbing/src/test_bar.t.h | 23 - .../SCons/test/globbing/src/test_foo.t.h | 23 - .../SCons/test/globbing_edmundo/README | 2 - .../SCons/test/globbing_edmundo/SConstruct | 35 - .../SCons/test/globbing_edmundo/TestDef.py | 10 - .../SCons/test/globbing_edmundo/hello.cc | 22 - .../SCons/test/globbing_edmundo/hello.hh | 15 - .../SCons/test/globbing_edmundo/hellotest.t.h | 23 - .../SCons/test/globbing_edmundo/main.cpp | 18 - .../SCons/test/include_CCFLAGS/README | 3 - .../SCons/test/include_CCFLAGS/SConstruct | 12 - .../SCons/test/include_CCFLAGS/TestDef.py | 10 - .../include_CCFLAGS/src/not-with-pedantic.h | 20 - .../include_CCFLAGS/src/only_with_ansi.t.h | 22 - .../SCons/test/include_CXXFLAGS/README | 5 - .../SCons/test/include_CXXFLAGS/SConstruct | 16 - .../SCons/test/include_CXXFLAGS/TestDef.py | 10 - .../include_CXXFLAGS/src/not-with-pedantic.h | 19 - .../build_tools/SCons/test/libpath/README | 2 - .../build_tools/SCons/test/libpath/SConstruct | 3 - .../build_tools/SCons/test/libpath/TestDef.py | 10 - .../SCons/test/libpath/src/SConscript | 3 - .../SCons/test/libpath/src/foo.cpp | 4 - .../SCons/test/libpath/test/SConscript | 2 - .../SCons/test/libpath/test/test.t.h | 12 - .../SCons/test/libpath_multitarget/README | 3 - .../SCons/test/libpath_multitarget/SConstruct | 3 - .../SCons/test/libpath_multitarget/TestDef.py | 10 - .../test/libpath_multitarget/src1/SConscript | 3 - .../test/libpath_multitarget/src1/foo.cpp | 4 - .../test/libpath_multitarget/src2/SConscript | 3 - .../test/libpath_multitarget/src2/bar.cpp | 4 - .../test/libpath_multitarget/test/SConscript | 5 - .../test/libpath_multitarget/test/test1.t.h | 12 - .../test/libpath_multitarget/test/test2.t.h | 12 - .../SCons/test/multifile_tests/SConstruct | 8 - .../SCons/test/multifile_tests/TestDef.py | 10 - .../test/multifile_tests/src/requirement.cpp | 14 - .../test/multifile_tests/src/requirement.h | 14 - .../test/multifile_tests/src/test_bar.t.h | 23 - .../test/multifile_tests/src/test_foo.t.h | 23 - .../SCons/test/need_cpppath/SConstruct | 9 - .../SCons/test/need_cpppath/src/cpppath.t.h | 25 - .../need_cpppath/src/cpppathdir/include.h | 16 - .../test/nonstandard_cxxtest_dir/SConstruct | 10 - .../test/nonstandard_cxxtest_dir/TestDef.py | 10 - .../SCons/test/printer_propagation/SConstruct | 8 - .../printer_propagation/cxxtest/CrazyRunner.h | 16 - .../test/printer_propagation/src/failtest.t.h | 23 - .../SCons/test/recursive_sources/README | 2 - .../SCons/test/recursive_sources/SConstruct | 3 - .../SCons/test/recursive_sources/TestDef.py | 10 - .../recursive_sources/src/requirement.cpp | 14 - .../test/recursive_sources/src/requirement.h | 14 - .../test/recursive_sources/src/test_bar.t.h | 23 - .../test/recursive_sources/src/test_foo.t.h | 23 - .../SCons/test/string_cpppath/SConstruct | 9 - .../SCons/test/string_cpppath/TestDef.py | 0 .../SCons/test/string_cpppath/src/cpppath.t.h | 25 - .../string_cpppath/src/cpppathdir/include.h | 16 - .../SCons/test/target_syntax/SConstruct | 9 - .../SCons/test/target_syntax/TestDef.py | 0 .../SCons/test/target_syntax/src/cpppath.t.h | 25 - .../target_syntax/src/cpppathdir/include.h | 16 - .../cxxtest/build_tools/cmake/CxxTest.cmake | 17 - .../build_tools/cmake/FindCxxTest.cmake | 36 - .../lib/py/cxxtest/cxxtest/Descriptions.cpp | 83 - noarch/lib/py/cxxtest/cxxtest/Descriptions.h | 91 - .../py/cxxtest/cxxtest/DummyDescriptions.cpp | 60 - .../py/cxxtest/cxxtest/DummyDescriptions.h | 87 - .../lib/py/cxxtest/cxxtest/ErrorFormatter.h | 347 --- noarch/lib/py/cxxtest/cxxtest/ErrorPrinter.h | 68 - noarch/lib/py/cxxtest/cxxtest/Flags.h | 154 - .../lib/py/cxxtest/cxxtest/GlobalFixture.cpp | 34 - noarch/lib/py/cxxtest/cxxtest/GlobalFixture.h | 41 - noarch/lib/py/cxxtest/cxxtest/Gui.h | 199 -- noarch/lib/py/cxxtest/cxxtest/LinkedList.cpp | 221 -- noarch/lib/py/cxxtest/cxxtest/LinkedList.h | 73 - .../lib/py/cxxtest/cxxtest/MSVCErrorPrinter.h | 40 - noarch/lib/py/cxxtest/cxxtest/Mock.h | 380 --- noarch/lib/py/cxxtest/cxxtest/ParenPrinter.h | 32 - noarch/lib/py/cxxtest/cxxtest/QtGui.h | 306 -- .../py/cxxtest/cxxtest/RealDescriptions.cpp | 361 --- .../lib/py/cxxtest/cxxtest/RealDescriptions.h | 243 -- noarch/lib/py/cxxtest/cxxtest/Root.cpp | 29 - noarch/lib/py/cxxtest/cxxtest/SelfTest.h | 18 - noarch/lib/py/cxxtest/cxxtest/StdHeaders.h | 36 - noarch/lib/py/cxxtest/cxxtest/StdTestSuite.h | 70 - .../lib/py/cxxtest/cxxtest/StdValueTraits.h | 303 -- .../lib/py/cxxtest/cxxtest/StdioFilePrinter.h | 52 - noarch/lib/py/cxxtest/cxxtest/StdioPrinter.h | 33 - noarch/lib/py/cxxtest/cxxtest/TeeListener.h | 205 -- noarch/lib/py/cxxtest/cxxtest/TestListener.h | 87 - noarch/lib/py/cxxtest/cxxtest/TestMain.h | 133 - noarch/lib/py/cxxtest/cxxtest/TestRunner.h | 154 - noarch/lib/py/cxxtest/cxxtest/TestSuite.cpp | 317 -- noarch/lib/py/cxxtest/cxxtest/TestSuite.h | 732 ----- noarch/lib/py/cxxtest/cxxtest/TestTracker.cpp | 288 -- noarch/lib/py/cxxtest/cxxtest/TestTracker.h | 134 - noarch/lib/py/cxxtest/cxxtest/ValueTraits.cpp | 195 -- noarch/lib/py/cxxtest/cxxtest/ValueTraits.h | 435 --- noarch/lib/py/cxxtest/cxxtest/Win32Gui.h | 572 ---- noarch/lib/py/cxxtest/cxxtest/X11Gui.h | 367 --- noarch/lib/py/cxxtest/cxxtest/XUnitPrinter.h | 48 - noarch/lib/py/cxxtest/cxxtest/XmlFormatter.h | 664 ----- noarch/lib/py/cxxtest/cxxtest/XmlPrinter.h | 75 - noarch/lib/py/cxxtest/cxxtest/YesNoRunner.h | 40 - noarch/lib/py/cxxtest/cxxtest/unix.h | 311 -- noarch/lib/py/cxxtest/doc/Makefile | 40 - noarch/lib/py/cxxtest/doc/README.txt | 43 - noarch/lib/py/cxxtest/doc/catalog.xml | 8 - noarch/lib/py/cxxtest/doc/epub/README | 88 - noarch/lib/py/cxxtest/doc/epub/bin/dbtoepub | 76 - .../cxxtest/doc/epub/bin/xslt/obfuscate.xsl | 12 - noarch/lib/py/cxxtest/doc/epub/docbook.xsl | 1690 ----------- .../lib/py/cxxtest/doc/examples/Assertions.h | 193 -- .../py/cxxtest/doc/examples/BadTestSuite1.h | 19 - .../lib/py/cxxtest/doc/examples/GetGlobals.sh | 4 - .../py/cxxtest/doc/examples/MockTestSuite.h | 26 - noarch/lib/py/cxxtest/doc/examples/MyClass.h | 38 - .../py/cxxtest/doc/examples/MyTestSuite1.h | 12 - .../py/cxxtest/doc/examples/MyTestSuite10.h | 20 - .../py/cxxtest/doc/examples/MyTestSuite11.h | 20 - .../py/cxxtest/doc/examples/MyTestSuite12.h | 24 - .../py/cxxtest/doc/examples/MyTestSuite2.h | 19 - .../py/cxxtest/doc/examples/MyTestSuite3.h | 32 - .../py/cxxtest/doc/examples/MyTestSuite4.h | 14 - .../py/cxxtest/doc/examples/MyTestSuite5.h | 35 - .../py/cxxtest/doc/examples/MyTestSuite6.h | 24 - .../py/cxxtest/doc/examples/MyTestSuite7.h | 36 - .../py/cxxtest/doc/examples/MyTestSuite8.h | 71 - .../py/cxxtest/doc/examples/MyTestSuite9.h | 34 - .../lib/py/cxxtest/doc/examples/Namespace1.h | 39 - .../lib/py/cxxtest/doc/examples/Namespace2.h | 28 - noarch/lib/py/cxxtest/doc/examples/TMyClass.h | 43 - .../py/cxxtest/doc/examples/buildRunner.log | 1 - .../py/cxxtest/doc/examples/buildRunner.sh | 18 - .../py/cxxtest/doc/examples/buildRunner.txt | 1 - .../py/cxxtest/doc/examples/buildRunner10.sh | 15 - .../py/cxxtest/doc/examples/buildRunner10.txt | 7 - .../py/cxxtest/doc/examples/buildRunner11.sh | 16 - .../py/cxxtest/doc/examples/buildRunner11.txt | 2 - .../py/cxxtest/doc/examples/buildRunner12.sh | 16 - .../py/cxxtest/doc/examples/buildRunner12.txt | 2 - .../py/cxxtest/doc/examples/buildRunner13.sh | 40 - .../py/cxxtest/doc/examples/buildRunner14.sh | 15 - .../py/cxxtest/doc/examples/buildRunner14.txt | 1 - .../py/cxxtest/doc/examples/buildRunner15.sh | 15 - .../py/cxxtest/doc/examples/buildRunner15.txt | 6 - .../py/cxxtest/doc/examples/buildRunner16.sh | 15 - .../py/cxxtest/doc/examples/buildRunner16.txt | 1 - .../py/cxxtest/doc/examples/buildRunner17.sh | 16 - .../py/cxxtest/doc/examples/buildRunner17.txt | 9 - .../py/cxxtest/doc/examples/buildRunner18.sh | 16 - .../py/cxxtest/doc/examples/buildRunner18.txt | 5 - .../py/cxxtest/doc/examples/buildRunner19.sh | 16 - .../py/cxxtest/doc/examples/buildRunner19.txt | 10 - .../py/cxxtest/doc/examples/buildRunner2.log | 5 - .../py/cxxtest/doc/examples/buildRunner2.sh | 16 - .../py/cxxtest/doc/examples/buildRunner2.txt | 5 - .../py/cxxtest/doc/examples/buildRunner20.sh | 16 - .../py/cxxtest/doc/examples/buildRunner20.txt | 5 - .../py/cxxtest/doc/examples/buildRunner21.sh | 16 - .../py/cxxtest/doc/examples/buildRunner21.txt | 5 - .../py/cxxtest/doc/examples/buildRunner22.sh | 16 - .../py/cxxtest/doc/examples/buildRunner22.txt | 2 - .../py/cxxtest/doc/examples/buildRunner23.sh | 16 - .../py/cxxtest/doc/examples/buildRunner23.txt | 1 - .../py/cxxtest/doc/examples/buildRunner24.sh | 16 - .../py/cxxtest/doc/examples/buildRunner24.txt | 2 - .../py/cxxtest/doc/examples/buildRunner25.sh | 24 - .../py/cxxtest/doc/examples/buildRunner25.txt | 2 - .../py/cxxtest/doc/examples/buildRunner3.sh | 15 - .../py/cxxtest/doc/examples/buildRunner3.txt | 5 - .../py/cxxtest/doc/examples/buildRunner4.sh | 15 - .../py/cxxtest/doc/examples/buildRunner4.txt | 5 - .../py/cxxtest/doc/examples/buildRunner5.sh | 17 - .../py/cxxtest/doc/examples/buildRunner5.txt | 1 - .../py/cxxtest/doc/examples/buildRunner6.sh | 15 - .../py/cxxtest/doc/examples/buildRunner6.txt | 7 - .../py/cxxtest/doc/examples/buildRunner7.sh | 15 - .../py/cxxtest/doc/examples/buildRunner7.txt | 5 - .../py/cxxtest/doc/examples/buildRunner8.sh | 15 - .../py/cxxtest/doc/examples/buildRunner9.sh | 21 - .../py/cxxtest/doc/examples/rand_example.cpp | 7 - .../lib/py/cxxtest/doc/examples/runner10.tpl | 14 - .../doc/examples/runner13.MyTestSuite2.txt | 5 - .../py/cxxtest/doc/examples/runner13.help.txt | 6 - .../doc/examples/runner13.helpTests.txt | 6 - .../examples/runner13.testMultiplication.txt | 5 - .../runner13.testMultiplicationVerbose.txt | 7 - .../py/cxxtest/doc/examples/test_examples.py | 68 - .../lib/py/cxxtest/doc/examples/time_mock.cpp | 3 - .../lib/py/cxxtest/doc/examples/time_mock.h | 8 - .../lib/py/cxxtest/doc/examples/time_real.cpp | 3 - noarch/lib/py/cxxtest/doc/guide.txt | 1841 ------------ noarch/lib/py/cxxtest/doc/images/icons/README | 5 - .../cxxtest/doc/images/icons/callouts/1.png | Bin 329 -> 0 bytes .../cxxtest/doc/images/icons/callouts/10.png | Bin 361 -> 0 bytes .../cxxtest/doc/images/icons/callouts/11.png | Bin 565 -> 0 bytes .../cxxtest/doc/images/icons/callouts/12.png | Bin 617 -> 0 bytes .../cxxtest/doc/images/icons/callouts/13.png | Bin 623 -> 0 bytes .../cxxtest/doc/images/icons/callouts/14.png | Bin 411 -> 0 bytes .../cxxtest/doc/images/icons/callouts/15.png | Bin 640 -> 0 bytes .../cxxtest/doc/images/icons/callouts/2.png | Bin 353 -> 0 bytes .../cxxtest/doc/images/icons/callouts/3.png | Bin 350 -> 0 bytes .../cxxtest/doc/images/icons/callouts/4.png | Bin 345 -> 0 bytes .../cxxtest/doc/images/icons/callouts/5.png | Bin 348 -> 0 bytes .../cxxtest/doc/images/icons/callouts/6.png | Bin 355 -> 0 bytes .../cxxtest/doc/images/icons/callouts/7.png | Bin 344 -> 0 bytes .../cxxtest/doc/images/icons/callouts/8.png | Bin 357 -> 0 bytes .../cxxtest/doc/images/icons/callouts/9.png | Bin 357 -> 0 bytes .../py/cxxtest/doc/images/icons/caution.png | Bin 2734 -> 0 bytes .../py/cxxtest/doc/images/icons/example.png | Bin 2599 -> 0 bytes .../lib/py/cxxtest/doc/images/icons/home.png | Bin 1340 -> 0 bytes .../py/cxxtest/doc/images/icons/important.png | Bin 2980 -> 0 bytes .../lib/py/cxxtest/doc/images/icons/next.png | Bin 1302 -> 0 bytes .../lib/py/cxxtest/doc/images/icons/note.png | Bin 2494 -> 0 bytes .../lib/py/cxxtest/doc/images/icons/prev.png | Bin 1348 -> 0 bytes .../lib/py/cxxtest/doc/images/icons/tip.png | Bin 2718 -> 0 bytes noarch/lib/py/cxxtest/doc/images/icons/up.png | Bin 1320 -> 0 bytes .../py/cxxtest/doc/images/icons/warning.png | Bin 3214 -> 0 bytes noarch/lib/py/cxxtest/doc/include_anchors.py | 90 - noarch/lib/py/cxxtest/python/README.txt | 8 - noarch/lib/py/cxxtest/python/convert.py | 27 - .../lib/py/cxxtest/python/cxxtest/__init__.py | 33 - .../py/cxxtest/python/cxxtest/__release__.py | 13 - .../py/cxxtest/python/cxxtest/cxx_parser.py | 2204 -------------- .../py/cxxtest/python/cxxtest/cxxtest_fog.py | 99 - .../py/cxxtest/python/cxxtest/cxxtest_misc.py | 78 - .../cxxtest/python/cxxtest/cxxtest_parser.py | 254 -- .../py/cxxtest/python/cxxtest/cxxtestgen.py | 630 ---- .../python/python3/cxxtest/__init__.py | 33 - .../python/python3/cxxtest/__release__.py | 13 - .../python/python3/cxxtest/cxx_parser.py | 2204 -------------- .../python/python3/cxxtest/cxxtest_fog.py | 99 - .../python/python3/cxxtest/cxxtest_misc.py | 78 - .../python/python3/cxxtest/cxxtest_parser.py | 254 -- .../python/python3/cxxtest/cxxtestgen.py | 630 ---- .../cxxtest/python/python3/scripts/cxxtestgen | 5 - .../lib/py/cxxtest/python/scripts/cxxtestgen | 18 - noarch/lib/py/cxxtest/python/setup.py | 62 - noarch/lib/py/cxxtest/sample/Construct | 64 - noarch/lib/py/cxxtest/sample/CreatedTest.h | 29 - noarch/lib/py/cxxtest/sample/DeltaTest.h | 30 - noarch/lib/py/cxxtest/sample/EnumTraits.h | 37 - noarch/lib/py/cxxtest/sample/ExceptionTest.h | 49 - noarch/lib/py/cxxtest/sample/FixtureTest.h | 33 - noarch/lib/py/cxxtest/sample/Makefile.PL | 32 - noarch/lib/py/cxxtest/sample/Makefile.bcc32 | 94 - noarch/lib/py/cxxtest/sample/Makefile.msvc | 93 - noarch/lib/py/cxxtest/sample/Makefile.unix | 83 - noarch/lib/py/cxxtest/sample/MessageTest.h | 27 - noarch/lib/py/cxxtest/sample/SCons/SConstruct | 40 - .../py/cxxtest/sample/SCons/include/stack.h | 27 - .../lib/py/cxxtest/sample/SCons/src/stack.c | 48 - .../cxxtest/sample/SCons/tests/stack_test.h | 71 - noarch/lib/py/cxxtest/sample/SimpleTest.h | 58 - noarch/lib/py/cxxtest/sample/TraitsTest.h | 63 - noarch/lib/py/cxxtest/sample/aborter.tpl | 16 - noarch/lib/py/cxxtest/sample/file_printer.tpl | 22 - .../py/cxxtest/sample/gui/GreenYellowRed.h | 57 - noarch/lib/py/cxxtest/sample/mock/Dice.cpp | 14 - noarch/lib/py/cxxtest/sample/mock/Dice.h | 13 - noarch/lib/py/cxxtest/sample/mock/Makefile | 22 - .../lib/py/cxxtest/sample/mock/MockStdlib.h | 33 - noarch/lib/py/cxxtest/sample/mock/T/stdlib.h | 13 - noarch/lib/py/cxxtest/sample/mock/TestDice.h | 62 - .../py/cxxtest/sample/mock/mock_stdlib.cpp | 2 - .../py/cxxtest/sample/mock/real_stdlib.cpp | 2 - noarch/lib/py/cxxtest/sample/mock/roll.cpp | 11 - .../py/cxxtest/sample/msvc/CxxTest_1_Run.dsp | 93 - .../cxxtest/sample/msvc/CxxTest_2_Build.dsp | 94 - .../sample/msvc/CxxTest_3_Generate.dsp | 93 - .../cxxtest/sample/msvc/CxxTest_Workspace.dsw | 59 - .../lib/py/cxxtest/sample/msvc/FixFiles.bat | 210 -- noarch/lib/py/cxxtest/sample/msvc/Makefile | 34 - noarch/lib/py/cxxtest/sample/msvc/ReadMe.txt | 30 - noarch/lib/py/cxxtest/sample/only.tpl | 33 - .../lib/py/cxxtest/sample/parts/Makefile.unix | 39 - noarch/lib/py/cxxtest/sample/winddk/Makefile | 2 - .../lib/py/cxxtest/sample/winddk/Makefile.inc | 13 - .../lib/py/cxxtest/sample/winddk/RunTests.tpl | 13 - noarch/lib/py/cxxtest/sample/winddk/SOURCES | 46 - .../lib/py/cxxtest/sample/yes_no_runner.cpp | 10 - noarch/lib/py/cxxtest/test/AborterNoThrow.h | 19 - noarch/lib/py/cxxtest/test/BadTest.h | 55 - noarch/lib/py/cxxtest/test/Comments.h | 24 - noarch/lib/py/cxxtest/test/Comments2.h | 21 - noarch/lib/py/cxxtest/test/CppTemplateTest.h | 39 - noarch/lib/py/cxxtest/test/DeepAbort.h | 84 - noarch/lib/py/cxxtest/test/DefaultAbort.h | 3 - noarch/lib/py/cxxtest/test/DefaultTraits.h | 41 - noarch/lib/py/cxxtest/test/DoubleCall.h | 38 - noarch/lib/py/cxxtest/test/DynamicAbort.h | 52 - noarch/lib/py/cxxtest/test/DynamicMax.h | 67 - noarch/lib/py/cxxtest/test/EmptySuite.h | 16 - noarch/lib/py/cxxtest/test/Exceptions.h | 70 - noarch/lib/py/cxxtest/test/Factor.h | 69 - noarch/lib/py/cxxtest/test/ForceNoEh.h | 16 - noarch/lib/py/cxxtest/test/GfSetUpFails.h | 28 - noarch/lib/py/cxxtest/test/GfSetUpThrows.h | 28 - noarch/lib/py/cxxtest/test/GfTearDownFails.h | 26 - noarch/lib/py/cxxtest/test/GfTearDownThrows.h | 26 - noarch/lib/py/cxxtest/test/GlobalFixtures.h | 72 - noarch/lib/py/cxxtest/test/GoodSuite.h | 114 - noarch/lib/py/cxxtest/test/GuiWait.h | 6 - noarch/lib/py/cxxtest/test/HaveEH.tpl | 10 - noarch/lib/py/cxxtest/test/HaveStd.h | 15 - noarch/lib/py/cxxtest/test/HaveStd.tpl | 10 - noarch/lib/py/cxxtest/test/IncludeTest.h | 15 - noarch/lib/py/cxxtest/test/InheritedTest.h | 65 - noarch/lib/py/cxxtest/test/Int64.h | 16 - noarch/lib/py/cxxtest/test/LessThanEquals.h | 22 - noarch/lib/py/cxxtest/test/LongLong.h | 16 - noarch/lib/py/cxxtest/test/LongTraits.h | 16 - noarch/lib/py/cxxtest/test/Makefile | 11 - noarch/lib/py/cxxtest/test/MaxDump.h | 5 - noarch/lib/py/cxxtest/test/MockTest.h | 182 -- noarch/lib/py/cxxtest/test/Namespace1.h | 72 - noarch/lib/py/cxxtest/test/Namespace2.h | 68 - noarch/lib/py/cxxtest/test/NoEh.h | 11 - noarch/lib/py/cxxtest/test/Part1.h | 18 - noarch/lib/py/cxxtest/test/Part2.h | 18 - noarch/lib/py/cxxtest/test/Relation.h | 41 - noarch/lib/py/cxxtest/test/SameData.h | 41 - noarch/lib/py/cxxtest/test/SameFiles.h | 41 - noarch/lib/py/cxxtest/test/SameFilesLonger.h | 42 - noarch/lib/py/cxxtest/test/SameZero.h | 28 - noarch/lib/py/cxxtest/test/SetUpWorldError.h | 34 - noarch/lib/py/cxxtest/test/SetUpWorldFails.h | 28 - noarch/lib/py/cxxtest/test/SetUpWorldThrows.h | 28 - .../lib/py/cxxtest/test/SimpleInheritedTest.h | 36 - .../py/cxxtest/test/SimpleInheritedTest2.h | 38 - noarch/lib/py/cxxtest/test/Something.h | 3 - noarch/lib/py/cxxtest/test/StlTraits.h | 152 - .../lib/py/cxxtest/test/TearDownWorldFails.h | 25 - .../lib/py/cxxtest/test/TearDownWorldThrows.h | 25 - noarch/lib/py/cxxtest/test/TestNonFinite.h | 33 - noarch/lib/py/cxxtest/test/ThrowNoStd.h | 10 - noarch/lib/py/cxxtest/test/ThrowNoStd.tpl | 10 - noarch/lib/py/cxxtest/test/ThrowsAssert.h | 101 - noarch/lib/py/cxxtest/test/TraitsTest.h | 61 - noarch/lib/py/cxxtest/test/Tsm.h | 53 - noarch/lib/py/cxxtest/test/UserTraits.h | 36 - noarch/lib/py/cxxtest/test/UserTraits.tpl | 20 - noarch/lib/py/cxxtest/test/VoidTraits.h | 20 - noarch/lib/py/cxxtest/test/WideCharTest.h | 18 - noarch/lib/py/cxxtest/test/WorldFixtures.h | 40 - noarch/lib/py/cxxtest/test/__init__.py | 10 - noarch/lib/py/cxxtest/test/activate.tpl | 19 - noarch/lib/py/cxxtest/test/anything.cpp | 6 - noarch/lib/py/cxxtest/test/cxxtest/DummyGui.h | 45 - noarch/lib/py/cxxtest/test/fake/X11/Xlib.h | 46 - noarch/lib/py/cxxtest/test/fake/X11/Xutil.h | 1 - noarch/lib/py/cxxtest/test/fake/commctrl.h | 26 - .../lib/py/cxxtest/test/fake/qapplication.h | 14 - noarch/lib/py/cxxtest/test/fake/qglobal.h | 2 - noarch/lib/py/cxxtest/test/fake/qlabel.h | 10 - noarch/lib/py/cxxtest/test/fake/qlayout.h | 8 - noarch/lib/py/cxxtest/test/fake/qmessagebox.h | 8 - noarch/lib/py/cxxtest/test/fake/qpixmap.h | 2 - .../lib/py/cxxtest/test/fake/qprogressbar.h | 29 - noarch/lib/py/cxxtest/test/fake/qstatusbar.h | 10 - noarch/lib/py/cxxtest/test/fake/qstring.h | 17 - noarch/lib/py/cxxtest/test/fake/qwidget.h | 23 - noarch/lib/py/cxxtest/test/fake/windows.h | 123 - noarch/lib/py/cxxtest/test/int64.cpp | 8 - noarch/lib/py/cxxtest/test/longlong.cpp | 8 - noarch/lib/py/cxxtest/test/main.cpp | 34 - noarch/lib/py/cxxtest/test/normal.xml | 437 --- noarch/lib/py/cxxtest/test/preamble.tpl | 29 - noarch/lib/py/cxxtest/test/stpltpl.cpp | 6 - noarch/lib/py/cxxtest/test/test_cxxtest.py | 944 ------ noarch/lib/py/cxxtest/test/test_doc.py | 35 - noarch/lib/py/cxxtest/test/tpltpl.cpp | 10 - .../py/cxxtest/test/unit/LinkedList_test.t.h | 57 - noarch/lib/py/cxxtest/test/unit/SConstruct | 12 - noarch/lib/py/cxxtest/test/wchar.cpp | 11 - 415 files changed, 33615 deletions(-) rename noarch/{lib/py/cxxtest/build_tools/SCons/test/need_cpppath/TestDef.py => bin/.gitignore} (100%) delete mode 100755 noarch/bin/cpythonbuild delete mode 100644 noarch/bin/cpythonbuild.bat delete mode 100644 noarch/bin/cpythonbuild.py rename noarch/lib/{py/cxxtest/build_tools/SCons/test/printer_propagation/TestDef.py => .gitignore} (100%) delete mode 100644 noarch/lib/py/cxxtest/COPYING delete mode 100644 noarch/lib/py/cxxtest/README delete mode 100644 noarch/lib/py/cxxtest/Versions delete mode 100644 noarch/lib/py/cxxtest/admin/announcement delete mode 100644 noarch/lib/py/cxxtest/admin/cloudbees_cxxtest delete mode 100644 noarch/lib/py/cxxtest/admin/cxxtest.spec delete mode 100644 noarch/lib/py/cxxtest/admin/jenkins_cxxtest delete mode 100644 noarch/lib/py/cxxtest/admin/virtualenv.py delete mode 100644 noarch/lib/py/cxxtest/admin/virtualenv_1.7.py delete mode 100644 noarch/lib/py/cxxtest/bin/cxxtestgen delete mode 100644 noarch/lib/py/cxxtest/bin/cxxtestgen.bat delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/AUTHORS delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/cxxtest.py delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/default_env/README delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/default_env/SConstruct delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/default_env/TestDef.py delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/empty_source_list/README delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/empty_source_list/SConstruct delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/empty_source_list/TestDef.py delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/empty_source_list/requirement.hpp delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/empty_source_list/test_bar.t.h delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/empty_source_list/test_foo.t.h delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/eprouvette.py delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/expanding_#/README delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/expanding_#/SConstruct delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/expanding_#/TestDef.py delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/globbing/README delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/globbing/SConstruct delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/globbing/TestDef.py delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/globbing/src/requirement.cpp delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/globbing/src/requirement.h delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/globbing/src/test_bar.t.h delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/globbing/src/test_foo.t.h delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/globbing_edmundo/README delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/globbing_edmundo/SConstruct delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/globbing_edmundo/TestDef.py delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/globbing_edmundo/hello.cc delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/globbing_edmundo/hello.hh delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/globbing_edmundo/hellotest.t.h delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/globbing_edmundo/main.cpp delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/include_CCFLAGS/README delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/include_CCFLAGS/SConstruct delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/include_CCFLAGS/TestDef.py delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/include_CCFLAGS/src/not-with-pedantic.h delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/include_CCFLAGS/src/only_with_ansi.t.h delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/include_CXXFLAGS/README delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/include_CXXFLAGS/SConstruct delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/include_CXXFLAGS/TestDef.py delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/include_CXXFLAGS/src/not-with-pedantic.h delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/libpath/README delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/libpath/SConstruct delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/libpath/TestDef.py delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/libpath/src/SConscript delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/libpath/src/foo.cpp delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/libpath/test/SConscript delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/libpath/test/test.t.h delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/README delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/SConstruct delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/TestDef.py delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/src1/SConscript delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/src1/foo.cpp delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/src2/SConscript delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/src2/bar.cpp delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/test/SConscript delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/test/test1.t.h delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/test/test2.t.h delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/multifile_tests/SConstruct delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/multifile_tests/TestDef.py delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/multifile_tests/src/requirement.cpp delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/multifile_tests/src/requirement.h delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/multifile_tests/src/test_bar.t.h delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/multifile_tests/src/test_foo.t.h delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/need_cpppath/SConstruct delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/need_cpppath/src/cpppath.t.h delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/need_cpppath/src/cpppathdir/include.h delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/nonstandard_cxxtest_dir/SConstruct delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/nonstandard_cxxtest_dir/TestDef.py delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/printer_propagation/SConstruct delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/printer_propagation/cxxtest/CrazyRunner.h delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/printer_propagation/src/failtest.t.h delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/recursive_sources/README delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/recursive_sources/SConstruct delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/recursive_sources/TestDef.py delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/recursive_sources/src/requirement.cpp delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/recursive_sources/src/requirement.h delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/recursive_sources/src/test_bar.t.h delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/recursive_sources/src/test_foo.t.h delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/string_cpppath/SConstruct delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/string_cpppath/TestDef.py delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/string_cpppath/src/cpppath.t.h delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/string_cpppath/src/cpppathdir/include.h delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/target_syntax/SConstruct delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/target_syntax/TestDef.py delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/target_syntax/src/cpppath.t.h delete mode 100644 noarch/lib/py/cxxtest/build_tools/SCons/test/target_syntax/src/cpppathdir/include.h delete mode 100644 noarch/lib/py/cxxtest/build_tools/cmake/CxxTest.cmake delete mode 100644 noarch/lib/py/cxxtest/build_tools/cmake/FindCxxTest.cmake delete mode 100644 noarch/lib/py/cxxtest/cxxtest/Descriptions.cpp delete mode 100644 noarch/lib/py/cxxtest/cxxtest/Descriptions.h delete mode 100644 noarch/lib/py/cxxtest/cxxtest/DummyDescriptions.cpp delete mode 100644 noarch/lib/py/cxxtest/cxxtest/DummyDescriptions.h delete mode 100644 noarch/lib/py/cxxtest/cxxtest/ErrorFormatter.h delete mode 100644 noarch/lib/py/cxxtest/cxxtest/ErrorPrinter.h delete mode 100644 noarch/lib/py/cxxtest/cxxtest/Flags.h delete mode 100644 noarch/lib/py/cxxtest/cxxtest/GlobalFixture.cpp delete mode 100644 noarch/lib/py/cxxtest/cxxtest/GlobalFixture.h delete mode 100644 noarch/lib/py/cxxtest/cxxtest/Gui.h delete mode 100644 noarch/lib/py/cxxtest/cxxtest/LinkedList.cpp delete mode 100644 noarch/lib/py/cxxtest/cxxtest/LinkedList.h delete mode 100644 noarch/lib/py/cxxtest/cxxtest/MSVCErrorPrinter.h delete mode 100644 noarch/lib/py/cxxtest/cxxtest/Mock.h delete mode 100644 noarch/lib/py/cxxtest/cxxtest/ParenPrinter.h delete mode 100644 noarch/lib/py/cxxtest/cxxtest/QtGui.h delete mode 100644 noarch/lib/py/cxxtest/cxxtest/RealDescriptions.cpp delete mode 100644 noarch/lib/py/cxxtest/cxxtest/RealDescriptions.h delete mode 100644 noarch/lib/py/cxxtest/cxxtest/Root.cpp delete mode 100644 noarch/lib/py/cxxtest/cxxtest/SelfTest.h delete mode 100644 noarch/lib/py/cxxtest/cxxtest/StdHeaders.h delete mode 100644 noarch/lib/py/cxxtest/cxxtest/StdTestSuite.h delete mode 100644 noarch/lib/py/cxxtest/cxxtest/StdValueTraits.h delete mode 100644 noarch/lib/py/cxxtest/cxxtest/StdioFilePrinter.h delete mode 100644 noarch/lib/py/cxxtest/cxxtest/StdioPrinter.h delete mode 100644 noarch/lib/py/cxxtest/cxxtest/TeeListener.h delete mode 100644 noarch/lib/py/cxxtest/cxxtest/TestListener.h delete mode 100644 noarch/lib/py/cxxtest/cxxtest/TestMain.h delete mode 100644 noarch/lib/py/cxxtest/cxxtest/TestRunner.h delete mode 100644 noarch/lib/py/cxxtest/cxxtest/TestSuite.cpp delete mode 100644 noarch/lib/py/cxxtest/cxxtest/TestSuite.h delete mode 100644 noarch/lib/py/cxxtest/cxxtest/TestTracker.cpp delete mode 100644 noarch/lib/py/cxxtest/cxxtest/TestTracker.h delete mode 100644 noarch/lib/py/cxxtest/cxxtest/ValueTraits.cpp delete mode 100644 noarch/lib/py/cxxtest/cxxtest/ValueTraits.h delete mode 100644 noarch/lib/py/cxxtest/cxxtest/Win32Gui.h delete mode 100644 noarch/lib/py/cxxtest/cxxtest/X11Gui.h delete mode 100644 noarch/lib/py/cxxtest/cxxtest/XUnitPrinter.h delete mode 100644 noarch/lib/py/cxxtest/cxxtest/XmlFormatter.h delete mode 100644 noarch/lib/py/cxxtest/cxxtest/XmlPrinter.h delete mode 100644 noarch/lib/py/cxxtest/cxxtest/YesNoRunner.h delete mode 100644 noarch/lib/py/cxxtest/cxxtest/unix.h delete mode 100644 noarch/lib/py/cxxtest/doc/Makefile delete mode 100644 noarch/lib/py/cxxtest/doc/README.txt delete mode 100644 noarch/lib/py/cxxtest/doc/catalog.xml delete mode 100644 noarch/lib/py/cxxtest/doc/epub/README delete mode 100644 noarch/lib/py/cxxtest/doc/epub/bin/dbtoepub delete mode 100644 noarch/lib/py/cxxtest/doc/epub/bin/xslt/obfuscate.xsl delete mode 100644 noarch/lib/py/cxxtest/doc/epub/docbook.xsl delete mode 100644 noarch/lib/py/cxxtest/doc/examples/Assertions.h delete mode 100644 noarch/lib/py/cxxtest/doc/examples/BadTestSuite1.h delete mode 100644 noarch/lib/py/cxxtest/doc/examples/GetGlobals.sh delete mode 100644 noarch/lib/py/cxxtest/doc/examples/MockTestSuite.h delete mode 100644 noarch/lib/py/cxxtest/doc/examples/MyClass.h delete mode 100644 noarch/lib/py/cxxtest/doc/examples/MyTestSuite1.h delete mode 100644 noarch/lib/py/cxxtest/doc/examples/MyTestSuite10.h delete mode 100644 noarch/lib/py/cxxtest/doc/examples/MyTestSuite11.h delete mode 100644 noarch/lib/py/cxxtest/doc/examples/MyTestSuite12.h delete mode 100644 noarch/lib/py/cxxtest/doc/examples/MyTestSuite2.h delete mode 100644 noarch/lib/py/cxxtest/doc/examples/MyTestSuite3.h delete mode 100644 noarch/lib/py/cxxtest/doc/examples/MyTestSuite4.h delete mode 100644 noarch/lib/py/cxxtest/doc/examples/MyTestSuite5.h delete mode 100644 noarch/lib/py/cxxtest/doc/examples/MyTestSuite6.h delete mode 100644 noarch/lib/py/cxxtest/doc/examples/MyTestSuite7.h delete mode 100644 noarch/lib/py/cxxtest/doc/examples/MyTestSuite8.h delete mode 100644 noarch/lib/py/cxxtest/doc/examples/MyTestSuite9.h delete mode 100644 noarch/lib/py/cxxtest/doc/examples/Namespace1.h delete mode 100644 noarch/lib/py/cxxtest/doc/examples/Namespace2.h delete mode 100644 noarch/lib/py/cxxtest/doc/examples/TMyClass.h delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner.log delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner.sh delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner.txt delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner10.sh delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner10.txt delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner11.sh delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner11.txt delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner12.sh delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner12.txt delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner13.sh delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner14.sh delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner14.txt delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner15.sh delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner15.txt delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner16.sh delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner16.txt delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner17.sh delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner17.txt delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner18.sh delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner18.txt delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner19.sh delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner19.txt delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner2.log delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner2.sh delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner2.txt delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner20.sh delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner20.txt delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner21.sh delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner21.txt delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner22.sh delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner22.txt delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner23.sh delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner23.txt delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner24.sh delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner24.txt delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner25.sh delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner25.txt delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner3.sh delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner3.txt delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner4.sh delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner4.txt delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner5.sh delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner5.txt delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner6.sh delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner6.txt delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner7.sh delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner7.txt delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner8.sh delete mode 100644 noarch/lib/py/cxxtest/doc/examples/buildRunner9.sh delete mode 100644 noarch/lib/py/cxxtest/doc/examples/rand_example.cpp delete mode 100644 noarch/lib/py/cxxtest/doc/examples/runner10.tpl delete mode 100644 noarch/lib/py/cxxtest/doc/examples/runner13.MyTestSuite2.txt delete mode 100644 noarch/lib/py/cxxtest/doc/examples/runner13.help.txt delete mode 100644 noarch/lib/py/cxxtest/doc/examples/runner13.helpTests.txt delete mode 100644 noarch/lib/py/cxxtest/doc/examples/runner13.testMultiplication.txt delete mode 100644 noarch/lib/py/cxxtest/doc/examples/runner13.testMultiplicationVerbose.txt delete mode 100644 noarch/lib/py/cxxtest/doc/examples/test_examples.py delete mode 100644 noarch/lib/py/cxxtest/doc/examples/time_mock.cpp delete mode 100644 noarch/lib/py/cxxtest/doc/examples/time_mock.h delete mode 100644 noarch/lib/py/cxxtest/doc/examples/time_real.cpp delete mode 100644 noarch/lib/py/cxxtest/doc/guide.txt delete mode 100644 noarch/lib/py/cxxtest/doc/images/icons/README delete mode 100644 noarch/lib/py/cxxtest/doc/images/icons/callouts/1.png delete mode 100644 noarch/lib/py/cxxtest/doc/images/icons/callouts/10.png delete mode 100644 noarch/lib/py/cxxtest/doc/images/icons/callouts/11.png delete mode 100644 noarch/lib/py/cxxtest/doc/images/icons/callouts/12.png delete mode 100644 noarch/lib/py/cxxtest/doc/images/icons/callouts/13.png delete mode 100644 noarch/lib/py/cxxtest/doc/images/icons/callouts/14.png delete mode 100644 noarch/lib/py/cxxtest/doc/images/icons/callouts/15.png delete mode 100644 noarch/lib/py/cxxtest/doc/images/icons/callouts/2.png delete mode 100644 noarch/lib/py/cxxtest/doc/images/icons/callouts/3.png delete mode 100644 noarch/lib/py/cxxtest/doc/images/icons/callouts/4.png delete mode 100644 noarch/lib/py/cxxtest/doc/images/icons/callouts/5.png delete mode 100644 noarch/lib/py/cxxtest/doc/images/icons/callouts/6.png delete mode 100644 noarch/lib/py/cxxtest/doc/images/icons/callouts/7.png delete mode 100644 noarch/lib/py/cxxtest/doc/images/icons/callouts/8.png delete mode 100644 noarch/lib/py/cxxtest/doc/images/icons/callouts/9.png delete mode 100644 noarch/lib/py/cxxtest/doc/images/icons/caution.png delete mode 100644 noarch/lib/py/cxxtest/doc/images/icons/example.png delete mode 100644 noarch/lib/py/cxxtest/doc/images/icons/home.png delete mode 100644 noarch/lib/py/cxxtest/doc/images/icons/important.png delete mode 100644 noarch/lib/py/cxxtest/doc/images/icons/next.png delete mode 100644 noarch/lib/py/cxxtest/doc/images/icons/note.png delete mode 100644 noarch/lib/py/cxxtest/doc/images/icons/prev.png delete mode 100644 noarch/lib/py/cxxtest/doc/images/icons/tip.png delete mode 100644 noarch/lib/py/cxxtest/doc/images/icons/up.png delete mode 100644 noarch/lib/py/cxxtest/doc/images/icons/warning.png delete mode 100644 noarch/lib/py/cxxtest/doc/include_anchors.py delete mode 100644 noarch/lib/py/cxxtest/python/README.txt delete mode 100644 noarch/lib/py/cxxtest/python/convert.py delete mode 100644 noarch/lib/py/cxxtest/python/cxxtest/__init__.py delete mode 100644 noarch/lib/py/cxxtest/python/cxxtest/__release__.py delete mode 100644 noarch/lib/py/cxxtest/python/cxxtest/cxx_parser.py delete mode 100644 noarch/lib/py/cxxtest/python/cxxtest/cxxtest_fog.py delete mode 100644 noarch/lib/py/cxxtest/python/cxxtest/cxxtest_misc.py delete mode 100644 noarch/lib/py/cxxtest/python/cxxtest/cxxtest_parser.py delete mode 100644 noarch/lib/py/cxxtest/python/cxxtest/cxxtestgen.py delete mode 100644 noarch/lib/py/cxxtest/python/python3/cxxtest/__init__.py delete mode 100644 noarch/lib/py/cxxtest/python/python3/cxxtest/__release__.py delete mode 100644 noarch/lib/py/cxxtest/python/python3/cxxtest/cxx_parser.py delete mode 100644 noarch/lib/py/cxxtest/python/python3/cxxtest/cxxtest_fog.py delete mode 100644 noarch/lib/py/cxxtest/python/python3/cxxtest/cxxtest_misc.py delete mode 100644 noarch/lib/py/cxxtest/python/python3/cxxtest/cxxtest_parser.py delete mode 100644 noarch/lib/py/cxxtest/python/python3/cxxtest/cxxtestgen.py delete mode 100644 noarch/lib/py/cxxtest/python/python3/scripts/cxxtestgen delete mode 100644 noarch/lib/py/cxxtest/python/scripts/cxxtestgen delete mode 100644 noarch/lib/py/cxxtest/python/setup.py delete mode 100644 noarch/lib/py/cxxtest/sample/Construct delete mode 100644 noarch/lib/py/cxxtest/sample/CreatedTest.h delete mode 100644 noarch/lib/py/cxxtest/sample/DeltaTest.h delete mode 100644 noarch/lib/py/cxxtest/sample/EnumTraits.h delete mode 100644 noarch/lib/py/cxxtest/sample/ExceptionTest.h delete mode 100644 noarch/lib/py/cxxtest/sample/FixtureTest.h delete mode 100644 noarch/lib/py/cxxtest/sample/Makefile.PL delete mode 100644 noarch/lib/py/cxxtest/sample/Makefile.bcc32 delete mode 100644 noarch/lib/py/cxxtest/sample/Makefile.msvc delete mode 100644 noarch/lib/py/cxxtest/sample/Makefile.unix delete mode 100644 noarch/lib/py/cxxtest/sample/MessageTest.h delete mode 100644 noarch/lib/py/cxxtest/sample/SCons/SConstruct delete mode 100644 noarch/lib/py/cxxtest/sample/SCons/include/stack.h delete mode 100644 noarch/lib/py/cxxtest/sample/SCons/src/stack.c delete mode 100644 noarch/lib/py/cxxtest/sample/SCons/tests/stack_test.h delete mode 100644 noarch/lib/py/cxxtest/sample/SimpleTest.h delete mode 100644 noarch/lib/py/cxxtest/sample/TraitsTest.h delete mode 100644 noarch/lib/py/cxxtest/sample/aborter.tpl delete mode 100644 noarch/lib/py/cxxtest/sample/file_printer.tpl delete mode 100644 noarch/lib/py/cxxtest/sample/gui/GreenYellowRed.h delete mode 100644 noarch/lib/py/cxxtest/sample/mock/Dice.cpp delete mode 100644 noarch/lib/py/cxxtest/sample/mock/Dice.h delete mode 100644 noarch/lib/py/cxxtest/sample/mock/Makefile delete mode 100644 noarch/lib/py/cxxtest/sample/mock/MockStdlib.h delete mode 100644 noarch/lib/py/cxxtest/sample/mock/T/stdlib.h delete mode 100644 noarch/lib/py/cxxtest/sample/mock/TestDice.h delete mode 100644 noarch/lib/py/cxxtest/sample/mock/mock_stdlib.cpp delete mode 100644 noarch/lib/py/cxxtest/sample/mock/real_stdlib.cpp delete mode 100644 noarch/lib/py/cxxtest/sample/mock/roll.cpp delete mode 100644 noarch/lib/py/cxxtest/sample/msvc/CxxTest_1_Run.dsp delete mode 100644 noarch/lib/py/cxxtest/sample/msvc/CxxTest_2_Build.dsp delete mode 100644 noarch/lib/py/cxxtest/sample/msvc/CxxTest_3_Generate.dsp delete mode 100644 noarch/lib/py/cxxtest/sample/msvc/CxxTest_Workspace.dsw delete mode 100644 noarch/lib/py/cxxtest/sample/msvc/FixFiles.bat delete mode 100644 noarch/lib/py/cxxtest/sample/msvc/Makefile delete mode 100644 noarch/lib/py/cxxtest/sample/msvc/ReadMe.txt delete mode 100644 noarch/lib/py/cxxtest/sample/only.tpl delete mode 100644 noarch/lib/py/cxxtest/sample/parts/Makefile.unix delete mode 100644 noarch/lib/py/cxxtest/sample/winddk/Makefile delete mode 100644 noarch/lib/py/cxxtest/sample/winddk/Makefile.inc delete mode 100644 noarch/lib/py/cxxtest/sample/winddk/RunTests.tpl delete mode 100644 noarch/lib/py/cxxtest/sample/winddk/SOURCES delete mode 100644 noarch/lib/py/cxxtest/sample/yes_no_runner.cpp delete mode 100644 noarch/lib/py/cxxtest/test/AborterNoThrow.h delete mode 100644 noarch/lib/py/cxxtest/test/BadTest.h delete mode 100644 noarch/lib/py/cxxtest/test/Comments.h delete mode 100644 noarch/lib/py/cxxtest/test/Comments2.h delete mode 100644 noarch/lib/py/cxxtest/test/CppTemplateTest.h delete mode 100644 noarch/lib/py/cxxtest/test/DeepAbort.h delete mode 100644 noarch/lib/py/cxxtest/test/DefaultAbort.h delete mode 100644 noarch/lib/py/cxxtest/test/DefaultTraits.h delete mode 100644 noarch/lib/py/cxxtest/test/DoubleCall.h delete mode 100644 noarch/lib/py/cxxtest/test/DynamicAbort.h delete mode 100644 noarch/lib/py/cxxtest/test/DynamicMax.h delete mode 100644 noarch/lib/py/cxxtest/test/EmptySuite.h delete mode 100644 noarch/lib/py/cxxtest/test/Exceptions.h delete mode 100644 noarch/lib/py/cxxtest/test/Factor.h delete mode 100644 noarch/lib/py/cxxtest/test/ForceNoEh.h delete mode 100644 noarch/lib/py/cxxtest/test/GfSetUpFails.h delete mode 100644 noarch/lib/py/cxxtest/test/GfSetUpThrows.h delete mode 100644 noarch/lib/py/cxxtest/test/GfTearDownFails.h delete mode 100644 noarch/lib/py/cxxtest/test/GfTearDownThrows.h delete mode 100644 noarch/lib/py/cxxtest/test/GlobalFixtures.h delete mode 100644 noarch/lib/py/cxxtest/test/GoodSuite.h delete mode 100644 noarch/lib/py/cxxtest/test/GuiWait.h delete mode 100644 noarch/lib/py/cxxtest/test/HaveEH.tpl delete mode 100644 noarch/lib/py/cxxtest/test/HaveStd.h delete mode 100644 noarch/lib/py/cxxtest/test/HaveStd.tpl delete mode 100644 noarch/lib/py/cxxtest/test/IncludeTest.h delete mode 100644 noarch/lib/py/cxxtest/test/InheritedTest.h delete mode 100644 noarch/lib/py/cxxtest/test/Int64.h delete mode 100644 noarch/lib/py/cxxtest/test/LessThanEquals.h delete mode 100644 noarch/lib/py/cxxtest/test/LongLong.h delete mode 100644 noarch/lib/py/cxxtest/test/LongTraits.h delete mode 100644 noarch/lib/py/cxxtest/test/Makefile delete mode 100644 noarch/lib/py/cxxtest/test/MaxDump.h delete mode 100644 noarch/lib/py/cxxtest/test/MockTest.h delete mode 100644 noarch/lib/py/cxxtest/test/Namespace1.h delete mode 100644 noarch/lib/py/cxxtest/test/Namespace2.h delete mode 100644 noarch/lib/py/cxxtest/test/NoEh.h delete mode 100644 noarch/lib/py/cxxtest/test/Part1.h delete mode 100644 noarch/lib/py/cxxtest/test/Part2.h delete mode 100644 noarch/lib/py/cxxtest/test/Relation.h delete mode 100644 noarch/lib/py/cxxtest/test/SameData.h delete mode 100644 noarch/lib/py/cxxtest/test/SameFiles.h delete mode 100644 noarch/lib/py/cxxtest/test/SameFilesLonger.h delete mode 100644 noarch/lib/py/cxxtest/test/SameZero.h delete mode 100644 noarch/lib/py/cxxtest/test/SetUpWorldError.h delete mode 100644 noarch/lib/py/cxxtest/test/SetUpWorldFails.h delete mode 100644 noarch/lib/py/cxxtest/test/SetUpWorldThrows.h delete mode 100644 noarch/lib/py/cxxtest/test/SimpleInheritedTest.h delete mode 100644 noarch/lib/py/cxxtest/test/SimpleInheritedTest2.h delete mode 100644 noarch/lib/py/cxxtest/test/Something.h delete mode 100644 noarch/lib/py/cxxtest/test/StlTraits.h delete mode 100644 noarch/lib/py/cxxtest/test/TearDownWorldFails.h delete mode 100644 noarch/lib/py/cxxtest/test/TearDownWorldThrows.h delete mode 100644 noarch/lib/py/cxxtest/test/TestNonFinite.h delete mode 100644 noarch/lib/py/cxxtest/test/ThrowNoStd.h delete mode 100644 noarch/lib/py/cxxtest/test/ThrowNoStd.tpl delete mode 100644 noarch/lib/py/cxxtest/test/ThrowsAssert.h delete mode 100644 noarch/lib/py/cxxtest/test/TraitsTest.h delete mode 100644 noarch/lib/py/cxxtest/test/Tsm.h delete mode 100644 noarch/lib/py/cxxtest/test/UserTraits.h delete mode 100644 noarch/lib/py/cxxtest/test/UserTraits.tpl delete mode 100644 noarch/lib/py/cxxtest/test/VoidTraits.h delete mode 100644 noarch/lib/py/cxxtest/test/WideCharTest.h delete mode 100644 noarch/lib/py/cxxtest/test/WorldFixtures.h delete mode 100644 noarch/lib/py/cxxtest/test/__init__.py delete mode 100644 noarch/lib/py/cxxtest/test/activate.tpl delete mode 100644 noarch/lib/py/cxxtest/test/anything.cpp delete mode 100644 noarch/lib/py/cxxtest/test/cxxtest/DummyGui.h delete mode 100644 noarch/lib/py/cxxtest/test/fake/X11/Xlib.h delete mode 100644 noarch/lib/py/cxxtest/test/fake/X11/Xutil.h delete mode 100644 noarch/lib/py/cxxtest/test/fake/commctrl.h delete mode 100644 noarch/lib/py/cxxtest/test/fake/qapplication.h delete mode 100644 noarch/lib/py/cxxtest/test/fake/qglobal.h delete mode 100644 noarch/lib/py/cxxtest/test/fake/qlabel.h delete mode 100644 noarch/lib/py/cxxtest/test/fake/qlayout.h delete mode 100644 noarch/lib/py/cxxtest/test/fake/qmessagebox.h delete mode 100644 noarch/lib/py/cxxtest/test/fake/qpixmap.h delete mode 100644 noarch/lib/py/cxxtest/test/fake/qprogressbar.h delete mode 100644 noarch/lib/py/cxxtest/test/fake/qstatusbar.h delete mode 100644 noarch/lib/py/cxxtest/test/fake/qstring.h delete mode 100644 noarch/lib/py/cxxtest/test/fake/qwidget.h delete mode 100644 noarch/lib/py/cxxtest/test/fake/windows.h delete mode 100644 noarch/lib/py/cxxtest/test/int64.cpp delete mode 100644 noarch/lib/py/cxxtest/test/longlong.cpp delete mode 100644 noarch/lib/py/cxxtest/test/main.cpp delete mode 100644 noarch/lib/py/cxxtest/test/normal.xml delete mode 100644 noarch/lib/py/cxxtest/test/preamble.tpl delete mode 100644 noarch/lib/py/cxxtest/test/stpltpl.cpp delete mode 100644 noarch/lib/py/cxxtest/test/test_cxxtest.py delete mode 100644 noarch/lib/py/cxxtest/test/test_doc.py delete mode 100644 noarch/lib/py/cxxtest/test/tpltpl.cpp delete mode 100644 noarch/lib/py/cxxtest/test/unit/LinkedList_test.t.h delete mode 100644 noarch/lib/py/cxxtest/test/unit/SConstruct delete mode 100644 noarch/lib/py/cxxtest/test/wchar.cpp diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/need_cpppath/TestDef.py b/noarch/bin/.gitignore similarity index 100% rename from noarch/lib/py/cxxtest/build_tools/SCons/test/need_cpppath/TestDef.py rename to noarch/bin/.gitignore diff --git a/noarch/bin/cpythonbuild b/noarch/bin/cpythonbuild deleted file mode 100755 index 3942f1aa..00000000 --- a/noarch/bin/cpythonbuild +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -# -# Copyright (C) 2017-2018 Bassem Girgis brgirgis@gmail.com -# All Rights Reserved -# -# NOTICE: All information contained herein is, and remains the property of -# Bassem Girgis brgirgis@gmail.com. The intellectual and technical concepts -# contained herein are proprietary to Bassem Girgis and may be covered by -# U.S. and Foreign Patents, patents in process, and are protected by trade -# secret or copyright law. Dissemination of this information or reproduction -# of this material is strictly forbidden, unless prior authorized written -# permission is obtained from Bassem Girgis. -# - -SCRIPT=`realpath -s $0` -SCRIPTPATH=`dirname $SCRIPT` - -#echo $SCRIPT -#echo $SCRIPTPATH - -python3 $SCRIPTPATH/cpythonbuild.py "$@" diff --git a/noarch/bin/cpythonbuild.bat b/noarch/bin/cpythonbuild.bat deleted file mode 100644 index 48908b6f..00000000 --- a/noarch/bin/cpythonbuild.bat +++ /dev/null @@ -1,20 +0,0 @@ -:: -:: Copyright (C) 2017-2018 Bassem Girgis brgirgis@gmail.com -:: All Rights Reserved -:: -:: NOTICE: All information contained herein is, and remains the property of -:: Bassem Girgis brgirgis@gmail.com. The intellectual and technical concepts -:: contained herein are proprietary to Bassem Girgis and may be covered by -:: U.S. and Foreign Patents, patents in process, and are protected by trade -:: secret or copyright law. Dissemination of this information or reproduction -:: of this material is strictly forbidden, unless prior authorized written -:: permission is obtained from Bassem Girgis. -:: - -@echo off - -setlocal - -set scriptPath=%~dp0 - -"C:\Program Files\Python36\python.exe" %scriptPath%cpythonbuild.py %* diff --git a/noarch/bin/cpythonbuild.py b/noarch/bin/cpythonbuild.py deleted file mode 100644 index 94d79f52..00000000 --- a/noarch/bin/cpythonbuild.py +++ /dev/null @@ -1,159 +0,0 @@ -# -# Copyright (C) 2017-2018 Bassem Girgis brgirgis@gmail.com -# All Rights Reserved -# -# NOTICE: All information contained herein is, and remains the property of -# Bassem Girgis brgirgis@gmail.com. The intellectual and technical concepts -# contained herein are proprietary to Bassem Girgis and may be covered by -# U.S. and Foreign Patents, patents in process, and are protected by trade -# secret or copyright law. Dissemination of this information or reproduction -# of this material is strictly forbidden, unless prior authorized written -# permission is obtained from Bassem Girgis. -# - -import os - - -def compileFile(filePath, cFilePath, dFilePath, doRaise, nOptimization): - assert filePath[-3:] == '.py', \ - 'Cannot compile non-python files' - - print('compiling', filePath) - - try: - import py_compile - py_compile.compile( - file=filePath, - cfile=cFilePath, - dfile=dFilePath, - doraise=doRaise, - optimize=nOptimization - ) - return True - except: - return False - - -def compileDir(srcPath, cPath, dPath, doRaise, nOptimization): - - if not cPath: - cPath = srcPath - - for root, _, files in os.walk(srcPath): - for fileName in files: - if '.py' != fileName[-3:]: - continue - - filePath = os.path.join(root, fileName) - relFilePath = os.path.relpath(filePath, srcPath) - cFilePath = os.path.join(cPath, relFilePath) + 'c' - dFilePath = os.path.join( - dPath, relFilePath - ) if dPath else relFilePath - if not compileFile( - filePath=filePath, - cFilePath=cFilePath, - dFilePath=dFilePath, - doRaise=doRaise, - nOptimization=nOptimization - ): - return False - return True - - -def main(): - - import argparse - - parser = argparse.ArgumentParser( - description='Utility to build python binaries.' - ) - - parser.add_argument( - '-i', - metavar='INPUTPATH', - dest='inputPath', - default=None, - help=('file to be processed') - ) - parser.add_argument( - '-s', - metavar='SRCPATH', - dest='srcPath', - default=None, - help=('directory to be processed') - ) - parser.add_argument( - '-o', - metavar='OUTPUTDIR', - dest='outputDir', - default=None, - help=('output directory') - ) - parser.add_argument( - '-d', - metavar='DESTDIR', - dest='destDir', - default='', - help=('destination directory') - ) - parser.add_argument( - '-e', - action='store_true', - dest='doraise', - help='raise if there are errors' - ) - parser.add_argument( - '-l', - type=int, - default=-1, - dest='noptimize', - help=('level of optimization') - ) - args = parser.parse_args() - - if not args.inputPath: - assert args.srcPath, 'missing source path' - assert os.path.isdir(args.srcPath), 'source path does not exist' - return not compileDir( - srcPath=args.srcPath, - cPath=args.outputDir, - dPath=args.destDir, - doRaise=args.doraise, - nOptimization=args.noptimize - ) - elif args.inputPath: - assert os.path.isfile(args.inputPath), 'input file does not exist' - - relFilePath = None - if args.srcPath: - assert os.path.isdir(args.srcPath), 'source path does not exist' - relFilePath = os.path.relpath(args.inputPath, args.srcPath) - - cFilePath = args.inputPath + 'c' - if args.srcPath and args.outputDir: - assert os.path.isdir(args.outputDir), 'output path does not exist' - cFilePath = os.path.join(args.outputDir, relFilePath) + 'c' - cFileDirPath = os.path.dirname(cFilePath) - if not os.path.exists(cFileDirPath): - os.makedirs(cFileDirPath) - - dFilePath = relFilePath if relFilePath else args.inputPath - if args.srcPath and args.destDir: - dFilePath = os.path.join(args.destDir, relFilePath) - - return not compileFile( - filePath=args.inputPath, - cFilePath=cFilePath, - dFilePath=dFilePath, - doRaise=args.doraise, - nOptimization=args.noptimize - ) - - args.print_help() - return True - - -if __name__ == '__main__': - import sys - sys.exit(main()) diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/printer_propagation/TestDef.py b/noarch/lib/.gitignore similarity index 100% rename from noarch/lib/py/cxxtest/build_tools/SCons/test/printer_propagation/TestDef.py rename to noarch/lib/.gitignore diff --git a/noarch/lib/py/cxxtest/COPYING b/noarch/lib/py/cxxtest/COPYING deleted file mode 100644 index 65c5ca88..00000000 --- a/noarch/lib/py/cxxtest/COPYING +++ /dev/null @@ -1,165 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. diff --git a/noarch/lib/py/cxxtest/README b/noarch/lib/py/cxxtest/README deleted file mode 100644 index 87aea1bf..00000000 --- a/noarch/lib/py/cxxtest/README +++ /dev/null @@ -1,44 +0,0 @@ -Overview --------- - -CxxTest is a unit testing framework for C++ that is similar in -spirit to JUnit, CppUnit, and xUnit. CxxTest is easy to use because -it does not require precompiling a CxxTest testing library, it -employs no advanced features of C++ (e.g. RTTI) and it supports a -very flexible form of test discovery. - -CxxTest is available under the GNU Lesser General Public Licence (LGPL). - -A user guide can be downloaded from http://cxxtest.com. - - -A Simple Example ----------------- - -1. Create a test suite header file: - -MyTestSuite.h: - - #include - - class MyTestSuite : public CxxTest::TestSuite - { - public: - void testAddition( void ) - { - TS_ASSERT( 1 + 1 > 1 ); - TS_ASSERT_EQUALS( 1 + 1, 2 ); - } - }; - - -2. Generate the tests file: - - # cxxtestgen --error-printer -o tests.cpp MyTestSuite.h - -3. Compile and run! - - # g++ -o main tests.cpp - # ./main - Running cxxtest tests (1 test).OK! - diff --git a/noarch/lib/py/cxxtest/Versions b/noarch/lib/py/cxxtest/Versions deleted file mode 100644 index 89fe0761..00000000 --- a/noarch/lib/py/cxxtest/Versions +++ /dev/null @@ -1,192 +0,0 @@ - -CxxTest Releases ----------------- - -* Version 4.4 (2014-06-03) - - Fixed compilation error on Windows (MSVC) in XmlFormatter.h (#86) - - Fix to ensure that tearDown() is called (#89) - - Add option run test with a user defined command in scons (#91) - - Use a Python path relative to the cxxtestgen script (#88) - - Add defensive guard in ErrorFormatter.h (#96) - - Fixed bug with "None" appearing in CXXTEST_CPPATH (#99) - - Added CXXTEST_LIBPATH to properly use shared libraries (#100) - - Added guards when XmlFormatter.h data is not initialize (#87) - -* Version 4.3 (2013-07-05) - - Changes to assess code coverage of the cxxtestgen command - - Standardizing C++ file formats (using astyle) - - Bug fixes that led to the test runner hanging - - Adding special assertions for floating point values - - Added date to XML output - - Added support for comparison of C strings - -* Version 4.2.1 (2013-03-22) - - Fixing documentation of LGPL version - -* Version 4.2 (2013-03-16) - - Changes to support test fixtures in namespaces - - Adding logic to support test skipping - - Change to create self-contained HTML documentation - - Fixed inheritance issue in GlobalFixture (#69) - - Update LGPL version - - Changes to try/catch to avoid ambiguities withn catching std::exception (#53) - - Fixed TS_ASSERT_DELTA to work on integer types (#65) - - Changed output format to print world-name (#70) - -* Version 4.1 (2012-11-30) - - Added absolute paths to resolve bug when relative path links are provided. - - Bug fix when files contain unicode characters - - Fix for --no-static-init: Changed how non-static tests are created - - Updated user guide to include SCons build system - - Closing out Tigris and SourceForge tickets - - Added valgrind tests. - -* Version 4.0.3 (2012-01-07) - - Adding support for Python 2.4 - 3.2 - - Various cleanup of CxxTest root directory - - Adding patch that allows the cxxtestgen script to be used when symlinked. - -* Version 4.0.2 (2012-01-02) - - Bug fix to enable installation of cxxtestgen without the 'setuptools' package - -* Version 4.0.1 (2012-01-01) - - Documentation updates - - Bug fix for installation of cxxtestgen script - -* Version 4.0 (2011-12-28) - - Perl is no longer used to support CxxTest scripts. Python is now the only scripting language used by CxxTest. - - The testing scripts have been rewritten using the PyUnit framework. - - The installation process for CxxTest now leverages and integrates with the system Python installation. - - A more comprehensive C++ parser is now available, which supports testing of templates. - - The CxxTest GUI is no longer supported. - - The <> and <> macros have the same behavior now. - - CxxTest runners now have a command-line interface that facilitates interactive use of the test runner. - - A new user guide is now available in PDF, HTML and Ebook formats. - -* Version 3.10.1 (2004-12-01) - - Improved support for VC7 - - Fixed clash with some versions of STL - -* Version 3.10.0 (2004-11-20) - - Added mock framework for global functions - - Added TS_ASSERT_THROWS_ASSERT and TS_ASSERT_THROWS_EQUALS - - Added CXXTEST_ENUM_TRAITS - - Improved support for STL classes (vector, map etc.) - - Added support for Digital Mars compiler - - Reduced root/part compilation time and binary size - - Support C++-style commenting of tests - -* Version 3.9.1 (2004-01-19) - - Fixed small bug with runner exit code - - Embedded test suites are now deprecated - -* Version 3.9.0 (2004-01-17) - - Added TS_TRACE - - Added --no-static-init - - CxxTest::setAbortTestOnFail() works even without --abort-on-fail - -* Version 3.8.5 (2004-01-08) - - Added --no-eh - - Added CxxTest::setAbortTestOnFail() and CXXTEST_DEFAULT_ABORT - - Added CxxTest::setMaxDumpSize() - - Added StdioFilePrinter - -* Version 3.8.4 (2003-12-31) - - Split distribution into cxxtest and cxxtest-selftest - - Added `sample/msvc/FixFiles.bat' - -* Version 3.8.3 (2003-12-24) - - Added TS_ASSERT_PREDICATE - - Template files can now specify where to insert the preamble - - Added a sample Visual Studio workspace in `sample/msvc' - - Can compile in MSVC with warning level 4 - - Changed output format slightly - -* Version 3.8.1 (2003-12-21) - - Fixed small bug when using multiple --part files. - - Fixed X11 GUI crash when there's no X server. - - Added GlobalFixture::setUpWorld()/tearDownWorld() - - Added leaveOnly(), activateAllTests() and `sample/only.tpl' - - Should now run without warnings on Sun compiler. - -* Version 3.8.0 (2003-12-13) - - Fixed bug where `Root.cpp' needed exception handling - - Added TS_ASSERT_RELATION - - TSM_ macros now also tell you what went wrong - - Renamed Win32Gui::free() to avoid clashes - - Now compatible with more versions of Borland compiler - - Improved the documentation - -* Version 3.7.1 (2003-09-29) - - Added --version - - Compiles with even more exotic g++ warnings - - Win32 Gui compiles with UNICODE - - Should compile on some more platforms (Sun Forte, HP aCC) - -* Version 3.7.0 (2003-09-20) - - Added TS_ASSERT_LESS_THAN_EQUALS - - Minor cleanups - -* Version 3.6.1 (2003-09-15) - - Improved QT GUI - - Improved portability some more - -* Version 3.6.0 (2003-09-04) - - Added --longlong - - Some portability improvements - -* Version 3.5.1 (2003-09-03) - - Major internal rewrite of macros - - Added TS_ASSERT_SAME_DATA - - Added --include option - - Added --part and --root to enable splitting the test runner - - Added global fixtures - - Enhanced Win32 GUI with timers, -keep and -title - - Now compiles with strict warnings - -* Version 3.1.1 (2003-08-27) - - Fixed small bug in TS_ASSERT_THROWS_*() - -* Version 3.1.0 (2003-08-23) - - Default ValueTraits now dumps value as hex bytes - - Fixed double invocation bug (e.g. TS_FAIL(functionWithSideEffects())) - - TS_ASSERT_THROWS*() are now "abort on fail"-friendly - - Win32 GUI now supports Windows 98 and doesn't need comctl32.lib - -* Version 3.0.1 (2003-08-07) - - Added simple GUI for X11, Win32 and Qt - - Added TS_WARN() macro - - Removed --exit-code - - Improved samples - - Improved support for older (pre-std::) compilers - - Made a PDF version of the User's Guide - -* Version 2.8.4 (2003-07-21) - - Now supports g++-3.3 - - Added --have-eh - - Fixed bug in numberToString() - -* Version 2.8.3 (2003-06-30) - - Fixed bugs in cxxtestgen.pl - - Fixed warning for some compilers in ErrorPrinter/StdioPrinter - - Thanks Martin Jost for pointing out these problems! - -* Version 2.8.2 (2003-06-10) - - Fixed bug when using CXXTEST_ABORT_TEST_ON_FAIL without standard library - - Added CXXTEST_USER_TRAITS - - Added --abort-on-fail - -* Version 2.8.1 (2003-01-16) - - Fixed charToString() for negative chars - -* Version 2.8.0 (2003-01-13) - - Added CXXTEST_ABORT_TEST_ON_FAIL for xUnit-like behaviour - - Added `sample/winddk' - - Improved ValueTraits - - Improved output formatter - - Started version history - -* Version 2.7.0 (2002-09-29) - - Added embedded test suites - - Major internal improvements - diff --git a/noarch/lib/py/cxxtest/admin/announcement b/noarch/lib/py/cxxtest/admin/announcement deleted file mode 100644 index 65b4d039..00000000 --- a/noarch/lib/py/cxxtest/admin/announcement +++ /dev/null @@ -1,19 +0,0 @@ -We are pleased to announce the updated release of CxxTest 4.4. CxxTest is a unit testing framework for C++ that is similar in spirit to JUnit, CppUnit, and xUnit. CxxTest is easy to use because it does not require precompiling a CxxTest testing library, it employs no advanced features of C++ (e.g. RTTI) and it supports a very flexible form of test discovery. - -This release includes a variety of bug fixes: - - - Fixed compilation error on Windows (MSVC) in XmlFormatter.h (#86) - - Fix to ensure that tearDown() is called (#89) - - Add option run test with a user defined command in scons (#91) - - Use a Python path relative to the cxxtestgen script (#88) - - Add defensive guard in ErrorFormatter.h (#96) - - Fixed bug with "None" appearing in CXXTEST_CPPATH (#99) - - Added CXXTEST_LIBPATH to properly use shared libraries (#100) - - Added guards when XmlFormatter.h data is not initialize (#87) - -See the CxxTest Home Page (http://cxxtest.com) for documentation and download instructions. - -Enjoy! - - CxxTest Developer Team - cxxtest-developers@googlegroups.com diff --git a/noarch/lib/py/cxxtest/admin/cloudbees_cxxtest b/noarch/lib/py/cxxtest/admin/cloudbees_cxxtest deleted file mode 100644 index 49a21499..00000000 --- a/noarch/lib/py/cxxtest/admin/cloudbees_cxxtest +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash - -export PATH=$WORKSPACE/vpython/bin:$PATH -g++ --version - -# Setup virtual Python environment -\rm -Rf vpython -python cxxtest/admin/virtualenv.py vpython -#vpy/scripts/vpy_install -vpython/bin/easy_install nose -vpython/bin/easy_install unittest2 -vpython/bin/easy_install ply -vpython/bin/easy_install ordereddict -vpython/bin/easy_install gcovr -vpython/bin/easy_install pyutilib.th -cd cxxtest/python -../../vpython/bin/python setup.py install - -# Cleanup test directory -cd ../test -make clean -cd ../.. - -# Run tests -#export CXXTEST_GCOV_FLAGS='-fprofile-arcs -ftest-coverage' -vpython/bin/nosetests --verbosity=2 --with-xunit --xunit-file=$WORKSPACE/TEST-cxxtest.xml -w $WORKSPACE/cxxtest/test - -# Generate code coverage -#cd cxxtest -#../vpython/bin/gcovr -v -r $WORKSPACE/cxxtest -x -o $WORKSPACE/cxxtest/test/coverage.xml --gcov-filter '.*#test#(\.\.|\^)#cxxtest#.*gcov' - -echo "DONE" - -# Cleanup old gcov files -cd $WORKSPACE -#\rm -f *.gcov cxxtest/*.gcov doc/*.gcov doc/examples/*.gcov -#\rm -f *.gcno cxxtest/*.gcno doc/*.gcno doc/examples/*.gcno -#\rm -f *.gcda cxxtest/*.gcda doc/*.gcda doc/examples/*.gcda -cd $WORKSPACE/cxxtest/test -make clean - diff --git a/noarch/lib/py/cxxtest/admin/cxxtest.spec b/noarch/lib/py/cxxtest/admin/cxxtest.spec deleted file mode 100644 index b25f135a..00000000 --- a/noarch/lib/py/cxxtest/admin/cxxtest.spec +++ /dev/null @@ -1,37 +0,0 @@ -Name: cxxtest -Summary: CxxTest Testing Framework for C++ -Version: %{version} -Release: 1 -Copyright: LGPL -Group: Development/C++ -Source: cxxtest-%{version}.tar.gz -BuildRoot: /tmp/cxxtest-build -BuildArch: noarch -Prefix: /usr - -%description -CxxTest is a unit testing framework for C++ that is similar in -spirit to JUnit, CppUnit, and xUnit. CxxTest is easy to use because -it does not require precompiling a CxxTest testing library, it -employs no advanced features of C++ (e.g. RTTI) and it supports a -very flexible form of test discovery. - -%prep -%setup -n cxxtest - -%build - -%install -install -m 755 -d $RPM_BUILD_ROOT/usr/bin $RPM_BUILD_ROOT/usr/include/cxxtest -install -m 755 bin/cxxtestgen $RPM_BUILD_ROOT/usr/bin/ -install -m 644 cxxtest/* $RPM_BUILD_ROOT/usr/include/cxxtest/ - -%clean -rm -rf $RPM_BUILD_ROOT - -%files -%attr(-, root, root) %doc README -%attr(-, root, root) %doc sample -%attr(-, root, root) /usr/include/cxxtest -%attr(-, root, root) /usr/bin/cxxtestgen - diff --git a/noarch/lib/py/cxxtest/admin/jenkins_cxxtest b/noarch/lib/py/cxxtest/admin/jenkins_cxxtest deleted file mode 100644 index 552924cf..00000000 --- a/noarch/lib/py/cxxtest/admin/jenkins_cxxtest +++ /dev/null @@ -1,85 +0,0 @@ -#!/bin/bash - -if test -z "$WORKSPACE"; then - echo "ERROR: \$WORKSPACE not defined" - exit 1 -fi -export PATH="$WORKSPACE/vpython/bin:$PATH" - -if test -n "$1"; then - PYTHON="$1" -else - PYTHON=python -fi - -echo -echo "Building on `hostname`:" -echo -echo " Workspace: ${WORKSPACE}" -echo -echo " Package: ${PACKAGE}" -echo -echo " Environment:" -/usr/bin/env 2>&1 | sort | sed 's/^/ /' -echo -echo " Python:" -${PYTHON} -c 'import sys; sys.stdout.write(sys.version+"\n")' 2>&1 \ - | sed 's/^/ /' -PYTHON_VER=`${PYTHON} -c 'import sys; sys.stdout.write(str(sys.version_info[0]))'` -echo -# The following executables are required (missing app yields build failure) -for app in gcc; do -which $app || exit 1 -echo " $app:" -$app --version 2>&1 | grep -v '^$' | sed 's/^/ /' || exit 1 -echo -done - - -# Setup virtual Python environment -\rm -Rf vpython -tmp=2.6 -if [ "yes" = "$(echo | awk "($PYTHON_VER < $tmp) { print \"yes\"; }")" ]; then - "$PYTHON" "$WORKSPACE"/cxxtest/admin/virtualenv_1.7.py "$WORKSPACE"/vpython || exit 1 -else - "$PYTHON" "$WORKSPACE"/cxxtest/admin/virtualenv.py "$WORKSPACE"/vpython || exit 1 -fi -vpython/bin/easy_install nose -if test "$PYTHON_VER" -gt 2; then - vpython/bin/easy_install unittest2py3k - #vpython/bin/pip install unittest2py3k -else - vpython/bin/easy_install unittest2 -fi -vpython/bin/easy_install ply -vpython/bin/easy_install ordereddict -vpython/bin/easy_install gcovr -vpython/bin/easy_install coverage -vpython/bin/easy_install pyutilib.th -cd "$WORKSPACE"/cxxtest/python -"$WORKSPACE"/vpython/bin/python setup.py develop - -# Cleanup test directories -cd "$WORKSPACE"/cxxtest/test -make clean -cd "$WORKSPACE"/cxxtest/doc -make clean -cd "$WORKSPACE" - -# Run tests -export CXXTEST_GCOV_FLAGS='-fprofile-arcs -ftest-coverage' -vpython/bin/nosetests --verbosity=2 -w "$WORKSPACE"/cxxtest \ - --with-coverage --with-xunit --xunit-file="$WORKSPACE"/TEST-cxxtest.xml \ - || echo "(INFO) nosetests returned non-zero return code" - -# Generate Python code coverage -vpython/bin/coverage xml --omit="$WORKSPACE/vpython/lib/*,$WORKSPACE/cxxtest/test/*,$WORKSPACE/cxxtest/doc/examples/*" -o $WORKSPACE/cxxtest/test/coverage.xml - -# Generate C++ code coverage -cd "$WORKSPACE"/cxxtest -"$WORKSPACE"/vpython/bin/gcovr -v -d -r "$WORKSPACE"/cxxtest \ - -x -o "$WORKSPACE"/cxxtest/coverage.xml \ - --gcov-filter '.*#test#(\.\.|\^)#cxxtest#.*gcov' - -echo "DONE" - diff --git a/noarch/lib/py/cxxtest/admin/virtualenv.py b/noarch/lib/py/cxxtest/admin/virtualenv.py deleted file mode 100644 index ccb6eec9..00000000 --- a/noarch/lib/py/cxxtest/admin/virtualenv.py +++ /dev/null @@ -1,2581 +0,0 @@ -#!/usr/bin/env python -"""Create a "virtual" Python installation -""" - -# If you change the version here, change it in setup.py -# and docs/conf.py as well. -__version__ = "1.9.1" # following best practices -virtualenv_version = __version__ # legacy, again - -import base64 -import sys -import os -import codecs -import optparse -import re -import shutil -import logging -import tempfile -import zlib -import errno -import glob -import distutils.sysconfig -from distutils.util import strtobool -import struct -import subprocess - -if sys.version_info < (2, 5): - print('ERROR: %s' % sys.exc_info()[1]) - print('ERROR: this script requires Python 2.5 or greater.') - sys.exit(101) - -try: - set -except NameError: - from sets import Set as set -try: - basestring -except NameError: - basestring = str - -try: - import ConfigParser -except ImportError: - import configparser as ConfigParser - -join = os.path.join -py_version = 'python%s.%s' % (sys.version_info[0], sys.version_info[1]) - -is_jython = sys.platform.startswith('java') -is_pypy = hasattr(sys, 'pypy_version_info') -is_win = (sys.platform == 'win32') -is_cygwin = (sys.platform == 'cygwin') -is_darwin = (sys.platform == 'darwin') -abiflags = getattr(sys, 'abiflags', '') - -user_dir = os.path.expanduser('~') -if is_win: - default_storage_dir = os.path.join(user_dir, 'virtualenv') -else: - default_storage_dir = os.path.join(user_dir, '.virtualenv') -default_config_file = os.path.join(default_storage_dir, 'virtualenv.ini') - -if is_pypy: - expected_exe = 'pypy' -elif is_jython: - expected_exe = 'jython' -else: - expected_exe = 'python' - - -REQUIRED_MODULES = ['os', 'posix', 'posixpath', 'nt', 'ntpath', 'genericpath', - 'fnmatch', 'locale', 'encodings', 'codecs', - 'stat', 'UserDict', 'readline', 'copy_reg', 'types', - 're', 'sre', 'sre_parse', 'sre_constants', 'sre_compile', - 'zlib'] - -REQUIRED_FILES = ['lib-dynload', 'config'] - -majver, minver = sys.version_info[:2] -if majver == 2: - if minver >= 6: - REQUIRED_MODULES.extend(['warnings', 'linecache', '_abcoll', 'abc']) - if minver >= 7: - REQUIRED_MODULES.extend(['_weakrefset']) - if minver <= 3: - REQUIRED_MODULES.extend(['sets', '__future__']) -elif majver == 3: - # Some extra modules are needed for Python 3, but different ones - # for different versions. - REQUIRED_MODULES.extend(['_abcoll', 'warnings', 'linecache', 'abc', 'io', - '_weakrefset', 'copyreg', 'tempfile', 'random', - '__future__', 'collections', 'keyword', 'tarfile', - 'shutil', 'struct', 'copy', 'tokenize', 'token', - 'functools', 'heapq', 'bisect', 'weakref', - 'reprlib']) - if minver >= 2: - REQUIRED_FILES[-1] = 'config-%s' % majver - if minver == 3: - import sysconfig - platdir = sysconfig.get_config_var('PLATDIR') - REQUIRED_FILES.append(platdir) - # The whole list of 3.3 modules is reproduced below - the current - # uncommented ones are required for 3.3 as of now, but more may be - # added as 3.3 development continues. - REQUIRED_MODULES.extend([ - #"aifc", - #"antigravity", - #"argparse", - #"ast", - #"asynchat", - #"asyncore", - "base64", - #"bdb", - #"binhex", - #"bisect", - #"calendar", - #"cgi", - #"cgitb", - #"chunk", - #"cmd", - #"codeop", - #"code", - #"colorsys", - #"_compat_pickle", - #"compileall", - #"concurrent", - #"configparser", - #"contextlib", - #"cProfile", - #"crypt", - #"csv", - #"ctypes", - #"curses", - #"datetime", - #"dbm", - #"decimal", - #"difflib", - #"dis", - #"doctest", - #"dummy_threading", - "_dummy_thread", - #"email", - #"filecmp", - #"fileinput", - #"formatter", - #"fractions", - #"ftplib", - #"functools", - #"getopt", - #"getpass", - #"gettext", - #"glob", - #"gzip", - "hashlib", - #"heapq", - "hmac", - #"html", - #"http", - #"idlelib", - #"imaplib", - #"imghdr", - "imp", - "importlib", - #"inspect", - #"json", - #"lib2to3", - #"logging", - #"macpath", - #"macurl2path", - #"mailbox", - #"mailcap", - #"_markupbase", - #"mimetypes", - #"modulefinder", - #"multiprocessing", - #"netrc", - #"nntplib", - #"nturl2path", - #"numbers", - #"opcode", - #"optparse", - #"os2emxpath", - #"pdb", - #"pickle", - #"pickletools", - #"pipes", - #"pkgutil", - #"platform", - #"plat-linux2", - #"plistlib", - #"poplib", - #"pprint", - #"profile", - #"pstats", - #"pty", - #"pyclbr", - #"py_compile", - #"pydoc_data", - #"pydoc", - #"_pyio", - #"queue", - #"quopri", - #"reprlib", - "rlcompleter", - #"runpy", - #"sched", - #"shelve", - #"shlex", - #"smtpd", - #"smtplib", - #"sndhdr", - #"socket", - #"socketserver", - #"sqlite3", - #"ssl", - #"stringprep", - #"string", - #"_strptime", - #"subprocess", - #"sunau", - #"symbol", - #"symtable", - #"sysconfig", - #"tabnanny", - #"telnetlib", - #"test", - #"textwrap", - #"this", - #"_threading_local", - #"threading", - #"timeit", - #"tkinter", - #"tokenize", - #"token", - #"traceback", - #"trace", - #"tty", - #"turtledemo", - #"turtle", - #"unittest", - #"urllib", - #"uuid", - #"uu", - #"wave", - #"weakref", - #"webbrowser", - #"wsgiref", - #"xdrlib", - #"xml", - #"xmlrpc", - #"zipfile", - ]) - -if is_pypy: - # these are needed to correctly display the exceptions that may happen - # during the bootstrap - REQUIRED_MODULES.extend(['traceback', 'linecache']) - -class Logger(object): - - """ - Logging object for use in command-line script. Allows ranges of - levels, to avoid some redundancy of displayed information. - """ - - DEBUG = logging.DEBUG - INFO = logging.INFO - NOTIFY = (logging.INFO+logging.WARN)/2 - WARN = WARNING = logging.WARN - ERROR = logging.ERROR - FATAL = logging.FATAL - - LEVELS = [DEBUG, INFO, NOTIFY, WARN, ERROR, FATAL] - - def __init__(self, consumers): - self.consumers = consumers - self.indent = 0 - self.in_progress = None - self.in_progress_hanging = False - - def debug(self, msg, *args, **kw): - self.log(self.DEBUG, msg, *args, **kw) - def info(self, msg, *args, **kw): - self.log(self.INFO, msg, *args, **kw) - def notify(self, msg, *args, **kw): - self.log(self.NOTIFY, msg, *args, **kw) - def warn(self, msg, *args, **kw): - self.log(self.WARN, msg, *args, **kw) - def error(self, msg, *args, **kw): - self.log(self.ERROR, msg, *args, **kw) - def fatal(self, msg, *args, **kw): - self.log(self.FATAL, msg, *args, **kw) - def log(self, level, msg, *args, **kw): - if args: - if kw: - raise TypeError( - "You may give positional or keyword arguments, not both") - args = args or kw - rendered = None - for consumer_level, consumer in self.consumers: - if self.level_matches(level, consumer_level): - if (self.in_progress_hanging - and consumer in (sys.stdout, sys.stderr)): - self.in_progress_hanging = False - sys.stdout.write('\n') - sys.stdout.flush() - if rendered is None: - if args: - rendered = msg % args - else: - rendered = msg - rendered = ' '*self.indent + rendered - if hasattr(consumer, 'write'): - consumer.write(rendered+'\n') - else: - consumer(rendered) - - def start_progress(self, msg): - assert not self.in_progress, ( - "Tried to start_progress(%r) while in_progress %r" - % (msg, self.in_progress)) - if self.level_matches(self.NOTIFY, self._stdout_level()): - sys.stdout.write(msg) - sys.stdout.flush() - self.in_progress_hanging = True - else: - self.in_progress_hanging = False - self.in_progress = msg - - def end_progress(self, msg='done.'): - assert self.in_progress, ( - "Tried to end_progress without start_progress") - if self.stdout_level_matches(self.NOTIFY): - if not self.in_progress_hanging: - # Some message has been printed out since start_progress - sys.stdout.write('...' + self.in_progress + msg + '\n') - sys.stdout.flush() - else: - sys.stdout.write(msg + '\n') - sys.stdout.flush() - self.in_progress = None - self.in_progress_hanging = False - - def show_progress(self): - """If we are in a progress scope, and no log messages have been - shown, write out another '.'""" - if self.in_progress_hanging: - sys.stdout.write('.') - sys.stdout.flush() - - def stdout_level_matches(self, level): - """Returns true if a message at this level will go to stdout""" - return self.level_matches(level, self._stdout_level()) - - def _stdout_level(self): - """Returns the level that stdout runs at""" - for level, consumer in self.consumers: - if consumer is sys.stdout: - return level - return self.FATAL - - def level_matches(self, level, consumer_level): - """ - >>> l = Logger([]) - >>> l.level_matches(3, 4) - False - >>> l.level_matches(3, 2) - True - >>> l.level_matches(slice(None, 3), 3) - False - >>> l.level_matches(slice(None, 3), 2) - True - >>> l.level_matches(slice(1, 3), 1) - True - >>> l.level_matches(slice(2, 3), 1) - False - """ - if isinstance(level, slice): - start, stop = level.start, level.stop - if start is not None and start > consumer_level: - return False - if stop is not None and stop <= consumer_level: - return False - return True - else: - return level >= consumer_level - - #@classmethod - def level_for_integer(cls, level): - levels = cls.LEVELS - if level < 0: - return levels[0] - if level >= len(levels): - return levels[-1] - return levels[level] - - level_for_integer = classmethod(level_for_integer) - -# create a silent logger just to prevent this from being undefined -# will be overridden with requested verbosity main() is called. -logger = Logger([(Logger.LEVELS[-1], sys.stdout)]) - -def mkdir(path): - if not os.path.exists(path): - logger.info('Creating %s', path) - os.makedirs(path) - else: - logger.info('Directory %s already exists', path) - -def copyfileordir(src, dest): - if os.path.isdir(src): - shutil.copytree(src, dest, True) - else: - shutil.copy2(src, dest) - -def copyfile(src, dest, symlink=True): - if not os.path.exists(src): - # Some bad symlink in the src - logger.warn('Cannot find file %s (bad symlink)', src) - return - if os.path.exists(dest): - logger.debug('File %s already exists', dest) - return - if not os.path.exists(os.path.dirname(dest)): - logger.info('Creating parent directories for %s' % os.path.dirname(dest)) - os.makedirs(os.path.dirname(dest)) - if not os.path.islink(src): - srcpath = os.path.abspath(src) - else: - srcpath = os.readlink(src) - if symlink and hasattr(os, 'symlink') and not is_win: - logger.info('Symlinking %s', dest) - try: - os.symlink(srcpath, dest) - except (OSError, NotImplementedError): - logger.info('Symlinking failed, copying to %s', dest) - copyfileordir(src, dest) - else: - logger.info('Copying to %s', dest) - copyfileordir(src, dest) - -def writefile(dest, content, overwrite=True): - if not os.path.exists(dest): - logger.info('Writing %s', dest) - f = open(dest, 'wb') - f.write(content.encode('utf-8')) - f.close() - return - else: - f = open(dest, 'rb') - c = f.read() - f.close() - if c != content.encode("utf-8"): - if not overwrite: - logger.notify('File %s exists with different content; not overwriting', dest) - return - logger.notify('Overwriting %s with new content', dest) - f = open(dest, 'wb') - f.write(content.encode('utf-8')) - f.close() - else: - logger.info('Content %s already in place', dest) - -def rmtree(dir): - if os.path.exists(dir): - logger.notify('Deleting tree %s', dir) - shutil.rmtree(dir) - else: - logger.info('Do not need to delete %s; already gone', dir) - -def make_exe(fn): - if hasattr(os, 'chmod'): - oldmode = os.stat(fn).st_mode & 0xFFF # 0o7777 - newmode = (oldmode | 0x16D) & 0xFFF # 0o555, 0o7777 - os.chmod(fn, newmode) - logger.info('Changed mode of %s to %s', fn, oct(newmode)) - -def _find_file(filename, dirs): - for dir in reversed(dirs): - files = glob.glob(os.path.join(dir, filename)) - if files and os.path.isfile(files[0]): - return True, files[0] - return False, filename - -def _install_req(py_executable, unzip=False, distribute=False, - search_dirs=None, never_download=False): - - if search_dirs is None: - search_dirs = file_search_dirs() - - if not distribute: - egg_path = 'setuptools-*-py%s.egg' % sys.version[:3] - found, egg_path = _find_file(egg_path, search_dirs) - project_name = 'setuptools' - bootstrap_script = EZ_SETUP_PY - tgz_path = None - else: - # Look for a distribute egg (these are not distributed by default, - # but can be made available by the user) - egg_path = 'distribute-*-py%s.egg' % sys.version[:3] - found, egg_path = _find_file(egg_path, search_dirs) - project_name = 'distribute' - if found: - tgz_path = None - bootstrap_script = DISTRIBUTE_FROM_EGG_PY - else: - # Fall back to sdist - # NB: egg_path is not None iff tgz_path is None - # iff bootstrap_script is a generic setup script accepting - # the standard arguments. - egg_path = None - tgz_path = 'distribute-*.tar.gz' - found, tgz_path = _find_file(tgz_path, search_dirs) - bootstrap_script = DISTRIBUTE_SETUP_PY - - if is_jython and os._name == 'nt': - # Jython's .bat sys.executable can't handle a command line - # argument with newlines - fd, ez_setup = tempfile.mkstemp('.py') - os.write(fd, bootstrap_script) - os.close(fd) - cmd = [py_executable, ez_setup] - else: - cmd = [py_executable, '-c', bootstrap_script] - if unzip and egg_path: - cmd.append('--always-unzip') - env = {} - remove_from_env = ['__PYVENV_LAUNCHER__'] - if logger.stdout_level_matches(logger.DEBUG) and egg_path: - cmd.append('-v') - - old_chdir = os.getcwd() - if egg_path is not None and os.path.exists(egg_path): - logger.info('Using existing %s egg: %s' % (project_name, egg_path)) - cmd.append(egg_path) - if os.environ.get('PYTHONPATH'): - env['PYTHONPATH'] = egg_path + os.path.pathsep + os.environ['PYTHONPATH'] - else: - env['PYTHONPATH'] = egg_path - elif tgz_path is not None and os.path.exists(tgz_path): - # Found a tgz source dist, let's chdir - logger.info('Using existing %s egg: %s' % (project_name, tgz_path)) - os.chdir(os.path.dirname(tgz_path)) - # in this case, we want to be sure that PYTHONPATH is unset (not - # just empty, really unset), else CPython tries to import the - # site.py that it's in virtualenv_support - remove_from_env.append('PYTHONPATH') - elif never_download: - logger.fatal("Can't find any local distributions of %s to install " - "and --never-download is set. Either re-run virtualenv " - "without the --never-download option, or place a %s " - "distribution (%s) in one of these " - "locations: %r" % (project_name, project_name, - egg_path or tgz_path, - search_dirs)) - sys.exit(1) - elif egg_path: - logger.info('No %s egg found; downloading' % project_name) - cmd.extend(['--always-copy', '-U', project_name]) - else: - logger.info('No %s tgz found; downloading' % project_name) - logger.start_progress('Installing %s...' % project_name) - logger.indent += 2 - cwd = None - if project_name == 'distribute': - env['DONT_PATCH_SETUPTOOLS'] = 'true' - - def _filter_ez_setup(line): - return filter_ez_setup(line, project_name) - - if not os.access(os.getcwd(), os.W_OK): - cwd = tempfile.mkdtemp() - if tgz_path is not None and os.path.exists(tgz_path): - # the current working dir is hostile, let's copy the - # tarball to a temp dir - target = os.path.join(cwd, os.path.split(tgz_path)[-1]) - shutil.copy(tgz_path, target) - try: - call_subprocess(cmd, show_stdout=False, - filter_stdout=_filter_ez_setup, - extra_env=env, - remove_from_env=remove_from_env, - cwd=cwd) - finally: - logger.indent -= 2 - logger.end_progress() - if cwd is not None: - shutil.rmtree(cwd) - if os.getcwd() != old_chdir: - os.chdir(old_chdir) - if is_jython and os._name == 'nt': - os.remove(ez_setup) - -def file_search_dirs(): - here = os.path.dirname(os.path.abspath(__file__)) - dirs = ['.', here, - join(here, 'virtualenv_support')] - if os.path.splitext(os.path.dirname(__file__))[0] != 'virtualenv': - # Probably some boot script; just in case virtualenv is installed... - try: - import virtualenv - except ImportError: - pass - else: - dirs.append(os.path.join(os.path.dirname(virtualenv.__file__), 'virtualenv_support')) - return [d for d in dirs if os.path.isdir(d)] - -def install_setuptools(py_executable, unzip=False, - search_dirs=None, never_download=False): - _install_req(py_executable, unzip, - search_dirs=search_dirs, never_download=never_download) - -def install_distribute(py_executable, unzip=False, - search_dirs=None, never_download=False): - _install_req(py_executable, unzip, distribute=True, - search_dirs=search_dirs, never_download=never_download) - -_pip_re = re.compile(r'^pip-.*(zip|tar.gz|tar.bz2|tgz|tbz)$', re.I) -def install_pip(py_executable, search_dirs=None, never_download=False): - if search_dirs is None: - search_dirs = file_search_dirs() - - filenames = [] - for dir in search_dirs: - filenames.extend([join(dir, fn) for fn in os.listdir(dir) - if _pip_re.search(fn)]) - filenames = [(os.path.basename(filename).lower(), i, filename) for i, filename in enumerate(filenames)] - filenames.sort() - filenames = [filename for basename, i, filename in filenames] - if not filenames: - filename = 'pip' - else: - filename = filenames[-1] - easy_install_script = 'easy_install' - if is_win: - easy_install_script = 'easy_install-script.py' - # There's two subtle issues here when invoking easy_install. - # 1. On unix-like systems the easy_install script can *only* be executed - # directly if its full filesystem path is no longer than 78 characters. - # 2. A work around to [1] is to use the `python path/to/easy_install foo` - # pattern, but that breaks if the path contains non-ASCII characters, as - # you can't put the file encoding declaration before the shebang line. - # The solution is to use Python's -x flag to skip the first line of the - # script (and any ASCII decoding errors that may have occurred in that line) - cmd = [py_executable, '-x', join(os.path.dirname(py_executable), easy_install_script), filename] - # jython and pypy don't yet support -x - if is_jython or is_pypy: - cmd.remove('-x') - if filename == 'pip': - if never_download: - logger.fatal("Can't find any local distributions of pip to install " - "and --never-download is set. Either re-run virtualenv " - "without the --never-download option, or place a pip " - "source distribution (zip/tar.gz/tar.bz2) in one of these " - "locations: %r" % search_dirs) - sys.exit(1) - logger.info('Installing pip from network...') - else: - logger.info('Installing existing %s distribution: %s' % ( - os.path.basename(filename), filename)) - logger.start_progress('Installing pip...') - logger.indent += 2 - def _filter_setup(line): - return filter_ez_setup(line, 'pip') - try: - call_subprocess(cmd, show_stdout=False, - filter_stdout=_filter_setup) - finally: - logger.indent -= 2 - logger.end_progress() - -def filter_ez_setup(line, project_name='setuptools'): - if not line.strip(): - return Logger.DEBUG - if project_name == 'distribute': - for prefix in ('Extracting', 'Now working', 'Installing', 'Before', - 'Scanning', 'Setuptools', 'Egg', 'Already', - 'running', 'writing', 'reading', 'installing', - 'creating', 'copying', 'byte-compiling', 'removing', - 'Processing'): - if line.startswith(prefix): - return Logger.DEBUG - return Logger.DEBUG - for prefix in ['Reading ', 'Best match', 'Processing setuptools', - 'Copying setuptools', 'Adding setuptools', - 'Installing ', 'Installed ']: - if line.startswith(prefix): - return Logger.DEBUG - return Logger.INFO - - -class UpdatingDefaultsHelpFormatter(optparse.IndentedHelpFormatter): - """ - Custom help formatter for use in ConfigOptionParser that updates - the defaults before expanding them, allowing them to show up correctly - in the help listing - """ - def expand_default(self, option): - if self.parser is not None: - self.parser.update_defaults(self.parser.defaults) - return optparse.IndentedHelpFormatter.expand_default(self, option) - - -class ConfigOptionParser(optparse.OptionParser): - """ - Custom option parser which updates its defaults by by checking the - configuration files and environmental variables - """ - def __init__(self, *args, **kwargs): - self.config = ConfigParser.RawConfigParser() - self.files = self.get_config_files() - self.config.read(self.files) - optparse.OptionParser.__init__(self, *args, **kwargs) - - def get_config_files(self): - config_file = os.environ.get('VIRTUALENV_CONFIG_FILE', False) - if config_file and os.path.exists(config_file): - return [config_file] - return [default_config_file] - - def update_defaults(self, defaults): - """ - Updates the given defaults with values from the config files and - the environ. Does a little special handling for certain types of - options (lists). - """ - # Then go and look for the other sources of configuration: - config = {} - # 1. config files - config.update(dict(self.get_config_section('virtualenv'))) - # 2. environmental variables - config.update(dict(self.get_environ_vars())) - # Then set the options with those values - for key, val in config.items(): - key = key.replace('_', '-') - if not key.startswith('--'): - key = '--%s' % key # only prefer long opts - option = self.get_option(key) - if option is not None: - # ignore empty values - if not val: - continue - # handle multiline configs - if option.action == 'append': - val = val.split() - else: - option.nargs = 1 - if option.action == 'store_false': - val = not strtobool(val) - elif option.action in ('store_true', 'count'): - val = strtobool(val) - try: - val = option.convert_value(key, val) - except optparse.OptionValueError: - e = sys.exc_info()[1] - print("An error occured during configuration: %s" % e) - sys.exit(3) - defaults[option.dest] = val - return defaults - - def get_config_section(self, name): - """ - Get a section of a configuration - """ - if self.config.has_section(name): - return self.config.items(name) - return [] - - def get_environ_vars(self, prefix='VIRTUALENV_'): - """ - Returns a generator with all environmental vars with prefix VIRTUALENV - """ - for key, val in os.environ.items(): - if key.startswith(prefix): - yield (key.replace(prefix, '').lower(), val) - - def get_default_values(self): - """ - Overridding to make updating the defaults after instantiation of - the option parser possible, update_defaults() does the dirty work. - """ - if not self.process_default_values: - # Old, pre-Optik 1.5 behaviour. - return optparse.Values(self.defaults) - - defaults = self.update_defaults(self.defaults.copy()) # ours - for option in self._get_all_options(): - default = defaults.get(option.dest) - if isinstance(default, basestring): - opt_str = option.get_opt_string() - defaults[option.dest] = option.check_value(opt_str, default) - return optparse.Values(defaults) - - -def main(): - parser = ConfigOptionParser( - version=virtualenv_version, - usage="%prog [OPTIONS] DEST_DIR", - formatter=UpdatingDefaultsHelpFormatter()) - - parser.add_option( - '-v', '--verbose', - action='count', - dest='verbose', - default=0, - help="Increase verbosity") - - parser.add_option( - '-q', '--quiet', - action='count', - dest='quiet', - default=0, - help='Decrease verbosity') - - parser.add_option( - '-p', '--python', - dest='python', - metavar='PYTHON_EXE', - help='The Python interpreter to use, e.g., --python=python2.5 will use the python2.5 ' - 'interpreter to create the new environment. The default is the interpreter that ' - 'virtualenv was installed with (%s)' % sys.executable) - - parser.add_option( - '--clear', - dest='clear', - action='store_true', - help="Clear out the non-root install and start from scratch") - - parser.set_defaults(system_site_packages=False) - parser.add_option( - '--no-site-packages', - dest='system_site_packages', - action='store_false', - help="Don't give access to the global site-packages dir to the " - "virtual environment (default)") - - parser.add_option( - '--system-site-packages', - dest='system_site_packages', - action='store_true', - help="Give access to the global site-packages dir to the " - "virtual environment") - - parser.add_option( - '--unzip-setuptools', - dest='unzip_setuptools', - action='store_true', - help="Unzip Setuptools or Distribute when installing it") - - parser.add_option( - '--relocatable', - dest='relocatable', - action='store_true', - help='Make an EXISTING virtualenv environment relocatable. ' - 'This fixes up scripts and makes all .pth files relative') - - parser.add_option( - '--distribute', '--use-distribute', # the second option is for legacy reasons here. Hi Kenneth! - dest='use_distribute', - action='store_true', - help='Use Distribute instead of Setuptools. Set environ variable ' - 'VIRTUALENV_DISTRIBUTE to make it the default ') - - parser.add_option( - '--no-setuptools', - dest='no_setuptools', - action='store_true', - help='Do not install distribute/setuptools (or pip) ' - 'in the new virtualenv.') - - parser.add_option( - '--no-pip', - dest='no_pip', - action='store_true', - help='Do not install pip in the new virtualenv.') - - parser.add_option( - '--setuptools', - dest='use_distribute', - action='store_false', - help='Use Setuptools instead of Distribute. Set environ variable ' - 'VIRTUALENV_SETUPTOOLS to make it the default ') - - # Set this to True to use distribute by default, even in Python 2. - parser.set_defaults(use_distribute=False) - - default_search_dirs = file_search_dirs() - parser.add_option( - '--extra-search-dir', - dest="search_dirs", - action="append", - default=default_search_dirs, - help="Directory to look for setuptools/distribute/pip distributions in. " - "You can add any number of additional --extra-search-dir paths.") - - parser.add_option( - '--never-download', - dest="never_download", - action="store_true", - help="Never download anything from the network. Instead, virtualenv will fail " - "if local distributions of setuptools/distribute/pip are not present.") - - parser.add_option( - '--prompt', - dest='prompt', - help='Provides an alternative prompt prefix for this environment') - - if 'extend_parser' in globals(): - extend_parser(parser) - - options, args = parser.parse_args() - - global logger - - if 'adjust_options' in globals(): - adjust_options(options, args) - - verbosity = options.verbose - options.quiet - logger = Logger([(Logger.level_for_integer(2 - verbosity), sys.stdout)]) - - if options.python and not os.environ.get('VIRTUALENV_INTERPRETER_RUNNING'): - env = os.environ.copy() - interpreter = resolve_interpreter(options.python) - if interpreter == sys.executable: - logger.warn('Already using interpreter %s' % interpreter) - else: - logger.notify('Running virtualenv with interpreter %s' % interpreter) - env['VIRTUALENV_INTERPRETER_RUNNING'] = 'true' - file = __file__ - if file.endswith('.pyc'): - file = file[:-1] - popen = subprocess.Popen([interpreter, file] + sys.argv[1:], env=env) - raise SystemExit(popen.wait()) - - # Force --distribute on Python 3, since setuptools is not available. - if majver > 2: - options.use_distribute = True - - if os.environ.get('PYTHONDONTWRITEBYTECODE') and not options.use_distribute: - print( - "The PYTHONDONTWRITEBYTECODE environment variable is " - "not compatible with setuptools. Either use --distribute " - "or unset PYTHONDONTWRITEBYTECODE.") - sys.exit(2) - if not args: - print('You must provide a DEST_DIR') - parser.print_help() - sys.exit(2) - if len(args) > 1: - print('There must be only one argument: DEST_DIR (you gave %s)' % ( - ' '.join(args))) - parser.print_help() - sys.exit(2) - - home_dir = args[0] - - if os.environ.get('WORKING_ENV'): - logger.fatal('ERROR: you cannot run virtualenv while in a workingenv') - logger.fatal('Please deactivate your workingenv, then re-run this script') - sys.exit(3) - - if 'PYTHONHOME' in os.environ: - logger.warn('PYTHONHOME is set. You *must* activate the virtualenv before using it') - del os.environ['PYTHONHOME'] - - if options.relocatable: - make_environment_relocatable(home_dir) - return - - create_environment(home_dir, - site_packages=options.system_site_packages, - clear=options.clear, - unzip_setuptools=options.unzip_setuptools, - use_distribute=options.use_distribute, - prompt=options.prompt, - search_dirs=options.search_dirs, - never_download=options.never_download, - no_setuptools=options.no_setuptools, - no_pip=options.no_pip) - if 'after_install' in globals(): - after_install(options, home_dir) - -def call_subprocess(cmd, show_stdout=True, - filter_stdout=None, cwd=None, - raise_on_returncode=True, extra_env=None, - remove_from_env=None): - cmd_parts = [] - for part in cmd: - if len(part) > 45: - part = part[:20]+"..."+part[-20:] - if ' ' in part or '\n' in part or '"' in part or "'" in part: - part = '"%s"' % part.replace('"', '\\"') - if hasattr(part, 'decode'): - try: - part = part.decode(sys.getdefaultencoding()) - except UnicodeDecodeError: - part = part.decode(sys.getfilesystemencoding()) - cmd_parts.append(part) - cmd_desc = ' '.join(cmd_parts) - if show_stdout: - stdout = None - else: - stdout = subprocess.PIPE - logger.debug("Running command %s" % cmd_desc) - if extra_env or remove_from_env: - env = os.environ.copy() - if extra_env: - env.update(extra_env) - if remove_from_env: - for varname in remove_from_env: - env.pop(varname, None) - else: - env = None - try: - proc = subprocess.Popen( - cmd, stderr=subprocess.STDOUT, stdin=None, stdout=stdout, - cwd=cwd, env=env) - except Exception: - e = sys.exc_info()[1] - logger.fatal( - "Error %s while executing command %s" % (e, cmd_desc)) - raise - all_output = [] - if stdout is not None: - stdout = proc.stdout - encoding = sys.getdefaultencoding() - fs_encoding = sys.getfilesystemencoding() - while 1: - line = stdout.readline() - try: - line = line.decode(encoding) - except UnicodeDecodeError: - line = line.decode(fs_encoding) - if not line: - break - line = line.rstrip() - all_output.append(line) - if filter_stdout: - level = filter_stdout(line) - if isinstance(level, tuple): - level, line = level - logger.log(level, line) - if not logger.stdout_level_matches(level): - logger.show_progress() - else: - logger.info(line) - else: - proc.communicate() - proc.wait() - if proc.returncode: - if raise_on_returncode: - if all_output: - logger.notify('Complete output from command %s:' % cmd_desc) - logger.notify('\n'.join(all_output) + '\n----------------------------------------') - raise OSError( - "Command %s failed with error code %s" - % (cmd_desc, proc.returncode)) - else: - logger.warn( - "Command %s had error code %s" - % (cmd_desc, proc.returncode)) - - -def create_environment(home_dir, site_packages=False, clear=False, - unzip_setuptools=False, use_distribute=False, - prompt=None, search_dirs=None, never_download=False, - no_setuptools=False, no_pip=False): - """ - Creates a new environment in ``home_dir``. - - If ``site_packages`` is true, then the global ``site-packages/`` - directory will be on the path. - - If ``clear`` is true (default False) then the environment will - first be cleared. - """ - home_dir, lib_dir, inc_dir, bin_dir = path_locations(home_dir) - - py_executable = os.path.abspath(install_python( - home_dir, lib_dir, inc_dir, bin_dir, - site_packages=site_packages, clear=clear)) - - install_distutils(home_dir) - - if not no_setuptools: - if use_distribute: - install_distribute(py_executable, unzip=unzip_setuptools, - search_dirs=search_dirs, never_download=never_download) - else: - install_setuptools(py_executable, unzip=unzip_setuptools, - search_dirs=search_dirs, never_download=never_download) - - if not no_pip: - install_pip(py_executable, search_dirs=search_dirs, never_download=never_download) - - install_activate(home_dir, bin_dir, prompt) - -def is_executable_file(fpath): - return os.path.isfile(fpath) and os.access(fpath, os.X_OK) - -def path_locations(home_dir): - """Return the path locations for the environment (where libraries are, - where scripts go, etc)""" - # XXX: We'd use distutils.sysconfig.get_python_inc/lib but its - # prefix arg is broken: http://bugs.python.org/issue3386 - if is_win: - # Windows has lots of problems with executables with spaces in - # the name; this function will remove them (using the ~1 - # format): - mkdir(home_dir) - if ' ' in home_dir: - import ctypes - GetShortPathName = ctypes.windll.kernel32.GetShortPathNameW - size = max(len(home_dir)+1, 256) - buf = ctypes.create_unicode_buffer(size) - try: - u = unicode - except NameError: - u = str - ret = GetShortPathName(u(home_dir), buf, size) - if not ret: - print('Error: the path "%s" has a space in it' % home_dir) - print('We could not determine the short pathname for it.') - print('Exiting.') - sys.exit(3) - home_dir = str(buf.value) - lib_dir = join(home_dir, 'Lib') - inc_dir = join(home_dir, 'Include') - bin_dir = join(home_dir, 'Scripts') - if is_jython: - lib_dir = join(home_dir, 'Lib') - inc_dir = join(home_dir, 'Include') - bin_dir = join(home_dir, 'bin') - elif is_pypy: - lib_dir = home_dir - inc_dir = join(home_dir, 'include') - bin_dir = join(home_dir, 'bin') - elif not is_win: - lib_dir = join(home_dir, 'lib', py_version) - multiarch_exec = '/usr/bin/multiarch-platform' - if is_executable_file(multiarch_exec): - # In Mageia (2) and Mandriva distros the include dir must be like: - # virtualenv/include/multiarch-x86_64-linux/python2.7 - # instead of being virtualenv/include/python2.7 - p = subprocess.Popen(multiarch_exec, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - stdout, stderr = p.communicate() - # stdout.strip is needed to remove newline character - inc_dir = join(home_dir, 'include', stdout.strip(), py_version + abiflags) - else: - inc_dir = join(home_dir, 'include', py_version + abiflags) - bin_dir = join(home_dir, 'bin') - return home_dir, lib_dir, inc_dir, bin_dir - - -def change_prefix(filename, dst_prefix): - prefixes = [sys.prefix] - - if is_darwin: - prefixes.extend(( - os.path.join("/Library/Python", sys.version[:3], "site-packages"), - os.path.join(sys.prefix, "Extras", "lib", "python"), - os.path.join("~", "Library", "Python", sys.version[:3], "site-packages"), - # Python 2.6 no-frameworks - os.path.join("~", ".local", "lib","python", sys.version[:3], "site-packages"), - # System Python 2.7 on OSX Mountain Lion - os.path.join("~", "Library", "Python", sys.version[:3], "lib", "python", "site-packages"))) - - if hasattr(sys, 'real_prefix'): - prefixes.append(sys.real_prefix) - if hasattr(sys, 'base_prefix'): - prefixes.append(sys.base_prefix) - prefixes = list(map(os.path.expanduser, prefixes)) - prefixes = list(map(os.path.abspath, prefixes)) - # Check longer prefixes first so we don't split in the middle of a filename - prefixes = sorted(prefixes, key=len, reverse=True) - filename = os.path.abspath(filename) - for src_prefix in prefixes: - if filename.startswith(src_prefix): - _, relpath = filename.split(src_prefix, 1) - if src_prefix != os.sep: # sys.prefix == "/" - assert relpath[0] == os.sep - relpath = relpath[1:] - return join(dst_prefix, relpath) - assert False, "Filename %s does not start with any of these prefixes: %s" % \ - (filename, prefixes) - -def copy_required_modules(dst_prefix): - import imp - # If we are running under -p, we need to remove the current - # directory from sys.path temporarily here, so that we - # definitely get the modules from the site directory of - # the interpreter we are running under, not the one - # virtualenv.py is installed under (which might lead to py2/py3 - # incompatibility issues) - _prev_sys_path = sys.path - if os.environ.get('VIRTUALENV_INTERPRETER_RUNNING'): - sys.path = sys.path[1:] - try: - for modname in REQUIRED_MODULES: - if modname in sys.builtin_module_names: - logger.info("Ignoring built-in bootstrap module: %s" % modname) - continue - try: - f, filename, _ = imp.find_module(modname) - except ImportError: - logger.info("Cannot import bootstrap module: %s" % modname) - else: - if f is not None: - f.close() - # special-case custom readline.so on OS X, but not for pypy: - if modname == 'readline' and sys.platform == 'darwin' and not ( - is_pypy or filename.endswith(join('lib-dynload', 'readline.so'))): - dst_filename = join(dst_prefix, 'lib', 'python%s' % sys.version[:3], 'readline.so') - else: - dst_filename = change_prefix(filename, dst_prefix) - copyfile(filename, dst_filename) - if filename.endswith('.pyc'): - pyfile = filename[:-1] - if os.path.exists(pyfile): - copyfile(pyfile, dst_filename[:-1]) - finally: - sys.path = _prev_sys_path - - -def subst_path(prefix_path, prefix, home_dir): - prefix_path = os.path.normpath(prefix_path) - prefix = os.path.normpath(prefix) - home_dir = os.path.normpath(home_dir) - if not prefix_path.startswith(prefix): - logger.warn('Path not in prefix %r %r', prefix_path, prefix) - return - return prefix_path.replace(prefix, home_dir, 1) - - -def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear): - """Install just the base environment, no distutils patches etc""" - if sys.executable.startswith(bin_dir): - print('Please use the *system* python to run this script') - return - - if clear: - rmtree(lib_dir) - ## FIXME: why not delete it? - ## Maybe it should delete everything with #!/path/to/venv/python in it - logger.notify('Not deleting %s', bin_dir) - - if hasattr(sys, 'real_prefix'): - logger.notify('Using real prefix %r' % sys.real_prefix) - prefix = sys.real_prefix - elif hasattr(sys, 'base_prefix'): - logger.notify('Using base prefix %r' % sys.base_prefix) - prefix = sys.base_prefix - else: - prefix = sys.prefix - mkdir(lib_dir) - fix_lib64(lib_dir) - stdlib_dirs = [os.path.dirname(os.__file__)] - if is_win: - stdlib_dirs.append(join(os.path.dirname(stdlib_dirs[0]), 'DLLs')) - elif is_darwin: - stdlib_dirs.append(join(stdlib_dirs[0], 'site-packages')) - if hasattr(os, 'symlink'): - logger.info('Symlinking Python bootstrap modules') - else: - logger.info('Copying Python bootstrap modules') - logger.indent += 2 - try: - # copy required files... - for stdlib_dir in stdlib_dirs: - if not os.path.isdir(stdlib_dir): - continue - for fn in os.listdir(stdlib_dir): - bn = os.path.splitext(fn)[0] - if fn != 'site-packages' and bn in REQUIRED_FILES: - copyfile(join(stdlib_dir, fn), join(lib_dir, fn)) - # ...and modules - copy_required_modules(home_dir) - finally: - logger.indent -= 2 - mkdir(join(lib_dir, 'site-packages')) - import site - site_filename = site.__file__ - if site_filename.endswith('.pyc'): - site_filename = site_filename[:-1] - elif site_filename.endswith('$py.class'): - site_filename = site_filename.replace('$py.class', '.py') - site_filename_dst = change_prefix(site_filename, home_dir) - site_dir = os.path.dirname(site_filename_dst) - writefile(site_filename_dst, SITE_PY) - writefile(join(site_dir, 'orig-prefix.txt'), prefix) - site_packages_filename = join(site_dir, 'no-global-site-packages.txt') - if not site_packages: - writefile(site_packages_filename, '') - - if is_pypy or is_win: - stdinc_dir = join(prefix, 'include') - else: - stdinc_dir = join(prefix, 'include', py_version + abiflags) - if os.path.exists(stdinc_dir): - copyfile(stdinc_dir, inc_dir) - else: - logger.debug('No include dir %s' % stdinc_dir) - - platinc_dir = distutils.sysconfig.get_python_inc(plat_specific=1) - if platinc_dir != stdinc_dir: - platinc_dest = distutils.sysconfig.get_python_inc( - plat_specific=1, prefix=home_dir) - if platinc_dir == platinc_dest: - # Do platinc_dest manually due to a CPython bug; - # not http://bugs.python.org/issue3386 but a close cousin - platinc_dest = subst_path(platinc_dir, prefix, home_dir) - if platinc_dest: - # PyPy's stdinc_dir and prefix are relative to the original binary - # (traversing virtualenvs), whereas the platinc_dir is relative to - # the inner virtualenv and ignores the prefix argument. - # This seems more evolved than designed. - copyfile(platinc_dir, platinc_dest) - - # pypy never uses exec_prefix, just ignore it - if sys.exec_prefix != prefix and not is_pypy: - if is_win: - exec_dir = join(sys.exec_prefix, 'lib') - elif is_jython: - exec_dir = join(sys.exec_prefix, 'Lib') - else: - exec_dir = join(sys.exec_prefix, 'lib', py_version) - for fn in os.listdir(exec_dir): - copyfile(join(exec_dir, fn), join(lib_dir, fn)) - - if is_jython: - # Jython has either jython-dev.jar and javalib/ dir, or just - # jython.jar - for name in 'jython-dev.jar', 'javalib', 'jython.jar': - src = join(prefix, name) - if os.path.exists(src): - copyfile(src, join(home_dir, name)) - # XXX: registry should always exist after Jython 2.5rc1 - src = join(prefix, 'registry') - if os.path.exists(src): - copyfile(src, join(home_dir, 'registry'), symlink=False) - copyfile(join(prefix, 'cachedir'), join(home_dir, 'cachedir'), - symlink=False) - - mkdir(bin_dir) - py_executable = join(bin_dir, os.path.basename(sys.executable)) - if 'Python.framework' in prefix: - # OS X framework builds cause validation to break - # https://github.com/pypa/virtualenv/issues/322 - if os.environ.get('__PYVENV_LAUNCHER__'): - os.unsetenv('__PYVENV_LAUNCHER__') - if re.search(r'/Python(?:-32|-64)*$', py_executable): - # The name of the python executable is not quite what - # we want, rename it. - py_executable = os.path.join( - os.path.dirname(py_executable), 'python') - - logger.notify('New %s executable in %s', expected_exe, py_executable) - pcbuild_dir = os.path.dirname(sys.executable) - pyd_pth = os.path.join(lib_dir, 'site-packages', 'virtualenv_builddir_pyd.pth') - if is_win and os.path.exists(os.path.join(pcbuild_dir, 'build.bat')): - logger.notify('Detected python running from build directory %s', pcbuild_dir) - logger.notify('Writing .pth file linking to build directory for *.pyd files') - writefile(pyd_pth, pcbuild_dir) - else: - pcbuild_dir = None - if os.path.exists(pyd_pth): - logger.info('Deleting %s (not Windows env or not build directory python)' % pyd_pth) - os.unlink(pyd_pth) - - if sys.executable != py_executable: - ## FIXME: could I just hard link? - executable = sys.executable - shutil.copyfile(executable, py_executable) - make_exe(py_executable) - if is_win or is_cygwin: - pythonw = os.path.join(os.path.dirname(sys.executable), 'pythonw.exe') - if os.path.exists(pythonw): - logger.info('Also created pythonw.exe') - shutil.copyfile(pythonw, os.path.join(os.path.dirname(py_executable), 'pythonw.exe')) - python_d = os.path.join(os.path.dirname(sys.executable), 'python_d.exe') - python_d_dest = os.path.join(os.path.dirname(py_executable), 'python_d.exe') - if os.path.exists(python_d): - logger.info('Also created python_d.exe') - shutil.copyfile(python_d, python_d_dest) - elif os.path.exists(python_d_dest): - logger.info('Removed python_d.exe as it is no longer at the source') - os.unlink(python_d_dest) - # we need to copy the DLL to enforce that windows will load the correct one. - # may not exist if we are cygwin. - py_executable_dll = 'python%s%s.dll' % ( - sys.version_info[0], sys.version_info[1]) - py_executable_dll_d = 'python%s%s_d.dll' % ( - sys.version_info[0], sys.version_info[1]) - pythondll = os.path.join(os.path.dirname(sys.executable), py_executable_dll) - pythondll_d = os.path.join(os.path.dirname(sys.executable), py_executable_dll_d) - pythondll_d_dest = os.path.join(os.path.dirname(py_executable), py_executable_dll_d) - if os.path.exists(pythondll): - logger.info('Also created %s' % py_executable_dll) - shutil.copyfile(pythondll, os.path.join(os.path.dirname(py_executable), py_executable_dll)) - if os.path.exists(pythondll_d): - logger.info('Also created %s' % py_executable_dll_d) - shutil.copyfile(pythondll_d, pythondll_d_dest) - elif os.path.exists(pythondll_d_dest): - logger.info('Removed %s as the source does not exist' % pythondll_d_dest) - os.unlink(pythondll_d_dest) - if is_pypy: - # make a symlink python --> pypy-c - python_executable = os.path.join(os.path.dirname(py_executable), 'python') - if sys.platform in ('win32', 'cygwin'): - python_executable += '.exe' - logger.info('Also created executable %s' % python_executable) - copyfile(py_executable, python_executable) - - if is_win: - for name in 'libexpat.dll', 'libpypy.dll', 'libpypy-c.dll', 'libeay32.dll', 'ssleay32.dll', 'sqlite.dll': - src = join(prefix, name) - if os.path.exists(src): - copyfile(src, join(bin_dir, name)) - - if os.path.splitext(os.path.basename(py_executable))[0] != expected_exe: - secondary_exe = os.path.join(os.path.dirname(py_executable), - expected_exe) - py_executable_ext = os.path.splitext(py_executable)[1] - if py_executable_ext == '.exe': - # python2.4 gives an extension of '.4' :P - secondary_exe += py_executable_ext - if os.path.exists(secondary_exe): - logger.warn('Not overwriting existing %s script %s (you must use %s)' - % (expected_exe, secondary_exe, py_executable)) - else: - logger.notify('Also creating executable in %s' % secondary_exe) - shutil.copyfile(sys.executable, secondary_exe) - make_exe(secondary_exe) - - if '.framework' in prefix: - if 'Python.framework' in prefix: - logger.debug('MacOSX Python framework detected') - # Make sure we use the the embedded interpreter inside - # the framework, even if sys.executable points to - # the stub executable in ${sys.prefix}/bin - # See http://groups.google.com/group/python-virtualenv/ - # browse_thread/thread/17cab2f85da75951 - original_python = os.path.join( - prefix, 'Resources/Python.app/Contents/MacOS/Python') - if 'EPD' in prefix: - logger.debug('EPD framework detected') - original_python = os.path.join(prefix, 'bin/python') - shutil.copy(original_python, py_executable) - - # Copy the framework's dylib into the virtual - # environment - virtual_lib = os.path.join(home_dir, '.Python') - - if os.path.exists(virtual_lib): - os.unlink(virtual_lib) - copyfile( - os.path.join(prefix, 'Python'), - virtual_lib) - - # And then change the install_name of the copied python executable - try: - mach_o_change(py_executable, - os.path.join(prefix, 'Python'), - '@executable_path/../.Python') - except: - e = sys.exc_info()[1] - logger.warn("Could not call mach_o_change: %s. " - "Trying to call install_name_tool instead." % e) - try: - call_subprocess( - ["install_name_tool", "-change", - os.path.join(prefix, 'Python'), - '@executable_path/../.Python', - py_executable]) - except: - logger.fatal("Could not call install_name_tool -- you must " - "have Apple's development tools installed") - raise - - if not is_win: - # Ensure that 'python', 'pythonX' and 'pythonX.Y' all exist - py_exe_version_major = 'python%s' % sys.version_info[0] - py_exe_version_major_minor = 'python%s.%s' % ( - sys.version_info[0], sys.version_info[1]) - py_exe_no_version = 'python' - required_symlinks = [ py_exe_no_version, py_exe_version_major, - py_exe_version_major_minor ] - - py_executable_base = os.path.basename(py_executable) - - if py_executable_base in required_symlinks: - # Don't try to symlink to yourself. - required_symlinks.remove(py_executable_base) - - for pth in required_symlinks: - full_pth = join(bin_dir, pth) - if os.path.exists(full_pth): - os.unlink(full_pth) - os.symlink(py_executable_base, full_pth) - - if is_win and ' ' in py_executable: - # There's a bug with subprocess on Windows when using a first - # argument that has a space in it. Instead we have to quote - # the value: - py_executable = '"%s"' % py_executable - # NOTE: keep this check as one line, cmd.exe doesn't cope with line breaks - cmd = [py_executable, '-c', 'import sys;out=sys.stdout;' - 'getattr(out, "buffer", out).write(sys.prefix.encode("utf-8"))'] - logger.info('Testing executable with %s %s "%s"' % tuple(cmd)) - try: - proc = subprocess.Popen(cmd, - stdout=subprocess.PIPE) - proc_stdout, proc_stderr = proc.communicate() - except OSError: - e = sys.exc_info()[1] - if e.errno == errno.EACCES: - logger.fatal('ERROR: The executable %s could not be run: %s' % (py_executable, e)) - sys.exit(100) - else: - raise e - - proc_stdout = proc_stdout.strip().decode("utf-8") - proc_stdout = os.path.normcase(os.path.abspath(proc_stdout)) - norm_home_dir = os.path.normcase(os.path.abspath(home_dir)) - if hasattr(norm_home_dir, 'decode'): - norm_home_dir = norm_home_dir.decode(sys.getfilesystemencoding()) - if proc_stdout != norm_home_dir: - logger.fatal( - 'ERROR: The executable %s is not functioning' % py_executable) - logger.fatal( - 'ERROR: It thinks sys.prefix is %r (should be %r)' - % (proc_stdout, norm_home_dir)) - logger.fatal( - 'ERROR: virtualenv is not compatible with this system or executable') - if is_win: - logger.fatal( - 'Note: some Windows users have reported this error when they ' - 'installed Python for "Only this user" or have multiple ' - 'versions of Python installed. Copying the appropriate ' - 'PythonXX.dll to the virtualenv Scripts/ directory may fix ' - 'this problem.') - sys.exit(100) - else: - logger.info('Got sys.prefix result: %r' % proc_stdout) - - pydistutils = os.path.expanduser('~/.pydistutils.cfg') - if os.path.exists(pydistutils): - logger.notify('Please make sure you remove any previous custom paths from ' - 'your %s file.' % pydistutils) - ## FIXME: really this should be calculated earlier - - fix_local_scheme(home_dir) - - if site_packages: - if os.path.exists(site_packages_filename): - logger.info('Deleting %s' % site_packages_filename) - os.unlink(site_packages_filename) - - return py_executable - - -def install_activate(home_dir, bin_dir, prompt=None): - home_dir = os.path.abspath(home_dir) - if is_win or is_jython and os._name == 'nt': - files = { - 'activate.bat': ACTIVATE_BAT, - 'deactivate.bat': DEACTIVATE_BAT, - 'activate.ps1': ACTIVATE_PS, - } - - # MSYS needs paths of the form /c/path/to/file - drive, tail = os.path.splitdrive(home_dir.replace(os.sep, '/')) - home_dir_msys = (drive and "/%s%s" or "%s%s") % (drive[:1], tail) - - # Run-time conditional enables (basic) Cygwin compatibility - home_dir_sh = ("""$(if [ "$OSTYPE" "==" "cygwin" ]; then cygpath -u '%s'; else echo '%s'; fi;)""" % - (home_dir, home_dir_msys)) - files['activate'] = ACTIVATE_SH.replace('__VIRTUAL_ENV__', home_dir_sh) - - else: - files = {'activate': ACTIVATE_SH} - - # suppling activate.fish in addition to, not instead of, the - # bash script support. - files['activate.fish'] = ACTIVATE_FISH - - # same for csh/tcsh support... - files['activate.csh'] = ACTIVATE_CSH - - files['activate_this.py'] = ACTIVATE_THIS - if hasattr(home_dir, 'decode'): - home_dir = home_dir.decode(sys.getfilesystemencoding()) - vname = os.path.basename(home_dir) - for name, content in files.items(): - content = content.replace('__VIRTUAL_PROMPT__', prompt or '') - content = content.replace('__VIRTUAL_WINPROMPT__', prompt or '(%s)' % vname) - content = content.replace('__VIRTUAL_ENV__', home_dir) - content = content.replace('__VIRTUAL_NAME__', vname) - content = content.replace('__BIN_NAME__', os.path.basename(bin_dir)) - writefile(os.path.join(bin_dir, name), content) - -def install_distutils(home_dir): - distutils_path = change_prefix(distutils.__path__[0], home_dir) - mkdir(distutils_path) - ## FIXME: maybe this prefix setting should only be put in place if - ## there's a local distutils.cfg with a prefix setting? - home_dir = os.path.abspath(home_dir) - ## FIXME: this is breaking things, removing for now: - #distutils_cfg = DISTUTILS_CFG + "\n[install]\nprefix=%s\n" % home_dir - writefile(os.path.join(distutils_path, '__init__.py'), DISTUTILS_INIT) - writefile(os.path.join(distutils_path, 'distutils.cfg'), DISTUTILS_CFG, overwrite=False) - -def fix_local_scheme(home_dir): - """ - Platforms that use the "posix_local" install scheme (like Ubuntu with - Python 2.7) need to be given an additional "local" location, sigh. - """ - try: - import sysconfig - except ImportError: - pass - else: - if sysconfig._get_default_scheme() == 'posix_local': - local_path = os.path.join(home_dir, 'local') - if not os.path.exists(local_path): - os.mkdir(local_path) - for subdir_name in os.listdir(home_dir): - if subdir_name == 'local': - continue - os.symlink(os.path.abspath(os.path.join(home_dir, subdir_name)), \ - os.path.join(local_path, subdir_name)) - -def fix_lib64(lib_dir): - """ - Some platforms (particularly Gentoo on x64) put things in lib64/pythonX.Y - instead of lib/pythonX.Y. If this is such a platform we'll just create a - symlink so lib64 points to lib - """ - if [p for p in distutils.sysconfig.get_config_vars().values() - if isinstance(p, basestring) and 'lib64' in p]: - logger.debug('This system uses lib64; symlinking lib64 to lib') - assert os.path.basename(lib_dir) == 'python%s' % sys.version[:3], ( - "Unexpected python lib dir: %r" % lib_dir) - lib_parent = os.path.dirname(lib_dir) - top_level = os.path.dirname(lib_parent) - lib_dir = os.path.join(top_level, 'lib') - lib64_link = os.path.join(top_level, 'lib64') - assert os.path.basename(lib_parent) == 'lib', ( - "Unexpected parent dir: %r" % lib_parent) - if os.path.lexists(lib64_link): - return - os.symlink('lib', lib64_link) - -def resolve_interpreter(exe): - """ - If the executable given isn't an absolute path, search $PATH for the interpreter - """ - if os.path.abspath(exe) != exe: - paths = os.environ.get('PATH', '').split(os.pathsep) - for path in paths: - if os.path.exists(os.path.join(path, exe)): - exe = os.path.join(path, exe) - break - if not os.path.exists(exe): - logger.fatal('The executable %s (from --python=%s) does not exist' % (exe, exe)) - raise SystemExit(3) - if not is_executable(exe): - logger.fatal('The executable %s (from --python=%s) is not executable' % (exe, exe)) - raise SystemExit(3) - return exe - -def is_executable(exe): - """Checks a file is executable""" - return os.access(exe, os.X_OK) - -############################################################ -## Relocating the environment: - -def make_environment_relocatable(home_dir): - """ - Makes the already-existing environment use relative paths, and takes out - the #!-based environment selection in scripts. - """ - home_dir, lib_dir, inc_dir, bin_dir = path_locations(home_dir) - activate_this = os.path.join(bin_dir, 'activate_this.py') - if not os.path.exists(activate_this): - logger.fatal( - 'The environment doesn\'t have a file %s -- please re-run virtualenv ' - 'on this environment to update it' % activate_this) - fixup_scripts(home_dir) - fixup_pth_and_egg_link(home_dir) - ## FIXME: need to fix up distutils.cfg - -OK_ABS_SCRIPTS = ['python', 'python%s' % sys.version[:3], - 'activate', 'activate.bat', 'activate_this.py'] - -def fixup_scripts(home_dir): - # This is what we expect at the top of scripts: - shebang = '#!%s/bin/python' % os.path.normcase(os.path.abspath(home_dir)) - # This is what we'll put: - new_shebang = '#!/usr/bin/env python%s' % sys.version[:3] - if is_win: - bin_suffix = 'Scripts' - else: - bin_suffix = 'bin' - bin_dir = os.path.join(home_dir, bin_suffix) - home_dir, lib_dir, inc_dir, bin_dir = path_locations(home_dir) - for filename in os.listdir(bin_dir): - filename = os.path.join(bin_dir, filename) - if not os.path.isfile(filename): - # ignore subdirs, e.g. .svn ones. - continue - f = open(filename, 'rb') - try: - try: - lines = f.read().decode('utf-8').splitlines() - except UnicodeDecodeError: - # This is probably a binary program instead - # of a script, so just ignore it. - continue - finally: - f.close() - if not lines: - logger.warn('Script %s is an empty file' % filename) - continue - if not lines[0].strip().startswith(shebang): - if os.path.basename(filename) in OK_ABS_SCRIPTS: - logger.debug('Cannot make script %s relative' % filename) - elif lines[0].strip() == new_shebang: - logger.info('Script %s has already been made relative' % filename) - else: - logger.warn('Script %s cannot be made relative (it\'s not a normal script that starts with %s)' - % (filename, shebang)) - continue - logger.notify('Making script %s relative' % filename) - script = relative_script([new_shebang] + lines[1:]) - f = open(filename, 'wb') - f.write('\n'.join(script).encode('utf-8')) - f.close() - -def relative_script(lines): - "Return a script that'll work in a relocatable environment." - activate = "import os; activate_this=os.path.join(os.path.dirname(os.path.realpath(__file__)), 'activate_this.py'); execfile(activate_this, dict(__file__=activate_this)); del os, activate_this" - # Find the last future statement in the script. If we insert the activation - # line before a future statement, Python will raise a SyntaxError. - activate_at = None - for idx, line in reversed(list(enumerate(lines))): - if line.split()[:3] == ['from', '__future__', 'import']: - activate_at = idx + 1 - break - if activate_at is None: - # Activate after the shebang. - activate_at = 1 - return lines[:activate_at] + ['', activate, ''] + lines[activate_at:] - -def fixup_pth_and_egg_link(home_dir, sys_path=None): - """Makes .pth and .egg-link files use relative paths""" - home_dir = os.path.normcase(os.path.abspath(home_dir)) - if sys_path is None: - sys_path = sys.path - for path in sys_path: - if not path: - path = '.' - if not os.path.isdir(path): - continue - path = os.path.normcase(os.path.abspath(path)) - if not path.startswith(home_dir): - logger.debug('Skipping system (non-environment) directory %s' % path) - continue - for filename in os.listdir(path): - filename = os.path.join(path, filename) - if filename.endswith('.pth'): - if not os.access(filename, os.W_OK): - logger.warn('Cannot write .pth file %s, skipping' % filename) - else: - fixup_pth_file(filename) - if filename.endswith('.egg-link'): - if not os.access(filename, os.W_OK): - logger.warn('Cannot write .egg-link file %s, skipping' % filename) - else: - fixup_egg_link(filename) - -def fixup_pth_file(filename): - lines = [] - prev_lines = [] - f = open(filename) - prev_lines = f.readlines() - f.close() - for line in prev_lines: - line = line.strip() - if (not line or line.startswith('#') or line.startswith('import ') - or os.path.abspath(line) != line): - lines.append(line) - else: - new_value = make_relative_path(filename, line) - if line != new_value: - logger.debug('Rewriting path %s as %s (in %s)' % (line, new_value, filename)) - lines.append(new_value) - if lines == prev_lines: - logger.info('No changes to .pth file %s' % filename) - return - logger.notify('Making paths in .pth file %s relative' % filename) - f = open(filename, 'w') - f.write('\n'.join(lines) + '\n') - f.close() - -def fixup_egg_link(filename): - f = open(filename) - link = f.readline().strip() - f.close() - if os.path.abspath(link) != link: - logger.debug('Link in %s already relative' % filename) - return - new_link = make_relative_path(filename, link) - logger.notify('Rewriting link %s in %s as %s' % (link, filename, new_link)) - f = open(filename, 'w') - f.write(new_link) - f.close() - -def make_relative_path(source, dest, dest_is_directory=True): - """ - Make a filename relative, where the filename is dest, and it is - being referred to from the filename source. - - >>> make_relative_path('/usr/share/something/a-file.pth', - ... '/usr/share/another-place/src/Directory') - '../another-place/src/Directory' - >>> make_relative_path('/usr/share/something/a-file.pth', - ... '/home/user/src/Directory') - '../../../home/user/src/Directory' - >>> make_relative_path('/usr/share/a-file.pth', '/usr/share/') - './' - """ - source = os.path.dirname(source) - if not dest_is_directory: - dest_filename = os.path.basename(dest) - dest = os.path.dirname(dest) - dest = os.path.normpath(os.path.abspath(dest)) - source = os.path.normpath(os.path.abspath(source)) - dest_parts = dest.strip(os.path.sep).split(os.path.sep) - source_parts = source.strip(os.path.sep).split(os.path.sep) - while dest_parts and source_parts and dest_parts[0] == source_parts[0]: - dest_parts.pop(0) - source_parts.pop(0) - full_parts = ['..']*len(source_parts) + dest_parts - if not dest_is_directory: - full_parts.append(dest_filename) - if not full_parts: - # Special case for the current directory (otherwise it'd be '') - return './' - return os.path.sep.join(full_parts) - - - -############################################################ -## Bootstrap script creation: - -def create_bootstrap_script(extra_text, python_version=''): - """ - Creates a bootstrap script, which is like this script but with - extend_parser, adjust_options, and after_install hooks. - - This returns a string that (written to disk of course) can be used - as a bootstrap script with your own customizations. The script - will be the standard virtualenv.py script, with your extra text - added (your extra text should be Python code). - - If you include these functions, they will be called: - - ``extend_parser(optparse_parser)``: - You can add or remove options from the parser here. - - ``adjust_options(options, args)``: - You can change options here, or change the args (if you accept - different kinds of arguments, be sure you modify ``args`` so it is - only ``[DEST_DIR]``). - - ``after_install(options, home_dir)``: - - After everything is installed, this function is called. This - is probably the function you are most likely to use. An - example would be:: - - def after_install(options, home_dir): - subprocess.call([join(home_dir, 'bin', 'easy_install'), - 'MyPackage']) - subprocess.call([join(home_dir, 'bin', 'my-package-script'), - 'setup', home_dir]) - - This example immediately installs a package, and runs a setup - script from that package. - - If you provide something like ``python_version='2.5'`` then the - script will start with ``#!/usr/bin/env python2.5`` instead of - ``#!/usr/bin/env python``. You can use this when the script must - be run with a particular Python version. - """ - filename = __file__ - if filename.endswith('.pyc'): - filename = filename[:-1] - f = codecs.open(filename, 'r', encoding='utf-8') - content = f.read() - f.close() - py_exe = 'python%s' % python_version - content = (('#!/usr/bin/env %s\n' % py_exe) - + '## WARNING: This file is generated\n' - + content) - return content.replace('##EXT' 'END##', extra_text) - -##EXTEND## - -def convert(s): - b = base64.b64decode(s.encode('ascii')) - return zlib.decompress(b).decode('utf-8') - -##file site.py -SITE_PY = convert(""" -eJzFPf1z2zaWv/OvwMqToZTIdOK0vR2nzo2TOK3v3MTbpLO5dT1aSoIs1hTJEqRl7c3d337vAwAB -kpLtTXdO04klEnh4eHhfeHgPHQwGJ0Uhs7lY5fM6lULJuJwtRRFXSyUWeSmqZVLO94u4rDbwdHYT -X0slqlyojYqwVRQET7/yEzwVn5eJMijAt7iu8lVcJbM4TTciWRV5Wcm5mNdlkl2LJEuqJE6Tf0CL -PIvE06/HIDjLBMw8TWQpbmWpAK4S+UJcbKplnolhXeCcX0Tfxi9HY6FmZVJU0KDUOANFlnEVZFLO -AU1oWSsgZVL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dPR6ja5S8CoFNfa37BZbCldqAO -8/kPV23RfN0yyhwk+KALUaFOdBGEaJIuAT1/Qt5i+T3aqXn7hRvzeB4OlPP6qzTX3zYxV4vmpPLY -1ad2hCkv9PyTfmqoFKGnJK1e1ke/EPmgJsWzYuR+FBfN/KN6rfaouBN7AUT33JfuWv2pViwvXbUW -0tZCXTQXBV1cnnUnx+rdu+bUWbZF9cmTZ9kVu3oErEv0u7n646bY4N8aXIHxoek064as3chE8T2U -y9Vd97JZwuKudB7VUDGf15NCXaT7wMADGCGrdmLQXxHatnfNB1HVSavuL/uT9E53DLtdE/UdJI2M -taFhedW0RC0Ar8bGHkiFaXALPc1SkILtl/P3Wf8rPu+z5bt//Xb3YvXbXLcnq/4Yo9/ucdETjI1C -rr9klRpCscBn8+skbRmxVhX/f7fRgk3dei/t1R3GMA3kC/20fojRFY82d0+bv3hsYkI27VGneg+A -GcxocdxuF7udStjdbtF9sJEqiVBT5/BrR5fD9u939h3eefkSYNWp0itfvdzpljubu6fqouaIi0y1 -qL7+C1AkCcw= -""") - -##file distribute_from_egg.py -DISTRIBUTE_FROM_EGG_PY = convert(""" -eJw9j8tqAzEMRfcG/4MgmxQyptkGusonZBmGoGTUGYFfWPKE6dfXTkM3gqt7rh47OKP3NMF3SQFW -LlrRU1zhybpAxoKBlIqcrNnBdRjQP3GTocYfzmNrrCPQPN9iwzpxSQfQhWBi0cL3qtRtYIG/4Mv0 -KApY5hooqrOGQ05FQTaxptF9Fnx16Rq0XofjaE1XGXVxHIWK7j8P8EY/rHndLqQ1a0pe3COFgHFy -hLLdWkDbi/DeEpCjNb3u/zccT2Ob8gtnwVyI -""") - -##file distribute_setup.py -DISTRIBUTE_SETUP_PY = convert(""" -eJztPGtz2ziS3/UrcHK5SOUkxs7MzV25TlOVmTizrs0mKdvZ/ZC4aIiEJI75GpC0ov311403SEp2 -LrMfruq8O7ZENBqNfncDzMm/1ft2W5WT6XT6S1W1TctpTdIM/marrmUkK5uW5jltMwCaXK3JvurI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2r2+VsCn0doVWcFG1/4y1VwBjfwAyoZhD -""") - -##file activate.bat -ACTIVATE_BAT = convert(""" -eJx9UdEKgjAUfW6wfxjiIH+hEDKUFHSKLCMI7kNOEkIf9P9pTJ3OLJ/03HPPPed4Es9XS9qqwqgT -PbGKKOdXL4aAFS7A4gvAwgijuiKlqOpGlATS2NeMLE+TjJM9RkQ+SmqAXLrBo1LLIeLdiWlD6jZt -r7VNubWkndkXaxg5GO3UaOOKS6drO3luDDiO5my3iA0YAKGzPRV1ack8cOdhysI0CYzIPzjSiH5X -0QcvC8Lfaj0emsVKYF2rhL5L3fCkVjV76kShi59NHwDniAHzkgDgqBcwOgTMx+gDQQqXCw== -""") - -##file deactivate.bat -DEACTIVATE_BAT = convert(""" -eJxzSE3OyFfIT0vj4ipOLVEI8wwKCXX0iXf1C7Pl4spMU0hJTcvMS01RiPf3cYmHyQYE+fsGhCho -cCkAAUibEkTEVhWLMlUlLk6QGixStlyaeCyJDPHw9/Pw93VFsQguim4ZXAJoIUw5DhX47XUM8UCx -EchHtwsohN1bILUgw61c/Vy4AJYPYm4= -""") - -##file activate.ps1 -ACTIVATE_PS = convert(""" -eJylWdmS40Z2fVeE/oHT6rCloNUEAXDThB6wAyQAEjsB29GBjdgXYiWgmC/zgz/Jv+AEWNVd3S2N -xuOKYEUxM+/Jmzfvcm7W//zXf/+wUMOoXtyi1F9kbd0sHH/hFc2iLtrK9b3FrSqyxaVQwr8uhqJd -uHaeg9mqzRdR8/13Pyy8qPLdJh0+LMhi0QCoXxYfFh9WtttEnd34H8p6/f1300KauwrULws39e18 -0ZaLNm9rgN/ZVf3h++/e124Vlc0vKsspHy+Yyi5+XbzPhijvCtduoiL/kA1ukWV27n0o7Sb8LIFj -CvWR5GQgUJdp1Pw8TS9+rPy6SDv/+e3d+0+4qw8f3v20+PliV37efEYBAB9FTKC+RHn/Cfxn3rdv -00Fube5O+iyCtHDs9BfPfz3q4sfFv9d91Ljhfy7ei0VO+nVTtdOkv/jpt0l2A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BTHZZ3pIZpUIpuLkL1nNL6sYcHqcKm237wp -T2+RCjgXweXd2Zp7ZM8W6dG5bZsqo0nrJBTx8EC0+CQQdzEGnabTnkzofu1pYkWl4E7XSniECdxy -vLYavPMcL9LW5SToJFNnos+uqweOHriUZ1ntIYZUonc7ltEQ6oTRtwOHNwez2sVREskHN+bqG3ua -eaEbJ8XpyO8CeD9QJc8nbLP2C2R3A437ISUNyt5Yd0TbDNcl11/DSsOzdbi/VhCC0KE6v1vqVNkq -45ZnG6fiV2NwzInxCNth3BwL0+8814jE6+1W1EeWtpWbSZJOJNYXmWRXa7vLnAljE692eHjZ4y5u -y1u63De0IzKca7As48Z3XshVF+3XiLNz0JIMh/JOpbiNLlMi672uO0wYzOCZjRxcxj3D+gVenGIE -MvFUGGXuRps2RzMcgWIRolHXpGUP6sMsQt1hspUBnVKUn/WQj2u6j3SXd9Xz0QtEzoM7qTu5y7gR -q9gNNsrlEMLdikBt9bFvBnfbUIh6voTw7eDsyTmPKUvF0bHqWLbHe3VRHyRZnNeSGKsB73q66Vsk -taxWYmwz1tYVFG/vOQhlM0gUkyvIab3nv2caJ1udU1F3pDMty7stubTE4OJqm0i0ECfrJIkLtraC -HwRWKzlqpfhEIqYH09eT9WrOhQyt8YEoyBlnXtAT37WHIQ03TIuEHbnRxZDdLun0iok9PUC79prU -m5beZzfQUelEXnhzb/pIROKx3F7qCttYIFGh5dXNzFzID7u8vKykA8Uejf7XXz//S4nKvW//ofS/ -QastYw== -""") - -##file distutils-init.py -DISTUTILS_INIT = convert(""" -eJytV1uL4zYUfvevOE0ottuMW9q3gVDa3aUMXXbLMlDKMBiNrSTqOJKRlMxkf33PkXyRbGe7Dw2E -UXTu37lpxLFV2oIyifAncxmOL0xLIfcG+gv80x9VW6maw7o/CANSWWBwFtqeWMPlGY6qPjV8A0bB -C4eKSTgZ5LRgFeyErMEeOBhbN+Ipgeizhjtnhkn7DdyjuNLPoCS0l/ayQTG0djwZC08cLXozeMss -aG5EzQ0IScpnW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76icBGdeTHHXTKspUmr4NYo/furFLKiMdQzFjHJNcdAnMhltBJK -0/IKX3DVFqvPJ2dLE7bDBkH0l/PJ29074+F0CsGYOxsb7U3myTUncYfXqnLLfa6sJybX4g+hmcjO -kMRBfA1JellfRRKJcyRpxdS4rIl6FdmQCWjo/o9Qz7yKffoP4JHjOvABcRn4CZIT2RH4jnxmfpVG -qgLaAvQBNfuO6X0/Ux02nb4FKx3vgP+XnkX0QW9pLy/NsXgdN24dD3LxO2Nwil7Zlc1dqtP3d7/h -kzp1/+7hGBuY4pk0XD/0Ao/oTe/XGrfyM773aB7iUhgkpy+dwAMalxMP0DrBcsVw/6p25+/hobP9 -GBknrWExDhLJ1bwt1NcCNblaFbMKCyvmX0PeRaQ= -""") - -##file distutils.cfg -DISTUTILS_CFG = convert(""" -eJxNj00KwkAMhfc9xYNuxe4Ft57AjYiUtDO1wXSmNJnK3N5pdSEEAu8nH6lxHVlRhtDHMPATA4uH -xJ4EFmGbvfJiicSHFRzUSISMY6hq3GLCRLnIvSTnEefN0FIjw5tF0Hkk9Q5dRunBsVoyFi24aaLg -9FDOlL0FPGluf4QjcInLlxd6f6rqkgPu/5nHLg0cXCscXoozRrP51DRT3j9QNl99AP53T2Q= -""") - -##file activate_this.py -ACTIVATE_THIS = convert(""" -eJyNU01v2zAMvetXEB4K21jmDOstQA4dMGCHbeihlyEIDMWmG62yJEiKE//7kXKdpN2KzYBt8euR -fKSyLPs8wiEo8wh4wqZTGou4V6Hm0wJa1cSiTkJdr8+GsoTRHuCotBayiWqQEYGtMCgfD1KjGYBe -5a3p0cRKiAe2NtLADikftnDco0ko/SFEVgEZ8aRC5GLux7i3BpSJ6J1H+i7A2CjiHq9z7JRZuuQq -siwTIvpxJYCeuWaBpwZdhB+yxy/eWz+ZvVSU8C4E9FFZkyxFsvCT/ZzL8gcz9aXVE14Yyp2M+2W0 -y7n5mp0qN+avKXvbsyyzUqjeWR8hjGE+2iCE1W1tQ82hsCZN9UzlJr+/e/iab8WfqsmPI6pWeUPd -FrMsd4H/55poeO9n54COhUs+sZNEzNtg/wanpjpuqHJaxs76HtZryI/K3H7KJ/KDIhqcbJ7kI4ar -XL+sMgXnX0D+Te2Iy5xdP8yueSlQB/x/ED2BTAtyE3K4SYUN6AMNfbO63f4lBW3bUJPbTL+mjSxS -PyRfJkZRgj+VbFv+EzHFi5pKwUEepa4JslMnwkowSRCXI+m5XvEOvtuBrxHdhLalG0JofYBok6qj -YdN2dEngUlbC4PG60M1WEN0piu7Nq7on0mgyyUw3iV1etLo6r/81biWdQ9MWHFaePWZYaq+nmp+t -s3az+sj7eA0jfgPfeoN1 -""") - -MH_MAGIC = 0xfeedface -MH_CIGAM = 0xcefaedfe -MH_MAGIC_64 = 0xfeedfacf -MH_CIGAM_64 = 0xcffaedfe -FAT_MAGIC = 0xcafebabe -BIG_ENDIAN = '>' -LITTLE_ENDIAN = '<' -LC_LOAD_DYLIB = 0xc -maxint = majver == 3 and getattr(sys, 'maxsize') or getattr(sys, 'maxint') - - -class fileview(object): - """ - A proxy for file-like objects that exposes a given view of a file. - Modified from macholib. - """ - - def __init__(self, fileobj, start=0, size=maxint): - if isinstance(fileobj, fileview): - self._fileobj = fileobj._fileobj - else: - self._fileobj = fileobj - self._start = start - self._end = start + size - self._pos = 0 - - def __repr__(self): - return '' % ( - self._start, self._end, self._fileobj) - - def tell(self): - return self._pos - - def _checkwindow(self, seekto, op): - if not (self._start <= seekto <= self._end): - raise IOError("%s to offset %d is outside window [%d, %d]" % ( - op, seekto, self._start, self._end)) - - def seek(self, offset, whence=0): - seekto = offset - if whence == os.SEEK_SET: - seekto += self._start - elif whence == os.SEEK_CUR: - seekto += self._start + self._pos - elif whence == os.SEEK_END: - seekto += self._end - else: - raise IOError("Invalid whence argument to seek: %r" % (whence,)) - self._checkwindow(seekto, 'seek') - self._fileobj.seek(seekto) - self._pos = seekto - self._start - - def write(self, bytes): - here = self._start + self._pos - self._checkwindow(here, 'write') - self._checkwindow(here + len(bytes), 'write') - self._fileobj.seek(here, os.SEEK_SET) - self._fileobj.write(bytes) - self._pos += len(bytes) - - def read(self, size=maxint): - assert size >= 0 - here = self._start + self._pos - self._checkwindow(here, 'read') - size = min(size, self._end - here) - self._fileobj.seek(here, os.SEEK_SET) - bytes = self._fileobj.read(size) - self._pos += len(bytes) - return bytes - - -def read_data(file, endian, num=1): - """ - Read a given number of 32-bits unsigned integers from the given file - with the given endianness. - """ - res = struct.unpack(endian + 'L' * num, file.read(num * 4)) - if len(res) == 1: - return res[0] - return res - - -def mach_o_change(path, what, value): - """ - Replace a given name (what) in any LC_LOAD_DYLIB command found in - the given binary with a new name (value), provided it's shorter. - """ - - def do_macho(file, bits, endian): - # Read Mach-O header (the magic number is assumed read by the caller) - cputype, cpusubtype, filetype, ncmds, sizeofcmds, flags = read_data(file, endian, 6) - # 64-bits header has one more field. - if bits == 64: - read_data(file, endian) - # The header is followed by ncmds commands - for n in range(ncmds): - where = file.tell() - # Read command header - cmd, cmdsize = read_data(file, endian, 2) - if cmd == LC_LOAD_DYLIB: - # The first data field in LC_LOAD_DYLIB commands is the - # offset of the name, starting from the beginning of the - # command. - name_offset = read_data(file, endian) - file.seek(where + name_offset, os.SEEK_SET) - # Read the NUL terminated string - load = file.read(cmdsize - name_offset).decode() - load = load[:load.index('\0')] - # If the string is what is being replaced, overwrite it. - if load == what: - file.seek(where + name_offset, os.SEEK_SET) - file.write(value.encode() + '\0'.encode()) - # Seek to the next command - file.seek(where + cmdsize, os.SEEK_SET) - - def do_file(file, offset=0, size=maxint): - file = fileview(file, offset, size) - # Read magic number - magic = read_data(file, BIG_ENDIAN) - if magic == FAT_MAGIC: - # Fat binaries contain nfat_arch Mach-O binaries - nfat_arch = read_data(file, BIG_ENDIAN) - for n in range(nfat_arch): - # Read arch header - cputype, cpusubtype, offset, size, align = read_data(file, BIG_ENDIAN, 5) - do_file(file, offset, size) - elif magic == MH_MAGIC: - do_macho(file, 32, BIG_ENDIAN) - elif magic == MH_CIGAM: - do_macho(file, 32, LITTLE_ENDIAN) - elif magic == MH_MAGIC_64: - do_macho(file, 64, BIG_ENDIAN) - elif magic == MH_CIGAM_64: - do_macho(file, 64, LITTLE_ENDIAN) - - assert(len(what) >= len(value)) - do_file(open(path, 'r+b')) - - -if __name__ == '__main__': - main() - -## TODO: -## Copy python.exe.manifest -## Monkeypatch distutils.sysconfig diff --git a/noarch/lib/py/cxxtest/admin/virtualenv_1.7.py b/noarch/lib/py/cxxtest/admin/virtualenv_1.7.py deleted file mode 100644 index 5b4951db..00000000 --- a/noarch/lib/py/cxxtest/admin/virtualenv_1.7.py +++ /dev/null @@ -1,2102 +0,0 @@ -#!/usr/bin/env python -"""Create a "virtual" Python installation -""" - -# If you change the version here, change it in setup.py -# and docs/conf.py as well. -virtualenv_version = "1.7" - -import base64 -import sys -import os -import optparse -import re -import shutil -import logging -import tempfile -import zlib -import errno -import distutils.sysconfig -from distutils.util import strtobool - -try: - import subprocess -except ImportError: - if sys.version_info <= (2, 3): - print('ERROR: %s' % sys.exc_info()[1]) - print('ERROR: this script requires Python 2.4 or greater; or at least the subprocess module.') - print('If you copy subprocess.py from a newer version of Python this script will probably work') - sys.exit(101) - else: - raise -try: - set -except NameError: - from sets import Set as set -try: - basestring -except NameError: - basestring = str - -try: - import ConfigParser -except ImportError: - import configparser as ConfigParser - -join = os.path.join -py_version = 'python%s.%s' % (sys.version_info[0], sys.version_info[1]) - -is_jython = sys.platform.startswith('java') -is_pypy = hasattr(sys, 'pypy_version_info') -is_win = (sys.platform == 'win32') -abiflags = getattr(sys, 'abiflags', '') - -user_dir = os.path.expanduser('~') -if sys.platform == 'win32': - user_dir = os.environ.get('APPDATA', user_dir) # Use %APPDATA% for roaming - default_storage_dir = os.path.join(user_dir, 'virtualenv') -else: - default_storage_dir = os.path.join(user_dir, '.virtualenv') -default_config_file = os.path.join(default_storage_dir, 'virtualenv.ini') - -if is_pypy: - expected_exe = 'pypy' -elif is_jython: - expected_exe = 'jython' -else: - expected_exe = 'python' - - -REQUIRED_MODULES = ['os', 'posix', 'posixpath', 'nt', 'ntpath', 'genericpath', - 'fnmatch', 'locale', 'encodings', 'codecs', - 'stat', 'UserDict', 'readline', 'copy_reg', 'types', - 're', 'sre', 'sre_parse', 'sre_constants', 'sre_compile', - 'zlib'] - -REQUIRED_FILES = ['lib-dynload', 'config'] - -majver, minver = sys.version_info[:2] -if majver == 2: - if minver >= 6: - REQUIRED_MODULES.extend(['warnings', 'linecache', '_abcoll', 'abc']) - if minver >= 7: - REQUIRED_MODULES.extend(['_weakrefset']) - if minver <= 3: - REQUIRED_MODULES.extend(['sets', '__future__']) -elif majver == 3: - # Some extra modules are needed for Python 3, but different ones - # for different versions. - REQUIRED_MODULES.extend(['_abcoll', 'warnings', 'linecache', 'abc', 'io', - '_weakrefset', 'copyreg', 'tempfile', 'random', - '__future__', 'collections', 'keyword', 'tarfile', - 'shutil', 'struct', 'copy']) - if minver >= 2: - REQUIRED_FILES[-1] = 'config-%s' % majver - if minver == 3: - # The whole list of 3.3 modules is reproduced below - the current - # uncommented ones are required for 3.3 as of now, but more may be - # added as 3.3 development continues. - REQUIRED_MODULES.extend([ - #"aifc", - #"antigravity", - #"argparse", - #"ast", - #"asynchat", - #"asyncore", - "base64", - #"bdb", - #"binhex", - "bisect", - #"calendar", - #"cgi", - #"cgitb", - #"chunk", - #"cmd", - #"codeop", - #"code", - #"colorsys", - #"_compat_pickle", - #"compileall", - #"concurrent", - #"configparser", - #"contextlib", - #"cProfile", - #"crypt", - #"csv", - #"ctypes", - #"curses", - #"datetime", - #"dbm", - #"decimal", - #"difflib", - #"dis", - #"doctest", - #"dummy_threading", - "_dummy_thread", - #"email", - #"filecmp", - #"fileinput", - #"formatter", - #"fractions", - #"ftplib", - #"functools", - #"getopt", - #"getpass", - #"gettext", - #"glob", - #"gzip", - "hashlib", - "heapq", - "hmac", - #"html", - #"http", - #"idlelib", - #"imaplib", - #"imghdr", - #"importlib", - #"inspect", - #"json", - #"lib2to3", - #"logging", - #"macpath", - #"macurl2path", - #"mailbox", - #"mailcap", - #"_markupbase", - #"mimetypes", - #"modulefinder", - #"multiprocessing", - #"netrc", - #"nntplib", - #"nturl2path", - #"numbers", - #"opcode", - #"optparse", - #"os2emxpath", - #"pdb", - #"pickle", - #"pickletools", - #"pipes", - #"pkgutil", - #"platform", - #"plat-linux2", - #"plistlib", - #"poplib", - #"pprint", - #"profile", - #"pstats", - #"pty", - #"pyclbr", - #"py_compile", - #"pydoc_data", - #"pydoc", - #"_pyio", - #"queue", - #"quopri", - "reprlib", - "rlcompleter", - #"runpy", - #"sched", - #"shelve", - #"shlex", - #"smtpd", - #"smtplib", - #"sndhdr", - #"socket", - #"socketserver", - #"sqlite3", - #"ssl", - #"stringprep", - #"string", - #"_strptime", - #"subprocess", - #"sunau", - #"symbol", - #"symtable", - #"sysconfig", - #"tabnanny", - #"telnetlib", - #"test", - #"textwrap", - #"this", - #"_threading_local", - #"threading", - #"timeit", - #"tkinter", - #"tokenize", - #"token", - #"traceback", - #"trace", - #"tty", - #"turtledemo", - #"turtle", - #"unittest", - #"urllib", - #"uuid", - #"uu", - #"wave", - "weakref", - #"webbrowser", - #"wsgiref", - #"xdrlib", - #"xml", - #"xmlrpc", - #"zipfile", - ]) - -if is_pypy: - # these are needed to correctly display the exceptions that may happen - # during the bootstrap - REQUIRED_MODULES.extend(['traceback', 'linecache']) - -class Logger(object): - - """ - Logging object for use in command-line script. Allows ranges of - levels, to avoid some redundancy of displayed information. - """ - - DEBUG = logging.DEBUG - INFO = logging.INFO - NOTIFY = (logging.INFO+logging.WARN)/2 - WARN = WARNING = logging.WARN - ERROR = logging.ERROR - FATAL = logging.FATAL - - LEVELS = [DEBUG, INFO, NOTIFY, WARN, ERROR, FATAL] - - def __init__(self, consumers): - self.consumers = consumers - self.indent = 0 - self.in_progress = None - self.in_progress_hanging = False - - def debug(self, msg, *args, **kw): - self.log(self.DEBUG, msg, *args, **kw) - def info(self, msg, *args, **kw): - self.log(self.INFO, msg, *args, **kw) - def notify(self, msg, *args, **kw): - self.log(self.NOTIFY, msg, *args, **kw) - def warn(self, msg, *args, **kw): - self.log(self.WARN, msg, *args, **kw) - def error(self, msg, *args, **kw): - self.log(self.WARN, msg, *args, **kw) - def fatal(self, msg, *args, **kw): - self.log(self.FATAL, msg, *args, **kw) - def log(self, level, msg, *args, **kw): - if args: - if kw: - raise TypeError( - "You may give positional or keyword arguments, not both") - args = args or kw - rendered = None - for consumer_level, consumer in self.consumers: - if self.level_matches(level, consumer_level): - if (self.in_progress_hanging - and consumer in (sys.stdout, sys.stderr)): - self.in_progress_hanging = False - sys.stdout.write('\n') - sys.stdout.flush() - if rendered is None: - if args: - rendered = msg % args - else: - rendered = msg - rendered = ' '*self.indent + rendered - if hasattr(consumer, 'write'): - consumer.write(rendered+'\n') - else: - consumer(rendered) - - def start_progress(self, msg): - assert not self.in_progress, ( - "Tried to start_progress(%r) while in_progress %r" - % (msg, self.in_progress)) - if self.level_matches(self.NOTIFY, self._stdout_level()): - sys.stdout.write(msg) - sys.stdout.flush() - self.in_progress_hanging = True - else: - self.in_progress_hanging = False - self.in_progress = msg - - def end_progress(self, msg='done.'): - assert self.in_progress, ( - "Tried to end_progress without start_progress") - if self.stdout_level_matches(self.NOTIFY): - if not self.in_progress_hanging: - # Some message has been printed out since start_progress - sys.stdout.write('...' + self.in_progress + msg + '\n') - sys.stdout.flush() - else: - sys.stdout.write(msg + '\n') - sys.stdout.flush() - self.in_progress = None - self.in_progress_hanging = False - - def show_progress(self): - """If we are in a progress scope, and no log messages have been - shown, write out another '.'""" - if self.in_progress_hanging: - sys.stdout.write('.') - sys.stdout.flush() - - def stdout_level_matches(self, level): - """Returns true if a message at this level will go to stdout""" - return self.level_matches(level, self._stdout_level()) - - def _stdout_level(self): - """Returns the level that stdout runs at""" - for level, consumer in self.consumers: - if consumer is sys.stdout: - return level - return self.FATAL - - def level_matches(self, level, consumer_level): - """ - >>> l = Logger([]) - >>> l.level_matches(3, 4) - False - >>> l.level_matches(3, 2) - True - >>> l.level_matches(slice(None, 3), 3) - False - >>> l.level_matches(slice(None, 3), 2) - True - >>> l.level_matches(slice(1, 3), 1) - True - >>> l.level_matches(slice(2, 3), 1) - False - """ - if isinstance(level, slice): - start, stop = level.start, level.stop - if start is not None and start > consumer_level: - return False - if stop is not None and stop <= consumer_level: - return False - return True - else: - return level >= consumer_level - - #@classmethod - def level_for_integer(cls, level): - levels = cls.LEVELS - if level < 0: - return levels[0] - if level >= len(levels): - return levels[-1] - return levels[level] - - level_for_integer = classmethod(level_for_integer) - -# create a silent logger just to prevent this from being undefined -# will be overridden with requested verbosity main() is called. -logger = Logger([(Logger.LEVELS[-1], sys.stdout)]) - -def mkdir(path): - if not os.path.exists(path): - logger.info('Creating %s', path) - os.makedirs(path) - else: - logger.info('Directory %s already exists', path) - -def copyfileordir(src, dest): - if os.path.isdir(src): - shutil.copytree(src, dest, True) - else: - shutil.copy2(src, dest) - -def copyfile(src, dest, symlink=True): - if not os.path.exists(src): - # Some bad symlink in the src - logger.warn('Cannot find file %s (bad symlink)', src) - return - if os.path.exists(dest): - logger.debug('File %s already exists', dest) - return - if not os.path.exists(os.path.dirname(dest)): - logger.info('Creating parent directories for %s' % os.path.dirname(dest)) - os.makedirs(os.path.dirname(dest)) - if not os.path.islink(src): - srcpath = os.path.abspath(src) - else: - srcpath = os.readlink(src) - if symlink and hasattr(os, 'symlink'): - logger.info('Symlinking %s', dest) - try: - os.symlink(srcpath, dest) - except (OSError, NotImplementedError): - logger.info('Symlinking failed, copying to %s', dest) - copyfileordir(src, dest) - else: - logger.info('Copying to %s', dest) - copyfileordir(src, dest) - -def writefile(dest, content, overwrite=True): - if not os.path.exists(dest): - logger.info('Writing %s', dest) - f = open(dest, 'wb') - f.write(content.encode('utf-8')) - f.close() - return - else: - f = open(dest, 'rb') - c = f.read() - f.close() - if c != content: - if not overwrite: - logger.notify('File %s exists with different content; not overwriting', dest) - return - logger.notify('Overwriting %s with new content', dest) - f = open(dest, 'wb') - f.write(content.encode('utf-8')) - f.close() - else: - logger.info('Content %s already in place', dest) - -def rmtree(dir): - if os.path.exists(dir): - logger.notify('Deleting tree %s', dir) - shutil.rmtree(dir) - else: - logger.info('Do not need to delete %s; already gone', dir) - -def make_exe(fn): - if hasattr(os, 'chmod'): - oldmode = os.stat(fn).st_mode & 0xFFF # 0o7777 - newmode = (oldmode | 0x16D) & 0xFFF # 0o555, 0o7777 - os.chmod(fn, newmode) - logger.info('Changed mode of %s to %s', fn, oct(newmode)) - -def _find_file(filename, dirs): - for dir in dirs: - if os.path.exists(join(dir, filename)): - return join(dir, filename) - return filename - -def _install_req(py_executable, unzip=False, distribute=False, - search_dirs=None, never_download=False): - - if search_dirs is None: - search_dirs = file_search_dirs() - - if not distribute: - setup_fn = 'setuptools-0.6c11-py%s.egg' % sys.version[:3] - project_name = 'setuptools' - bootstrap_script = EZ_SETUP_PY - source = None - else: - setup_fn = None - source = 'distribute-0.6.24.tar.gz' - project_name = 'distribute' - bootstrap_script = DISTRIBUTE_SETUP_PY - - if setup_fn is not None: - setup_fn = _find_file(setup_fn, search_dirs) - - if source is not None: - source = _find_file(source, search_dirs) - - if is_jython and os._name == 'nt': - # Jython's .bat sys.executable can't handle a command line - # argument with newlines - fd, ez_setup = tempfile.mkstemp('.py') - os.write(fd, bootstrap_script) - os.close(fd) - cmd = [py_executable, ez_setup] - else: - cmd = [py_executable, '-c', bootstrap_script] - if unzip: - cmd.append('--always-unzip') - env = {} - remove_from_env = [] - if logger.stdout_level_matches(logger.DEBUG): - cmd.append('-v') - - old_chdir = os.getcwd() - if setup_fn is not None and os.path.exists(setup_fn): - logger.info('Using existing %s egg: %s' % (project_name, setup_fn)) - cmd.append(setup_fn) - if os.environ.get('PYTHONPATH'): - env['PYTHONPATH'] = setup_fn + os.path.pathsep + os.environ['PYTHONPATH'] - else: - env['PYTHONPATH'] = setup_fn - else: - # the source is found, let's chdir - if source is not None and os.path.exists(source): - logger.info('Using existing %s egg: %s' % (project_name, source)) - os.chdir(os.path.dirname(source)) - # in this case, we want to be sure that PYTHONPATH is unset (not - # just empty, really unset), else CPython tries to import the - # site.py that it's in virtualenv_support - remove_from_env.append('PYTHONPATH') - else: - if never_download: - logger.fatal("Can't find any local distributions of %s to install " - "and --never-download is set. Either re-run virtualenv " - "without the --never-download option, or place a %s " - "distribution (%s) in one of these " - "locations: %r" % (project_name, project_name, - setup_fn or source, - search_dirs)) - sys.exit(1) - - logger.info('No %s egg found; downloading' % project_name) - cmd.extend(['--always-copy', '-U', project_name]) - logger.start_progress('Installing %s...' % project_name) - logger.indent += 2 - cwd = None - if project_name == 'distribute': - env['DONT_PATCH_SETUPTOOLS'] = 'true' - - def _filter_ez_setup(line): - return filter_ez_setup(line, project_name) - - if not os.access(os.getcwd(), os.W_OK): - cwd = tempfile.mkdtemp() - if source is not None and os.path.exists(source): - # the current working dir is hostile, let's copy the - # tarball to a temp dir - target = os.path.join(cwd, os.path.split(source)[-1]) - shutil.copy(source, target) - try: - call_subprocess(cmd, show_stdout=False, - filter_stdout=_filter_ez_setup, - extra_env=env, - remove_from_env=remove_from_env, - cwd=cwd) - finally: - logger.indent -= 2 - logger.end_progress() - if os.getcwd() != old_chdir: - os.chdir(old_chdir) - if is_jython and os._name == 'nt': - os.remove(ez_setup) - -def file_search_dirs(): - here = os.path.dirname(os.path.abspath(__file__)) - dirs = ['.', here, - join(here, 'virtualenv_support')] - if os.path.splitext(os.path.dirname(__file__))[0] != 'virtualenv': - # Probably some boot script; just in case virtualenv is installed... - try: - import virtualenv - except ImportError: - pass - else: - dirs.append(os.path.join(os.path.dirname(virtualenv.__file__), 'virtualenv_support')) - return [d for d in dirs if os.path.isdir(d)] - -def install_setuptools(py_executable, unzip=False, - search_dirs=None, never_download=False): - _install_req(py_executable, unzip, - search_dirs=search_dirs, never_download=never_download) - -def install_distribute(py_executable, unzip=False, - search_dirs=None, never_download=False): - _install_req(py_executable, unzip, distribute=True, - search_dirs=search_dirs, never_download=never_download) - -_pip_re = re.compile(r'^pip-.*(zip|tar.gz|tar.bz2|tgz|tbz)$', re.I) -def install_pip(py_executable, search_dirs=None, never_download=False): - if search_dirs is None: - search_dirs = file_search_dirs() - - filenames = [] - for dir in search_dirs: - filenames.extend([join(dir, fn) for fn in os.listdir(dir) - if _pip_re.search(fn)]) - filenames = [(os.path.basename(filename).lower(), i, filename) for i, filename in enumerate(filenames)] - filenames.sort() - filenames = [filename for basename, i, filename in filenames] - if not filenames: - filename = 'pip' - else: - filename = filenames[-1] - easy_install_script = 'easy_install' - if sys.platform == 'win32': - easy_install_script = 'easy_install-script.py' - cmd = [join(os.path.dirname(py_executable), easy_install_script), filename] - if sys.platform == 'win32': - cmd.insert(0, py_executable) - if filename == 'pip': - if never_download: - logger.fatal("Can't find any local distributions of pip to install " - "and --never-download is set. Either re-run virtualenv " - "without the --never-download option, or place a pip " - "source distribution (zip/tar.gz/tar.bz2) in one of these " - "locations: %r" % search_dirs) - sys.exit(1) - logger.info('Installing pip from network...') - else: - logger.info('Installing existing %s distribution: %s' % ( - os.path.basename(filename), filename)) - logger.start_progress('Installing pip...') - logger.indent += 2 - def _filter_setup(line): - return filter_ez_setup(line, 'pip') - try: - call_subprocess(cmd, show_stdout=False, - filter_stdout=_filter_setup) - finally: - logger.indent -= 2 - logger.end_progress() - -def filter_ez_setup(line, project_name='setuptools'): - if not line.strip(): - return Logger.DEBUG - if project_name == 'distribute': - for prefix in ('Extracting', 'Now working', 'Installing', 'Before', - 'Scanning', 'Setuptools', 'Egg', 'Already', - 'running', 'writing', 'reading', 'installing', - 'creating', 'copying', 'byte-compiling', 'removing', - 'Processing'): - if line.startswith(prefix): - return Logger.DEBUG - return Logger.DEBUG - for prefix in ['Reading ', 'Best match', 'Processing setuptools', - 'Copying setuptools', 'Adding setuptools', - 'Installing ', 'Installed ']: - if line.startswith(prefix): - return Logger.DEBUG - return Logger.INFO - - -class UpdatingDefaultsHelpFormatter(optparse.IndentedHelpFormatter): - """ - Custom help formatter for use in ConfigOptionParser that updates - the defaults before expanding them, allowing them to show up correctly - in the help listing - """ - def expand_default(self, option): - if self.parser is not None: - self.parser.update_defaults(self.parser.defaults) - return optparse.IndentedHelpFormatter.expand_default(self, option) - - -class ConfigOptionParser(optparse.OptionParser): - """ - Custom option parser which updates its defaults by by checking the - configuration files and environmental variables - """ - def __init__(self, *args, **kwargs): - self.config = ConfigParser.RawConfigParser() - self.files = self.get_config_files() - self.config.read(self.files) - optparse.OptionParser.__init__(self, *args, **kwargs) - - def get_config_files(self): - config_file = os.environ.get('VIRTUALENV_CONFIG_FILE', False) - if config_file and os.path.exists(config_file): - return [config_file] - return [default_config_file] - - def update_defaults(self, defaults): - """ - Updates the given defaults with values from the config files and - the environ. Does a little special handling for certain types of - options (lists). - """ - # Then go and look for the other sources of configuration: - config = {} - # 1. config files - config.update(dict(self.get_config_section('virtualenv'))) - # 2. environmental variables - config.update(dict(self.get_environ_vars())) - # Then set the options with those values - for key, val in config.items(): - key = key.replace('_', '-') - if not key.startswith('--'): - key = '--%s' % key # only prefer long opts - option = self.get_option(key) - if option is not None: - # ignore empty values - if not val: - continue - # handle multiline configs - if option.action == 'append': - val = val.split() - else: - option.nargs = 1 - if option.action in ('store_true', 'store_false', 'count'): - val = strtobool(val) - try: - val = option.convert_value(key, val) - except optparse.OptionValueError: - e = sys.exc_info()[1] - print("An error occured during configuration: %s" % e) - sys.exit(3) - defaults[option.dest] = val - return defaults - - def get_config_section(self, name): - """ - Get a section of a configuration - """ - if self.config.has_section(name): - return self.config.items(name) - return [] - - def get_environ_vars(self, prefix='VIRTUALENV_'): - """ - Returns a generator with all environmental vars with prefix VIRTUALENV - """ - for key, val in os.environ.items(): - if key.startswith(prefix): - yield (key.replace(prefix, '').lower(), val) - - def get_default_values(self): - """ - Overridding to make updating the defaults after instantiation of - the option parser possible, update_defaults() does the dirty work. - """ - if not self.process_default_values: - # Old, pre-Optik 1.5 behaviour. - return optparse.Values(self.defaults) - - defaults = self.update_defaults(self.defaults.copy()) # ours - for option in self._get_all_options(): - default = defaults.get(option.dest) - if isinstance(default, basestring): - opt_str = option.get_opt_string() - defaults[option.dest] = option.check_value(opt_str, default) - return optparse.Values(defaults) - - -def main(): - parser = ConfigOptionParser( - version=virtualenv_version, - usage="%prog [OPTIONS] DEST_DIR", - formatter=UpdatingDefaultsHelpFormatter()) - - parser.add_option( - '-v', '--verbose', - action='count', - dest='verbose', - default=0, - help="Increase verbosity") - - parser.add_option( - '-q', '--quiet', - action='count', - dest='quiet', - default=0, - help='Decrease verbosity') - - parser.add_option( - '-p', '--python', - dest='python', - metavar='PYTHON_EXE', - help='The Python interpreter to use, e.g., --python=python2.5 will use the python2.5 ' - 'interpreter to create the new environment. The default is the interpreter that ' - 'virtualenv was installed with (%s)' % sys.executable) - - parser.add_option( - '--clear', - dest='clear', - action='store_true', - help="Clear out the non-root install and start from scratch") - - parser.add_option( - '--no-site-packages', - dest='no_site_packages', - action='store_true', - help="Don't give access to the global site-packages dir to the " - "virtual environment") - - parser.add_option( - '--system-site-packages', - dest='system_site_packages', - action='store_true', - help="Give access to the global site-packages dir to the " - "virtual environment") - - parser.add_option( - '--unzip-setuptools', - dest='unzip_setuptools', - action='store_true', - help="Unzip Setuptools or Distribute when installing it") - - parser.add_option( - '--relocatable', - dest='relocatable', - action='store_true', - help='Make an EXISTING virtualenv environment relocatable. ' - 'This fixes up scripts and makes all .pth files relative') - - parser.add_option( - '--distribute', - dest='use_distribute', - action='store_true', - help='Use Distribute instead of Setuptools. Set environ variable ' - 'VIRTUALENV_DISTRIBUTE to make it the default ') - - default_search_dirs = file_search_dirs() - parser.add_option( - '--extra-search-dir', - dest="search_dirs", - action="append", - default=default_search_dirs, - help="Directory to look for setuptools/distribute/pip distributions in. " - "You can add any number of additional --extra-search-dir paths.") - - parser.add_option( - '--never-download', - dest="never_download", - action="store_true", - help="Never download anything from the network. Instead, virtualenv will fail " - "if local distributions of setuptools/distribute/pip are not present.") - - parser.add_option( - '--prompt=', - dest='prompt', - help='Provides an alternative prompt prefix for this environment') - - if 'extend_parser' in globals(): - extend_parser(parser) - - options, args = parser.parse_args() - - global logger - - if 'adjust_options' in globals(): - adjust_options(options, args) - - verbosity = options.verbose - options.quiet - logger = Logger([(Logger.level_for_integer(2-verbosity), sys.stdout)]) - - if options.python and not os.environ.get('VIRTUALENV_INTERPRETER_RUNNING'): - env = os.environ.copy() - interpreter = resolve_interpreter(options.python) - if interpreter == sys.executable: - logger.warn('Already using interpreter %s' % interpreter) - else: - logger.notify('Running virtualenv with interpreter %s' % interpreter) - env['VIRTUALENV_INTERPRETER_RUNNING'] = 'true' - file = __file__ - if file.endswith('.pyc'): - file = file[:-1] - popen = subprocess.Popen([interpreter, file] + sys.argv[1:], env=env) - raise SystemExit(popen.wait()) - - # Force --use-distribute on Python 3, since setuptools is not available. - if majver > 2: - options.use_distribute = True - - if os.environ.get('PYTHONDONTWRITEBYTECODE') and not options.use_distribute: - print( - "The PYTHONDONTWRITEBYTECODE environment variable is " - "not compatible with setuptools. Either use --distribute " - "or unset PYTHONDONTWRITEBYTECODE.") - sys.exit(2) - if not args: - print('You must provide a DEST_DIR') - parser.print_help() - sys.exit(2) - if len(args) > 1: - print('There must be only one argument: DEST_DIR (you gave %s)' % ( - ' '.join(args))) - parser.print_help() - sys.exit(2) - - home_dir = args[0] - - if os.environ.get('WORKING_ENV'): - logger.fatal('ERROR: you cannot run virtualenv while in a workingenv') - logger.fatal('Please deactivate your workingenv, then re-run this script') - sys.exit(3) - - if 'PYTHONHOME' in os.environ: - logger.warn('PYTHONHOME is set. You *must* activate the virtualenv before using it') - del os.environ['PYTHONHOME'] - - if options.relocatable: - make_environment_relocatable(home_dir) - return - - if options.no_site_packages: - logger.warn('The --no-site-packages flag is deprecated; it is now ' - 'the default behavior.') - - create_environment(home_dir, - site_packages=options.system_site_packages, - clear=options.clear, - unzip_setuptools=options.unzip_setuptools, - use_distribute=options.use_distribute, - prompt=options.prompt, - search_dirs=options.search_dirs, - never_download=options.never_download) - if 'after_install' in globals(): - after_install(options, home_dir) - -def call_subprocess(cmd, show_stdout=True, - filter_stdout=None, cwd=None, - raise_on_returncode=True, extra_env=None, - remove_from_env=None): - cmd_parts = [] - for part in cmd: - if len(part) > 45: - part = part[:20]+"..."+part[-20:] - if ' ' in part or '\n' in part or '"' in part or "'" in part: - part = '"%s"' % part.replace('"', '\\"') - if hasattr(part, 'decode'): - try: - part = part.decode(sys.getdefaultencoding()) - except UnicodeDecodeError: - part = part.decode(sys.getfilesystemencoding()) - cmd_parts.append(part) - cmd_desc = ' '.join(cmd_parts) - if show_stdout: - stdout = None - else: - stdout = subprocess.PIPE - logger.debug("Running command %s" % cmd_desc) - if extra_env or remove_from_env: - env = os.environ.copy() - if extra_env: - env.update(extra_env) - if remove_from_env: - for varname in remove_from_env: - env.pop(varname, None) - else: - env = None - try: - proc = subprocess.Popen( - cmd, stderr=subprocess.STDOUT, stdin=None, stdout=stdout, - cwd=cwd, env=env) - except Exception: - e = sys.exc_info()[1] - logger.fatal( - "Error %s while executing command %s" % (e, cmd_desc)) - raise - all_output = [] - if stdout is not None: - stdout = proc.stdout - encoding = sys.getdefaultencoding() - fs_encoding = sys.getfilesystemencoding() - while 1: - line = stdout.readline() - try: - line = line.decode(encoding) - except UnicodeDecodeError: - line = line.decode(fs_encoding) - if not line: - break - line = line.rstrip() - all_output.append(line) - if filter_stdout: - level = filter_stdout(line) - if isinstance(level, tuple): - level, line = level - logger.log(level, line) - if not logger.stdout_level_matches(level): - logger.show_progress() - else: - logger.info(line) - else: - proc.communicate() - proc.wait() - if proc.returncode: - if raise_on_returncode: - if all_output: - logger.notify('Complete output from command %s:' % cmd_desc) - logger.notify('\n'.join(all_output) + '\n----------------------------------------') - raise OSError( - "Command %s failed with error code %s" - % (cmd_desc, proc.returncode)) - else: - logger.warn( - "Command %s had error code %s" - % (cmd_desc, proc.returncode)) - - -def create_environment(home_dir, site_packages=False, clear=False, - unzip_setuptools=False, use_distribute=False, - prompt=None, search_dirs=None, never_download=False): - """ - Creates a new environment in ``home_dir``. - - If ``site_packages`` is true, then the global ``site-packages/`` - directory will be on the path. - - If ``clear`` is true (default False) then the environment will - first be cleared. - """ - home_dir, lib_dir, inc_dir, bin_dir = path_locations(home_dir) - - py_executable = os.path.abspath(install_python( - home_dir, lib_dir, inc_dir, bin_dir, - site_packages=site_packages, clear=clear)) - - install_distutils(home_dir) - - # use_distribute also is True if VIRTUALENV_DISTRIBUTE env var is set - # we also check VIRTUALENV_USE_DISTRIBUTE for backwards compatibility - if use_distribute or os.environ.get('VIRTUALENV_USE_DISTRIBUTE'): - install_distribute(py_executable, unzip=unzip_setuptools, - search_dirs=search_dirs, never_download=never_download) - else: - install_setuptools(py_executable, unzip=unzip_setuptools, - search_dirs=search_dirs, never_download=never_download) - - install_pip(py_executable, search_dirs=search_dirs, never_download=never_download) - - install_activate(home_dir, bin_dir, prompt) - -def path_locations(home_dir): - """Return the path locations for the environment (where libraries are, - where scripts go, etc)""" - # XXX: We'd use distutils.sysconfig.get_python_inc/lib but its - # prefix arg is broken: http://bugs.python.org/issue3386 - if sys.platform == 'win32': - # Windows has lots of problems with executables with spaces in - # the name; this function will remove them (using the ~1 - # format): - mkdir(home_dir) - if ' ' in home_dir: - try: - import win32api - except ImportError: - print('Error: the path "%s" has a space in it' % home_dir) - print('To handle these kinds of paths, the win32api module must be installed:') - print(' http://sourceforge.net/projects/pywin32/') - sys.exit(3) - home_dir = win32api.GetShortPathName(home_dir) - lib_dir = join(home_dir, 'Lib') - inc_dir = join(home_dir, 'Include') - bin_dir = join(home_dir, 'Scripts') - elif is_jython: - lib_dir = join(home_dir, 'Lib') - inc_dir = join(home_dir, 'Include') - bin_dir = join(home_dir, 'bin') - elif is_pypy: - lib_dir = home_dir - inc_dir = join(home_dir, 'include') - bin_dir = join(home_dir, 'bin') - else: - lib_dir = join(home_dir, 'lib', py_version) - inc_dir = join(home_dir, 'include', py_version + abiflags) - bin_dir = join(home_dir, 'bin') - return home_dir, lib_dir, inc_dir, bin_dir - - -def change_prefix(filename, dst_prefix): - prefixes = [sys.prefix] - - if sys.platform == "darwin": - prefixes.extend(( - os.path.join("/Library/Python", sys.version[:3], "site-packages"), - os.path.join(sys.prefix, "Extras", "lib", "python"), - os.path.join("~", "Library", "Python", sys.version[:3], "site-packages"))) - - if hasattr(sys, 'real_prefix'): - prefixes.append(sys.real_prefix) - prefixes = list(map(os.path.abspath, prefixes)) - filename = os.path.abspath(filename) - for src_prefix in prefixes: - if filename.startswith(src_prefix): - _, relpath = filename.split(src_prefix, 1) - assert relpath[0] == os.sep - relpath = relpath[1:] - return join(dst_prefix, relpath) - assert False, "Filename %s does not start with any of these prefixes: %s" % \ - (filename, prefixes) - -def copy_required_modules(dst_prefix): - import imp - for modname in REQUIRED_MODULES: - if modname in sys.builtin_module_names: - logger.info("Ignoring built-in bootstrap module: %s" % modname) - continue - try: - f, filename, _ = imp.find_module(modname) - except ImportError: - logger.info("Cannot import bootstrap module: %s" % modname) - else: - if f is not None: - f.close() - dst_filename = change_prefix(filename, dst_prefix) - copyfile(filename, dst_filename) - if filename.endswith('.pyc'): - pyfile = filename[:-1] - if os.path.exists(pyfile): - copyfile(pyfile, dst_filename[:-1]) - - -def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear): - """Install just the base environment, no distutils patches etc""" - if sys.executable.startswith(bin_dir): - print('Please use the *system* python to run this script') - return - - if clear: - rmtree(lib_dir) - ## FIXME: why not delete it? - ## Maybe it should delete everything with #!/path/to/venv/python in it - logger.notify('Not deleting %s', bin_dir) - - if hasattr(sys, 'real_prefix'): - logger.notify('Using real prefix %r' % sys.real_prefix) - prefix = sys.real_prefix - else: - prefix = sys.prefix - mkdir(lib_dir) - fix_lib64(lib_dir) - fix_local_scheme(home_dir) - stdlib_dirs = [os.path.dirname(os.__file__)] - if sys.platform == 'win32': - stdlib_dirs.append(join(os.path.dirname(stdlib_dirs[0]), 'DLLs')) - elif sys.platform == 'darwin': - stdlib_dirs.append(join(stdlib_dirs[0], 'site-packages')) - if hasattr(os, 'symlink'): - logger.info('Symlinking Python bootstrap modules') - else: - logger.info('Copying Python bootstrap modules') - logger.indent += 2 - try: - # copy required files... - for stdlib_dir in stdlib_dirs: - if not os.path.isdir(stdlib_dir): - continue - for fn in os.listdir(stdlib_dir): - bn = os.path.splitext(fn)[0] - if fn != 'site-packages' and bn in REQUIRED_FILES: - copyfile(join(stdlib_dir, fn), join(lib_dir, fn)) - # ...and modules - copy_required_modules(home_dir) - finally: - logger.indent -= 2 - mkdir(join(lib_dir, 'site-packages')) - import site - site_filename = site.__file__ - if site_filename.endswith('.pyc'): - site_filename = site_filename[:-1] - elif site_filename.endswith('$py.class'): - site_filename = site_filename.replace('$py.class', '.py') - site_filename_dst = change_prefix(site_filename, home_dir) - site_dir = os.path.dirname(site_filename_dst) - writefile(site_filename_dst, SITE_PY) - writefile(join(site_dir, 'orig-prefix.txt'), prefix) - site_packages_filename = join(site_dir, 'no-global-site-packages.txt') - if not site_packages: - writefile(site_packages_filename, '') - else: - if os.path.exists(site_packages_filename): - logger.info('Deleting %s' % site_packages_filename) - os.unlink(site_packages_filename) - - if is_pypy or is_win: - stdinc_dir = join(prefix, 'include') - else: - stdinc_dir = join(prefix, 'include', py_version + abiflags) - if os.path.exists(stdinc_dir): - copyfile(stdinc_dir, inc_dir) - else: - logger.debug('No include dir %s' % stdinc_dir) - - # pypy never uses exec_prefix, just ignore it - if sys.exec_prefix != prefix and not is_pypy: - if sys.platform == 'win32': - exec_dir = join(sys.exec_prefix, 'lib') - elif is_jython: - exec_dir = join(sys.exec_prefix, 'Lib') - else: - exec_dir = join(sys.exec_prefix, 'lib', py_version) - for fn in os.listdir(exec_dir): - copyfile(join(exec_dir, fn), join(lib_dir, fn)) - - if is_jython: - # Jython has either jython-dev.jar and javalib/ dir, or just - # jython.jar - for name in 'jython-dev.jar', 'javalib', 'jython.jar': - src = join(prefix, name) - if os.path.exists(src): - copyfile(src, join(home_dir, name)) - # XXX: registry should always exist after Jython 2.5rc1 - src = join(prefix, 'registry') - if os.path.exists(src): - copyfile(src, join(home_dir, 'registry'), symlink=False) - copyfile(join(prefix, 'cachedir'), join(home_dir, 'cachedir'), - symlink=False) - - mkdir(bin_dir) - py_executable = join(bin_dir, os.path.basename(sys.executable)) - if 'Python.framework' in prefix: - if re.search(r'/Python(?:-32|-64)*$', py_executable): - # The name of the python executable is not quite what - # we want, rename it. - py_executable = os.path.join( - os.path.dirname(py_executable), 'python') - - logger.notify('New %s executable in %s', expected_exe, py_executable) - if sys.executable != py_executable: - ## FIXME: could I just hard link? - executable = sys.executable - if sys.platform == 'cygwin' and os.path.exists(executable + '.exe'): - # Cygwin misreports sys.executable sometimes - executable += '.exe' - py_executable += '.exe' - logger.info('Executable actually exists in %s' % executable) - shutil.copyfile(executable, py_executable) - make_exe(py_executable) - if sys.platform == 'win32' or sys.platform == 'cygwin': - pythonw = os.path.join(os.path.dirname(sys.executable), 'pythonw.exe') - if os.path.exists(pythonw): - logger.info('Also created pythonw.exe') - shutil.copyfile(pythonw, os.path.join(os.path.dirname(py_executable), 'pythonw.exe')) - if is_pypy: - # make a symlink python --> pypy-c - python_executable = os.path.join(os.path.dirname(py_executable), 'python') - logger.info('Also created executable %s' % python_executable) - copyfile(py_executable, python_executable) - - if os.path.splitext(os.path.basename(py_executable))[0] != expected_exe: - secondary_exe = os.path.join(os.path.dirname(py_executable), - expected_exe) - py_executable_ext = os.path.splitext(py_executable)[1] - if py_executable_ext == '.exe': - # python2.4 gives an extension of '.4' :P - secondary_exe += py_executable_ext - if os.path.exists(secondary_exe): - logger.warn('Not overwriting existing %s script %s (you must use %s)' - % (expected_exe, secondary_exe, py_executable)) - else: - logger.notify('Also creating executable in %s' % secondary_exe) - shutil.copyfile(sys.executable, secondary_exe) - make_exe(secondary_exe) - - if 'Python.framework' in prefix: - logger.debug('MacOSX Python framework detected') - - # Make sure we use the the embedded interpreter inside - # the framework, even if sys.executable points to - # the stub executable in ${sys.prefix}/bin - # See http://groups.google.com/group/python-virtualenv/ - # browse_thread/thread/17cab2f85da75951 - original_python = os.path.join( - prefix, 'Resources/Python.app/Contents/MacOS/Python') - shutil.copy(original_python, py_executable) - - # Copy the framework's dylib into the virtual - # environment - virtual_lib = os.path.join(home_dir, '.Python') - - if os.path.exists(virtual_lib): - os.unlink(virtual_lib) - copyfile( - os.path.join(prefix, 'Python'), - virtual_lib) - - # And then change the install_name of the copied python executable - try: - call_subprocess( - ["install_name_tool", "-change", - os.path.join(prefix, 'Python'), - '@executable_path/../.Python', - py_executable]) - except: - logger.fatal( - "Could not call install_name_tool -- you must have Apple's development tools installed") - raise - - # Some tools depend on pythonX.Y being present - py_executable_version = '%s.%s' % ( - sys.version_info[0], sys.version_info[1]) - if not py_executable.endswith(py_executable_version): - # symlinking pythonX.Y > python - pth = py_executable + '%s.%s' % ( - sys.version_info[0], sys.version_info[1]) - if os.path.exists(pth): - os.unlink(pth) - os.symlink('python', pth) - else: - # reverse symlinking python -> pythonX.Y (with --python) - pth = join(bin_dir, 'python') - if os.path.exists(pth): - os.unlink(pth) - os.symlink(os.path.basename(py_executable), pth) - - if sys.platform == 'win32' and ' ' in py_executable: - # There's a bug with subprocess on Windows when using a first - # argument that has a space in it. Instead we have to quote - # the value: - py_executable = '"%s"' % py_executable - cmd = [py_executable, '-c', """ -import sys -prefix = sys.prefix -if sys.version_info[0] == 3: - prefix = prefix.encode('utf8') -if hasattr(sys.stdout, 'detach'): - sys.stdout = sys.stdout.detach() -elif hasattr(sys.stdout, 'buffer'): - sys.stdout = sys.stdout.buffer -sys.stdout.write(prefix) -"""] - logger.info('Testing executable with %s %s "%s"' % tuple(cmd)) - try: - proc = subprocess.Popen(cmd, - stdout=subprocess.PIPE) - proc_stdout, proc_stderr = proc.communicate() - except OSError: - e = sys.exc_info()[1] - if e.errno == errno.EACCES: - logger.fatal('ERROR: The executable %s could not be run: %s' % (py_executable, e)) - sys.exit(100) - else: - raise e - - proc_stdout = proc_stdout.strip().decode("utf-8") - proc_stdout = os.path.normcase(os.path.abspath(proc_stdout)) - norm_home_dir = os.path.normcase(os.path.abspath(home_dir)) - if hasattr(norm_home_dir, 'decode'): - norm_home_dir = norm_home_dir.decode(sys.getfilesystemencoding()) - if proc_stdout != norm_home_dir: - logger.fatal( - 'ERROR: The executable %s is not functioning' % py_executable) - logger.fatal( - 'ERROR: It thinks sys.prefix is %r (should be %r)' - % (proc_stdout, norm_home_dir)) - logger.fatal( - 'ERROR: virtualenv is not compatible with this system or executable') - if sys.platform == 'win32': - logger.fatal( - 'Note: some Windows users have reported this error when they installed Python for "Only this user". The problem may be resolvable if you install Python "For all users". (See https://bugs.launchpad.net/virtualenv/+bug/352844)') - sys.exit(100) - else: - logger.info('Got sys.prefix result: %r' % proc_stdout) - - pydistutils = os.path.expanduser('~/.pydistutils.cfg') - if os.path.exists(pydistutils): - logger.notify('Please make sure you remove any previous custom paths from ' - 'your %s file.' % pydistutils) - ## FIXME: really this should be calculated earlier - return py_executable - -def install_activate(home_dir, bin_dir, prompt=None): - if sys.platform == 'win32' or is_jython and os._name == 'nt': - files = {'activate.bat': ACTIVATE_BAT, - 'deactivate.bat': DEACTIVATE_BAT} - if os.environ.get('OS') == 'Windows_NT' and os.environ.get('OSTYPE') == 'cygwin': - files['activate'] = ACTIVATE_SH - else: - files = {'activate': ACTIVATE_SH} - - # suppling activate.fish in addition to, not instead of, the - # bash script support. - files['activate.fish'] = ACTIVATE_FISH - - # same for csh/tcsh support... - files['activate.csh'] = ACTIVATE_CSH - - - - files['activate_this.py'] = ACTIVATE_THIS - home_dir = os.path.abspath(home_dir) - if hasattr(home_dir, 'decode'): - home_dir = home_dir.decode(sys.getfilesystemencoding()) - vname = os.path.basename(home_dir) - for name, content in files.items(): - content = content.replace('__VIRTUAL_PROMPT__', prompt or '') - content = content.replace('__VIRTUAL_WINPROMPT__', prompt or '(%s)' % vname) - content = content.replace('__VIRTUAL_ENV__', home_dir) - content = content.replace('__VIRTUAL_NAME__', vname) - content = content.replace('__BIN_NAME__', os.path.basename(bin_dir)) - writefile(os.path.join(bin_dir, name), content) - -def install_distutils(home_dir): - distutils_path = change_prefix(distutils.__path__[0], home_dir) - mkdir(distutils_path) - ## FIXME: maybe this prefix setting should only be put in place if - ## there's a local distutils.cfg with a prefix setting? - home_dir = os.path.abspath(home_dir) - ## FIXME: this is breaking things, removing for now: - #distutils_cfg = DISTUTILS_CFG + "\n[install]\nprefix=%s\n" % home_dir - writefile(os.path.join(distutils_path, '__init__.py'), DISTUTILS_INIT) - writefile(os.path.join(distutils_path, 'distutils.cfg'), DISTUTILS_CFG, overwrite=False) - -def fix_local_scheme(home_dir): - """ - Platforms that use the "posix_local" install scheme (like Ubuntu with - Python 2.7) need to be given an additional "local" location, sigh. - """ - try: - import sysconfig - except ImportError: - pass - else: - if sysconfig._get_default_scheme() == 'posix_local': - local_path = os.path.join(home_dir, 'local') - if not os.path.exists(local_path): - os.symlink(os.path.abspath(home_dir), local_path) - -def fix_lib64(lib_dir): - """ - Some platforms (particularly Gentoo on x64) put things in lib64/pythonX.Y - instead of lib/pythonX.Y. If this is such a platform we'll just create a - symlink so lib64 points to lib - """ - if [p for p in distutils.sysconfig.get_config_vars().values() - if isinstance(p, basestring) and 'lib64' in p]: - logger.debug('This system uses lib64; symlinking lib64 to lib') - assert os.path.basename(lib_dir) == 'python%s' % sys.version[:3], ( - "Unexpected python lib dir: %r" % lib_dir) - lib_parent = os.path.dirname(lib_dir) - assert os.path.basename(lib_parent) == 'lib', ( - "Unexpected parent dir: %r" % lib_parent) - copyfile(lib_parent, os.path.join(os.path.dirname(lib_parent), 'lib64')) - -def resolve_interpreter(exe): - """ - If the executable given isn't an absolute path, search $PATH for the interpreter - """ - if os.path.abspath(exe) != exe: - paths = os.environ.get('PATH', '').split(os.pathsep) - for path in paths: - if os.path.exists(os.path.join(path, exe)): - exe = os.path.join(path, exe) - break - if not os.path.exists(exe): - logger.fatal('The executable %s (from --python=%s) does not exist' % (exe, exe)) - raise SystemExit(3) - if not is_executable(exe): - logger.fatal('The executable %s (from --python=%s) is not executable' % (exe, exe)) - raise SystemExit(3) - return exe - -def is_executable(exe): - """Checks a file is executable""" - return os.access(exe, os.X_OK) - -############################################################ -## Relocating the environment: - -def make_environment_relocatable(home_dir): - """ - Makes the already-existing environment use relative paths, and takes out - the #!-based environment selection in scripts. - """ - home_dir, lib_dir, inc_dir, bin_dir = path_locations(home_dir) - activate_this = os.path.join(bin_dir, 'activate_this.py') - if not os.path.exists(activate_this): - logger.fatal( - 'The environment doesn\'t have a file %s -- please re-run virtualenv ' - 'on this environment to update it' % activate_this) - fixup_scripts(home_dir) - fixup_pth_and_egg_link(home_dir) - ## FIXME: need to fix up distutils.cfg - -OK_ABS_SCRIPTS = ['python', 'python%s' % sys.version[:3], - 'activate', 'activate.bat', 'activate_this.py'] - -def fixup_scripts(home_dir): - # This is what we expect at the top of scripts: - shebang = '#!%s/bin/python' % os.path.normcase(os.path.abspath(home_dir)) - # This is what we'll put: - new_shebang = '#!/usr/bin/env python%s' % sys.version[:3] - activate = "import os; activate_this=os.path.join(os.path.dirname(__file__), 'activate_this.py'); execfile(activate_this, dict(__file__=activate_this)); del os, activate_this" - if sys.platform == 'win32': - bin_suffix = 'Scripts' - else: - bin_suffix = 'bin' - bin_dir = os.path.join(home_dir, bin_suffix) - home_dir, lib_dir, inc_dir, bin_dir = path_locations(home_dir) - for filename in os.listdir(bin_dir): - filename = os.path.join(bin_dir, filename) - if not os.path.isfile(filename): - # ignore subdirs, e.g. .svn ones. - continue - f = open(filename, 'rb') - lines = f.readlines() - f.close() - if not lines: - logger.warn('Script %s is an empty file' % filename) - continue - if not lines[0].strip().startswith(shebang): - if os.path.basename(filename) in OK_ABS_SCRIPTS: - logger.debug('Cannot make script %s relative' % filename) - elif lines[0].strip() == new_shebang: - logger.info('Script %s has already been made relative' % filename) - else: - logger.warn('Script %s cannot be made relative (it\'s not a normal script that starts with %s)' - % (filename, shebang)) - continue - logger.notify('Making script %s relative' % filename) - lines = [new_shebang+'\n', activate+'\n'] + lines[1:] - f = open(filename, 'wb') - f.writelines(lines) - f.close() - -def fixup_pth_and_egg_link(home_dir, sys_path=None): - """Makes .pth and .egg-link files use relative paths""" - home_dir = os.path.normcase(os.path.abspath(home_dir)) - if sys_path is None: - sys_path = sys.path - for path in sys_path: - if not path: - path = '.' - if not os.path.isdir(path): - continue - path = os.path.normcase(os.path.abspath(path)) - if not path.startswith(home_dir): - logger.debug('Skipping system (non-environment) directory %s' % path) - continue - for filename in os.listdir(path): - filename = os.path.join(path, filename) - if filename.endswith('.pth'): - if not os.access(filename, os.W_OK): - logger.warn('Cannot write .pth file %s, skipping' % filename) - else: - fixup_pth_file(filename) - if filename.endswith('.egg-link'): - if not os.access(filename, os.W_OK): - logger.warn('Cannot write .egg-link file %s, skipping' % filename) - else: - fixup_egg_link(filename) - -def fixup_pth_file(filename): - lines = [] - prev_lines = [] - f = open(filename) - prev_lines = f.readlines() - f.close() - for line in prev_lines: - line = line.strip() - if (not line or line.startswith('#') or line.startswith('import ') - or os.path.abspath(line) != line): - lines.append(line) - else: - new_value = make_relative_path(filename, line) - if line != new_value: - logger.debug('Rewriting path %s as %s (in %s)' % (line, new_value, filename)) - lines.append(new_value) - if lines == prev_lines: - logger.info('No changes to .pth file %s' % filename) - return - logger.notify('Making paths in .pth file %s relative' % filename) - f = open(filename, 'w') - f.write('\n'.join(lines) + '\n') - f.close() - -def fixup_egg_link(filename): - f = open(filename) - link = f.read().strip() - f.close() - if os.path.abspath(link) != link: - logger.debug('Link in %s already relative' % filename) - return - new_link = make_relative_path(filename, link) - logger.notify('Rewriting link %s in %s as %s' % (link, filename, new_link)) - f = open(filename, 'w') - f.write(new_link) - f.close() - -def make_relative_path(source, dest, dest_is_directory=True): - """ - Make a filename relative, where the filename is dest, and it is - being referred to from the filename source. - - >>> make_relative_path('/usr/share/something/a-file.pth', - ... '/usr/share/another-place/src/Directory') - '../another-place/src/Directory' - >>> make_relative_path('/usr/share/something/a-file.pth', - ... '/home/user/src/Directory') - '../../../home/user/src/Directory' - >>> make_relative_path('/usr/share/a-file.pth', '/usr/share/') - './' - """ - source = os.path.dirname(source) - if not dest_is_directory: - dest_filename = os.path.basename(dest) - dest = os.path.dirname(dest) - dest = os.path.normpath(os.path.abspath(dest)) - source = os.path.normpath(os.path.abspath(source)) - dest_parts = dest.strip(os.path.sep).split(os.path.sep) - source_parts = source.strip(os.path.sep).split(os.path.sep) - while dest_parts and source_parts and dest_parts[0] == source_parts[0]: - dest_parts.pop(0) - source_parts.pop(0) - full_parts = ['..']*len(source_parts) + dest_parts - if not dest_is_directory: - full_parts.append(dest_filename) - if not full_parts: - # Special case for the current directory (otherwise it'd be '') - return './' - return os.path.sep.join(full_parts) - - - -############################################################ -## Bootstrap script creation: - -def create_bootstrap_script(extra_text, python_version=''): - """ - Creates a bootstrap script, which is like this script but with - extend_parser, adjust_options, and after_install hooks. - - This returns a string that (written to disk of course) can be used - as a bootstrap script with your own customizations. The script - will be the standard virtualenv.py script, with your extra text - added (your extra text should be Python code). - - If you include these functions, they will be called: - - ``extend_parser(optparse_parser)``: - You can add or remove options from the parser here. - - ``adjust_options(options, args)``: - You can change options here, or change the args (if you accept - different kinds of arguments, be sure you modify ``args`` so it is - only ``[DEST_DIR]``). - - ``after_install(options, home_dir)``: - - After everything is installed, this function is called. This - is probably the function you are most likely to use. An - example would be:: - - def after_install(options, home_dir): - subprocess.call([join(home_dir, 'bin', 'easy_install'), - 'MyPackage']) - subprocess.call([join(home_dir, 'bin', 'my-package-script'), - 'setup', home_dir]) - - This example immediately installs a package, and runs a setup - script from that package. - - If you provide something like ``python_version='2.4'`` then the - script will start with ``#!/usr/bin/env python2.4`` instead of - ``#!/usr/bin/env python``. You can use this when the script must - be run with a particular Python version. - """ - filename = __file__ - if filename.endswith('.pyc'): - filename = filename[:-1] - f = open(filename, 'rb') - content = f.read() - f.close() - py_exe = 'python%s' % python_version - content = (('#!/usr/bin/env %s\n' % py_exe) - + '## WARNING: This file is generated\n' - + content) - return content.replace('##EXT' 'END##', extra_text) - -##EXTEND## - -def convert(s): - b = base64.b64decode(s.encode('ascii')) - return zlib.decompress(b).decode('utf-8') - -##file site.py -SITE_PY = convert(""" -eJzVPP1z2zaWv/OvwMqTIZXKdD66nR2n7o2TOK3v3MTbpLO5dT06SoIk1hTJEqQV7c3d337vAwAB -kvLHdvvDaTKxRAIPDw/vGw8YjUanZSnzhdgUiyaTQsmkmq9FmdRrJZZFJep1Wi0Oy6Sqd/B0fpOs -pBJ1IdROxdgqDoKnv/MTPBWf1qkyKMC3pKmLTVKn8yTLdiLdlEVVy4VYNFWar0Sap3WaZOk/oEWR -x+Lp78cgOM8FzDxLZSVuZaUArhLFUlzu6nWRi6gpcc7P4z8nL8cToeZVWtbQoNI4A0XWSR3kUi4A -TWjZKCBlWstDVcp5ukzntuG2aLKFKLNkLsV//RdPjZqGYaCKjdyuZSVFDsgATAmwSsQDvqaVmBcL -GQvxWs4THICft8QKGNoE10whGfNCZEW+gjnlci6VSqqdiGZNTYAIZbEoAKcUMKjTLAu2RXWjxrCk -tB5beCQSZg9/MsweME8cv885gOOHPPg5T79MGDZwD4Kr18w2lVymX0SCYOGn/CLnU/0sSpdikS6X -QIO8HmOTgBFQIktnRyUtx7d6hb47IqwsVyYwhkSUuTG/pB5xcF6LJFPAtk2JNFKE+Vs5S5McqJHf -wnAAEUgaDI2zSFVtx6HZiQIAVLiONUjJRolok6Q5MOuPyZzQ/luaL4qtGhMFYLWU+LVRtTv/aIAA -0NohwCTAxTKr2eRZeiOz3RgQ+ATYV1I1WY0CsUgrOa+LKpWKAABqOyG/ANITkVRSk5A508jthOhP -NElzXFgUMBR4fIkkWaarpiIJE8sUOBe44t2Hn8Tbs9fnp+81jxlgLLOrDeAMUGihHZxgAHHUqOoo -K0Cg4+AC/4hksUAhW+H4gFfb4OjelQ4imHsZd/s4Cw5k14urh4E51qBMaKyA+v03dJmoNdDnf+5Z -7yA43UcVmjh/264LkMk82UixTpi/kDOCbzWc7+KyXr8CblAIpwZSKVwcRDBFeEASl2ZRkUtRAotl -aS7HAVBoRm39VQRWeF/kh7TW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HnUal5vbJ8oOI+9wI86vb2d8Nrm/4Xy4RZ8R85E4uTZPB5EZPnTaaAGu -E59J8BE2J8XgrkbLeXMlVoQxznEYFYY8uFFdxsKQRx90Giwx9vSueHP1YNaUSFG4vTaErNSYuBOF -lXiVyXa9Sy3JdClEyK1dD6Nos9mEf8iKlOpmqSNTZnYjNEWiUYn2pKNB3ttcLJ3HmYYXy6Un76f7 -r8rRsC1TpTJj7f19m5sUf/V3Ir+x/yjtLu8KjLX/CmN/AcVGUUo= -""") - -##file activate.bat -ACTIVATE_BAT = convert(""" -eJyFUkEKgzAQvAfyhz0YaL9QEWpRqlSjWGspFPZQTevFHOr/adQaU1GaUzI7Mzu7ZF89XhKkEJS8 -qxaKMMsvboQ+LxxE44VICSW1gEa2UFaibqoS0iyJ0xw2lIA6nX5AHCu1jpRsv5KRjknkac9VLVug -sX9mtzxIeJDE/mg4OGp47qoLo3NHX2jsMB3AiDht5hryAUOEifoTdCXbSh7V0My2NMq/Xbh5MEjU -ZT63gpgNT9lKOJ/CtHsvT99re3pX303kydn4HeyOeAg5cjf2EW1D6HOPkg9NGKhu -""") - -##file deactivate.bat -DEACTIVATE_BAT = convert(""" -eJxzSE3OyFfIT0vj4spMU0hJTcvMS01RiPf3cYkP8wwKCXX0iQ8I8vcNCFHQ4FIAguLUEgWIgK0q -FlWqXJpcICVYpGzx2BAZ4uHv5+Hv6wq1BWINXBTdKriEKkI1DhW2QAfhttcxxANiFZCBbglQSJUL -i2dASrm4rFz9XLgAwJNbyQ== -""") - -##file distutils-init.py -DISTUTILS_INIT = convert(""" -eJytV92L4zYQf/dfMU0ottuse7RvC6FQrg8Lxz2Ugz4si9HacqKuIxlJ2ST313dG8odkO9d7aGBB -luZLv/nNjFacOqUtKJMIvzK3cXlhWgp5MDBsqK5SNYftsBAGpLLA4F1oe2Ytl+9wUvW55TswCi4c -KibhbFDSglXQCFmDPXIwtm7FawLRbwtPzg2T9gf4gupKv4GS0N262w7V0NvpbCy8cvTo3eAus6C5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Lf -XHbeft85D7tTCMYy2Njp4DJP7gWJr6paVWXZ1+/6YXLv/iE0M90FktiI7yFJD9e7SOLhEkkaMTUO -azq9i2woBNR0/0eoF1HFMf0H8ChxH/jgcB34GZIz3Qn4/vid+VEamQrOVqAPTrOfmD4MPdVh09tb -8dLLjvh/61lEP4yW5vJaH4vHcevG8agXvzPGoOhhXNncpTr99PTHx6e/UvffFLaxUSjuSeP286Dw -gtEMcW1xKr/he4/6IQ6FUXP+0gkioHY5iwC9Eyx3HKO7af0zPPe+XyLn7fAY78k4aiR387bCr5XT -5C4rFgwLGfMvJuAMew== -""") - -##file distutils.cfg -DISTUTILS_CFG = convert(""" -eJxNj00KwkAMhfc9xYNuxe4Ft57AjYiUtDO1wXSmNJnK3N5pdSEEAu8nH6lxHVlRhtDHMPATA4uH -xJ4EFmGbvfJiicSHFRzUSISMY6hq3GLCRLnIvSTnEefN0FIjw5tF0Hkk9Q5dRunBsVoyFi24aaLg -9FDOlL0FPGluf4QjcInLlxd6f6rqkgPu/5nHLg0cXCscXoozRrP51DRT3j9QNl99AP53T2Q= -""") - -##file activate_this.py -ACTIVATE_THIS = convert(""" -eJyNUlGL2zAMfvevEBlHEujSsXsL9GGDvW1jD3sZpQQ3Ua7aJXawnbT595Ocpe0dO5ghseVP+vRJ -VpIkn2cYPZknwAvWLXWYhRP5Sk4baKgOWRWNqtpdgTyH2Y5wpq5Tug406YAgKEzkwqg7NBPwR86a -Hk0olPopaK0NHJHzYQPnE5rI0o8+yBUwiBfyQcT8mMPJGiAT0A0O+b8BY4MKJ7zPcSSzHaKrSpJE -qeDmUgGvVbPCS41DgO+6xy/OWbfAThMn/OQ9ukDWRCSLiKzk1yrLjWapq6NnvHUoHXQ4bYPdrsVX -4lQMc/q6ZW975nmSK+oH6wL42a9H65U6aha342Mh0UVDzrD87C1bH73s16R5zsStkBZDp0NrXQ+7 -HaRnMo8f06UBnljKoOtn/YT+LtdvSyaT/BtIv9KR60nF9f3qmuYKO4//T9ItJMsjPfgUHqKwCZ3n -xu/Lx8M/UvCLTxW7VULHxB1PRRbrYfvWNY5S8it008jOjcleaMqVBDnUXcWULV2YK9JEQ92OfC96 -1Tv4ZicZZZ7GpuEpZbbeQ7DxquVx5hdqoyFSSmXwfC90f1Dc7hjFs/tK99I0fpkI8zSLy4tSy+sI -3vMWehjQNJmE5VePlZbL61nzX3S93ZcfDqznnkb9AZ3GWJU= -""") - -if __name__ == '__main__': - main() - -## TODO: -## Copy python.exe.manifest -## Monkeypatch distutils.sysconfig diff --git a/noarch/lib/py/cxxtest/bin/cxxtestgen b/noarch/lib/py/cxxtest/bin/cxxtestgen deleted file mode 100644 index e001cfa8..00000000 --- a/noarch/lib/py/cxxtest/bin/cxxtestgen +++ /dev/null @@ -1,18 +0,0 @@ -#! /usr/bin/env python -# -# The CxxTest driver script, which uses the cxxtest Python package. -# - -import sys -import os -from os.path import realpath, dirname -if sys.version_info < (3,0): - sys.path.insert(0, dirname(dirname(realpath(__file__)))+os.sep+'python') -else: - sys.path.insert(0, dirname(dirname(realpath(__file__)))+os.sep+'python'+os.sep+'python3') -sys.path.append(".") - -import cxxtest - -cxxtest.main(sys.argv) - diff --git a/noarch/lib/py/cxxtest/bin/cxxtestgen.bat b/noarch/lib/py/cxxtest/bin/cxxtestgen.bat deleted file mode 100644 index 95d7d140..00000000 --- a/noarch/lib/py/cxxtest/bin/cxxtestgen.bat +++ /dev/null @@ -1,3 +0,0 @@ -@echo off -rem Just run the python script -python %0 %* diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/AUTHORS b/noarch/lib/py/cxxtest/build_tools/SCons/AUTHORS deleted file mode 100644 index 1f3e7e44..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/AUTHORS +++ /dev/null @@ -1,19 +0,0 @@ -This file is meant to be a full credit of the people who helped make the CxxTest -builder what it is today. - - -Current maintainer: - GaÅ¡per Ažman (gasper dot azman at gmail.com) - - -Original author: - GaÅ¡per Ažman - -Additional patches and tests: - Diego Nieto Cid - Edmundo López Bobeda - John Darby Mitchell - Pavol Juhas - -Other helpful suggestions: - John Darby Mitchell diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/cxxtest.py b/noarch/lib/py/cxxtest/build_tools/SCons/cxxtest.py deleted file mode 100644 index a66856c4..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/cxxtest.py +++ /dev/null @@ -1,400 +0,0 @@ -# coding=UTF-8 -#------------------------------------------------------------------------- -# CxxTest: A lightweight C++ unit testing library. -# Copyright (c) 2008 Sandia Corporation. -# This software is distributed under the LGPL License v3 -# For more information, see the COPYING file in the top CxxTest directory. -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -#------------------------------------------------------------------------- -# -# == Preamble == -# Authors of this script are in the Authors file in the same directory as this -# script. -# -# Maintainer: GaÅ¡per Ažman -# -# This file is maintained as a part of the CxxTest test suite. -# -# == About == -# -# This builder correctly tracks dependencies and supports just about every -# configuration option for CxxTest that I can think of. It automatically -# defines a target "check" (configurable), so all tests can be run with a -# % scons check -# This will first compile and then run the tests. -# -# The default configuration assumes that cxxtest is located at the base source -# directory (where SConstruct is), that the cxxtestgen is under -# cxxtest/bin/cxxtestgen and headers are in cxxtest/cxxtest/. The -# header include path is automatically added to CPPPATH. It, however, can also -# recognise that cxxtest is installed system-wide (based on redhat's RPM). -# -# For a list of environment variables and their defaults, see the generate() -# function. -# -# This should be in a file called cxxtest.py somewhere in the scons toolpath. -# (default: #/site_scons/site_tools/) -# -# == Usage: == -# -# For configuration options, check the comment of the generate() function. -# -# This builder has a variety of different possible usages, so bear with me. -# -# env.CxxTest('target') -# The simplest of them all, it models the Program call. This sees if target.t.h -# is around and passes it through the cxxtestgen and compiles it. Might only -# work on unix though, because target can't have a suffix right now. -# -# env.CxxTest(['target.t.h']) -# This compiles target.t.h as in the previous example, but now sees that it is a -# source file. It need not have the same suffix as the env['CXXTEST_SUFFIX'] -# variable dictates. The only file provided is taken as the test source file. -# -# env.CxxTest(['test1.t.h','test1_lib.cpp','test1_lib2.cpp','test2.t.h',...]) -# You may also specify multiple source files. In this case, the 1st file that -# ends with CXXTEST_SUFFIX (default: .t.h) will be taken as the default test -# file. All others will be run with the --part switch and linked in. All files -# *not* having the right suffix will be passed to the Program call verbatim. -# -# In the last two cases, you may also specify the desired name of the test as -# the 1st argument to the function. This will result in the end executable -# called that. Normal Program builder rules apply. -# - -from SCons.Script import * -from SCons.Builder import Builder -from SCons.Util import PrependPath, unique, uniquer -import os - -# A warning class to notify users of problems -class ToolCxxTestWarning(SCons.Warnings.Warning): - pass - -SCons.Warnings.enableWarningClass(ToolCxxTestWarning) - -def accumulateEnvVar(dicts, name, default = []): - """ - Accumulates the values under key 'name' from the list of dictionaries dict. - The default value is appended to the end list if 'name' does not exist in - the dict. - """ - final = [] - for d in dicts: - final += Split(d.get(name, default)) - return final - -def multiget(dictlist, key, default = None): - """ - Takes a list of dictionaries as its 1st argument. Checks if the key exists - in each one and returns the 1st one it finds. If the key is found in no - dictionaries, the default is returned. - """ - for dict in dictlist: - if dict.has_key(key): - return dict[key] - else: - return default - -def envget(env, key, default=None): - """Look in the env, then in os.environ. Otherwise same as multiget.""" - return multiget([env, os.environ], key, default) - -def prepend_ld_library_path(env, overrides, **kwargs): - """Prepend LD_LIBRARY_PATH with LIBPATH to run successfully programs that - were linked against local shared libraries.""" - # make it unique but preserve order ... - libpath = uniquer(Split(kwargs.get('CXXTEST_LIBPATH', [])) + - Split(env.get( 'CXXTEST_LIBPATH', []))) - if len(libpath) > 0: - libpath = env.arg2nodes(libpath, env.fs.Dir) - platform = env.get('PLATFORM','') - if platform == 'win32': - var = 'PATH' - else: - var = 'LD_LIBRARY_PATH' - eenv = overrides.get('ENV', env['ENV'].copy()) - canonicalize = lambda p : p.abspath - eenv[var] = PrependPath(eenv.get(var,''), libpath, os.pathsep, 1, canonicalize) - overrides['ENV'] = eenv - return overrides - -def UnitTest(env, target, source = [], **kwargs): - """ - Prepares the Program call arguments, calls Program and adds the result to - the check target. - """ - # get the c and cxx flags to process. - ccflags = Split( multiget([kwargs, env, os.environ], 'CCFLAGS' )) - cxxflags = Split( multiget([kwargs, env, os.environ], 'CXXFLAGS')) - # get the removal c and cxx flags - cxxremove = set( Split( multiget([kwargs, env, os.environ],'CXXTEST_CXXFLAGS_REMOVE'))) - ccremove = set( Split( multiget([kwargs, env, os.environ],'CXXTEST_CCFLAGS_REMOVE' ))) - # remove the required flags - ccflags = [item for item in ccflags if item not in ccremove] - cxxflags = [item for item in cxxflags if item not in cxxremove] - # fill the flags into kwargs - kwargs["CXXFLAGS"] = cxxflags - kwargs["CCFLAGS"] = ccflags - test = env.Program(target, source = source, **kwargs) - testCommand = multiget([kwargs, env, os.environ], 'CXXTEST_COMMAND') - if testCommand: - testCommand = testCommand.replace('%t', test[0].abspath) - else: - testCommand = test[0].abspath - if multiget([kwargs, env, os.environ], 'CXXTEST_SKIP_ERRORS', False): - runner = env.Action(testCommand, exitstatfunc=lambda x:0) - else: - runner = env.Action(testCommand) - overrides = prepend_ld_library_path(env, {}, **kwargs) - cxxtest_target = multiget([kwargs, env], 'CXXTEST_TARGET') - env.Alias(cxxtest_target, test, runner, **overrides) - env.AlwaysBuild(cxxtest_target) - return test - -def isValidScriptPath(cxxtestgen): - """check keyword arg or environment variable locating cxxtestgen script""" - - if cxxtestgen and os.path.exists(cxxtestgen): - return True - else: - SCons.Warnings.warn(ToolCxxTestWarning, - "Invalid CXXTEST environment variable specified!") - return False - -def defaultCxxTestGenLocation(env): - return os.path.join( - envget(env, 'CXXTEST_CXXTESTGEN_DEFAULT_LOCATION'), - envget(env, 'CXXTEST_CXXTESTGEN_SCRIPT_NAME') - ) - -def findCxxTestGen(env): - """locate the cxxtestgen script by checking environment, path and project""" - - # check the SCons environment... - # Then, check the OS environment... - cxxtest = envget(env, 'CXXTEST', None) - - # check for common passing errors and provide diagnostics. - if isinstance(cxxtest, (list, tuple, dict)): - SCons.Warnings.warn( - ToolCxxTestWarning, - "The CXXTEST variable was specified as a list." - " This is not supported. Please pass a string." - ) - - if cxxtest: - try: - #try getting the absolute path of the file first. - # Required to expand '#' - cxxtest = env.File(cxxtest).abspath - except TypeError: - try: - #maybe only the directory was specified? - cxxtest = env.File( - os.path.join(cxxtest, defaultCxxTestGenLocation(env) - )).abspath - except TypeError: - pass - # If the user specified the location in the environment, - # make sure it was correct - if isValidScriptPath(cxxtest): - return os.path.realpath(cxxtest) - - # No valid environment variable found, so... - # Next, check the path... - # Next, check the project - check_path = os.path.join( - envget(env, 'CXXTEST_INSTALL_DIR'), - envget(env, 'CXXTEST_CXXTESTGEN_DEFAULT_LOCATION')) - - cxxtest = (env.WhereIs(envget(env, 'CXXTEST_CXXTESTGEN_SCRIPT_NAME')) or - env.WhereIs(envget(env, 'CXXTEST_CXXTESTGEN_SCRIPT_NAME'), - path=[Dir(check_path).abspath])) - - if cxxtest: - return cxxtest - else: - # If we weren't able to locate the cxxtestgen script, complain... - SCons.Warnings.warn( - ToolCxxTestWarning, - "Unable to locate cxxtestgen in environment, path or" - " project!\n" - "Please set the CXXTEST variable to the path of the" - " cxxtestgen script" - ) - return None - -def findCxxTestHeaders(env): - searchfile = 'TestSuite.h' - cxxtestgen_pathlen = len(defaultCxxTestGenLocation(env)) - - default_path = Dir(envget(env,'CXXTEST_INSTALL_DIR')).abspath - - os_cxxtestgen = os.path.realpath(File(env['CXXTEST']).abspath) - alt_path = os_cxxtestgen[:-cxxtestgen_pathlen] - - searchpaths = [default_path, alt_path] - foundpaths = [] - for p in searchpaths: - if os.path.exists(os.path.join(p, 'cxxtest', searchfile)): - foundpaths.append(p) - return foundpaths - -def generate(env, **kwargs): - """ - Keyword arguments (all can be set via environment variables as well): - CXXTEST - the path to the cxxtestgen script. - Default: searches SCons environment, OS environment, - path and project in that order. Instead of setting this, - you can also set CXXTEST_INSTALL_DIR - CXXTEST_RUNNER - the runner to use. Default: ErrorPrinter - CXXTEST_OPTS - other options to pass to cxxtest. Default: '' - CXXTEST_SUFFIX - the suffix of the test files. Default: '.t.h' - CXXTEST_TARGET - the target to append the tests to. Default: check - CXXTEST_COMMAND - the command that will be executed to run the test, - %t will be replace with the test executable. - Can be used for example for MPI or valgrind tests. - Default: %t - CXXTEST_CXXFLAGS_REMOVE - the flags that cxxtests can't compile with, - or give lots of warnings. Will be stripped. - Default: -pedantic -Weffc++ - CXXTEST_CCFLAGS_REMOVE - the same thing as CXXTEST_CXXFLAGS_REMOVE, just for - CCFLAGS. Default: same as CXXFLAGS. - CXXTEST_PYTHON - the path to the python binary. - Default: searches path for python - CXXTEST_SKIP_ERRORS - set to True to continue running the next test if one - test fails. Default: False - CXXTEST_CPPPATH - If you do not want to clutter your global CPPPATH with the - CxxTest header files and other stuff you only need for - your tests, this is the variable to set. Behaves as - CPPPATH does. - CXXTEST_LIBPATH - If your test is linked to shared libraries which are - outside of standard directories. This is used as LIBPATH - when compiling the test program and to modify - LD_LIBRARY_PATH (or PATH on win32) when running the - program. - CXXTEST_INSTALL_DIR - this is where you tell the builder where CxxTest is - installed. The install directory has cxxtest, - python, docs and other subdirectories. - ... and all others that Program() accepts, like CPPPATH etc. - """ - - print "Loading CxxTest tool..." - - # - # Expected behaviour: keyword arguments override environment variables; - # environment variables override default settings. - # - env.SetDefault( CXXTEST_RUNNER = 'ErrorPrinter' ) - env.SetDefault( CXXTEST_OPTS = '' ) - env.SetDefault( CXXTEST_SUFFIX = '.t.h' ) - env.SetDefault( CXXTEST_TARGET = 'check' ) - env.SetDefault( CXXTEST_CPPPATH = ['#'] ) - env.SetDefault( CXXTEST_PYTHON = env.WhereIs('python') ) - env.SetDefault( CXXTEST_SKIP_ERRORS = False ) - env.SetDefault( CXXTEST_CXXFLAGS_REMOVE = - ['-pedantic','-Weffc++','-pedantic-errors'] ) - env.SetDefault( CXXTEST_CCFLAGS_REMOVE = - ['-pedantic','-Weffc++','-pedantic-errors'] ) - env.SetDefault( CXXTEST_INSTALL_DIR = '#/cxxtest/' ) - - # this one's not for public use - it documents where the cxxtestgen script - # is located in the CxxTest tree normally. - env.SetDefault( CXXTEST_CXXTESTGEN_DEFAULT_LOCATION = 'bin' ) - # the cxxtestgen script name. - env.SetDefault( CXXTEST_CXXTESTGEN_SCRIPT_NAME = 'cxxtestgen' ) - - #Here's where keyword arguments are applied - apply(env.Replace, (), kwargs) - - #If the user specified the path to CXXTEST, make sure it is correct - #otherwise, search for and set the default toolpath. - if (not kwargs.has_key('CXXTEST') or not isValidScriptPath(kwargs['CXXTEST']) ): - env["CXXTEST"] = findCxxTestGen(env) - - # find and add the CxxTest headers to the path. - env.AppendUnique( CXXTEST_CPPPATH = findCxxTestHeaders(env) ) - - cxxtest = env['CXXTEST'] - if cxxtest: - # - # Create the Builder (only if we have a valid cxxtestgen!) - # - cxxtest_builder = Builder( - action = - [["$CXXTEST_PYTHON",cxxtest,"--runner=$CXXTEST_RUNNER", - "$CXXTEST_OPTS","$CXXTEST_ROOT_PART","-o","$TARGET","$SOURCE"]], - suffix = ".cpp", - src_suffix = '$CXXTEST_SUFFIX' - ) - else: - cxxtest_builder = (lambda *a: sys.stderr.write("ERROR: CXXTESTGEN NOT FOUND!")) - - def CxxTest(env, target, source = None, **kwargs): - """Usage: - The function is modelled to be called as the Program() call is: - env.CxxTest('target_name') will build the test from the source - target_name + env['CXXTEST_SUFFIX'], - env.CxxTest('target_name', source = 'test_src.t.h') will build the test - from test_src.t.h source, - env.CxxTest('target_name, source = ['test_src.t.h', other_srcs] - builds the test from source[0] and links in other files mentioned in - sources, - You may also add additional arguments to the function. In that case, they - will be passed to the actual Program builder call unmodified. Convenient - for passing different CPPPATHs and the sort. This function also appends - CXXTEST_CPPPATH to CPPPATH. It does not clutter the environment's CPPPATH. - """ - if (source == None): - suffix = multiget([kwargs, env, os.environ], 'CXXTEST_SUFFIX', "") - source = [t + suffix for t in target] - sources = Flatten(Split(source)) - headers = [] - linkins = [] - for l in sources: - # check whether this is a file object or a string path - try: - s = l.abspath - except AttributeError: - s = l - - if s.endswith(multiget([kwargs, env, os.environ], 'CXXTEST_SUFFIX', None)): - headers.append(l) - else: - linkins.append(l) - - deps = [] - if len(headers) == 0: - if len(linkins) != 0: - # the 1st source specified is the test - deps.append(env.CxxTestCpp(linkins.pop(0), **kwargs)) - else: - deps.append(env.CxxTestCpp(headers.pop(0), **kwargs)) - deps.extend( - [env.CxxTestCpp(header, CXXTEST_RUNNER = 'none', - CXXTEST_ROOT_PART = '--part', **kwargs) - for header in headers] - ) - deps.extend(linkins) - kwargs['CPPPATH'] = unique( - Split(kwargs.get('CPPPATH', [])) + - Split(env.get( 'CPPPATH', [])) + - Split(kwargs.get('CXXTEST_CPPPATH', [])) + - Split(env.get( 'CXXTEST_CPPPATH', [])) - ) - kwargs['LIBPATH'] = unique( - Split(kwargs.get('LIBPATH', [])) + - Split(env.get( 'LIBPATH', [])) + - Split(kwargs.get('CXXTEST_LIBPATH', [])) + - Split(env.get( 'CXXTEST_LIBPATH', [])) - ) - - return UnitTest(env, target, source = deps, **kwargs) - - env.Append( BUILDERS = { "CxxTest" : CxxTest, "CxxTestCpp" : cxxtest_builder } ) - -def exists(env): - return os.path.exists(env['CXXTEST']) - diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/default_env/README b/noarch/lib/py/cxxtest/build_tools/SCons/test/default_env/README deleted file mode 100644 index d8c8b69a..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/default_env/README +++ /dev/null @@ -1,2 +0,0 @@ -Tests if the 'default environment' defaults are sane and work out of the box. -by: GaÅ¡per Ažman diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/default_env/SConstruct b/noarch/lib/py/cxxtest/build_tools/SCons/test/default_env/SConstruct deleted file mode 100644 index 637992ee..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/default_env/SConstruct +++ /dev/null @@ -1,10 +0,0 @@ -env = Environment( - toolpath=['../../'], - tools=['default','cxxtest'] - ) - -env['CXXTEST_SKIP_ERRORS'] = True -env.CxxTest(['src/ThrowNoStd.h']) -env.CxxTest(['src/AborterNoThrow.h']) -env.CxxTest(['src/Comments.h']) - diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/default_env/TestDef.py b/noarch/lib/py/cxxtest/build_tools/SCons/test/default_env/TestDef.py deleted file mode 100644 index c951f102..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/default_env/TestDef.py +++ /dev/null @@ -1,17 +0,0 @@ -#------------------------------------------------------------------------- -# CxxTest: A lightweight C++ unit testing library. -# Copyright (c) 2008 Sandia Corporation. -# This software is distributed under the LGPL License v3 -# For more information, see the COPYING file in the top CxxTest directory. -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -#------------------------------------------------------------------------- - -expect_success = True -type = 'scons' -links = { - 'cxxtest': '../../../../', - 'src' : '../../../../test/' - } - - diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/empty_source_list/README b/noarch/lib/py/cxxtest/build_tools/SCons/test/empty_source_list/README deleted file mode 100644 index 419901bb..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/empty_source_list/README +++ /dev/null @@ -1,2 +0,0 @@ -Tests if cxxtest behaves correctly if no sources are given. -by: GaÅ¡per Ažman diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/empty_source_list/SConstruct b/noarch/lib/py/cxxtest/build_tools/SCons/test/empty_source_list/SConstruct deleted file mode 100644 index 9f1dda96..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/empty_source_list/SConstruct +++ /dev/null @@ -1,4 +0,0 @@ -env = Environment(toolpath=['../../'],tools=['default','cxxtest']) - -env.CxxTest('test_bar') -env.CxxTest('test_foo') diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/empty_source_list/TestDef.py b/noarch/lib/py/cxxtest/build_tools/SCons/test/empty_source_list/TestDef.py deleted file mode 100644 index 3758853f..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/empty_source_list/TestDef.py +++ /dev/null @@ -1,10 +0,0 @@ -#------------------------------------------------------------------------- -# CxxTest: A lightweight C++ unit testing library. -# Copyright (c) 2008 Sandia Corporation. -# This software is distributed under the LGPL License v3 -# For more information, see the COPYING file in the top CxxTest directory. -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -#------------------------------------------------------------------------- - -links = {'cxxtest' : '../../../../'} diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/empty_source_list/requirement.hpp b/noarch/lib/py/cxxtest/build_tools/SCons/test/empty_source_list/requirement.hpp deleted file mode 100644 index 3a6f7574..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/empty_source_list/requirement.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/** - * @file requirement.cpp - * Implementation of the requirement function. - * - * @author GaÅ¡per Ažman (GA), gasper.azman@gmail.com - * @version 1.0 - * @since 2008-08-29 10:09:42 AM - */ - -bool call_a_requirement() { - return true; -} diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/empty_source_list/test_bar.t.h b/noarch/lib/py/cxxtest/build_tools/SCons/test/empty_source_list/test_bar.t.h deleted file mode 100644 index 4cd1adad..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/empty_source_list/test_bar.t.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef TEST_BAR_T_H -#define TEST_BAR_T_H -/** - * @file test_bar.t.h - * Test one for the joint test ehm, test. - * - * @author GaÅ¡per Ažman (GA), gasper.azman@gmail.com - * @version 1.0 - * @since 2008-08-29 10:04:06 AM - */ - -#include -#include "requirement.hpp" - -class TestBar : public CxxTest::TestSuite -{ -public: - void test_foo() { - TS_ASSERT(call_a_requirement()); - } -}; - -#endif diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/empty_source_list/test_foo.t.h b/noarch/lib/py/cxxtest/build_tools/SCons/test/empty_source_list/test_foo.t.h deleted file mode 100644 index 2850447c..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/empty_source_list/test_foo.t.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef TEST_FOO_T_H -#define TEST_FOO_T_H -/** - * @file test_foo.t.h - * Test one for the joint test ehm, test. - * - * @author GaÅ¡per Ažman (GA), gasper.azman@gmail.com - * @version 1.0 - * @since 2008-08-29 10:02:06 AM - */ - -#include "requirement.hpp" -#include - -class TestFoo : public CxxTest::TestSuite -{ -public: - void test_foo() { - TS_ASSERT(call_a_requirement()); - } -}; - -#endif diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/eprouvette.py b/noarch/lib/py/cxxtest/build_tools/SCons/test/eprouvette.py deleted file mode 100644 index c1e6550b..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/eprouvette.py +++ /dev/null @@ -1,212 +0,0 @@ -#!/usr/bin/env python -# vim: fileencoding=utf-8 -#------------------------------------------------------------------------- -# CxxTest: A lightweight C++ unit testing library. -# Copyright (c) 2008 Sandia Corporation. -# This software is distributed under the LGPL License v3 -# For more information, see the COPYING file in the top CxxTest directory. -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -#------------------------------------------------------------------------- - -from __future__ import print_function -import os, sys -from os.path import isdir, isfile, islink, join -from optparse import OptionParser -from subprocess import check_call, CalledProcessError, PIPE - -options = None -args = [] -available_types = set(['scons']) -tool_stdout = PIPE - -def main(): - global options - global args - global tool_stdout - """Parse the options and execute the program.""" - usage = \ - """Usage: %prog [options] [test1 [test2 [...]]] - - If you provide one or more tests, this will run the provided tests. - Otherwise, it will look for tests in the current directory and run them all. - """ - # option parsing - parser = OptionParser(usage) - - parser.set_defaults( - action='run', - verbose=True) - - parser.add_option("-c", "--clean", - action='store_const', const='clean', dest='action', - help="deletes any generated files in the tests") - parser.add_option("--run", - action='store_const', const='run', dest='action', - help="sets up the environment, compiles and runs the tests") - parser.add_option("-v", "--verbose", - action='store_true', dest='verbose', - help="spew out more details") - parser.add_option("-q", "--quiet", - action='store_false', dest='verbose', - help="spew out only success/failure of tests") - parser.add_option("--target-dir", - dest='target_dir', action='store', default='./', - help='target directory to look for tests in. default: %default') - parser.add_option("--debug", - dest='debug', action='store_true', default=False, - help='turn on debug output.') - - (options, args) = parser.parse_args() - - if options.debug or options.verbose: - tool_stdout = None - # gather the tests - tests = [] - if len(args) == 0: - tests = crawl_tests(options.target_dir) - else: - tests = args - tests = purge_tests(tests) - - # run the tests - if options.action == 'run': - for t in tests: - run_test(t) - elif options.action == 'clean': - for t in tests: - clean_test(t) - -def crawl_tests(target): - """Gather the directories in the test directory.""" - files = os.listdir(target) - return [f for f in files if isdir(f) and f[0] != '.'] - -def purge_tests(dirs): - """Look at the test candidates and purge those that aren't from the list""" - tests = [] - for t in dirs: - if isfile(join(t, 'TestDef.py')): - tests.append(t) - else: - warn("{0} is not a test (missing TestDef.py file).".format(t)) - return tests - -def warn(msg): - """A general warning function.""" - if options.verbose: - print('[Warn]: ' + msg, file=sys.stderr) - -def notice(msg): - """A general print function.""" - if options.verbose: - print(msg) - -def debug(msg): - """A debugging function""" - if options.debug: - print(msg) - -def run_test(t): - """Runs the test in directory t.""" - opts = read_opts(t) - notice("-----------------------------------------------------") - notice("running test '{0}':\n".format(t)) - readme = join(t, 'README') - if isfile(readme): - notice(open(readme).read()) - notice("") - if opts['type'] not in available_types: - warn('{0} is not a recognised test type in {1}'.format(opts['type'], t)) - return - if not opts['expect_success']: - warn("tests that fail intentionally are not yet supported.") - return - - # set up the environment - setup_env(t, opts) - # run the test - try: - if opts['type'] == 'scons': - run_scons(t, opts) - except RuntimeError as e: - print("Test {0} failed.".format(t)) - return - - if not options.verbose: - print('.', end='') - sys.stdout.flush() - else: - print("test '{0}' successful.".format(t)) - -def read_opts(t): - """Read the test options and return them.""" - opts = { - 'expect_success' : True, - 'type' : 'scons', - 'links' : {} - } - f = open(join(t, "TestDef.py")) - exec(f.read(), opts) - return opts - -def setup_env(t, opts): - """Set up the environment for the test.""" - # symlinks - links = opts['links'] - for link in links: - frm = links[link] - to = join(t, link) - debug("Symlinking {0} to {1}".format(frm, to)) - if islink(to): - os.unlink(to) - os.symlink(frm, to) - -def teardown_env(t, opts): - """Remove all files generated for the test.""" - links = opts['links'] - for link in links: - to = join(t, link) - debug('removing link {0}'.format(to)) - os.unlink(to) - -def clean_test(t): - """Remove all generated files.""" - opts = read_opts(t) - notice("cleaning test {0}".format(t)) - if opts['type'] == 'scons': - setup_env(t, opts) # scons needs the environment links to work - clean_scons(t, opts) - teardown_env(t, opts) - -def clean_scons(t, opts): - """Make scons clean after itself.""" - cwd = os.getcwd() - os.chdir(t) - try: - check_call(['scons', '--clean'], stdout=tool_stdout, stderr=None) - except CalledProcessError as e: - warn("SCons failed with error {0}".format(e.returncode)) - os.chdir(cwd) - sconsign = join(t, '.sconsign.dblite') - if isfile(sconsign): - os.unlink(sconsign) - -def run_scons(t, opts): - """Run scons test.""" - cwd = os.getcwd() - os.chdir(t) - try: - check_call(['scons', '--clean'], stdout=tool_stdout) - check_call(['scons', '.'], stdout=tool_stdout) - check_call(['scons', 'check'], stdout=tool_stdout) - except CalledProcessError as e: - os.chdir(cwd) # clean up - raise e - os.chdir(cwd) - -if __name__ == "__main__": - main() - -if not options.verbose: - print() # quiet doesn't output newlines. diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/expanding_#/README b/noarch/lib/py/cxxtest/build_tools/SCons/test/expanding_#/README deleted file mode 100644 index eac1c926..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/expanding_#/README +++ /dev/null @@ -1,3 +0,0 @@ -Tests whether expanding '#' to the top-level directory works as intended in -scons. -by: GaÅ¡per Ažman diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/expanding_#/SConstruct b/noarch/lib/py/cxxtest/build_tools/SCons/test/expanding_#/SConstruct deleted file mode 100644 index bae8789b..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/expanding_#/SConstruct +++ /dev/null @@ -1,10 +0,0 @@ -env = Environment( - toolpath=['../../'], - tools=['default','cxxtest'], - CXXTEST='./../../../../bin/cxxtestgen' - ) - -env['CXXTEST_SKIP_ERRORS'] = True -env.CxxTest(['src/ThrowNoStd.h']) -env.CxxTest(['src/AborterNoThrow.h']) -env.CxxTest(['src/Comments.h']) diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/expanding_#/TestDef.py b/noarch/lib/py/cxxtest/build_tools/SCons/test/expanding_#/TestDef.py deleted file mode 100644 index 1ec6c2cc..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/expanding_#/TestDef.py +++ /dev/null @@ -1,10 +0,0 @@ -#------------------------------------------------------------------------- -# CxxTest: A lightweight C++ unit testing library. -# Copyright (c) 2008 Sandia Corporation. -# This software is distributed under the LGPL License v3 -# For more information, see the COPYING file in the top CxxTest directory. -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -#------------------------------------------------------------------------- - -links = {'src' : '../../../../test'} diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing/README b/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing/README deleted file mode 100644 index a83d021f..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing/README +++ /dev/null @@ -1,2 +0,0 @@ -Tests whether we can swallow file nodes as sources as well as strings. -by: GaÅ¡per Ažman diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing/SConstruct b/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing/SConstruct deleted file mode 100644 index f647182c..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing/SConstruct +++ /dev/null @@ -1,3 +0,0 @@ -env = Environment(toolpath=['../../'],tools=['default','cxxtest']) - -env.CxxTest('joint_tests',[Glob('src/*.t.h'), 'src/requirement.cpp']) diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing/TestDef.py b/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing/TestDef.py deleted file mode 100644 index 3758853f..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing/TestDef.py +++ /dev/null @@ -1,10 +0,0 @@ -#------------------------------------------------------------------------- -# CxxTest: A lightweight C++ unit testing library. -# Copyright (c) 2008 Sandia Corporation. -# This software is distributed under the LGPL License v3 -# For more information, see the COPYING file in the top CxxTest directory. -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -#------------------------------------------------------------------------- - -links = {'cxxtest' : '../../../../'} diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing/src/requirement.cpp b/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing/src/requirement.cpp deleted file mode 100644 index 45d60ad7..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing/src/requirement.cpp +++ /dev/null @@ -1,14 +0,0 @@ -/** - * @file requirement.cpp - * Implementation of the requirement function. - * - * @author GaÅ¡per Ažman (GA), gasper.azman@gmail.com - * @version 1.0 - * @since 2008-08-29 10:09:42 AM - */ - -#include "requirement.h" - -bool call_a_requirement() { - return true; -} diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing/src/requirement.h b/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing/src/requirement.h deleted file mode 100644 index 9bb94370..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing/src/requirement.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef REQUIREMENT_H -#define REQUIREMENT_H -/** - * @file requirement.h - * Prototype for the call_a_requirement() function. - * - * @author GaÅ¡per Ažman (GA), gasper.azman@gmail.com - * @version 1.0 - * @since 2008-08-29 10:08:35 AM - */ - -bool call_a_requirement(); - -#endif diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing/src/test_bar.t.h b/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing/src/test_bar.t.h deleted file mode 100644 index 76e594df..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing/src/test_bar.t.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef TEST_BAR_T_H -#define TEST_BAR_T_H -/** - * @file test_bar.t.h - * Test one for the joint test ehm, test. - * - * @author GaÅ¡per Ažman (GA), gasper.azman@gmail.com - * @version 1.0 - * @since 2008-08-29 10:04:06 AM - */ - -#include -#include "requirement.h" - -class TestBar : public CxxTest::TestSuite -{ -public: - void test_foo() { - TS_ASSERT(call_a_requirement()); - } -}; - -#endif diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing/src/test_foo.t.h b/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing/src/test_foo.t.h deleted file mode 100644 index 418a3ca0..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing/src/test_foo.t.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef TEST_FOO_T_H -#define TEST_FOO_T_H -/** - * @file test_foo.t.h - * Test one for the joint test ehm, test. - * - * @author GaÅ¡per Ažman (GA), gasper.azman@gmail.com - * @version 1.0 - * @since 2008-08-29 10:02:06 AM - */ - -#include "requirement.h" -#include - -class TestFoo : public CxxTest::TestSuite -{ -public: - void test_foo() { - TS_ASSERT(call_a_requirement()); - } -}; - -#endif diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing_edmundo/README b/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing_edmundo/README deleted file mode 100644 index 188908b6..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing_edmundo/README +++ /dev/null @@ -1,2 +0,0 @@ -Test for various things cxxtest failed to do, but now does. -by: Edmundo López B. diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing_edmundo/SConstruct b/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing_edmundo/SConstruct deleted file mode 100644 index fdfd3bd4..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing_edmundo/SConstruct +++ /dev/null @@ -1,35 +0,0 @@ -# What I want to do is the following: -# I have my class files ending with .cc and -# the main file ending with .cpp. This way it -# very easy to do the following line just to -# have all sources in that variable - -import os - -mySrc = Glob("*.cc") -myFlags = ['-I.'] - -myEnv = Environment( ENV = os.environ, tools = ['default', \ - 'cxxtest'], toolpath=['../../']) - -# Here is the first problem I corrected: -# Flags won't be correctly recognized by cxxtest -myEnv.Replace(CXXFLAGS = myFlags) - - -# Then I want to convert those sources to objects - -myObjs = myEnv.Object(mySrc) - -# Having the objects I can create my program -# this way: - -myEnv.Program('hello', ['main.cpp'] + myObjs) - -# Now I want to do the same thing with the tests -# target -# With the non corrected version you'll get 2 errors: -# The CXXFLAGS are not set correctly -# It won't even accept this construction, which as you see -# works perfectly with Program (and CxxTest should work like it) -myEnv.CxxTest('helloTest', ['hellotest.t.h'] + myObjs) diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing_edmundo/TestDef.py b/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing_edmundo/TestDef.py deleted file mode 100644 index 3758853f..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing_edmundo/TestDef.py +++ /dev/null @@ -1,10 +0,0 @@ -#------------------------------------------------------------------------- -# CxxTest: A lightweight C++ unit testing library. -# Copyright (c) 2008 Sandia Corporation. -# This software is distributed under the LGPL License v3 -# For more information, see the COPYING file in the top CxxTest directory. -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -#------------------------------------------------------------------------- - -links = {'cxxtest' : '../../../../'} diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing_edmundo/hello.cc b/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing_edmundo/hello.cc deleted file mode 100644 index e18191d5..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing_edmundo/hello.cc +++ /dev/null @@ -1,22 +0,0 @@ -/** - * \file - * Implementation of class. - */ -/**************************************************** - * Author: Edmundo LOPEZ - * email: lopezed5@etu.unige.ch - * - * This code was written as a part of my bachelor - * thesis at the University of Geneva. - * - * $Id$ - * - * **************************************************/ - -#include - -int -Hello::foo(int x, int y) - { - return x + y; - } diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing_edmundo/hello.hh b/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing_edmundo/hello.hh deleted file mode 100644 index 72299954..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing_edmundo/hello.hh +++ /dev/null @@ -1,15 +0,0 @@ -/** - * \file - * File containing a class - */ -/**************************************************** - * Author: Edmundo LOPEZ - * email: lopezed5@etu.unige.ch - * - * **************************************************/ - -class Hello - { - public: - int foo(int x, int y); - }; diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing_edmundo/hellotest.t.h b/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing_edmundo/hellotest.t.h deleted file mode 100644 index e90f26b2..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing_edmundo/hellotest.t.h +++ /dev/null @@ -1,23 +0,0 @@ -/** - * \file - * The test file. - */ -/**************************************************** - * Author: Edmundo LOPEZ - * email: lopezed5@etu.unige.ch - * - * **************************************************/ - -#include -#include - - -class helloTestSuite : public CxxTest::TestSuite - { - public: - void testFoo() - { - Hello h; - TS_ASSERT_EQUALS (h.foo(2,2), 4); - } - }; diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing_edmundo/main.cpp b/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing_edmundo/main.cpp deleted file mode 100644 index 21f1938f..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/globbing_edmundo/main.cpp +++ /dev/null @@ -1,18 +0,0 @@ -/** - * \file - * Main function comes here. - */ -/**************************************************** - * Author: Edmundo LOPEZ - * email: lopezed5@etu.unige.ch - * - * **************************************************/ - -#include -#include - -int main (int argc, char *argv[]) - { - Hello h; - std::cout << h.foo(2,3) << std::endl; - } diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/include_CCFLAGS/README b/noarch/lib/py/cxxtest/build_tools/SCons/test/include_CCFLAGS/README deleted file mode 100644 index 64905b91..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/include_CCFLAGS/README +++ /dev/null @@ -1,3 +0,0 @@ -Tests: - - if CXXTEST_CXXFLAGS_REMOVE and CXXTEST_CCFLAGS_REMOVE flags work, - - if CCFLAGS and CXXFLAGS vars work. diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/include_CCFLAGS/SConstruct b/noarch/lib/py/cxxtest/build_tools/SCons/test/include_CCFLAGS/SConstruct deleted file mode 100644 index d946c33f..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/include_CCFLAGS/SConstruct +++ /dev/null @@ -1,12 +0,0 @@ -flags = '-pedantic-errors -Weffc++ -Wall -Wextra -ansi' -env = Environment( - toolpath=['../../'], - tools=['default','cxxtest'], - CCFLAGS=flags, - CXXFLAGS=flags, - CXXTEST_CXXFLAGS_REMOVE=['-pedantic-errors','-Weffc++','-Wextra','-Wall','-W'], - CXXTEST_CCFLAGS_REMOVE=['-pedantic-errors','-Weffc++','-Wextra','-Wall','-W'] - ) - -env.CxxTest(['src/not-with-pedantic.h']) -env.CxxTest(['src/only_with_ansi.t.h']) diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/include_CCFLAGS/TestDef.py b/noarch/lib/py/cxxtest/build_tools/SCons/test/include_CCFLAGS/TestDef.py deleted file mode 100644 index 3758853f..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/include_CCFLAGS/TestDef.py +++ /dev/null @@ -1,10 +0,0 @@ -#------------------------------------------------------------------------- -# CxxTest: A lightweight C++ unit testing library. -# Copyright (c) 2008 Sandia Corporation. -# This software is distributed under the LGPL License v3 -# For more information, see the COPYING file in the top CxxTest directory. -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -#------------------------------------------------------------------------- - -links = {'cxxtest' : '../../../../'} diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/include_CCFLAGS/src/not-with-pedantic.h b/noarch/lib/py/cxxtest/build_tools/SCons/test/include_CCFLAGS/src/not-with-pedantic.h deleted file mode 100644 index e7377bb2..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/include_CCFLAGS/src/not-with-pedantic.h +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @file not-with-pedantic.h - * Compiles, but not with -pedantic. - * - * @author GaÅ¡per Ažman (GA), gasper.azman@gmail.com - * @version 1.0 - * @since 2008-09-30 13:33:50 - */ - - -#include - -class TestPedantic : public CxxTest::TestSuite -{ -public: - void testPedanticPresent() { - TS_ASSERT(true); - int f = (true)?:5; - } -}; diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/include_CCFLAGS/src/only_with_ansi.t.h b/noarch/lib/py/cxxtest/build_tools/SCons/test/include_CCFLAGS/src/only_with_ansi.t.h deleted file mode 100644 index 4f6615e6..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/include_CCFLAGS/src/only_with_ansi.t.h +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @file only_with_ansi.t.h - * This test only runs correctly if -ansi was supplied as a g++ switch. - * - * @author GaÅ¡per Ažman (GA), gasper.azman@gmail.com - * @version 1.0 - * @since 2009-02-11 06:26:59 PM - */ - -#include - -class TestAnsi : public CxxTest::TestSuite -{ -public: - void testAnsiPresent() { -#ifdef __STRICT_ANSI__ - TS_ASSERT(true); -#else - TS_ASSERT(false); -#endif - } -}; diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/include_CXXFLAGS/README b/noarch/lib/py/cxxtest/build_tools/SCons/test/include_CXXFLAGS/README deleted file mode 100644 index 07a99470..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/include_CXXFLAGS/README +++ /dev/null @@ -1,5 +0,0 @@ -This test tests whether variables that are put into the environment after it has -been initialised work as expected. - -If they do not, -pedantic-errors will appear in the gcc commandline and the -compilation WILL FAIL, failing the test. diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/include_CXXFLAGS/SConstruct b/noarch/lib/py/cxxtest/build_tools/SCons/test/include_CXXFLAGS/SConstruct deleted file mode 100644 index aefb4393..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/include_CXXFLAGS/SConstruct +++ /dev/null @@ -1,16 +0,0 @@ -flags = '-Weffc++ -Wall -Wextra -std=gnu++0x' -env = Environment( - toolpath=['../../'], - tools=['default','cxxtest'], - CCFLAGS = Split(flags) + ['-pedantic-errors'], - CXXFLAGS = Split(flags) + ['-pedantic-errors'] - ) - -env['CXXTEST_CXXFLAGS_REMOVE']=['-Weffc++','-Wextra','-Wall','-W'] -env['CXXTEST_CCFLAGS_REMOVE']='-Weffc++ -Wextra -Wall -W' -env['CCFLAGS'] = flags -env['CXXFLAGS'] = flags -env['CXXTEST_SKIP_ERRORS'] = True - -env.CxxTest(['src/not-with-pedantic.h']) - diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/include_CXXFLAGS/TestDef.py b/noarch/lib/py/cxxtest/build_tools/SCons/test/include_CXXFLAGS/TestDef.py deleted file mode 100644 index 3758853f..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/include_CXXFLAGS/TestDef.py +++ /dev/null @@ -1,10 +0,0 @@ -#------------------------------------------------------------------------- -# CxxTest: A lightweight C++ unit testing library. -# Copyright (c) 2008 Sandia Corporation. -# This software is distributed under the LGPL License v3 -# For more information, see the COPYING file in the top CxxTest directory. -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -#------------------------------------------------------------------------- - -links = {'cxxtest' : '../../../../'} diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/include_CXXFLAGS/src/not-with-pedantic.h b/noarch/lib/py/cxxtest/build_tools/SCons/test/include_CXXFLAGS/src/not-with-pedantic.h deleted file mode 100644 index 2b92cd69..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/include_CXXFLAGS/src/not-with-pedantic.h +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @file not-with-pedantic.h - * Compiles, but not with -pedantic. - * - * @author GaÅ¡per Ažman (GA), gasper.azman@gmail.com - * @version 1.0 - * @since 2008-09-30 13:33:50 - */ - - -#include - -class TestPedantic : public CxxTest::TestSuite -{ -public: - void testPedanticPresent() { - int f = (true)?:5; - } -}; diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath/README b/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath/README deleted file mode 100644 index 4eefa741..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath/README +++ /dev/null @@ -1,2 +0,0 @@ -Test whether we can run program that depends on (shared) libraries that we know -but they are outside of standard load path. diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath/SConstruct b/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath/SConstruct deleted file mode 100644 index b89e2b89..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath/SConstruct +++ /dev/null @@ -1,3 +0,0 @@ -env = Environment(toolpath=['../../'],tools=['default','cxxtest']) - -SConscript(['src/SConscript', 'test/SConscript'], exports = ['env']) diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath/TestDef.py b/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath/TestDef.py deleted file mode 100644 index 3758853f..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath/TestDef.py +++ /dev/null @@ -1,10 +0,0 @@ -#------------------------------------------------------------------------- -# CxxTest: A lightweight C++ unit testing library. -# Copyright (c) 2008 Sandia Corporation. -# This software is distributed under the LGPL License v3 -# For more information, see the COPYING file in the top CxxTest directory. -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -#------------------------------------------------------------------------- - -links = {'cxxtest' : '../../../../'} diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath/src/SConscript b/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath/src/SConscript deleted file mode 100644 index 889aa8ad..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath/src/SConscript +++ /dev/null @@ -1,3 +0,0 @@ -Import('env') - -env.SharedLibrary('foo', 'foo.cpp') diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath/src/foo.cpp b/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath/src/foo.cpp deleted file mode 100644 index e05eb7e6..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath/src/foo.cpp +++ /dev/null @@ -1,4 +0,0 @@ -int foo() -{ - return 0; -} diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath/test/SConscript b/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath/test/SConscript deleted file mode 100644 index 476e11d0..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath/test/SConscript +++ /dev/null @@ -1,2 +0,0 @@ -Import('env') -env.CxxTest('test.t.h', LIBS = ['foo'], CXXTEST_LIBPATH = ['../src']) diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath/test/test.t.h b/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath/test/test.t.h deleted file mode 100644 index eb505f14..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath/test/test.t.h +++ /dev/null @@ -1,12 +0,0 @@ -// test/test.t.h -#include - -extern int foo(); -class FooTestSuite1 : public CxxTest::TestSuite -{ -public: - void testFoo(void) - { - TS_ASSERT_EQUALS(foo(), 0); - } -}; diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/README b/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/README deleted file mode 100644 index 756e57cf..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/README +++ /dev/null @@ -1,3 +0,0 @@ -Test whether we can run program that depends on (shared) libraries that we know -but they are outside of standard load path. Test whether multiple test runners -do not alter each other. diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/SConstruct b/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/SConstruct deleted file mode 100644 index 98288e9b..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/SConstruct +++ /dev/null @@ -1,3 +0,0 @@ -env = Environment(toolpath=['../../'],tools=['default','cxxtest']) - -SConscript(['src1/SConscript', 'src2/SConscript', 'test/SConscript'], exports = ['env']) diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/TestDef.py b/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/TestDef.py deleted file mode 100644 index 3758853f..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/TestDef.py +++ /dev/null @@ -1,10 +0,0 @@ -#------------------------------------------------------------------------- -# CxxTest: A lightweight C++ unit testing library. -# Copyright (c) 2008 Sandia Corporation. -# This software is distributed under the LGPL License v3 -# For more information, see the COPYING file in the top CxxTest directory. -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -#------------------------------------------------------------------------- - -links = {'cxxtest' : '../../../../'} diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/src1/SConscript b/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/src1/SConscript deleted file mode 100644 index 889aa8ad..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/src1/SConscript +++ /dev/null @@ -1,3 +0,0 @@ -Import('env') - -env.SharedLibrary('foo', 'foo.cpp') diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/src1/foo.cpp b/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/src1/foo.cpp deleted file mode 100644 index e05eb7e6..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/src1/foo.cpp +++ /dev/null @@ -1,4 +0,0 @@ -int foo() -{ - return 0; -} diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/src2/SConscript b/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/src2/SConscript deleted file mode 100644 index 591773fa..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/src2/SConscript +++ /dev/null @@ -1,3 +0,0 @@ -Import('env') - -env.SharedLibrary('bar', 'bar.cpp') diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/src2/bar.cpp b/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/src2/bar.cpp deleted file mode 100644 index 01eedf70..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/src2/bar.cpp +++ /dev/null @@ -1,4 +0,0 @@ -int bar() -{ - return 0; -} diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/test/SConscript b/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/test/SConscript deleted file mode 100644 index 502196ac..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/test/SConscript +++ /dev/null @@ -1,5 +0,0 @@ -Import('env') -env.CxxTest('test1.t.h', LIBS = ['foo'], CXXTEST_LIBPATH = ['../src1'], CXXTEST_TARGET = 'check-1') -env.CxxTest('test2.t.h', LIBS = ['bar'], CXXTEST_LIBPATH = ['../src2'], CXXTEST_TARGET = 'check-2') -env.Alias('check', ['check-1', 'check-2']) -env.AlwaysBuild('check') diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/test/test1.t.h b/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/test/test1.t.h deleted file mode 100644 index eb505f14..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/test/test1.t.h +++ /dev/null @@ -1,12 +0,0 @@ -// test/test.t.h -#include - -extern int foo(); -class FooTestSuite1 : public CxxTest::TestSuite -{ -public: - void testFoo(void) - { - TS_ASSERT_EQUALS(foo(), 0); - } -}; diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/test/test2.t.h b/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/test/test2.t.h deleted file mode 100644 index 7378ba49..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/libpath_multitarget/test/test2.t.h +++ /dev/null @@ -1,12 +0,0 @@ -// test/test.t.h -#include - -extern int bar(); -class BarTestSuite1 : public CxxTest::TestSuite -{ -public: - void testBar(void) - { - TS_ASSERT_EQUALS(bar(), 0); - } -}; diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/multifile_tests/SConstruct b/noarch/lib/py/cxxtest/build_tools/SCons/test/multifile_tests/SConstruct deleted file mode 100644 index 435b9cb3..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/multifile_tests/SConstruct +++ /dev/null @@ -1,8 +0,0 @@ -env = Environment(toolpath=['../../'],tools=['default','cxxtest']) - -env.CxxTest('joint_tests', - Split('src/test_foo.t.h ' - 'src/test_bar.t.h ' - 'src/requirement.cpp' - ) - ) diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/multifile_tests/TestDef.py b/noarch/lib/py/cxxtest/build_tools/SCons/test/multifile_tests/TestDef.py deleted file mode 100644 index 3758853f..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/multifile_tests/TestDef.py +++ /dev/null @@ -1,10 +0,0 @@ -#------------------------------------------------------------------------- -# CxxTest: A lightweight C++ unit testing library. -# Copyright (c) 2008 Sandia Corporation. -# This software is distributed under the LGPL License v3 -# For more information, see the COPYING file in the top CxxTest directory. -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -#------------------------------------------------------------------------- - -links = {'cxxtest' : '../../../../'} diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/multifile_tests/src/requirement.cpp b/noarch/lib/py/cxxtest/build_tools/SCons/test/multifile_tests/src/requirement.cpp deleted file mode 100644 index 45d60ad7..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/multifile_tests/src/requirement.cpp +++ /dev/null @@ -1,14 +0,0 @@ -/** - * @file requirement.cpp - * Implementation of the requirement function. - * - * @author GaÅ¡per Ažman (GA), gasper.azman@gmail.com - * @version 1.0 - * @since 2008-08-29 10:09:42 AM - */ - -#include "requirement.h" - -bool call_a_requirement() { - return true; -} diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/multifile_tests/src/requirement.h b/noarch/lib/py/cxxtest/build_tools/SCons/test/multifile_tests/src/requirement.h deleted file mode 100644 index 9bb94370..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/multifile_tests/src/requirement.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef REQUIREMENT_H -#define REQUIREMENT_H -/** - * @file requirement.h - * Prototype for the call_a_requirement() function. - * - * @author GaÅ¡per Ažman (GA), gasper.azman@gmail.com - * @version 1.0 - * @since 2008-08-29 10:08:35 AM - */ - -bool call_a_requirement(); - -#endif diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/multifile_tests/src/test_bar.t.h b/noarch/lib/py/cxxtest/build_tools/SCons/test/multifile_tests/src/test_bar.t.h deleted file mode 100644 index 76e594df..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/multifile_tests/src/test_bar.t.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef TEST_BAR_T_H -#define TEST_BAR_T_H -/** - * @file test_bar.t.h - * Test one for the joint test ehm, test. - * - * @author GaÅ¡per Ažman (GA), gasper.azman@gmail.com - * @version 1.0 - * @since 2008-08-29 10:04:06 AM - */ - -#include -#include "requirement.h" - -class TestBar : public CxxTest::TestSuite -{ -public: - void test_foo() { - TS_ASSERT(call_a_requirement()); - } -}; - -#endif diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/multifile_tests/src/test_foo.t.h b/noarch/lib/py/cxxtest/build_tools/SCons/test/multifile_tests/src/test_foo.t.h deleted file mode 100644 index 418a3ca0..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/multifile_tests/src/test_foo.t.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef TEST_FOO_T_H -#define TEST_FOO_T_H -/** - * @file test_foo.t.h - * Test one for the joint test ehm, test. - * - * @author GaÅ¡per Ažman (GA), gasper.azman@gmail.com - * @version 1.0 - * @since 2008-08-29 10:02:06 AM - */ - -#include "requirement.h" -#include - -class TestFoo : public CxxTest::TestSuite -{ -public: - void test_foo() { - TS_ASSERT(call_a_requirement()); - } -}; - -#endif diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/need_cpppath/SConstruct b/noarch/lib/py/cxxtest/build_tools/SCons/test/need_cpppath/SConstruct deleted file mode 100644 index d457e55e..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/need_cpppath/SConstruct +++ /dev/null @@ -1,9 +0,0 @@ - -env = Environment( - toolpath=['../../'], - tools=['default','cxxtest'], - CXXTEST_INSTALL_DIR = '../../../../', - CPPPATH = ['src/cpppathdir/'] - ) - -env.CxxTest(['src/cpppath.t.h']) diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/need_cpppath/src/cpppath.t.h b/noarch/lib/py/cxxtest/build_tools/SCons/test/need_cpppath/src/cpppath.t.h deleted file mode 100644 index 3c08c391..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/need_cpppath/src/cpppath.t.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef CPPPATH_T_H -#define CPPPATH_T_H - -/** - * @file cpppath.t.h - * This file needs the include in the include dir. - * - * @author GaÅ¡per Ažman (GA), gasper.azman@gmail.com - * @version 1.0 - * @since 2008-08-28 11:16:46 AM - */ - -// actual path cpppathdir/include.h -#include "include.h" -#include - -class CppPathTest : public CxxTest::TestSuite -{ -public: - void test_i_need_me_exists() { - TS_ASSERT(i_need_me() == 0); - } -}; - -#endif diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/need_cpppath/src/cpppathdir/include.h b/noarch/lib/py/cxxtest/build_tools/SCons/test/need_cpppath/src/cpppathdir/include.h deleted file mode 100644 index 93d3b039..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/need_cpppath/src/cpppathdir/include.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef INCLUDE_H -#define INCLUDE_H -/** - * @file include.h - * Include file for this test. - * - * @author GaÅ¡per Ažman (GA), gasper.azman@gmail.com - * @version 1.0 - * @since 2008-08-28 11:15:40 AM - */ - -int i_need_me() { - return 0; -} - -#endif diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/nonstandard_cxxtest_dir/SConstruct b/noarch/lib/py/cxxtest/build_tools/SCons/test/nonstandard_cxxtest_dir/SConstruct deleted file mode 100644 index 9b811621..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/nonstandard_cxxtest_dir/SConstruct +++ /dev/null @@ -1,10 +0,0 @@ -env = Environment( - toolpath=['../../'], - tools=['default','cxxtest'], - CXXTEST_INSTALL_DIR = '../../../../' - ) - -env['CXXTEST_SKIP_ERRORS'] = True -env.CxxTest(['src/ThrowNoStd.h']) -env.CxxTest(['src/AborterNoThrow.h']) -env.CxxTest(['src/Comments.h']) diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/nonstandard_cxxtest_dir/TestDef.py b/noarch/lib/py/cxxtest/build_tools/SCons/test/nonstandard_cxxtest_dir/TestDef.py deleted file mode 100644 index b76a14cb..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/nonstandard_cxxtest_dir/TestDef.py +++ /dev/null @@ -1,10 +0,0 @@ -#------------------------------------------------------------------------- -# CxxTest: A lightweight C++ unit testing library. -# Copyright (c) 2008 Sandia Corporation. -# This software is distributed under the LGPL License v3 -# For more information, see the COPYING file in the top CxxTest directory. -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -#------------------------------------------------------------------------- - -links = {'src' : '../../../../test/'} diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/printer_propagation/SConstruct b/noarch/lib/py/cxxtest/build_tools/SCons/test/printer_propagation/SConstruct deleted file mode 100644 index d87118ff..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/printer_propagation/SConstruct +++ /dev/null @@ -1,8 +0,0 @@ - -env = Environment( - toolpath=['../../'], - tools=['default','cxxtest'], - CXXTEST_INSTALL_DIR = '../../../../', - ) - -env.CxxTest(['src/failtest.t.h'], CPPPATH=['#'], CXXTEST_RUNNER="CrazyRunner") diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/printer_propagation/cxxtest/CrazyRunner.h b/noarch/lib/py/cxxtest/build_tools/SCons/test/printer_propagation/cxxtest/CrazyRunner.h deleted file mode 100644 index 6ceac42a..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/printer_propagation/cxxtest/CrazyRunner.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef __cxxtest_CrazyRunner_h__ -#define __cxxtest_CrazyRunner_h__ - - -/* - * This is not a proper runner. Just a simple class that looks like one. - */ -namespace CxxTest { - class CrazyRunner { - public: - int run() { return 0; } - void process_commandline(int argc, char** argv) { } - }; -} - -#endif diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/printer_propagation/src/failtest.t.h b/noarch/lib/py/cxxtest/build_tools/SCons/test/printer_propagation/src/failtest.t.h deleted file mode 100644 index ac8c8295..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/printer_propagation/src/failtest.t.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef FAILTEST_T_H -#define FAILTEST_T_H - -/** - * @file failtest.t.h - * This test will succed only with a CrazyRunner. - * - * @author - * @version 1.0 - * @since jue ago 28 14:18:57 ART 2008 - */ - -#include - -class CppPathTest : public CxxTest::TestSuite -{ -public: - void test_i_will_fail() { - TS_ASSERT(false); - } -}; - -#endif diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/recursive_sources/README b/noarch/lib/py/cxxtest/build_tools/SCons/test/recursive_sources/README deleted file mode 100644 index e1e6b749..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/recursive_sources/README +++ /dev/null @@ -1,2 +0,0 @@ -Tests whether we can swallow recursively supplied sources - a list of lists, for -instance. diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/recursive_sources/SConstruct b/noarch/lib/py/cxxtest/build_tools/SCons/test/recursive_sources/SConstruct deleted file mode 100644 index 5ba85026..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/recursive_sources/SConstruct +++ /dev/null @@ -1,3 +0,0 @@ -env = Environment(toolpath=['../../'],tools=['default','cxxtest']) - -env.CxxTest('joint_tests',['src/test_foo.t.h',['src/test_bar.t.h','src/requirement.cpp']]) diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/recursive_sources/TestDef.py b/noarch/lib/py/cxxtest/build_tools/SCons/test/recursive_sources/TestDef.py deleted file mode 100644 index 3758853f..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/recursive_sources/TestDef.py +++ /dev/null @@ -1,10 +0,0 @@ -#------------------------------------------------------------------------- -# CxxTest: A lightweight C++ unit testing library. -# Copyright (c) 2008 Sandia Corporation. -# This software is distributed under the LGPL License v3 -# For more information, see the COPYING file in the top CxxTest directory. -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -#------------------------------------------------------------------------- - -links = {'cxxtest' : '../../../../'} diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/recursive_sources/src/requirement.cpp b/noarch/lib/py/cxxtest/build_tools/SCons/test/recursive_sources/src/requirement.cpp deleted file mode 100644 index 45d60ad7..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/recursive_sources/src/requirement.cpp +++ /dev/null @@ -1,14 +0,0 @@ -/** - * @file requirement.cpp - * Implementation of the requirement function. - * - * @author GaÅ¡per Ažman (GA), gasper.azman@gmail.com - * @version 1.0 - * @since 2008-08-29 10:09:42 AM - */ - -#include "requirement.h" - -bool call_a_requirement() { - return true; -} diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/recursive_sources/src/requirement.h b/noarch/lib/py/cxxtest/build_tools/SCons/test/recursive_sources/src/requirement.h deleted file mode 100644 index 9bb94370..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/recursive_sources/src/requirement.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef REQUIREMENT_H -#define REQUIREMENT_H -/** - * @file requirement.h - * Prototype for the call_a_requirement() function. - * - * @author GaÅ¡per Ažman (GA), gasper.azman@gmail.com - * @version 1.0 - * @since 2008-08-29 10:08:35 AM - */ - -bool call_a_requirement(); - -#endif diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/recursive_sources/src/test_bar.t.h b/noarch/lib/py/cxxtest/build_tools/SCons/test/recursive_sources/src/test_bar.t.h deleted file mode 100644 index 76e594df..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/recursive_sources/src/test_bar.t.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef TEST_BAR_T_H -#define TEST_BAR_T_H -/** - * @file test_bar.t.h - * Test one for the joint test ehm, test. - * - * @author GaÅ¡per Ažman (GA), gasper.azman@gmail.com - * @version 1.0 - * @since 2008-08-29 10:04:06 AM - */ - -#include -#include "requirement.h" - -class TestBar : public CxxTest::TestSuite -{ -public: - void test_foo() { - TS_ASSERT(call_a_requirement()); - } -}; - -#endif diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/recursive_sources/src/test_foo.t.h b/noarch/lib/py/cxxtest/build_tools/SCons/test/recursive_sources/src/test_foo.t.h deleted file mode 100644 index 418a3ca0..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/recursive_sources/src/test_foo.t.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef TEST_FOO_T_H -#define TEST_FOO_T_H -/** - * @file test_foo.t.h - * Test one for the joint test ehm, test. - * - * @author GaÅ¡per Ažman (GA), gasper.azman@gmail.com - * @version 1.0 - * @since 2008-08-29 10:02:06 AM - */ - -#include "requirement.h" -#include - -class TestFoo : public CxxTest::TestSuite -{ -public: - void test_foo() { - TS_ASSERT(call_a_requirement()); - } -}; - -#endif diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/string_cpppath/SConstruct b/noarch/lib/py/cxxtest/build_tools/SCons/test/string_cpppath/SConstruct deleted file mode 100644 index 4e1e8fee..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/string_cpppath/SConstruct +++ /dev/null @@ -1,9 +0,0 @@ - -env = Environment( - toolpath=['../../'], - tools=['default','cxxtest'], - CXXTEST_INSTALL_DIR = '../../../../', - CPPPATH = 'src/cpppathdir/' - ) - -env.CxxTest(['src/cpppath.t.h']) diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/string_cpppath/TestDef.py b/noarch/lib/py/cxxtest/build_tools/SCons/test/string_cpppath/TestDef.py deleted file mode 100644 index e69de29b..00000000 diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/string_cpppath/src/cpppath.t.h b/noarch/lib/py/cxxtest/build_tools/SCons/test/string_cpppath/src/cpppath.t.h deleted file mode 100644 index 3c08c391..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/string_cpppath/src/cpppath.t.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef CPPPATH_T_H -#define CPPPATH_T_H - -/** - * @file cpppath.t.h - * This file needs the include in the include dir. - * - * @author GaÅ¡per Ažman (GA), gasper.azman@gmail.com - * @version 1.0 - * @since 2008-08-28 11:16:46 AM - */ - -// actual path cpppathdir/include.h -#include "include.h" -#include - -class CppPathTest : public CxxTest::TestSuite -{ -public: - void test_i_need_me_exists() { - TS_ASSERT(i_need_me() == 0); - } -}; - -#endif diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/string_cpppath/src/cpppathdir/include.h b/noarch/lib/py/cxxtest/build_tools/SCons/test/string_cpppath/src/cpppathdir/include.h deleted file mode 100644 index 93d3b039..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/string_cpppath/src/cpppathdir/include.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef INCLUDE_H -#define INCLUDE_H -/** - * @file include.h - * Include file for this test. - * - * @author GaÅ¡per Ažman (GA), gasper.azman@gmail.com - * @version 1.0 - * @since 2008-08-28 11:15:40 AM - */ - -int i_need_me() { - return 0; -} - -#endif diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/target_syntax/SConstruct b/noarch/lib/py/cxxtest/build_tools/SCons/test/target_syntax/SConstruct deleted file mode 100644 index 7a600bba..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/target_syntax/SConstruct +++ /dev/null @@ -1,9 +0,0 @@ - -env = Environment( - toolpath=['../../'], - tools=['default','cxxtest'], - CXXTEST_INSTALL_DIR = '../../../../', - CPPPATH = ['src/cpppathdir/'] - ) - -env.CxxTest('src/cpppath') diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/target_syntax/TestDef.py b/noarch/lib/py/cxxtest/build_tools/SCons/test/target_syntax/TestDef.py deleted file mode 100644 index e69de29b..00000000 diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/target_syntax/src/cpppath.t.h b/noarch/lib/py/cxxtest/build_tools/SCons/test/target_syntax/src/cpppath.t.h deleted file mode 100644 index 3c08c391..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/target_syntax/src/cpppath.t.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef CPPPATH_T_H -#define CPPPATH_T_H - -/** - * @file cpppath.t.h - * This file needs the include in the include dir. - * - * @author GaÅ¡per Ažman (GA), gasper.azman@gmail.com - * @version 1.0 - * @since 2008-08-28 11:16:46 AM - */ - -// actual path cpppathdir/include.h -#include "include.h" -#include - -class CppPathTest : public CxxTest::TestSuite -{ -public: - void test_i_need_me_exists() { - TS_ASSERT(i_need_me() == 0); - } -}; - -#endif diff --git a/noarch/lib/py/cxxtest/build_tools/SCons/test/target_syntax/src/cpppathdir/include.h b/noarch/lib/py/cxxtest/build_tools/SCons/test/target_syntax/src/cpppathdir/include.h deleted file mode 100644 index 93d3b039..00000000 --- a/noarch/lib/py/cxxtest/build_tools/SCons/test/target_syntax/src/cpppathdir/include.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef INCLUDE_H -#define INCLUDE_H -/** - * @file include.h - * Include file for this test. - * - * @author GaÅ¡per Ažman (GA), gasper.azman@gmail.com - * @version 1.0 - * @since 2008-08-28 11:15:40 AM - */ - -int i_need_me() { - return 0; -} - -#endif diff --git a/noarch/lib/py/cxxtest/build_tools/cmake/CxxTest.cmake b/noarch/lib/py/cxxtest/build_tools/cmake/CxxTest.cmake deleted file mode 100644 index 6ed3652f..00000000 --- a/noarch/lib/py/cxxtest/build_tools/cmake/CxxTest.cmake +++ /dev/null @@ -1,17 +0,0 @@ - -include("${CMAKE_CURRENT_LIST_DIR}/FindCxxTest.cmake") - -function(cxx_test target source) - get_filename_component(CPP_FILE_NAME ${source} NAME) - string(REGEX REPLACE "h$|hpp$" "cpp" CPP_FILE_NAME ${CPP_FILE_NAME}) - message(${CPP_FILE_NAME}) - set(CPP_FULL_NAME "${CMAKE_CURRENT_BINARY_DIR}/${CPP_FILE_NAME}") - add_custom_command( - OUTPUT "${CPP_FULL_NAME}" - COMMAND ${CXXTESTGEN} --runner=ErrorPrinter --output "${CPP_FULL_NAME}" "${source}" - DEPENDS "${source}" - ) - add_executable(${target} ${CPP_FULL_NAME}) - set_target_properties(${target} PROPERTIES COMPILE_FLAGS "-Wno-effc++") - add_test(${target} ${RUNTIME_OUTPUT_DIRECTORY}/${target}) -endfunction(cxx_test) diff --git a/noarch/lib/py/cxxtest/build_tools/cmake/FindCxxTest.cmake b/noarch/lib/py/cxxtest/build_tools/cmake/FindCxxTest.cmake deleted file mode 100644 index e1e4404c..00000000 --- a/noarch/lib/py/cxxtest/build_tools/cmake/FindCxxTest.cmake +++ /dev/null @@ -1,36 +0,0 @@ -IF (DEFINED FIND_CXXTEST_CMAKE_INCLUDED) - RETURN() -ENDIF (DEFINED FIND_CXXTEST_CMAKE_INCLUDED) -SET(FIND_CXXTEST_CMAKE_INCLUDED true) - -FIND_PROGRAM(CXXTESTGEN - NAMES cxxtestgen - PATHS "${CXXTEST_PATH}/bin" - "${PROJECT_SOURCE_DIR}/cxxtest/bin" - "${PROJECT_SOURCE_DIR}/lib/cxxtest/bin" - "${PROJECT_BINARY_DIR}/cxxtest/bin" - "${PROJECT_BINARY_DIR}/lib/cxxtest/bin" - /usr/bin - /bin - ) - -FIND_PATH(CXXTEST_INCLUDES - NAMES "cxxtest/TestSuite.h" - PATHS "${CXXTEST_PATH}" - "${PROJECT_SOURCE_DIR}/cxxtest/" - "${PROJECT_SOURCE_DIR}/lib/cxxtest/" - ) - -IF(NOT CXXTESTGEN) - MESSAGE(FATAL_ERROR "Unable to find 'cxxtestgen'") - SET(CXXTEST_FOUND false) -ELSEIF(NOT CXXTEST_INCLUDES) - SET(CXXTEST_FOUND false) -ELSE(NOT CXXTESTGEN) - SET(CXXTEST_FOUND true) - SET(CXXTEST_ROOT ${CXXTEST_INCLUDES}) -ENDIF(NOT CXXTESTGEN) - -SET(CXXTEST_CMAKE_MODULES_PATH "${CMAKE_CURRENT_LIST_DIR}") -INCLUDE("${CXXTEST_CMAKE_MODULES_PATH}/CxxTest.cmake") - diff --git a/noarch/lib/py/cxxtest/cxxtest/Descriptions.cpp b/noarch/lib/py/cxxtest/cxxtest/Descriptions.cpp deleted file mode 100644 index 17e9de35..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/Descriptions.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __cxxtest__Descriptions_cpp__ -#define __cxxtest__Descriptions_cpp__ - -#include - -namespace CxxTest -{ -TestDescription::~TestDescription() {} -SuiteDescription::~SuiteDescription() {} -WorldDescription::~WorldDescription() {} - -// -// Convert total tests to string -// -#ifndef _CXXTEST_FACTOR -char *WorldDescription::strTotalTests(char *s) const -{ - numberToString(numTotalTests(), s); - return s; -} -#else // _CXXTEST_FACTOR -char *WorldDescription::strTotalTests(char *s) const -{ - char *p = numberToString(numTotalTests(), s); - - if (numTotalTests() <= 1) - { - return s; - } - - unsigned n = numTotalTests(); - unsigned numFactors = 0; - - for (unsigned factor = 2; (factor * factor) <= n; factor += (factor == 2) ? 1 : 2) - { - unsigned power; - - for (power = 0; (n % factor) == 0; n /= factor) - { - ++ power; - } - - if (!power) - { - continue; - } - - p = numberToString(factor, copyString(p, (numFactors == 0) ? " = " : " * ")); - if (power > 1) - { - p = numberToString(power, copyString(p, "^")); - } - ++ numFactors; - } - - if (n > 1) - { - if (!numFactors) - { - copyString(p, tracker().failedTests() ? " :(" : tracker().warnings() ? " :|" : " :)"); - } - else - { - numberToString(n, copyString(p, " * ")); - } - } - return s; -} -#endif // _CXXTEST_FACTOR -} - -#endif // __cxxtest__Descriptions_cpp__ diff --git a/noarch/lib/py/cxxtest/cxxtest/Descriptions.h b/noarch/lib/py/cxxtest/cxxtest/Descriptions.h deleted file mode 100644 index f579d5ad..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/Descriptions.h +++ /dev/null @@ -1,91 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __cxxtest__Descriptions_h__ -#define __cxxtest__Descriptions_h__ - -// -// TestDescription, SuiteDescription and WorldDescription -// hold information about tests so they can be run and reported. -// - -#include - -namespace CxxTest -{ -class TestSuite; - -class TestDescription : public Link -{ -public: - virtual ~TestDescription(); - - virtual const char *file() const = 0; - virtual int line() const = 0; - virtual const char *testName() const = 0; - virtual const char *suiteName() const = 0; - - virtual void run() = 0; - virtual bool setUp() = 0; - virtual bool tearDown() = 0; - - virtual const TestDescription *next() const = 0; - virtual TestDescription *next() = 0; -}; - -class SuiteDescription : public Link -{ -public: - virtual ~SuiteDescription(); - - virtual const char *file() const = 0; - virtual int line() const = 0; - virtual const char *suiteName() const = 0; - virtual TestSuite *suite() const = 0; - - virtual unsigned numTests() const = 0; - virtual const TestDescription &testDescription(unsigned /*i*/) const = 0; - - virtual TestDescription *firstTest() = 0; - virtual const TestDescription *firstTest() const = 0; - virtual SuiteDescription *next() = 0; - virtual const SuiteDescription *next() const = 0; - - virtual void activateAllTests() = 0; - virtual bool leaveOnly(const char * /*testName*/) = 0; - - virtual bool setUp() = 0; - virtual bool tearDown() = 0; -}; - -class WorldDescription : public Link -{ -public: - virtual ~WorldDescription(); - - virtual const char *worldName() const { return "cxxtest"; } - virtual unsigned numSuites(void) const = 0; - virtual unsigned numTotalTests(void) const = 0; - virtual const SuiteDescription &suiteDescription(unsigned /*i*/) const = 0; - - enum { MAX_STRLEN_TOTAL_TESTS = 32 }; - char *strTotalTests(char * /*buffer*/) const; - - virtual SuiteDescription *firstSuite() = 0; - virtual const SuiteDescription *firstSuite() const = 0; - - virtual void activateAllTests() = 0; - virtual bool leaveOnly(const char * /*suiteName*/, const char * /*testName*/ = 0) = 0; -}; -} - -#endif // __cxxtest__Descriptions_h__ - diff --git a/noarch/lib/py/cxxtest/cxxtest/DummyDescriptions.cpp b/noarch/lib/py/cxxtest/cxxtest/DummyDescriptions.cpp deleted file mode 100644 index 1cc81054..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/DummyDescriptions.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#include - -namespace CxxTest -{ -DummyTestDescription::DummyTestDescription() {} - -const char *DummyTestDescription::file() const { return ""; } -int DummyTestDescription::line() const { return 0; } -const char *DummyTestDescription::testName() const { return ""; } -const char *DummyTestDescription::suiteName() const { return ""; } -bool DummyTestDescription::setUp() { return true;} -void DummyTestDescription::run() {} -bool DummyTestDescription::tearDown() { return true;} - -TestDescription *DummyTestDescription::next() { return 0; } -const TestDescription *DummyTestDescription::next() const { return 0; } - -DummySuiteDescription::DummySuiteDescription() : _test() {} - -const char *DummySuiteDescription::file() const { return ""; } -int DummySuiteDescription::line() const { return 0; } -const char *DummySuiteDescription::suiteName() const { return ""; } -TestSuite *DummySuiteDescription::suite() const { return 0; } -unsigned DummySuiteDescription::numTests() const { return 0; } -const TestDescription &DummySuiteDescription::testDescription(unsigned) const { return _test; } -SuiteDescription *DummySuiteDescription::next() { return 0; } -TestDescription *DummySuiteDescription::firstTest() { return 0; } -const SuiteDescription *DummySuiteDescription::next() const { return 0; } -const TestDescription *DummySuiteDescription::firstTest() const { return 0; } -void DummySuiteDescription::activateAllTests() {} -bool DummySuiteDescription::leaveOnly(const char * /*testName*/) { return false; } - -bool DummySuiteDescription::setUp() { return true;} -bool DummySuiteDescription::tearDown() { return true;} - -DummyWorldDescription::DummyWorldDescription() : _suite() {} - -unsigned DummyWorldDescription::numSuites(void) const { return 0; } -unsigned DummyWorldDescription::numTotalTests(void) const { return 0; } -const SuiteDescription &DummyWorldDescription::suiteDescription(unsigned) const { return _suite; } -SuiteDescription *DummyWorldDescription::firstSuite() { return 0; } -const SuiteDescription *DummyWorldDescription::firstSuite() const { return 0; } -void DummyWorldDescription::activateAllTests() {} -bool DummyWorldDescription::leaveOnly(const char * /*suiteName*/, const char * /*testName*/) { return false; } - -bool DummyWorldDescription::setUp() { return true;} -bool DummyWorldDescription::tearDown() { return true;} -} - diff --git a/noarch/lib/py/cxxtest/cxxtest/DummyDescriptions.h b/noarch/lib/py/cxxtest/cxxtest/DummyDescriptions.h deleted file mode 100644 index 8964bb5f..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/DummyDescriptions.h +++ /dev/null @@ -1,87 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __cxxtest__DummyDescriptions_h__ -#define __cxxtest__DummyDescriptions_h__ - -// -// DummyTestDescription, DummySuiteDescription and DummyWorldDescription -// - -#include - -namespace CxxTest -{ -class DummyTestDescription : public TestDescription -{ -public: - DummyTestDescription(); - - const char *file() const; - int line() const; - const char *testName() const; - const char *suiteName() const; - bool setUp(); - void run(); - bool tearDown(); - - TestDescription *next(); - const TestDescription *next() const; -}; - -class DummySuiteDescription : public SuiteDescription -{ -public: - DummySuiteDescription(); - - const char *file() const; - int line() const; - const char *suiteName() const; - TestSuite *suite() const; - unsigned numTests() const; - const TestDescription &testDescription(unsigned) const; - SuiteDescription *next(); - TestDescription *firstTest(); - const SuiteDescription *next() const; - const TestDescription *firstTest() const; - void activateAllTests(); - bool leaveOnly(const char * /*testName*/); - - bool setUp(); - bool tearDown(); - -private: - DummyTestDescription _test; -}; - -class DummyWorldDescription : public WorldDescription -{ -public: - DummyWorldDescription(); - - unsigned numSuites(void) const; - unsigned numTotalTests(void) const; - const SuiteDescription &suiteDescription(unsigned) const; - SuiteDescription *firstSuite(); - const SuiteDescription *firstSuite() const; - void activateAllTests(); - bool leaveOnly(const char * /*suiteName*/, const char * /*testName*/ = 0); - - bool setUp(); - bool tearDown(); - -private: - DummySuiteDescription _suite; -}; -} - -#endif // __cxxtest__DummyDescriptions_h__ - diff --git a/noarch/lib/py/cxxtest/cxxtest/ErrorFormatter.h b/noarch/lib/py/cxxtest/cxxtest/ErrorFormatter.h deleted file mode 100644 index 81582a3a..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/ErrorFormatter.h +++ /dev/null @@ -1,347 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __cxxtest__ErrorFormatter_h__ -#define __cxxtest__ErrorFormatter_h__ - -// -// The ErrorFormatter is a TestListener that -// prints reports of the errors to an output -// stream. Since we cannot rely on the standard -// iostreams, this header defines a base class -// analogout to std::ostream. -// - -#include -#include -#include -#include -#include - -namespace CxxTest -{ -class OutputStream -{ -public: - virtual ~OutputStream() {} - virtual void flush() {}; - virtual OutputStream &operator<<(unsigned /*number*/) { return *this; } - virtual OutputStream &operator<<(const char * /*string*/) { return *this; } - - typedef void (*Manipulator)(OutputStream &); - - virtual OutputStream &operator<<(Manipulator m) { m(*this); return *this; } - static void endl(OutputStream &o) { (o << "\n").flush(); } -}; - -class ErrorFormatter : public TestListener -{ -public: - ErrorFormatter(OutputStream *o, const char *preLine = ":", const char *postLine = "", - const char *errorString = "Error", - const char *warningString = "Warning") : - _dotting(true), - _reported(false), - _o(o), - _preLine(preLine), - _postLine(postLine), - _errorString(errorString), - _warningString(warningString) - { - } - - int run() - { - TestRunner::runAllTests(*this); - return tracker().failedTests(); - } - - void enterWorld(const WorldDescription& desc) - { - (*_o) << "Running " << desc.worldName() << " tests (" << totalTests << ")"; - _o->flush(); - _dotting = true; - _reported = false; - } - - static void totalTests(OutputStream &o) - { - char s[WorldDescription::MAX_STRLEN_TOTAL_TESTS]; - const WorldDescription &wd = tracker().world(); - o << wd.strTotalTests(s) << (wd.numTotalTests() == 1 ? " test" : " tests"); - } - - void enterSuite(const SuiteDescription &) - { - _reported = false; - } - - void enterTest(const TestDescription &) - { - _reported = false; - } - - void leaveTest(const TestDescription &) - { - if (tracker().testSkipped()) - { - (*_o) << "s"; - _o->flush(); - fflush(stdout); - _dotting = true; - } - else if (!tracker().testFailed()) - { - (*_o) << "."; - _o->flush(); - fflush(stdout); - _dotting = true; - } - } - - void leaveWorld(const WorldDescription &desc) - { - if (!tracker().failedTests()) - { - (*_o) << "OK!" << endl; - return; - } - newLine(); - (*_o) << "Failed " << tracker().failedTests() << " and Skipped " << tracker().skippedTests() << " of " << totalTests << endl; - unsigned numPassed = desc.numTotalTests() - tracker().failedTests() - tracker().skippedTests(); - unsigned numTotal = desc.numTotalTests() - tracker().skippedTests(); - if (numTotal == 0) - { - (*_o) << "Success rate: 100%" << endl; - } - else - { - (*_o) << "Success rate: " << (unsigned)(numPassed * 100.0 / numTotal) << "%" << endl; - } - } - - void trace(const char *file, int line, const char *expression) - { - stop(file, line) << "Trace: " << - expression << endl; - } - - void warning(const char *file, int line, const char *expression) - { - stop(file, line) << _warningString << ": " << - expression << endl; - } - - void skippedTest(const char *file, int line, const char *expression) - { - if(expression && strlen(expression) > 0) - stop(file, line) << _warningString << ": Test skipped: " << - expression << endl; - } - - void failedTest(const char *file, int line, const char *expression) - { - stop(file, line) << _errorString << ": Test failed: " << - expression << endl; - } - - void failedAssert(const char *file, int line, const char *expression) - { - stop(file, line) << _errorString << ": Assertion failed: " << - expression << endl; - } - - void failedAssertEquals(const char *file, int line, - const char *xStr, const char *yStr, - const char *x, const char *y) - { - stop(file, line) << _errorString << ": Expected (" << - xStr << " == " << yStr << "), found (" << - x << " != " << y << ")" << endl; - } - - void failedAssertSameData(const char *file, int line, - const char *xStr, const char *yStr, - const char *sizeStr, const void *x, - const void *y, unsigned size) - { - stop(file, line) << _errorString << ": Expected " << sizeStr << " (" << size << ") bytes to be equal at (" << - xStr << ") and (" << yStr << "), found:" << endl; - dump(x, size); - (*_o) << " differs from" << endl; - dump(y, size); - } - - void failedAssertSameFiles(const char* file, int line, - const char*, const char*, - const char* explanation - ) - { - stop(file, line) << _errorString << ": " << explanation << endl; - } - - void failedAssertDelta(const char *file, int line, - const char *xStr, const char *yStr, const char *dStr, - const char *x, const char *y, const char *d) - { - stop(file, line) << _errorString << ": Expected (" << - xStr << " == " << yStr << ") up to " << dStr << " (" << d << "), found (" << - x << " != " << y << ")" << endl; - } - - void failedAssertDiffers(const char *file, int line, - const char *xStr, const char *yStr, - const char *value) - { - stop(file, line) << _errorString << ": Expected (" << - xStr << " != " << yStr << "), found (" << - value << ")" << endl; - } - - void failedAssertLessThan(const char *file, int line, - const char *xStr, const char *yStr, - const char *x, const char *y) - { - stop(file, line) << _errorString << ": Expected (" << - xStr << " < " << yStr << "), found (" << - x << " >= " << y << ")" << endl; - } - - void failedAssertLessThanEquals(const char *file, int line, - const char *xStr, const char *yStr, - const char *x, const char *y) - { - stop(file, line) << _errorString << ": Expected (" << - xStr << " <= " << yStr << "), found (" << - x << " > " << y << ")" << endl; - } - - void failedAssertRelation(const char *file, int line, - const char *relation, const char *xStr, const char *yStr, - const char *x, const char *y) - { - stop(file, line) << _errorString << ": Expected " << relation << "( " << - xStr << ", " << yStr << " ), found !" << relation << "( " << x << ", " << y << " )" << endl; - } - - void failedAssertPredicate(const char *file, int line, - const char *predicate, const char *xStr, const char *x) - { - stop(file, line) << _errorString << ": Expected " << predicate << "( " << - xStr << " ), found !" << predicate << "( " << x << " )" << endl; - } - - void failedAssertThrows(const char *file, int line, - const char *expression, const char *type, - bool otherThrown) - { - stop(file, line) << _errorString << ": Expected (" << expression << ") to throw (" << - type << ") but it " << (otherThrown ? "threw something else" : "didn't throw") << - endl; - } - - void failedAssertThrowsNot(const char *file, int line, const char *expression) - { - stop(file, line) << _errorString << ": Expected (" << expression << ") not to throw, but it did" << - endl; - } - -protected: - OutputStream *outputStream() const - { - return _o; - } - -private: - ErrorFormatter(const ErrorFormatter &); - ErrorFormatter &operator=(const ErrorFormatter &); - - OutputStream &stop(const char *file, int line) - { - newLine(); - reportTest(); - return (*_o) << file << _preLine << line << _postLine << ": "; - } - - void newLine(void) - { - if (_dotting) - { - (*_o) << endl; - _dotting = false; - } - } - - void reportTest(void) - { - if (_reported) - { - return; - } - (*_o) << "In " << tracker().suite().suiteName() << "::" << tracker().test().testName() << ":" << endl; - _reported = true; - } - - void dump(const void *buffer, unsigned size) - { - if (!buffer) - { - dumpNull(); - } - else - { - dumpBuffer(buffer, size); - } - } - - void dumpNull() - { - (*_o) << " (null)" << endl; - } - - void dumpBuffer(const void *buffer, unsigned size) - { - unsigned dumpSize = size; - if (maxDumpSize() && dumpSize > maxDumpSize()) - { - dumpSize = maxDumpSize(); - } - - const unsigned char *p = (const unsigned char *)buffer; - (*_o) << " { "; - for (unsigned i = 0; i < dumpSize; ++ i) - { - (*_o) << byteToHex(*p++) << " "; - } - if (dumpSize < size) - { - (*_o) << "... "; - } - (*_o) << "}" << endl; - } - - static void endl(OutputStream &o) - { - OutputStream::endl(o); - } - - bool _dotting; - bool _reported; - OutputStream *_o; - const char *_preLine; - const char *_postLine; - const char *_errorString; - const char *_warningString; -}; -} - -#endif // __cxxtest__ErrorFormatter_h__ - diff --git a/noarch/lib/py/cxxtest/cxxtest/ErrorPrinter.h b/noarch/lib/py/cxxtest/cxxtest/ErrorPrinter.h deleted file mode 100644 index 8d5b1725..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/ErrorPrinter.h +++ /dev/null @@ -1,68 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __cxxtest__ErrorPrinter_h__ -#define __cxxtest__ErrorPrinter_h__ - -// -// The ErrorPrinter is a simple TestListener that -// just prints "OK" if everything goes well, otherwise -// reports the error in the format of compiler messages. -// The ErrorPrinter uses std::cout -// - -#include - -#ifndef _CXXTEST_HAVE_STD -# define _CXXTEST_HAVE_STD -#endif // _CXXTEST_HAVE_STD - -#include -#include - -#ifdef _CXXTEST_OLD_STD -# include -#else // !_CXXTEST_OLD_STD -# include -#endif // _CXXTEST_OLD_STD - -namespace CxxTest -{ -class ErrorPrinter : public ErrorFormatter -{ -public: - ErrorPrinter(CXXTEST_STD(ostream) &o = CXXTEST_STD(cout), const char *preLine = ":", const char *postLine = "", - const char *errorString = "Error", - const char *warningString = "Warning") : - ErrorFormatter(new Adapter(o), preLine, postLine, errorString, warningString) {} - virtual ~ErrorPrinter() { delete outputStream(); } - -private: - class Adapter : public OutputStream - { - CXXTEST_STD(ostream) &_o; - public: - Adapter(CXXTEST_STD(ostream) &o) : _o(o) {} - void flush() { _o.flush(); } - OutputStream &operator<<(const char *s) { _o << s; return *this; } - OutputStream &operator<<(Manipulator m) { return OutputStream::operator<<(m); } - OutputStream &operator<<(unsigned i) - { - char s[1 + 3 * sizeof(unsigned)]; - numberToString(i, s); - _o << s; - return *this; - } - }; -}; -} - -#endif // __cxxtest__ErrorPrinter_h__ diff --git a/noarch/lib/py/cxxtest/cxxtest/Flags.h b/noarch/lib/py/cxxtest/cxxtest/Flags.h deleted file mode 100644 index 54e9858d..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/Flags.h +++ /dev/null @@ -1,154 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __cxxtest__Flags_h__ -#define __cxxtest__Flags_h__ - -// -// These are the flags that control CxxTest -// - -#if !defined(CXXTEST_FLAGS) -# define CXXTEST_FLAGS -#endif // !CXXTEST_FLAGS - -#if defined(CXXTEST_HAVE_EH) && !defined(_CXXTEST_HAVE_EH) -# define _CXXTEST_HAVE_EH -#endif // CXXTEST_HAVE_EH - -#if defined(CXXTEST_HAVE_STD) && !defined(_CXXTEST_HAVE_STD) -# define _CXXTEST_HAVE_STD -#endif // CXXTEST_HAVE_STD - -#if defined(CXXTEST_OLD_TEMPLATE_SYNTAX) && !defined(_CXXTEST_OLD_TEMPLATE_SYNTAX) -# define _CXXTEST_OLD_TEMPLATE_SYNTAX -#endif // CXXTEST_OLD_TEMPLATE_SYNTAX - -#if defined(CXXTEST_OLD_STD) && !defined(_CXXTEST_OLD_STD) -# define _CXXTEST_OLD_STD -#endif // CXXTEST_OLD_STD - -#if defined(CXXTEST_ABORT_TEST_ON_FAIL) && !defined(_CXXTEST_ABORT_TEST_ON_FAIL) -# define _CXXTEST_ABORT_TEST_ON_FAIL -#endif // CXXTEST_ABORT_TEST_ON_FAIL - -#if defined(CXXTEST_NO_COPY_CONST) && !defined(_CXXTEST_NO_COPY_CONST) -# define _CXXTEST_NO_COPY_CONST -#endif // CXXTEST_NO_COPY_CONST - -#if defined(CXXTEST_FACTOR) && !defined(_CXXTEST_FACTOR) -# define _CXXTEST_FACTOR -#endif // CXXTEST_FACTOR - -#if defined(CXXTEST_PARTIAL_TEMPLATE_SPECIALIZATION) && !defined(_CXXTEST_PARTIAL_TEMPLATE_SPECIALIZATION) -# define _CXXTEST_PARTIAL_TEMPLATE_SPECIALIZATION -#endif // CXXTEST_PARTIAL_TEMPLATE_SPECIALIZATION - -#if defined(CXXTEST_LONGLONG) -# if defined(_CXXTEST_LONGLONG) -# undef _CXXTEST_LONGLONG -# endif -# define _CXXTEST_LONGLONG CXXTEST_LONGLONG -#endif // CXXTEST_LONGLONG - -#ifndef CXXTEST_MAX_DUMP_SIZE -# define CXXTEST_MAX_DUMP_SIZE 0 -#endif // CXXTEST_MAX_DUMP_SIZE - -#if defined(_CXXTEST_ABORT_TEST_ON_FAIL) && !defined(CXXTEST_DEFAULT_ABORT) -# define CXXTEST_DEFAULT_ABORT true -#endif // _CXXTEST_ABORT_TEST_ON_FAIL && !CXXTEST_DEFAULT_ABORT - -#if !defined(CXXTEST_DEFAULT_ABORT) -# define CXXTEST_DEFAULT_ABORT false -#endif // !CXXTEST_DEFAULT_ABORT - -#if defined(_CXXTEST_ABORT_TEST_ON_FAIL) && !defined(_CXXTEST_HAVE_EH) -# warning "CXXTEST_ABORT_TEST_ON_FAIL is meaningless without CXXTEST_HAVE_EH" -# undef _CXXTEST_ABORT_TEST_ON_FAIL -#endif // _CXXTEST_ABORT_TEST_ON_FAIL && !_CXXTEST_HAVE_EH - -// -// Some minimal per-compiler configuration to allow us to compile -// - -#ifdef __BORLANDC__ -# if __BORLANDC__ <= 0x520 // Borland C++ 5.2 or earlier -# ifndef _CXXTEST_OLD_STD -# define _CXXTEST_OLD_STD -# endif -# ifndef _CXXTEST_OLD_TEMPLATE_SYNTAX -# define _CXXTEST_OLD_TEMPLATE_SYNTAX -# endif -# endif -# if __BORLANDC__ >= 0x540 // C++ Builder 4.0 or later -# ifndef _CXXTEST_NO_COPY_CONST -# define _CXXTEST_NO_COPY_CONST -# endif -# ifndef _CXXTEST_LONGLONG -# define _CXXTEST_LONGLONG __int64 -# endif -# endif -#endif // __BORLANDC__ - -#ifdef _MSC_VER // Visual C++ -# ifndef _CXXTEST_LONGLONG -# define _CXXTEST_LONGLONG __int64 -# endif -# if (_MSC_VER >= 0x51E) -# ifndef _CXXTEST_PARTIAL_TEMPLATE_SPECIALIZATION -# define _CXXTEST_PARTIAL_TEMPLATE_SPECIALIZATION -# endif -# endif -# pragma warning( disable : 4127 ) -# pragma warning( disable : 4290 ) -# pragma warning( disable : 4511 ) -# pragma warning( disable : 4512 ) -# pragma warning( disable : 4514 ) -#endif // _MSC_VER - -#ifdef __GNUC__ -# if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 9) -# ifndef _CXXTEST_PARTIAL_TEMPLATE_SPECIALIZATION -# define _CXXTEST_PARTIAL_TEMPLATE_SPECIALIZATION -# endif -# endif -# if defined(__LONG_LONG_MAX__) && !defined(__cplusplus) -# define _CXXTEST_LONGLONG long long -# endif -#endif // __GNUC__ - -#ifdef __DMC__ // Digital Mars -# ifndef _CXXTEST_OLD_STD -# define _CXXTEST_OLD_STD -# endif -#endif - -#ifdef __SUNPRO_CC // Sun Studio C++ -# if __SUNPRO_CC >= 0x510 -# ifndef _CXXTEST_PARTIAL_TEMPLATE_SPECIALIZATION -# define _CXXTEST_PARTIAL_TEMPLATE_SPECIALIZATION -# endif -# endif -#endif - -#ifdef __xlC__ // IBM XL C/C++ -// Partial specialization may be supported before 7.0.0.3, but it is -// definitely supported after. -# if __xlC__ >= 0x0700 -# ifndef _CXXTEST_PARTIAL_TEMPLATE_SPECIALIZATION -# define _CXXTEST_PARTIAL_TEMPLATE_SPECIALIZATION -# endif -# endif -#endif - -#endif // __cxxtest__Flags_h__ - diff --git a/noarch/lib/py/cxxtest/cxxtest/GlobalFixture.cpp b/noarch/lib/py/cxxtest/cxxtest/GlobalFixture.cpp deleted file mode 100644 index c3bea78f..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/GlobalFixture.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __cxxtest__GlobalFixture_cpp__ -#define __cxxtest__GlobalFixture_cpp__ - -#include - -namespace CxxTest -{ -bool GlobalFixture::setUpWorld() { return true; } -bool GlobalFixture::tearDownWorld() { return true; } -bool GlobalFixture::setUp() { return true; } -bool GlobalFixture::tearDown() { return true; } - -GlobalFixture::GlobalFixture() { attach(_list); } -GlobalFixture::~GlobalFixture() { detach(_list); } - -GlobalFixture *GlobalFixture::firstGlobalFixture() { return (GlobalFixture *)_list.head(); } -GlobalFixture *GlobalFixture::lastGlobalFixture() { return (GlobalFixture *)_list.tail(); } -GlobalFixture *GlobalFixture::nextGlobalFixture() { return (GlobalFixture *)next(); } -GlobalFixture *GlobalFixture::prevGlobalFixture() { return (GlobalFixture *)prev(); } -} - -#endif // __cxxtest__GlobalFixture_cpp__ - diff --git a/noarch/lib/py/cxxtest/cxxtest/GlobalFixture.h b/noarch/lib/py/cxxtest/cxxtest/GlobalFixture.h deleted file mode 100644 index c969fd93..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/GlobalFixture.h +++ /dev/null @@ -1,41 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __cxxtest__GlobalFixture_h__ -#define __cxxtest__GlobalFixture_h__ - -#include - -namespace CxxTest -{ -class GlobalFixture : public Link -{ -public: - virtual bool setUpWorld(); - virtual bool tearDownWorld(); - virtual bool setUp(); - virtual bool tearDown(); - - GlobalFixture(); - virtual ~GlobalFixture(); - - static GlobalFixture *firstGlobalFixture(); - static GlobalFixture *lastGlobalFixture(); - GlobalFixture *nextGlobalFixture(); - GlobalFixture *prevGlobalFixture(); - -private: - static List _list; -}; -} - -#endif // __cxxtest__GlobalFixture_h__ - diff --git a/noarch/lib/py/cxxtest/cxxtest/Gui.h b/noarch/lib/py/cxxtest/cxxtest/Gui.h deleted file mode 100644 index 253ed627..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/Gui.h +++ /dev/null @@ -1,199 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __CXXTEST__GUI_H -#define __CXXTEST__GUI_H - -// -// GuiListener is a simple base class for the differes GUIs -// GuiTuiRunner combines a GUI with a text-mode error formatter -// - -#include - -namespace CxxTest -{ -class GuiListener : public TestListener -{ -public: - GuiListener() : _state(GREEN_BAR) {} - virtual ~GuiListener() {} - - virtual void runGui(int &argc, char **argv, TestListener &listener) - { - enterGui(argc, argv); - TestRunner::runAllTests(listener); - leaveGui(); - } - - virtual void enterGui(int & /*argc*/, char ** /*argv*/) {} - virtual void leaveGui() {} - - // - // The easy way is to implement these functions: - // - virtual void guiEnterWorld(unsigned /*numTotalTests*/) {} - virtual void guiEnterSuite(const char * /*suiteName*/) {} - virtual void guiEnterTest(const char * /*suiteName*/, const char * /*testName*/) {} - virtual void yellowBar() {} - virtual void redBar() {} - - // - // The hard way is this: - // - void enterWorld(const WorldDescription &d) { guiEnterWorld(d.numTotalTests()); } - void enterSuite(const SuiteDescription &d) { guiEnterSuite(d.suiteName()); } - void enterTest(const TestDescription &d) { guiEnterTest(d.suiteName(), d.testName()); } - void leaveTest(const TestDescription &) {} - void leaveSuite(const SuiteDescription &) {} - void leaveWorld(const WorldDescription &) {} - - void warning(const char * /*file*/, int /*line*/, const char * /*expression*/) - { - yellowBarSafe(); - } - - void skippedTest(const char * /*file*/, int /*line*/, const char * /*expression*/) - { - yellowBarSafe(); - } - - void failedTest(const char * /*file*/, int /*line*/, const char * /*expression*/) - { - redBarSafe(); - } - - void failedAssert(const char * /*file*/, int /*line*/, const char * /*expression*/) - { - redBarSafe(); - } - - void failedAssertEquals(const char * /*file*/, int /*line*/, - const char * /*xStr*/, const char * /*yStr*/, - const char * /*x*/, const char * /*y*/) - { - redBarSafe(); - } - - void failedAssertSameData(const char * /*file*/, int /*line*/, - const char * /*xStr*/, const char * /*yStr*/, - const char * /*sizeStr*/, const void * /*x*/, - const void * /*y*/, unsigned /*size*/) - { - redBarSafe(); - } - - void failedAssertDelta(const char * /*file*/, int /*line*/, - const char * /*xStr*/, const char * /*yStr*/, const char * /*dStr*/, - const char * /*x*/, const char * /*y*/, const char * /*d*/) - { - redBarSafe(); - } - - void failedAssertDiffers(const char * /*file*/, int /*line*/, - const char * /*xStr*/, const char * /*yStr*/, - const char * /*value*/) - { - redBarSafe(); - } - - void failedAssertLessThan(const char * /*file*/, int /*line*/, - const char * /*xStr*/, const char * /*yStr*/, - const char * /*x*/, const char * /*y*/) - { - redBarSafe(); - } - - void failedAssertLessThanEquals(const char * /*file*/, int /*line*/, - const char * /*xStr*/, const char * /*yStr*/, - const char * /*x*/, const char * /*y*/) - { - redBarSafe(); - } - - void failedAssertPredicate(const char * /*file*/, int /*line*/, - const char * /*predicate*/, const char * /*xStr*/, const char * /*x*/) - { - redBarSafe(); - } - - void failedAssertRelation(const char * /*file*/, int /*line*/, - const char * /*relation*/, const char * /*xStr*/, const char * /*yStr*/, - const char * /*x*/, const char * /*y*/) - { - redBarSafe(); - } - - void failedAssertThrows(const char * /*file*/, int /*line*/, - const char * /*expression*/, const char * /*type*/, - bool /*otherThrown*/) - { - redBarSafe(); - } - - void failedAssertThrowsNot(const char * /*file*/, int /*line*/, - const char * /*expression*/) - { - redBarSafe(); - } - -protected: - void yellowBarSafe() - { - if (_state < YELLOW_BAR) - { - yellowBar(); - _state = YELLOW_BAR; - } - } - - void redBarSafe() - { - if (_state < RED_BAR) - { - redBar(); - _state = RED_BAR; - } - } - -private: - enum { GREEN_BAR, YELLOW_BAR, RED_BAR } _state; -}; - -template -class GuiTuiRunner : public TeeListener -{ - int* _argc; - char **_argv; - GuiT _gui; - TuiT _tui; - -public: - GuiTuiRunner() : _argc(0), _argv(0) {} - - void process_commandline(int& argc, char** argv) - { - _argc = &argc; - _argv = argv; - setFirst(_gui); - setSecond(_tui); - } - - int run() - { - _gui.runGui(*_argc, _argv, *this); - return tracker().failedTests(); - } -}; -} - -#endif //__CXXTEST__GUI_H - diff --git a/noarch/lib/py/cxxtest/cxxtest/LinkedList.cpp b/noarch/lib/py/cxxtest/cxxtest/LinkedList.cpp deleted file mode 100644 index 223e4d9b..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/LinkedList.cpp +++ /dev/null @@ -1,221 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __cxxtest__LinkedList_cpp__ -#define __cxxtest__LinkedList_cpp__ - -#include - -namespace CxxTest -{ -List GlobalFixture::_list = { 0, 0 }; -List RealSuiteDescription::_suites = { 0, 0 }; - -void List::initialize() -{ - _head = _tail = 0; -} - -Link *List::head() -{ - Link *l = _head; - while (l && !l->active()) - { - l = l->next(); - } - return l; -} - -const Link *List::head() const -{ - Link *l = _head; - while (l && !l->active()) - { - l = l->next(); - } - return l; -} - -Link *List::tail() -{ - Link *l = _tail; - while (l && !l->active()) - { - l = l->prev(); - } - return l; -} - -const Link *List::tail() const -{ - Link *l = _tail; - while (l && !l->active()) - { - l = l->prev(); - } - return l; -} - -bool List::empty() const -{ - return (_head == 0); -} - -unsigned List::size() const -{ - unsigned count = 0; - for (const Link *l = head(); l != 0; l = l->next()) - { - ++ count; - } - return count; -} - -Link *List::nth(unsigned n) -{ - Link *l = head(); - while (n --) - { - l = l->next(); - } - return l; -} - -void List::activateAll() -{ - for (Link *l = _head; l != 0; l = l->justNext()) - { - l->setActive(true); - } -} - -void List::leaveOnly(const Link &link) -{ - for (Link *l = head(); l != 0; l = l->next()) - { - if (l != &link) - { - l->setActive(false); - } - } -} - -Link::Link() : - _next(0), - _prev(0), - _active(true) -{ -} - -Link::~Link() -{ -} - -bool Link::active() const -{ - return _active; -} - -void Link::setActive(bool value) -{ - _active = value; -} - -Link * Link::justNext() -{ - return _next; -} - -Link * Link::justPrev() -{ - return _prev; -} - -Link * Link::next() -{ - Link *l = _next; - while (l && !l->_active) - { - l = l->_next; - } - return l; -} - -Link * Link::prev() -{ - Link *l = _prev; - while (l && !l->_active) - { - l = l->_prev; - } - return l; -} - -const Link * Link::next() const -{ - Link *l = _next; - while (l && !l->_active) - { - l = l->_next; - } - return l; -} - -const Link * Link::prev() const -{ - Link *l = _prev; - while (l && !l->_active) - { - l = l->_prev; - } - return l; -} - -void Link::attach(List &l) -{ - if (l._tail) - { - l._tail->_next = this; - } - - _prev = l._tail; - _next = 0; - - if (l._head == 0) - { - l._head = this; - } - l._tail = this; -} - -void Link::detach(List &l) -{ - if (_prev) - { - _prev->_next = _next; - } - else - { - l._head = _next; - } - - if (_next) - { - _next->_prev = _prev; - } - else - { - l._tail = _prev; - } -} -} - -#endif // __cxxtest__LinkedList_cpp__ diff --git a/noarch/lib/py/cxxtest/cxxtest/LinkedList.h b/noarch/lib/py/cxxtest/cxxtest/LinkedList.h deleted file mode 100644 index d2fced11..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/LinkedList.h +++ /dev/null @@ -1,73 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __cxxtest__LinkedList_h__ -#define __cxxtest__LinkedList_h__ - -#include - -namespace CxxTest -{ -struct List; -class Link; - -struct List -{ - Link *_head; - Link *_tail; - - void initialize(); - - Link *head(); - const Link *head() const; - Link *tail(); - const Link *tail() const; - - bool empty() const; - unsigned size() const; - Link *nth(unsigned n); - - void activateAll(); - void leaveOnly(const Link &link); -}; - -class Link -{ -public: - Link(); - virtual ~Link(); - - bool active() const; - void setActive(bool value = true); - - Link *justNext(); - Link *justPrev(); - - Link *next(); - Link *prev(); - const Link *next() const; - const Link *prev() const; - - void attach(List &l); - void detach(List &l); - -private: - Link *_next; - Link *_prev; - bool _active; - - Link(const Link &); - Link &operator=(const Link &); -}; -} - -#endif // __cxxtest__LinkedList_h__ - diff --git a/noarch/lib/py/cxxtest/cxxtest/MSVCErrorPrinter.h b/noarch/lib/py/cxxtest/cxxtest/MSVCErrorPrinter.h deleted file mode 100644 index 845d7041..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/MSVCErrorPrinter.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __cxxtest__MSVCErrorPrinter_h__ -#define __cxxtest__MSVCErrorPrinter_h__ - -// -// The MSVCErrorPrinter is identical to the ErrorPrinter, except it -// prints the line number and error/warning strings in a format -// consistent with that generated by Microsoft's compiler. -// -// Strict error parsers (e.g. QtCreator's) expect each error to be -// followed by a proper-looking error code, so give them one to make -// them work. Same for warnings. -// -// C2999 : "Unknown error" from Visual Studio 6, no longer used. -// C4999 : "Unknown warning" from Visual Studio 6, no longer used. -// - -#include - -namespace CxxTest -{ -class MSVCErrorPrinter : public ErrorPrinter -{ -public: - MSVCErrorPrinter(CXXTEST_STD(ostream) &o = CXXTEST_STD(cout)) - : ErrorPrinter(o, "(", ") ", "error C2999", "warning C4999") {} -}; -} - -#endif // __cxxtest__MSVCErrorPrinter_h__ diff --git a/noarch/lib/py/cxxtest/cxxtest/Mock.h b/noarch/lib/py/cxxtest/cxxtest/Mock.h deleted file mode 100644 index 2ba2a436..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/Mock.h +++ /dev/null @@ -1,380 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __cxxtest__Mock_h__ -#define __cxxtest__Mock_h__ - -namespace dummy_mock_ns {} - -// -// The default namespace is T:: -// -#ifndef CXXTEST_MOCK_NAMESPACE -# define CXXTEST_MOCK_NAMESPACE T -#endif // CXXTEST_MOCK_NAMESPACE - -// -// MockTraits: What to return when no mock object has been created -// -#define __CXXTEST_MOCK__TRAITS \ - namespace CXXTEST_MOCK_NAMESPACE \ - { \ - template \ - class MockTraits \ - { \ - public: \ - static T defaultValue() { return 0; } \ - }; \ - } - -// -// extern "C" when needed -// -#ifdef __cplusplus -# define CXXTEST_EXTERN_C extern "C" -#else -# define CXXTEST_EXTERN_C -#endif // __cplusplus - -// -// Prototypes: For "normal" headers -// -#define __CXXTEST_MOCK__PROTOTYPE( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \ - namespace CXXTEST_MOCK_NAMESPACE { TYPE NAME ARGS; } - -#define __CXXTEST_MOCK_VOID__PROTOTYPE( MOCK, NAME, ARGS, REAL, CALL ) \ - __CXXTEST_MOCK__PROTOTYPE( MOCK, void, NAME, ARGS, REAL, CALL ) - -#define __CXXTEST_SUPPLY__PROTOTYPE( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \ - TYPE REAL ARGS; - -#define __CXXTEST_SUPPLY_VOID__PROTOTYPE( MOCK, NAME, ARGS, REAL, CALL ) \ - __CXXTEST_SUPPLY__PROTOTYPE( MOCK, void, NAME, ARGS, REAL, CALL ) - -// -// Class declarations: For test files -// -#define __CXXTEST_MOCK__CLASS_DECLARATION( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \ - namespace CXXTEST_MOCK_NAMESPACE { \ - class Base_##MOCK : public CxxTest::Link \ - { \ - public: \ - Base_##MOCK(); \ - ~Base_##MOCK(); \ - bool setUp(); \ - bool tearDown(); \ - \ - static Base_##MOCK ¤t(); \ - \ - virtual TYPE NAME ARGS = 0; \ - \ - private: \ - static CxxTest::List _list; \ - }; \ - \ - class Real_##MOCK : public Base_##MOCK \ - { \ - public: \ - TYPE NAME ARGS; \ - }; \ - \ - class _Unimplemented_##MOCK : public Base_##MOCK \ - { \ - public: \ - TYPE NAME ARGS; \ - }; \ - } - -#define __CXXTEST_MOCK_VOID__CLASS_DECLARATION( MOCK, NAME, ARGS, REAL, CALL ) \ - __CXXTEST_MOCK__CLASS_DECLARATION( MOCK, void, NAME, ARGS, REAL, CALL ) - -#define __CXXTEST_SUPPLY__CLASS_DECLARATION( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \ - namespace CXXTEST_MOCK_NAMESPACE { \ - class Base_##MOCK : public CxxTest::Link \ - { \ - public: \ - Base_##MOCK(); \ - ~Base_##MOCK(); \ - bool setUp(); \ - bool tearDown(); \ - \ - static Base_##MOCK ¤t(); \ - \ - virtual TYPE NAME ARGS = 0; \ - \ - private: \ - static CxxTest::List _list; \ - }; \ - \ - class _Unimplemented_##MOCK : public Base_##MOCK \ - { \ - public: \ - TYPE NAME ARGS; \ - }; \ - } - -#define __CXXTEST_SUPPLY_VOID__CLASS_DECLARATION( MOCK, NAME, ARGS, REAL, CALL ) \ - __CXXTEST_SUPPLY__CLASS_DECLARATION( MOCK, void, NAME, ARGS, REAL, CALL ) - -// -// Class implementation: For test source files -// -#define __CXXTEST_MOCK__COMMON_CLASS_IMPLEMENTATION( MOCK, NAME ) \ - namespace CXXTEST_MOCK_NAMESPACE { \ - \ - CxxTest::List Base_##MOCK::_list = { 0, 0 }; \ - \ - Base_##MOCK::Base_##MOCK() { attach( _list ); } \ - Base_##MOCK::~Base_##MOCK() { detach( _list ); } \ - bool Base_##MOCK::setUp() { return true; } \ - bool Base_##MOCK::tearDown() { return true; } \ - \ - Base_##MOCK &Base_##MOCK::current() \ - { \ - if ( _list.empty() ) { \ - static _Unimplemented_##MOCK unimplemented; \ - } \ - return *(Base_##MOCK *)_list.tail(); \ - } \ - } - -#define __CXXTEST_MOCK__CLASS_IMPLEMENTATION( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \ - __CXXTEST_MOCK__COMMON_CLASS_IMPLEMENTATION( MOCK, NAME ) \ - namespace CXXTEST_MOCK_NAMESPACE { \ - TYPE Real_##MOCK::NAME ARGS \ - { \ - return REAL CALL; \ - } \ - \ - TYPE _Unimplemented_##MOCK::NAME ARGS \ - { \ - while ( false ) {\ - return NAME CALL; \ - } \ - __CXXTEST_MOCK_UNIMPLEMENTED( NAME, ARGS ); \ - return MockTraits::defaultValue(); \ - } \ - \ - TYPE NAME ARGS \ - { \ - return Base_##MOCK::current().NAME CALL; \ - } \ - } - -#define __CXXTEST_MOCK_VOID__CLASS_IMPLEMENTATION( MOCK, NAME, ARGS, REAL, CALL ) \ - __CXXTEST_MOCK__COMMON_CLASS_IMPLEMENTATION( MOCK, NAME ) \ - namespace CXXTEST_MOCK_NAMESPACE { \ - void Real_##MOCK::NAME ARGS \ - { \ - REAL CALL; \ - } \ - \ - void _Unimplemented_##MOCK::NAME ARGS \ - { \ - while ( false ) { \ - NAME CALL; \ - } \ - __CXXTEST_MOCK_UNIMPLEMENTED( NAME, ARGS ); \ - } \ - \ - void NAME ARGS \ - { \ - Base_##MOCK::current().NAME CALL; \ - } \ - } - -#define __CXXTEST_SUPPLY__CLASS_IMPLEMENTATION( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \ - __CXXTEST_MOCK__COMMON_CLASS_IMPLEMENTATION( MOCK, NAME ) \ - namespace CXXTEST_MOCK_NAMESPACE { \ - TYPE _Unimplemented_##MOCK::NAME ARGS \ - { \ - while ( false ) { \ - return NAME CALL; \ - } \ - __CXXTEST_MOCK_UNIMPLEMENTED( NAME, ARGS ); \ - return MockTraits::defaultValue(); \ - } \ - } \ - \ - TYPE REAL ARGS \ - { \ - return CXXTEST_MOCK_NAMESPACE::Base_##MOCK::current().NAME CALL; \ - } - -#define __CXXTEST_SUPPLY_VOID__CLASS_IMPLEMENTATION( MOCK, NAME, ARGS, REAL, CALL ) \ - __CXXTEST_MOCK__COMMON_CLASS_IMPLEMENTATION( MOCK, NAME ) \ - namespace CXXTEST_MOCK_NAMESPACE { \ - void _Unimplemented_##MOCK::NAME ARGS \ - { \ - while ( false ) { \ - NAME CALL; \ - } \ - __CXXTEST_MOCK_UNIMPLEMENTED( NAME, ARGS ); \ - } \ - } \ - \ - void REAL ARGS \ - { \ - CXXTEST_MOCK_NAMESPACE::Base_##MOCK::current().NAME CALL; \ - } \ - -// -// Error for calling mock function w/o object -// -#define __CXXTEST_MOCK_UNIMPLEMENTED( NAME, ARGS ) \ - TS_FAIL( CXXTEST_MOCK_NAMESPACE_STR #NAME #ARGS " called with no " \ - CXXTEST_MOCK_NAMESPACE_STR "Base_" #NAME " object" ); \ - -#define CXXTEST_MOCK_NAMESPACE_STR __CXXTEST_STR(CXXTEST_MOCK_NAMESPACE) "::" -#define __CXXTEST_STR(X) __CXXTEST_XSTR(X) -#define __CXXTEST_XSTR(X) #X - -#if defined(CXXTEST_MOCK_TEST_SOURCE_FILE) -// -// Test source file: Prototypes, class declarations and implementation -// -#include - -__CXXTEST_MOCK__TRAITS - -#define CXXTEST_MOCK( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \ - __CXXTEST_MOCK__PROTOTYPE( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \ - __CXXTEST_MOCK__CLASS_DECLARATION( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \ - __CXXTEST_MOCK__CLASS_IMPLEMENTATION( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \ - using namespace dummy_mock_ns - -#define CXXTEST_MOCK_VOID( MOCK, NAME, ARGS, REAL, CALL ) \ - __CXXTEST_MOCK_VOID__PROTOTYPE( MOCK, NAME, ARGS, REAL, CALL ) \ - __CXXTEST_MOCK_VOID__CLASS_DECLARATION( MOCK, NAME, ARGS, REAL, CALL ) \ - __CXXTEST_MOCK_VOID__CLASS_IMPLEMENTATION( MOCK, NAME, ARGS, REAL, CALL ) \ - using namespace dummy_mock_ns - -#define CXXTEST_SUPPLY( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \ - __CXXTEST_SUPPLY__PROTOTYPE( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \ - __CXXTEST_SUPPLY__CLASS_DECLARATION( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \ - __CXXTEST_SUPPLY__CLASS_IMPLEMENTATION( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \ - using namespace dummy_mock_ns - -#define CXXTEST_SUPPLY_VOID( MOCK, NAME, ARGS, REAL, CALL ) \ - __CXXTEST_SUPPLY_VOID__PROTOTYPE( MOCK, NAME, ARGS, REAL, CALL ) \ - __CXXTEST_SUPPLY_VOID__CLASS_DECLARATION( MOCK, NAME, ARGS, REAL, CALL ) \ - __CXXTEST_SUPPLY_VOID__CLASS_IMPLEMENTATION( MOCK, NAME, ARGS, REAL, CALL ) \ - using namespace dummy_mock_ns - -#elif defined(CXXTEST_FLAGS) || defined(CXXTEST_RUNNING) -// -// Test file other than source: Prototypes and class declarations -// -#include - -__CXXTEST_MOCK__TRAITS; - -#define CXXTEST_MOCK( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \ - __CXXTEST_MOCK__PROTOTYPE( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \ - __CXXTEST_MOCK__CLASS_DECLARATION( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \ - using namespace dummy_mock_ns - -#define CXXTEST_MOCK_VOID( MOCK, NAME, ARGS, REAL, CALL ) \ - __CXXTEST_MOCK_VOID__PROTOTYPE( MOCK, NAME, ARGS, REAL, CALL ) \ - __CXXTEST_MOCK_VOID__CLASS_DECLARATION( MOCK, NAME, ARGS, REAL, CALL ) \ - using namespace dummy_mock_ns - -#define CXXTEST_SUPPLY( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \ - __CXXTEST_SUPPLY__PROTOTYPE( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \ - __CXXTEST_SUPPLY__CLASS_DECLARATION( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \ - using namespace dummy_mock_ns - -#define CXXTEST_SUPPLY_VOID( MOCK, NAME, ARGS, REAL, CALL ) \ - __CXXTEST_SUPPLY_VOID__PROTOTYPE( MOCK, NAME, ARGS, REAL, CALL ) \ - __CXXTEST_SUPPLY_VOID__CLASS_DECLARATION( MOCK, NAME, ARGS, REAL, CALL ) \ - using namespace dummy_mock_ns - -#elif defined(CXXTEST_MOCK_REAL_SOURCE_FILE) -// -// Real source file: "Real" implementations -// -#define CXXTEST_MOCK( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \ - namespace CXXTEST_MOCK_NAMESPACE { TYPE NAME ARGS { return REAL CALL; } } using namespace dummy_mock_ns - -#define CXXTEST_MOCK_VOID( MOCK, NAME, ARGS, REAL, CALL ) \ - namespace CXXTEST_MOCK_NAMESPACE { void NAME ARGS { REAL CALL; } } using namespace dummy_mock_ns - -#else -// -// Ordinary header file: Just prototypes -// - -#define CXXTEST_MOCK( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \ - __CXXTEST_MOCK__PROTOTYPE( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \ - using namespace dummy_mock_ns - -#define CXXTEST_MOCK_VOID( MOCK, NAME, ARGS, REAL, CALL ) \ - __CXXTEST_MOCK_VOID__PROTOTYPE( MOCK, NAME, ARGS, REAL, CALL ) \ - using namespace dummy_mock_ns - -#define CXXTEST_SUPPLY( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \ - __CXXTEST_SUPPLY__PROTOTYPE( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \ - using namespace dummy_mock_ns - -#define CXXTEST_SUPPLY_VOID( MOCK, NAME, ARGS, REAL, CALL ) \ - __CXXTEST_SUPPLY_VOID__PROTOTYPE( MOCK, NAME, ARGS, REAL, CALL ) \ - using namespace dummy_mock_ns - -#endif // Ordinary header file - -// -// How to supply extern "C" functions -// -#define CXXTEST_SUPPLY_C( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \ - CXXTEST_EXTERN_C __CXXTEST_SUPPLY__PROTOTYPE( MOCK, TYPE, NAME, ARGS, REAL, CALL ) \ - CXXTEST_SUPPLY( MOCK, TYPE, NAME, ARGS, REAL, CALL ) - -#define CXXTEST_SUPPLY_VOID_C( MOCK, NAME, ARGS, REAL, CALL ) \ - CXXTEST_EXTERN_C __CXXTEST_SUPPLY_VOID__PROTOTYPE( MOCK, NAME, ARGS, REAL, CALL ) \ - CXXTEST_SUPPLY_VOID( MOCK, NAME, ARGS, REAL, CALL ) - -// -// Usually we mean the global namespace -// -#define CXXTEST_MOCK_GLOBAL( TYPE, NAME, ARGS, CALL ) \ - CXXTEST_MOCK( NAME, TYPE, NAME, ARGS, ::NAME, CALL ) - -#define CXXTEST_MOCK_VOID_GLOBAL( NAME, ARGS, CALL ) \ - CXXTEST_MOCK_VOID( NAME, NAME, ARGS, ::NAME, CALL ) - -#define CXXTEST_SUPPLY_GLOBAL( TYPE, NAME, ARGS, CALL ) \ - CXXTEST_SUPPLY( NAME, TYPE, NAME, ARGS, NAME, CALL ) - -#define CXXTEST_SUPPLY_VOID_GLOBAL( NAME, ARGS, CALL ) \ - CXXTEST_SUPPLY_VOID( NAME, NAME, ARGS, NAME, CALL ) - -#define CXXTEST_SUPPLY_GLOBAL_C( TYPE, NAME, ARGS, CALL ) \ - CXXTEST_SUPPLY_C( NAME, TYPE, NAME, ARGS, NAME, CALL ) - -#define CXXTEST_SUPPLY_VOID_GLOBAL_C( NAME, ARGS, CALL ) \ - CXXTEST_SUPPLY_VOID_C( NAME, NAME, ARGS, NAME, CALL ) - -// -// What to return when no mock object has been created. -// The default value of 0 usually works, but some cases may need this. -// -#define CXXTEST_MOCK_DEFAULT_VALUE( TYPE, VALUE ) \ - namespace CXXTEST_MOCK_NAMESPACE \ - { \ - template<> \ - class MockTraits \ - { \ - public: \ - static TYPE defaultValue() { return VALUE; } \ - }; \ - } using namespace dummy_mock_ns - -#endif // __cxxtest__Mock_h__ diff --git a/noarch/lib/py/cxxtest/cxxtest/ParenPrinter.h b/noarch/lib/py/cxxtest/cxxtest/ParenPrinter.h deleted file mode 100644 index 3a114af6..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/ParenPrinter.h +++ /dev/null @@ -1,32 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __cxxtest__ParenPrinter_h__ -#define __cxxtest__ParenPrinter_h__ - -// -// The ParenPrinter is identical to the ErrorPrinter, except it -// prints the line number in a format expected by some compilers -// (notably, MSVC). -// - -#include - -namespace CxxTest -{ -class ParenPrinter : public ErrorPrinter -{ -public: - ParenPrinter(CXXTEST_STD(ostream) &o = CXXTEST_STD(cout)) : ErrorPrinter(o, "(", ")") {} -}; -} - -#endif // __cxxtest__ParenPrinter_h__ diff --git a/noarch/lib/py/cxxtest/cxxtest/QtGui.h b/noarch/lib/py/cxxtest/cxxtest/QtGui.h deleted file mode 100644 index 589c2327..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/QtGui.h +++ /dev/null @@ -1,306 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __cxxtest__QtGui_h__ -#define __cxxtest__QtGui_h__ - -// -// The QtGui displays a simple progress bar using the Qt Toolkit. It -// has been tested with versions 2.x and 3.x. -// -// Apart from normal Qt command-line arguments, it accepts the following options: -// -minimized Start minimized, pop up on error -// -keep Don't close the window at the end -// -title TITLE Set the window caption -// -// If both are -minimized and -keep specified, GUI will only keep the -// window if it's in focus. -// - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace CxxTest -{ -class QtGui : public GuiListener -{ -public: - void enterGui(int &argc, char **argv) - { - parseCommandLine(argc, argv); - createApplication(argc, argv); - } - - void enterWorld(const WorldDescription &wd) - { - createWindow(wd); - processEvents(); - } - - void guiEnterSuite(const char *suiteName) - { - showSuiteName(suiteName); - } - - void guiEnterTest(const char *suiteName, const char *testName) - { - setCaption(suiteName, testName); - advanceProgressBar(); - showTestName(testName); - showTestsDone(_progressBar->progress()); - processEvents(); - } - - void yellowBar() - { - setColor(255, 255, 0); - setIcon(QMessageBox::Warning); - getTotalTests(); - processEvents(); - } - - void redBar() - { - if (_startMinimized && _mainWindow->isMinimized()) - { - showNormal(); - } - setColor(255, 0, 0); - setIcon(QMessageBox::Critical); - getTotalTests(); - processEvents(); - } - - void leaveGui() - { - if (keep()) - { - showSummary(); - _application->exec(); - } - else - { - _mainWindow->close(true); - } - } - -private: - QString _title; - bool _startMinimized, _keep; - unsigned _numTotalTests; - QString _strTotalTests; - QApplication *_application; - QWidget *_mainWindow; - QVBoxLayout *_layout; - QProgressBar *_progressBar; - QStatusBar *_statusBar; - QLabel *_suiteName, *_testName, *_testsDone; - - void parseCommandLine(int argc, char **argv) - { - _startMinimized = _keep = false; - _title = argv[0]; - - for (int i = 1; i < argc; ++ i) - { - QString arg(argv[i]); - if (arg == "-minimized") - { - _startMinimized = true; - } - else if (arg == "-keep") - { - _keep = true; - } - else if (arg == "-title" && (i + 1 < argc)) - { - _title = argv[++i]; - } - } - } - - void createApplication(int &argc, char **argv) - { - _application = new QApplication(argc, argv); - } - - void createWindow(const WorldDescription &wd) - { - getTotalTests(wd); - createMainWindow(); - createProgressBar(); - createStatusBar(); - setMainWidget(); - if (_startMinimized) - { - showMinimized(); - } - else - { - showNormal(); - } - } - - void getTotalTests() - { - getTotalTests(tracker().world()); - } - - void getTotalTests(const WorldDescription &wd) - { - _numTotalTests = wd.numTotalTests(); - char s[WorldDescription::MAX_STRLEN_TOTAL_TESTS]; - _strTotalTests = wd.strTotalTests(s); - } - - void createMainWindow() - { - _mainWindow = new QWidget(); - _layout = new QVBoxLayout(_mainWindow); - } - - void createProgressBar() - { - _layout->addWidget(_progressBar = new QProgressBar(_numTotalTests, _mainWindow)); - _progressBar->setProgress(0); - setColor(0, 255, 0); - setIcon(QMessageBox::Information); - } - - void createStatusBar() - { - _layout->addWidget(_statusBar = new QStatusBar(_mainWindow)); - _statusBar->addWidget(_suiteName = new QLabel(_statusBar), 2); - _statusBar->addWidget(_testName = new QLabel(_statusBar), 4); - _statusBar->addWidget(_testsDone = new QLabel(_statusBar), 1); - } - - void setMainWidget() - { - _application->setMainWidget(_mainWindow); - } - - void showMinimized() - { - _mainWindow->showMinimized(); - } - - void showNormal() - { - _mainWindow->showNormal(); - centerWindow(); - } - - void setCaption(const QString &suiteName, const QString &testName) - { - _mainWindow->setCaption(_title + " - " + suiteName + "::" + testName + "()"); - } - - void showSuiteName(const QString &suiteName) - { - _suiteName->setText("class " + suiteName); - } - - void advanceProgressBar() - { - _progressBar->setProgress(_progressBar->progress() + 1); - } - - void showTestName(const QString &testName) - { - _testName->setText(testName + "()"); - } - - void showTestsDone(unsigned testsDone) - { - _testsDone->setText(asString(testsDone) + " of " + _strTotalTests); - } - - static QString asString(unsigned n) - { - return QString::number(n); - } - - void setColor(int r, int g, int b) - { - QPalette palette = _progressBar->palette(); - palette.setColor(QColorGroup::Highlight, QColor(r, g, b)); - _progressBar->setPalette(palette); - } - - void setIcon(QMessageBox::Icon icon) - { -#if QT_VERSION >= 0x030000 - _mainWindow->setIcon(QMessageBox::standardIcon(icon)); -#else // Qt version < 3.0.0 - _mainWindow->setIcon(QMessageBox::standardIcon(icon, QApplication::style().guiStyle())); -#endif // QT_VERSION - } - - void processEvents() - { - _application->processEvents(); - } - - void centerWindow() - { - QWidget *desktop = QApplication::desktop(); - int xCenter = desktop->x() + (desktop->width() / 2); - int yCenter = desktop->y() + (desktop->height() / 2); - - int windowWidth = (desktop->width() * 4) / 5; - int windowHeight = _mainWindow->height(); - _mainWindow->setGeometry(xCenter - (windowWidth / 2), yCenter - (windowHeight / 2), windowWidth, windowHeight); - } - - bool keep() - { - if (!_keep) - { - return false; - } - if (!_startMinimized) - { - return true; - } - return (_mainWindow == _application->activeWindow()); - } - - void showSummary() - { - QString summary = _strTotalTests + (_numTotalTests == 1 ? " test" : " tests"); - if (tracker().failedTests()) - { - summary = "Failed " + asString(tracker().failedTests()) + " of " + summary; - } - else - { - summary = summary + " passed"; - } - - _mainWindow->setCaption(_title + " - " + summary); - - _statusBar->removeWidget(_suiteName); - _statusBar->removeWidget(_testName); - _testsDone->setText(summary); - } -}; -} - -#endif // __cxxtest__QtGui_h__ diff --git a/noarch/lib/py/cxxtest/cxxtest/RealDescriptions.cpp b/noarch/lib/py/cxxtest/cxxtest/RealDescriptions.cpp deleted file mode 100644 index 60b4f205..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/RealDescriptions.cpp +++ /dev/null @@ -1,361 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __cxxtest__RealDescriptions_cpp__ -#define __cxxtest__RealDescriptions_cpp__ - -// -// NOTE: If an error occur during world construction/deletion, CxxTest cannot -// know where the error originated. -// - -#include - -namespace CxxTest -{ -RealTestDescription::RealTestDescription() -{ -} - -RealTestDescription::RealTestDescription(List &argList, - SuiteDescription &argSuite, - unsigned argLine, - const char *argTestName) -{ - initialize(argList, argSuite, argLine, argTestName); -} - -void RealTestDescription::initialize(List &argList, - SuiteDescription &argSuite, - unsigned argLine, - const char *argTestName) -{ - _suite = &argSuite; - _line = argLine; - _testName = argTestName; - attach(argList); -} - -bool RealTestDescription::setUp() -{ - if (!suite()) - { - return false; - } - - for (GlobalFixture *gf = GlobalFixture::firstGlobalFixture(); gf != 0; gf = gf->nextGlobalFixture()) - { - bool ok; - _TS_TRY { ok = gf->setUp(); } - _TS_LAST_CATCH( { ok = false; }); - - if (!ok) - { - doFailTest(file(), line(), "Error in GlobalFixture::setUp()"); - return false; - } - } - - _TS_TRY - { - bool ok = false; - _TSM_ASSERT_THROWS_NOTHING(file(), line(), "Exception thrown from setUp()", suite()->setUp(); ok = true); - if (ok == false) { return ok; } - } - _TS_CATCH_ABORT( { return false; }) - _TS_CATCH_SKIPPED( { return false; }); - - return true; -} - -bool RealTestDescription::tearDown() -{ - if (!suite()) - { - return false; - } - - _TS_TRY - { - _TSM_ASSERT_THROWS_NOTHING(file(), line(), "Exception thrown from tearDown()", suite()->tearDown()); - } - _TS_CATCH_ABORT( { return false; }) - _TS_CATCH_SKIPPED( { return false; }); - - for (GlobalFixture *gf = GlobalFixture::lastGlobalFixture(); gf != 0; gf = gf->prevGlobalFixture()) - { - bool ok; - _TS_TRY { ok = gf->tearDown(); } - _TS_LAST_CATCH( { ok = false; }); - - if (!ok) - { - doFailTest(file(), line(), "Error in GlobalFixture::tearDown()"); - return false; - } - } - - return true; -} - -const char *RealTestDescription::file() const { return _suite->file(); } -int RealTestDescription::line() const { return _line; } -const char *RealTestDescription::testName() const { return _testName; } -const char *RealTestDescription::suiteName() const { return _suite->suiteName(); } - -TestDescription *RealTestDescription::next() { return (RealTestDescription *)Link::next(); } -const TestDescription *RealTestDescription::next() const { return (const RealTestDescription *)Link::next(); } - -TestSuite *RealTestDescription::suite() const { return _suite->suite(); } - -void RealTestDescription::run() -{ - _TS_TRY { runTest(); } - _TS_CATCH_ABORT( {}) - _TS_CATCH_SKIPPED( {}) - ___TSM_CATCH(file(), line(), "Exception thrown from test"); -} - -RealSuiteDescription::RealSuiteDescription() {} -RealSuiteDescription::RealSuiteDescription(const char *argFile, - unsigned argLine, - const char *argSuiteName, - List &argTests) -{ - initialize(argFile, argLine, argSuiteName, argTests); -} - -void RealSuiteDescription::initialize(const char *argFile, - unsigned argLine, - const char *argSuiteName, - List &argTests) -{ - _file = argFile; - _line = argLine; - _suiteName = argSuiteName; - _tests = &argTests; - - attach(_suites); -} - -const char *RealSuiteDescription::file() const { return _file; } -int RealSuiteDescription::line() const { return _line; } -const char *RealSuiteDescription::suiteName() const { return _suiteName; } - -TestDescription *RealSuiteDescription::firstTest() { return (RealTestDescription *)_tests->head(); } -const TestDescription *RealSuiteDescription::firstTest() const { return (const RealTestDescription *)_tests->head(); } -SuiteDescription *RealSuiteDescription::next() { return (RealSuiteDescription *)Link::next(); } -const SuiteDescription *RealSuiteDescription::next() const { return (const RealSuiteDescription *)Link::next(); } - -unsigned RealSuiteDescription::numTests() const { return _tests->size(); } - -const TestDescription &RealSuiteDescription::testDescription(unsigned i) const -{ - return *(RealTestDescription *)_tests->nth(i); -} - -void RealSuiteDescription::activateAllTests() -{ - _tests->activateAll(); -} - -bool RealSuiteDescription::leaveOnly(const char *testName) -{ - for (TestDescription *td = firstTest(); td != 0; td = td->next()) - { - if (stringsEqual(td->testName(), testName)) - { - _tests->leaveOnly(*td); - return true; - } - } - return false; -} - -StaticSuiteDescription::StaticSuiteDescription() {} -StaticSuiteDescription::StaticSuiteDescription(const char *argFile, unsigned argLine, - const char *argSuiteName, TestSuite &argSuite, - List &argTests) : - RealSuiteDescription(argFile, argLine, argSuiteName, argTests) -{ - doInitialize(argSuite); -} - -void StaticSuiteDescription::initialize(const char *argFile, unsigned argLine, - const char *argSuiteName, TestSuite &argSuite, - List &argTests) -{ - RealSuiteDescription::initialize(argFile, argLine, argSuiteName, argTests); - doInitialize(argSuite); -} - -void StaticSuiteDescription::doInitialize(TestSuite &argSuite) -{ - _suite = &argSuite; -} - -TestSuite *StaticSuiteDescription::suite() const -{ - return _suite; -} - -bool StaticSuiteDescription::setUp() { return true; } -bool StaticSuiteDescription::tearDown() { return true; } - -CommonDynamicSuiteDescription::CommonDynamicSuiteDescription() {} -CommonDynamicSuiteDescription::CommonDynamicSuiteDescription(const char *argFile, unsigned argLine, - const char *argSuiteName, List &argTests, - unsigned argCreateLine, unsigned argDestroyLine) : - RealSuiteDescription(argFile, argLine, argSuiteName, argTests) -{ - doInitialize(argCreateLine, argDestroyLine); -} - -void CommonDynamicSuiteDescription::initialize(const char *argFile, unsigned argLine, - const char *argSuiteName, List &argTests, - unsigned argCreateLine, unsigned argDestroyLine) -{ - RealSuiteDescription::initialize(argFile, argLine, argSuiteName, argTests); - doInitialize(argCreateLine, argDestroyLine); -} - -void CommonDynamicSuiteDescription::doInitialize(unsigned argCreateLine, unsigned argDestroyLine) -{ - _createLine = argCreateLine; - _destroyLine = argDestroyLine; -} - -List &RealWorldDescription::suites() -{ - return RealSuiteDescription::_suites; -} - -unsigned RealWorldDescription::numSuites(void) const -{ - return suites().size(); -} - -unsigned RealWorldDescription::numTotalTests(void) const -{ - unsigned count = 0; - for (const SuiteDescription *sd = firstSuite(); sd != 0; sd = sd->next()) - { - count += sd->numTests(); - } - return count; -} - -SuiteDescription *RealWorldDescription::firstSuite() -{ - return (RealSuiteDescription *)suites().head(); -} - -const SuiteDescription *RealWorldDescription::firstSuite() const -{ - return (const RealSuiteDescription *)suites().head(); -} - -const SuiteDescription &RealWorldDescription::suiteDescription(unsigned i) const -{ - return *(const RealSuiteDescription *)suites().nth(i); -} - -void RealWorldDescription::activateAllTests() -{ - suites().activateAll(); - for (SuiteDescription *sd = firstSuite(); sd != 0; sd = sd->next()) - { - sd->activateAllTests(); - } -} - -bool RealWorldDescription::leaveOnly(const char *suiteName, const char *testName) -{ - for (SuiteDescription *sd = firstSuite(); sd != 0; sd = sd->next()) - { - if (stringsEqual(sd->suiteName(), suiteName)) - { - if (testName) - { - if (!sd->leaveOnly(testName)) - { - return false; - } - } - suites().leaveOnly(*sd); - return true; - } - } - return false; -} - -bool RealWorldDescription::setUp() -{ - for (GlobalFixture *gf = GlobalFixture::firstGlobalFixture(); gf != 0; gf = gf->nextGlobalFixture()) - { - bool ok; - _TS_TRY - { - ok = gf->setUpWorld(); - if (tracker().testFailed()) - { - tracker().initialize(); - ok = false; - } - } - _TS_LAST_CATCH( { ok = false; }); - - if (!ok) - { - reportError("Error setting up world"); - return false; - } - } - - return true; -} - -bool RealWorldDescription::tearDown() -{ - for (GlobalFixture *gf = GlobalFixture::lastGlobalFixture(); gf != 0; gf = gf->prevGlobalFixture()) - { - bool ok; - _TS_TRY { ok = gf->tearDownWorld(); } - _TS_LAST_CATCH( { ok = false; }); - - if (!ok) - { - reportError("Error tearing down world"); - return false; - } - } - - return true; -} - -void RealWorldDescription::reportError(const char *message) -{ - doWarn(__FILE__, 5, message); -} - -void activateAllTests() -{ - RealWorldDescription().activateAllTests(); -} - -bool leaveOnly(const char *suiteName, const char *testName) -{ - return RealWorldDescription().leaveOnly(suiteName, testName); -} -} - -#endif // __cxxtest__RealDescriptions_cpp__ - diff --git a/noarch/lib/py/cxxtest/cxxtest/RealDescriptions.h b/noarch/lib/py/cxxtest/cxxtest/RealDescriptions.h deleted file mode 100644 index 48b6d9ed..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/RealDescriptions.h +++ /dev/null @@ -1,243 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __cxxtest__RealDescriptions_h__ -#define __cxxtest__RealDescriptions_h__ - -// -// The "real" description classes -// - -#include -#include -#include - -namespace CxxTest -{ -class RealTestDescription : public TestDescription -{ -public: - RealTestDescription(); - RealTestDescription(List &argList, SuiteDescription &argSuite, unsigned argLine, const char *argTestName); - void initialize(List &argList, SuiteDescription &argSuite, unsigned argLine, const char *argTestName); - - const char *file() const; - int line() const; - const char *testName() const; - const char *suiteName() const; - - TestDescription *next(); - const TestDescription *next() const; - - TestSuite *suite() const; - - bool setUp(); - void run(); - bool tearDown(); - -private: - RealTestDescription(const RealTestDescription &); - RealTestDescription &operator=(const RealTestDescription &); - - virtual void runTest() = 0; - - SuiteDescription *_suite; - int _line; - const char *_testName; -}; - -class RealSuiteDescription : public SuiteDescription -{ -public: - RealSuiteDescription(); - RealSuiteDescription(const char *argFile, unsigned argLine, const char *argSuiteName, List &argTests); - - void initialize(const char *argFile, unsigned argLine, const char *argSuiteName, List &argTests); - - const char *file() const; - int line() const; - const char *suiteName() const; - - TestDescription *firstTest(); - const TestDescription *firstTest() const; - SuiteDescription *next(); - const SuiteDescription *next() const; - - unsigned numTests() const; - const TestDescription &testDescription(unsigned i) const; - - void activateAllTests(); - bool leaveOnly(const char *testName); - -private: - RealSuiteDescription(const RealSuiteDescription &); - RealSuiteDescription &operator=(const RealSuiteDescription &); - - const char *_file; - int _line; - const char *_suiteName; - List *_tests; - - static List _suites; - friend class RealWorldDescription; -}; - -class StaticSuiteDescription : public RealSuiteDescription -{ -public: - StaticSuiteDescription(); - StaticSuiteDescription(const char *argFile, unsigned argLine, - const char *argSuiteName, TestSuite &argSuite, - List &argTests); - - void initialize(const char *argFile, unsigned argLine, - const char *argSuiteName, TestSuite &argSuite, - List &argTests); - TestSuite *suite() const; - - bool setUp(); - bool tearDown(); - -private: - StaticSuiteDescription(const StaticSuiteDescription &); - StaticSuiteDescription &operator=(const StaticSuiteDescription &); - - void doInitialize(TestSuite &argSuite); - - TestSuite *_suite; -}; - -class CommonDynamicSuiteDescription : public RealSuiteDescription -{ -public: - CommonDynamicSuiteDescription(); - CommonDynamicSuiteDescription(const char *argFile, unsigned argLine, - const char *argSuiteName, List &argTests, - unsigned argCreateLine, unsigned argDestroyLine); - - void initialize(const char *argFile, unsigned argLine, - const char *argSuiteName, List &argTests, - unsigned argCreateLine, unsigned argDestroyLine); - -protected: - unsigned _createLine, _destroyLine; - -private: - void doInitialize(unsigned argCreateLine, unsigned argDestroyLine); -}; - -template -class DynamicSuiteDescription : public CommonDynamicSuiteDescription -{ -public: - DynamicSuiteDescription() {} - DynamicSuiteDescription(const char *argFile, unsigned argLine, - const char *argSuiteName, List &argTests, - S *&argSuite, unsigned argCreateLine, - unsigned argDestroyLine) : - CommonDynamicSuiteDescription(argFile, argLine, argSuiteName, argTests, argCreateLine, argDestroyLine) - { - _suite = &argSuite; - } - - void initialize(const char *argFile, unsigned argLine, - const char *argSuiteName, List &argTests, - S *&argSuite, unsigned argCreateLine, - unsigned argDestroyLine) - { - CommonDynamicSuiteDescription::initialize(argFile, argLine, - argSuiteName, argTests, - argCreateLine, argDestroyLine); - _suite = &argSuite; - } - - TestSuite *suite() const { return realSuite(); } - - bool setUp(); - bool tearDown(); - -private: - S *realSuite() const { return *_suite; } - void setSuite(S *s) { *_suite = s; } - - void createSuite() - { - setSuite(S::createSuite()); - } - - void destroySuite() - { - S *s = realSuite(); - setSuite(0); - S::destroySuite(s); - } - - S **_suite; -}; - -template -bool DynamicSuiteDescription::setUp() -{ - _TS_TRY - { - _TSM_ASSERT_THROWS_NOTHING(file(), _createLine, "Exception thrown from createSuite()", createSuite()); - _TSM_ASSERT(file(), _createLine, "createSuite() failed", suite() != 0); - } - _TS_CATCH_ABORT( { return false; }) - _TS_CATCH_SKIPPED( { return false; }); - - return (suite() != 0); -} - -template -bool DynamicSuiteDescription::tearDown() -{ - if (!_suite) - { - return true; - } - - _TS_TRY - { - _TSM_ASSERT_THROWS_NOTHING(file(), _destroyLine, "destroySuite() failed", destroySuite()); - } - _TS_CATCH_ABORT( { return false; }) - _TS_CATCH_SKIPPED( { return false; }); - - return true; -} - -class RealWorldDescription : public WorldDescription -{ -public: - static List &suites(); - const char *worldName() const { return _worldName;} - unsigned numSuites(void) const; - unsigned numTotalTests(void) const; - SuiteDescription *firstSuite(); - const SuiteDescription *firstSuite() const; - const SuiteDescription &suiteDescription(unsigned i) const; - void activateAllTests(); - bool leaveOnly(const char *suiteName, const char *testName = 0); - - bool setUp(); - bool tearDown(); - static void reportError(const char *message); - - static const char *_worldName; -}; - -void activateAllTests(); -bool leaveOnly(const char *suiteName, const char *testName = 0); -} - -#endif // __cxxtest__RealDescriptions_h__ - diff --git a/noarch/lib/py/cxxtest/cxxtest/Root.cpp b/noarch/lib/py/cxxtest/cxxtest/Root.cpp deleted file mode 100644 index 39aa599a..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/Root.cpp +++ /dev/null @@ -1,29 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __cxxtest__Root_cpp__ -#define __cxxtest__Root_cpp__ - -// -// This file holds the "root" of CxxTest, i.e. -// the parts that must be in a source file file. -// - -#include -#include -#include -#include -#include -#include -#include -#include - -#endif // __cxxtest__Root_cpp__ diff --git a/noarch/lib/py/cxxtest/cxxtest/SelfTest.h b/noarch/lib/py/cxxtest/cxxtest/SelfTest.h deleted file mode 100644 index 3951ac2c..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/SelfTest.h +++ /dev/null @@ -1,18 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __cxxtest_SelfTest_h__ -#define __cxxtest_SelfTest_h__ - -#define CXXTEST_SUITE(name) -#define CXXTEST_CODE(member) - -#endif // __cxxtest_SelfTest_h__ diff --git a/noarch/lib/py/cxxtest/cxxtest/StdHeaders.h b/noarch/lib/py/cxxtest/cxxtest/StdHeaders.h deleted file mode 100644 index 7866a752..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/StdHeaders.h +++ /dev/null @@ -1,36 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __cxxtest_StdHeaders_h__ -#define __cxxtest_StdHeaders_h__ - -// -// This file basically #includes the STL headers. -// It exists to support warning level 4 in Visual C++ -// - -#ifdef _MSC_VER -# pragma warning( push, 1 ) -#endif // _MSC_VER - -#include -#include -#include -#include -#include -#include -#include - -#ifdef _MSC_VER -# pragma warning( pop ) -#endif // _MSC_VER - -#endif // __cxxtest_StdHeaders_h__ diff --git a/noarch/lib/py/cxxtest/cxxtest/StdTestSuite.h b/noarch/lib/py/cxxtest/cxxtest/StdTestSuite.h deleted file mode 100644 index c9b2bcc3..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/StdTestSuite.h +++ /dev/null @@ -1,70 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __cxxtest__StdTestSuite_h__ -#define __cxxtest__StdTestSuite_h__ - -// -// This provides explicit partial specializations for STL-based -// TestSuite comparison functions -// - -namespace CxxTest -{ - -#ifdef _CXXTEST_PARTIAL_TEMPLATE_SPECIALIZATION - -template -struct delta, std::vector, D> -{ - static bool test(std::vector x, std::vector y, D d) - { - if (x.size() != y.size()) - { - return false; - } - for (size_t i = 0; i < x.size(); ++i) - if (! delta::test(x[i], y[i], d)) - { - return false; - } - return true; - } -}; - -template -struct delta, std::list, D> -{ - static bool test(std::list x, std::list y, D d) - { - typename std::list::const_iterator x_it = x.begin(); - typename std::list::const_iterator y_it = y.begin(); - for (; x_it != x.end(); ++x_it, ++y_it) - { - if (y_it == y.end()) - { - return false; - } - if (! delta::test(*x_it, *y_it, d)) - { - return false; - } - } - return y_it == y.end(); - } -}; - -#endif - -} // namespace CxxTest - -#endif // __cxxtest__StdTestSuite_h__ - diff --git a/noarch/lib/py/cxxtest/cxxtest/StdValueTraits.h b/noarch/lib/py/cxxtest/cxxtest/StdValueTraits.h deleted file mode 100644 index 552c5081..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/StdValueTraits.h +++ /dev/null @@ -1,303 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __cxxtest_StdValueTraits_h__ -#define __cxxtest_StdValueTraits_h__ - -// -// This file defines ValueTraits for std:: stuff. -// It is #included by if you -// define CXXTEST_HAVE_STD -// - -#include -#include - -#ifdef _CXXTEST_OLD_STD -# define CXXTEST_STD(x) x -#else // !_CXXTEST_OLD_STD -# define CXXTEST_STD(x) std::x -#endif // _CXXTEST_OLD_STD - -#ifndef CXXTEST_USER_VALUE_TRAITS - -namespace CxxTest -{ -// -// NOTE: This should have been -// template -// class ValueTraits< std::basic_string > {}; -// But MSVC doesn't support it (yet). -// - -// -// If we have std::string, we might as well use it -// -class StdTraitsBase -{ -public: - StdTraitsBase &operator<<(const CXXTEST_STD(string) &s) { _s += s; return *this; } - const char *asString() const { return _s.c_str(); } - -private: - CXXTEST_STD(string) _s; -}; - -// -// std::string -// -CXXTEST_TEMPLATE_INSTANTIATION -class ValueTraits : public StdTraitsBase -{ - static bool mb_partial(char ch) - { - return !!(ch & 0x80); - } - static bool mb_start(char ch) - { - return (ch & 0xC0) == 0xC0; - } - static size_t mb_length(char ch) - { - size_t numBytes = 1; - while ((ch & (1 << (7 - numBytes))) && numBytes < 6) - { - ++numBytes; - } - return numBytes; - } - static bool is_mb(const CXXTEST_STD(string) &s, unsigned i) - { - if (!mb_start(s[i]) || i + mb_length(s[i]) > s.length()) - { - return false; - } - for (size_t len = mb_length(s[i]); len > 0; -- len, ++ i) - { - if (!mb_partial(s[i])) - { - return false; - } - } - return true; - } - -public: - ValueTraits(const CXXTEST_STD(string) &s) - { - *this << "\""; - for (unsigned i = 0; i < s.length(); ++ i) - { - if (is_mb(s, i)) - { - for (size_t len = mb_length(s[i]); len > 0; -- len, ++ i) - { - char c[2] = { s[i], '\0' }; - *this << c; - } - -- i; - } - else - { - char c[sizeof("\\xXX")]; - charToString(s[i], c); - *this << c; - } - } - *this << "\""; - } -}; - -CXXTEST_COPY_CONST_TRAITS(CXXTEST_STD(string)); - -#ifndef _CXXTEST_OLD_STD -// -// std::wstring -// -CXXTEST_TEMPLATE_INSTANTIATION -class ValueTraits)> : public StdTraitsBase -{ -public: - ValueTraits(const CXXTEST_STD(basic_string) &s) - { - *this << "L\""; - for (unsigned i = 0; i < s.length(); ++ i) - { - char c[sizeof("\\x12345678")]; - charToString((unsigned long)s[i], c); - *this << c; - } - *this << "\""; - } -}; - -CXXTEST_COPY_CONST_TRAITS(CXXTEST_STD(basic_string)); -#endif // _CXXTEST_OLD_STD - -// -// Convert a range defined by iterators to a string -// This is useful for almost all STL containers -// -template -void dumpRange(Stream &s, Iterator first, Iterator last) -{ - if (first == last) - { - s << "{}"; - return; - } - - s << "{ "; - while (first != last) - { - s << TS_AS_STRING(*first); - if (++ first != last) - { - s << ", "; - } - } - s << " }"; -} - -#ifdef _CXXTEST_PARTIAL_TEMPLATE_SPECIALIZATION -// -// std::pair -// -template -class ValueTraits< CXXTEST_STD(pair) > : public StdTraitsBase -{ -public: - ValueTraits(const CXXTEST_STD(pair) &p) - { - *this << "<" << TS_AS_STRING(p.first) << ", " << TS_AS_STRING(p.second) << ">"; - } -}; - -// -// std::vector -// -template -class ValueTraits< CXXTEST_STD(vector) > : public StdTraitsBase -{ -public: - ValueTraits(const CXXTEST_STD(vector) &v) - { - dumpRange(*this, v.begin(), v.end()); - } -}; - -// -// std::list -// -template -class ValueTraits< CXXTEST_STD(list) > : public StdTraitsBase -{ -public: - ValueTraits(const CXXTEST_STD(list) &l) - { - dumpRange(*this, l.begin(), l.end()); - } -}; - -// -// std::set -// -template -class ValueTraits< CXXTEST_STD(set) > : public StdTraitsBase -{ -public: - ValueTraits(const CXXTEST_STD(set) &s) - { - dumpRange(*this, s.begin(), s.end()); - } -}; - -// -// std::map -// -template -class ValueTraits< CXXTEST_STD(map) > : public StdTraitsBase -{ -public: - ValueTraits(const CXXTEST_STD(map) &m) - { - dumpRange(*this, m.begin(), m.end()); - } -}; - -// -// std::deque -// -template -class ValueTraits< CXXTEST_STD(deque) > : public StdTraitsBase -{ -public: - ValueTraits(const CXXTEST_STD(deque) &d) - { - dumpRange(*this, d.begin(), d.end()); - } -}; - -// -// std::multiset -// -template -class ValueTraits< CXXTEST_STD(multiset) > : public StdTraitsBase -{ -public: - ValueTraits(const CXXTEST_STD(multiset) &ms) - { - dumpRange(*this, ms.begin(), ms.end()); - } -}; - -// -// std::multimap -// -template -class ValueTraits< CXXTEST_STD(multimap) > : public StdTraitsBase -{ -public: - ValueTraits(const CXXTEST_STD(multimap) &mm) - { - dumpRange(*this, mm.begin(), mm.end()); - } -}; - -// -// std::complex -// -template -class ValueTraits< CXXTEST_STD(complex) > : public StdTraitsBase -{ -public: - ValueTraits(const CXXTEST_STD(complex) &c) - { - if (!c.imag()) - { - *this << TS_AS_STRING(c.real()); - } - else if (!c.real()) - { - *this << "(" << TS_AS_STRING(c.imag()) << " * i)"; - } - else - { - *this << "(" << TS_AS_STRING(c.real()) << " + " << TS_AS_STRING(c.imag()) << " * i)"; - } - } -}; -#endif // _CXXTEST_PARTIAL_TEMPLATE_SPECIALIZATION -} - -#endif // CXXTEST_USER_VALUE_TRAITS - -#endif // __cxxtest_StdValueTraits_h__ diff --git a/noarch/lib/py/cxxtest/cxxtest/StdioFilePrinter.h b/noarch/lib/py/cxxtest/cxxtest/StdioFilePrinter.h deleted file mode 100644 index e293e1cb..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/StdioFilePrinter.h +++ /dev/null @@ -1,52 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __cxxtest__StdioFilePrinter_h__ -#define __cxxtest__StdioFilePrinter_h__ - -// -// The StdioFilePrinter is a simple TestListener that -// just prints "OK" if everything goes well, otherwise -// reports the error in the format of compiler messages. -// This class uses , i.e. FILE * and fprintf(). -// - -#include -#include - -namespace CxxTest -{ -class StdioFilePrinter : public ErrorFormatter -{ -public: - StdioFilePrinter(FILE *o, const char *preLine = ":", const char *postLine = "") : - ErrorFormatter(new Adapter(o), preLine, postLine) {} - virtual ~StdioFilePrinter() { delete outputStream(); } - -private: - class Adapter : public OutputStream - { - Adapter(const Adapter &); - Adapter &operator=(const Adapter &); - - FILE *_o; - - public: - Adapter(FILE *o) : _o(o) {} - void flush() { fflush(_o); } - OutputStream &operator<<(unsigned i) { fprintf(_o, "%u", i); return *this; } - OutputStream &operator<<(const char *s) { fputs(s, _o); return *this; } - OutputStream &operator<<(Manipulator m) { return OutputStream::operator<<(m); } - }; -}; -} - -#endif // __cxxtest__StdioFilePrinter_h__ diff --git a/noarch/lib/py/cxxtest/cxxtest/StdioPrinter.h b/noarch/lib/py/cxxtest/cxxtest/StdioPrinter.h deleted file mode 100644 index 55c9fcc3..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/StdioPrinter.h +++ /dev/null @@ -1,33 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __cxxtest__StdioPrinter_h__ -#define __cxxtest__StdioPrinter_h__ - -// -// The StdioPrinter is an StdioFilePrinter which defaults to stdout. -// This should have been called StdOutPrinter or something, but the name -// has been historically used. -// - -#include - -namespace CxxTest -{ -class StdioPrinter : public StdioFilePrinter -{ -public: - StdioPrinter(FILE *o = stdout, const char *preLine = ":", const char *postLine = "") : - StdioFilePrinter(o, preLine, postLine) {} -}; -} - -#endif // __cxxtest__StdioPrinter_h__ diff --git a/noarch/lib/py/cxxtest/cxxtest/TeeListener.h b/noarch/lib/py/cxxtest/cxxtest/TeeListener.h deleted file mode 100644 index 06ca0a7e..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/TeeListener.h +++ /dev/null @@ -1,205 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __cxxtest__TeeListener_h__ -#define __cxxtest__TeeListener_h__ - -// -// A TeeListener notifies two "regular" TestListeners -// - -#include -#include - -namespace CxxTest -{ -class TeeListener : public TestListener -{ -public: - TeeListener() - { - setFirst(_dummy); - setSecond(_dummy); - } - - virtual ~TeeListener() - { - } - - void setFirst(TestListener &first) - { - _first = &first; - } - - void setSecond(TestListener &second) - { - _second = &second; - } - - void enterWorld(const WorldDescription &d) - { - _first->enterWorld(d); - _second->enterWorld(d); - } - - void enterSuite(const SuiteDescription &d) - { - _first->enterSuite(d); - _second->enterSuite(d); - } - - void enterTest(const TestDescription &d) - { - _first->enterTest(d); - _second->enterTest(d); - } - - void trace(const char *file, int line, const char *expression) - { - _first->trace(file, line, expression); - _second->trace(file, line, expression); - } - - void warning(const char *file, int line, const char *expression) - { - _first->warning(file, line, expression); - _second->warning(file, line, expression); - } - - void skippedTest(const char *file, int line, const char *expression) - { - _first->skippedTest(file, line, expression); - _second->skippedTest(file, line, expression); - } - - void failedTest(const char *file, int line, const char *expression) - { - _first->failedTest(file, line, expression); - _second->failedTest(file, line, expression); - } - - void failedAssert(const char *file, int line, const char *expression) - { - _first->failedAssert(file, line, expression); - _second->failedAssert(file, line, expression); - } - - void failedAssertEquals(const char *file, int line, - const char *xStr, const char *yStr, - const char *x, const char *y) - { - _first->failedAssertEquals(file, line, xStr, yStr, x, y); - _second->failedAssertEquals(file, line, xStr, yStr, x, y); - } - - void failedAssertSameData(const char *file, int line, - const char *xStr, const char *yStr, - const char *sizeStr, const void *x, - const void *y, unsigned size) - { - _first->failedAssertSameData(file, line, xStr, yStr, sizeStr, x, y, size); - _second->failedAssertSameData(file, line, xStr, yStr, sizeStr, x, y, size); - } - - void failedAssertSameFiles(const char* file, int line, const char* file1, const char* file2, const char* explanation) - { - _first->failedAssertSameFiles(file, line, file1, file2, explanation); - _second->failedAssertSameFiles(file, line, file1, file2, explanation); - } - - void failedAssertDelta(const char *file, int line, - const char *xStr, const char *yStr, const char *dStr, - const char *x, const char *y, const char *d) - { - _first->failedAssertDelta(file, line, xStr, yStr, dStr, x, y, d); - _second->failedAssertDelta(file, line, xStr, yStr, dStr, x, y, d); - } - - void failedAssertDiffers(const char *file, int line, - const char *xStr, const char *yStr, - const char *value) - { - _first->failedAssertDiffers(file, line, xStr, yStr, value); - _second->failedAssertDiffers(file, line, xStr, yStr, value); - } - - void failedAssertLessThan(const char *file, int line, - const char *xStr, const char *yStr, - const char *x, const char *y) - { - _first->failedAssertLessThan(file, line, xStr, yStr, x, y); - _second->failedAssertLessThan(file, line, xStr, yStr, x, y); - } - - void failedAssertLessThanEquals(const char *file, int line, - const char *xStr, const char *yStr, - const char *x, const char *y) - { - _first->failedAssertLessThanEquals(file, line, xStr, yStr, x, y); - _second->failedAssertLessThanEquals(file, line, xStr, yStr, x, y); - } - - void failedAssertPredicate(const char *file, int line, - const char *predicate, const char *xStr, const char *x) - { - _first->failedAssertPredicate(file, line, predicate, xStr, x); - _second->failedAssertPredicate(file, line, predicate, xStr, x); - } - - void failedAssertRelation(const char *file, int line, - const char *relation, const char *xStr, const char *yStr, - const char *x, const char *y) - { - _first->failedAssertRelation(file, line, relation, xStr, yStr, x, y); - _second->failedAssertRelation(file, line, relation, xStr, yStr, x, y); - } - - void failedAssertThrows(const char *file, int line, - const char *expression, const char *type, - bool otherThrown) - { - _first->failedAssertThrows(file, line, expression, type, otherThrown); - _second->failedAssertThrows(file, line, expression, type, otherThrown); - } - - void failedAssertThrowsNot(const char *file, int line, - const char *expression) - { - _first->failedAssertThrowsNot(file, line, expression); - _second->failedAssertThrowsNot(file, line, expression); - } - - void leaveTest(const TestDescription &d) - { - _first->leaveTest(d); - _second->leaveTest(d); - } - - void leaveSuite(const SuiteDescription &d) - { - _first->leaveSuite(d); - _second->leaveSuite(d); - } - - void leaveWorld(const WorldDescription &d) - { - _first->leaveWorld(d); - _second->leaveWorld(d); - } - -private: - TestListener *_first, *_second; - TestListener _dummy; -}; -} - - -#endif // __cxxtest__TeeListener_h__ diff --git a/noarch/lib/py/cxxtest/cxxtest/TestListener.h b/noarch/lib/py/cxxtest/cxxtest/TestListener.h deleted file mode 100644 index dbc2365e..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/TestListener.h +++ /dev/null @@ -1,87 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __cxxtest__TestListener_h__ -#define __cxxtest__TestListener_h__ - -// -// TestListener is the base class for all "listeners", -// i.e. classes that receive notifications of the -// testing process. -// -// The names of the parameters are in comments to avoid -// "unused parameter" warnings. -// - -#include - -namespace CxxTest -{ -class TestListener -{ -public: - TestListener() {} - virtual ~TestListener() {} - virtual void process_commandline(int& /*argc*/, char** /*argv*/) {} - - virtual void enterWorld(const WorldDescription & /*desc*/) {} - virtual void enterSuite(const SuiteDescription & /*desc*/) {} - virtual void enterTest(const TestDescription & /*desc*/) {} - virtual void trace(const char * /*file*/, int /*line*/, - const char * /*expression*/) {} - virtual void warning(const char * /*file*/, int /*line*/, - const char * /*expression*/) {} - virtual void skippedTest(const char * /*file*/, int /*line*/, - const char * /*expression*/) {} - virtual void failedTest(const char * /*file*/, int /*line*/, - const char * /*expression*/) {} - virtual void failedAssert(const char * /*file*/, int /*line*/, - const char * /*expression*/) {} - virtual void failedAssertEquals(const char * /*file*/, int /*line*/, - const char * /*xStr*/, const char * /*yStr*/, - const char * /*x*/, const char * /*y*/) {} - virtual void failedAssertSameData(const char * /*file*/, int /*line*/, - const char * /*xStr*/, const char * /*yStr*/, - const char * /*sizeStr*/, const void * /*x*/, - const void * /*y*/, unsigned /*size*/) {} - virtual void failedAssertDelta(const char * /*file*/, int /*line*/, - const char * /*xStr*/, const char * /*yStr*/, - const char * /*dStr*/, const char * /*x*/, - const char * /*y*/, const char * /*d*/) {} - virtual void failedAssertDiffers(const char * /*file*/, int /*line*/, - const char * /*xStr*/, const char * /*yStr*/, - const char * /*value*/) {} - virtual void failedAssertLessThan(const char * /*file*/, int /*line*/, - const char * /*xStr*/, const char * /*yStr*/, - const char * /*x*/, const char * /*y*/) {} - virtual void failedAssertLessThanEquals(const char * /*file*/, int /*line*/, - const char * /*xStr*/, const char * /*yStr*/, - const char * /*x*/, const char * /*y*/) {} - virtual void failedAssertPredicate(const char * /*file*/, int /*line*/, - const char * /*predicate*/, const char * /*xStr*/, const char * /*x*/) {} - virtual void failedAssertRelation(const char * /*file*/, int /*line*/, - const char * /*relation*/, const char * /*xStr*/, const char * /*yStr*/, - const char * /*x*/, const char * /*y*/) {} - virtual void failedAssertThrows(const char * /*file*/, int /*line*/, - const char * /*expression*/, const char * /*type*/, - bool /*otherThrown*/) {} - virtual void failedAssertThrowsNot(const char * /*file*/, int /*line*/, - const char * /*expression*/) {} - virtual void failedAssertSameFiles(const char* /*file*/, int /*line*/, - const char* , const char*, const char*) {} - virtual void leaveTest(const TestDescription & /*desc*/) {} - virtual void leaveSuite(const SuiteDescription & /*desc*/) {} - virtual void leaveWorld(const WorldDescription & /*desc*/) {} -}; -} - -#endif // __cxxtest__TestListener_h__ - diff --git a/noarch/lib/py/cxxtest/cxxtest/TestMain.h b/noarch/lib/py/cxxtest/cxxtest/TestMain.h deleted file mode 100644 index c4d14bb6..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/TestMain.h +++ /dev/null @@ -1,133 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __CxxTestMain_h -#define __CxxTestMain_h - -#include -#include - -#ifndef _CXXTEST_HAVE_STD -# define _CXXTEST_HAVE_STD -#endif // _CXXTEST_HAVE_STD - -#include - -#if defined(_CXXTEST_HAVE_STD) -#ifdef _CXXTEST_OLD_STD -# include -# include -#else // !_CXXTEST_OLD_STD -# include -# include -#endif // _CXXTEST_OLD_STD - -namespace CxxTest -{ - -inline void print_help(const char* name) -{ - CXXTEST_STD(cerr) << name << " " << CXXTEST_STD(endl); - CXXTEST_STD(cerr) << name << " " << CXXTEST_STD(endl); - CXXTEST_STD(cerr) << name << " -h" << CXXTEST_STD(endl); - CXXTEST_STD(cerr) << name << " --help" << CXXTEST_STD(endl); - CXXTEST_STD(cerr) << name << " --help-tests" << CXXTEST_STD(endl); - CXXTEST_STD(cerr) << name << " -v Enable tracing output." << CXXTEST_STD(endl); -} -#endif - - -template -int Main(TesterT& tmp, int argc, char* argv[]) -{ -// -// Parse the command-line arguments. The default behavior is to run all tests -// -// This is a primitive parser, but I'm not sure what sort of portable -// parser should be used in cxxtest. -// - -#if defined(_CXXTEST_HAVE_STD) -// -// Print command-line syntax -// - for (int i = 1; i < argc; i++) - { - if ((CXXTEST_STD(strcmp)(argv[i], "-h") == 0) || (CXXTEST_STD(strcmp)(argv[i], "--help") == 0)) - { - print_help(argv[0]); - return 0; - } - else if ((CXXTEST_STD(strcmp)(argv[1], "--help-tests") == 0)) - { - CXXTEST_STD(cout) << "Suite/Test Names" << CXXTEST_STD(endl); - CXXTEST_STD(cout) << "---------------------------------------------------------------------------" << CXXTEST_STD(endl); - for (SuiteDescription *sd = RealWorldDescription().firstSuite(); sd; sd = sd->next()) - for (TestDescription *td = sd->firstTest(); td; td = td->next()) - { - CXXTEST_STD(cout) << td->suiteName() << " " << td->testName() << CXXTEST_STD(endl); - } - return 0; - } - } - -// -// Process command-line options here. -// - while ((argc > 1) && (argv[1][0] == '-')) - { - if (CXXTEST_STD(strcmp)(argv[1], "-v") == 0) - { - tracker().print_tracing = true; - } - else - { - CXXTEST_STD(cerr) << "ERROR: unknown option '" << argv[1] << "'" << CXXTEST_STD(endl); - return -1; - } - for (int i = 1; i < (argc - 1); i++) - { - argv[i] = argv[i + 1]; - } - argc--; - } - -// -// Run experiments -// - bool status = false; - if ((argc == 2) && (argv[1][0] != '-')) - { - status = leaveOnly(argv[1]); - if (!status) - { - CXXTEST_STD(cerr) << "ERROR: unknown suite '" << argv[1] << "'" << CXXTEST_STD(endl); - return -1; - } - } - if ((argc == 3) && (argv[1][0] != '-')) - { - status = leaveOnly(argv[1], argv[2]); - if (!status) - { - CXXTEST_STD(cerr) << "ERROR: unknown test '" << argv[1] << "::" << argv[2] << "'" << CXXTEST_STD(endl); - return -1; - } - } -#endif - - tmp.process_commandline(argc, argv); - return tmp.run(); -} - -} -#endif - diff --git a/noarch/lib/py/cxxtest/cxxtest/TestRunner.h b/noarch/lib/py/cxxtest/cxxtest/TestRunner.h deleted file mode 100644 index 25ff3f8e..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/TestRunner.h +++ /dev/null @@ -1,154 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __cxxtest_TestRunner_h__ -#define __cxxtest_TestRunner_h__ - -// -// TestRunner is the class that runs all the tests. -// To use it, create an object that implements the TestListener -// interface and call TestRunner::runAllTests( myListener ); -// - -#include -#include -#include -#include - -namespace CxxTest -{ -class TestRunner -{ -public: - - static void setListener(TestListener* listener) - { - tracker().setListener(listener); - } - - static void runAllTests(TestListener &listener) - { - tracker().setListener(&listener); - _TS_TRY { TestRunner().runWorld(); } - _TS_LAST_CATCH( { tracker().failedTest(__FILE__, __LINE__, "Exception thrown from world"); }); - tracker().setListener(0); - } - - static void runAllTests(TestListener *listener) - { - if (listener) - { - listener->warning(__FILE__, __LINE__, "Deprecated; Use runAllTests( TestListener & )"); - runAllTests(*listener); - } - } - -private: - void runWorld() - { - RealWorldDescription wd; - WorldGuard sg; - - tracker().enterWorld(wd); - if (wd.setUp()) - { - for (SuiteDescription *sd = wd.firstSuite(); sd; sd = sd->next()) - { - if (sd->active()) - { - runSuite(*sd); - } - } - - wd.tearDown(); - } - tracker().leaveWorld(wd); - } - - void runSuite(SuiteDescription &sd) - { - StateGuard sg; - - tracker().enterSuite(sd); - if (sd.setUp()) - { - for (TestDescription *td = sd.firstTest(); td; td = td->next()) - { - if (td->active()) - { - runTest(*td); - } - } - - sd.tearDown(); - } - tracker().leaveSuite(sd); - } - - void runTest(TestDescription &td) - { - StateGuard sg; - - tracker().enterTest(td); - if (td.setUp()) - { - td.run(); - td.tearDown(); - } - tracker().leaveTest(td); - } - - class StateGuard - { -#ifdef _CXXTEST_HAVE_EH - bool _abortTestOnFail; -#endif // _CXXTEST_HAVE_EH - unsigned _maxDumpSize; - - public: - StateGuard() - { -#ifdef _CXXTEST_HAVE_EH - _abortTestOnFail = abortTestOnFail(); -#endif // _CXXTEST_HAVE_EH - _maxDumpSize = maxDumpSize(); - } - - ~StateGuard() - { -#ifdef _CXXTEST_HAVE_EH - setAbortTestOnFail(_abortTestOnFail); -#endif // _CXXTEST_HAVE_EH - setMaxDumpSize(_maxDumpSize); - } - }; - - class WorldGuard : public StateGuard - { - public: - WorldGuard() : StateGuard() - { -#ifdef _CXXTEST_HAVE_EH - setAbortTestOnFail(CXXTEST_DEFAULT_ABORT); -#endif // _CXXTEST_HAVE_EH - setMaxDumpSize(CXXTEST_MAX_DUMP_SIZE); - } - }; -}; - -// -// For --no-static-init -// -void initialize(); -} - - -#endif // __cxxtest_TestRunner_h__ diff --git a/noarch/lib/py/cxxtest/cxxtest/TestSuite.cpp b/noarch/lib/py/cxxtest/cxxtest/TestSuite.cpp deleted file mode 100644 index 63dbf1f1..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/TestSuite.cpp +++ /dev/null @@ -1,317 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __cxxtest__TestSuite_cpp__ -#define __cxxtest__TestSuite_cpp__ - -#include -#if defined(_CXXTEST_HAVE_STD) -#include -#endif - -namespace CxxTest -{ -// -// TestSuite members -// -TestSuite::~TestSuite() {} -void TestSuite::setUp() {} -void TestSuite::tearDown() {} - -// -// Test-aborting stuff -// -static bool currentAbortTestOnFail = false; - -bool abortTestOnFail() -{ - return currentAbortTestOnFail; -} - -void setAbortTestOnFail(bool value) -{ - currentAbortTestOnFail = value; -} - -void doAbortTest() -{ -# if defined(_CXXTEST_HAVE_EH) - if (currentAbortTestOnFail) - { - throw AbortTest(); - } -# endif // _CXXTEST_HAVE_EH -} - -// -// Max dump size -// -static unsigned currentMaxDumpSize = CXXTEST_MAX_DUMP_SIZE; - -unsigned maxDumpSize() -{ - return currentMaxDumpSize; -} - -void setMaxDumpSize(unsigned value) -{ - currentMaxDumpSize = value; -} - -// -// Some non-template functions -// -void doTrace(const char *file, int line, const char *message) -{ - if (tracker().print_tracing) - { - tracker().trace(file, line, message); - } -} - -void doWarn(const char *file, int line, const char *message) -{ - tracker().warning(file, line, message); -} - -# if defined(_CXXTEST_HAVE_EH) -void doSkipTest(const char* file, int line, const char* message) -{ - tracker().skippedTest(file, line, message); - throw SkipTest(); -# else -void doSkipTest(const char * file, int line, const char*) -{ - doWarn(file, line, "Test skipping is not supported without exception handling."); -# endif -} - -void doFailTest(const char * file, int line, const char * message) -{ - tracker().failedTest(file, line, message); - TS_ABORT(); -} - -void doFailAssert(const char * file, int line, - const char * expression, const char * message) -{ - if (message) - { - tracker().failedTest(file, line, message); - } - tracker().failedAssert(file, line, expression); - TS_ABORT(); -} - -bool sameData(const void * x, const void * y, unsigned size) -{ - if (size == 0) - { - return true; - } - - if (x == y) - { - return true; - } - - if (!x || !y) - { - return false; - } - - const char *cx = (const char *)x; - const char *cy = (const char *)y; - while (size --) - { - if (*cx++ != *cy++) - { - return false; - } - } - - return true; -} - -void doAssertSameData(const char * file, int line, - const char * xExpr, const void * x, - const char * yExpr, const void * y, - const char * sizeExpr, unsigned size, - const char * message) -{ - if (!sameData(x, y, size)) - { - if (message) - { - tracker().failedTest(file, line, message); - } - tracker().failedAssertSameData(file, line, xExpr, yExpr, sizeExpr, x, y, size); - TS_ABORT(); - } -} - -#if defined(_CXXTEST_HAVE_STD) -bool sameFiles(const char * file1, const char * file2, std::ostringstream & explanation) -{ - std::string ppprev_line; - std::string pprev_line; - std::string prev_line; - std::string curr_line; - - std::ifstream is1; - is1.open(file1); - std::ifstream is2; - is2.open(file2); - if (!is1) - { - explanation << "File '" << file1 << "' does not exist!"; - return false; - } - if (!is2) - { - explanation << "File '" << file2 << "' does not exist!"; - return false; - } - - int nline = 1; - char c1, c2; - while (1) - { - is1.get(c1); - is2.get(c2); - if (!is1 && !is2) { return true; } - if (!is1) - { - explanation << "File '" << file1 << "' ended before file '" << file2 << "' (line " << nline << ")"; - explanation << std::endl << "= " << ppprev_line << std::endl << "= " << pprev_line << std::endl << "= " << prev_line << std::endl << "< " << curr_line; - is1.get(c1); - while (is1 && (c1 != '\n')) - { - explanation << c1; - is1.get(c1); - } - explanation << std::endl; - return false; - } - if (!is2) - { - explanation << "File '" << file2 << "' ended before file '" << file1 << "' (line " << nline << ")"; - explanation << std::endl << "= " << ppprev_line << std::endl << "= " << pprev_line << std::endl << "= " << prev_line << std::endl << "> " << curr_line; - is2.get(c2); - while (is2 && (c2 != '\n')) - { - explanation << c2; - is2.get(c2); - } - explanation << std::endl; - return false; - } - if (c1 != c2) - { - explanation << "Files '" << file1 << "' and '" << file2 << "' differ at line " << nline; - explanation << std::endl << "= " << ppprev_line << std::endl << "= " << pprev_line << std::endl << "= " << prev_line; - - explanation << std::endl << "< " << curr_line; - is2.get(c1); - while (is1 && (c1 != '\n')) - { - explanation << c1; - is2.get(c1); - } - explanation << std::endl; - - explanation << std::endl << "> " << curr_line; - is2.get(c2); - while (is2 && (c2 != '\n')) - { - explanation << c2; - is2.get(c2); - } - explanation << std::endl; - - return false; - } - if (c1 == '\n') - { - ppprev_line = pprev_line; - pprev_line = prev_line; - prev_line = curr_line; - curr_line = ""; - nline++; - } - else - { - curr_line += c1; - } - } -} -#endif - -void doAssertSameFiles(const char * file, int line, - const char * file1, const char * file2, - const char * message) -{ -#if defined(_CXXTEST_HAVE_STD) - std::ostringstream explanation; - if (!sameFiles(file1, file2, explanation)) - { - if (message) - { - tracker().failedTest(file, line, message); - } - tracker().failedAssertSameFiles(file, line, file1, file2, explanation.str().c_str()); - TS_ABORT(); - } -#else - tracker().failedAssertSameFiles(file, line, file1, file2, "This test is only supported when --have-std is enabled"); - TS_ABORT(); -#endif -} - -void doFailAssertThrows(const char * file, int line, - const char * expr, const char * type, - bool otherThrown, - const char * message, - const char * exception) -{ - if (exception) - { - tracker().failedTest(file, line, exception); - } - if (message) - { - tracker().failedTest(file, line, message); - } - - tracker().failedAssertThrows(file, line, expr, type, otherThrown); - TS_ABORT(); -} - -void doFailAssertThrowsNot(const char * file, int line, - const char * expression, const char * message, - const char * exception) -{ - if (exception) - { - tracker().failedTest(file, line, exception); - } - if (message) - { - tracker().failedTest(file, line, message); - } - - tracker().failedAssertThrowsNot(file, line, expression); - TS_ABORT(); -} -} - -#endif // __cxxtest__TestSuite_cpp__ - diff --git a/noarch/lib/py/cxxtest/cxxtest/TestSuite.h b/noarch/lib/py/cxxtest/cxxtest/TestSuite.h deleted file mode 100644 index b34c45d3..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/TestSuite.h +++ /dev/null @@ -1,732 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __cxxtest__TestSuite_h__ -#define __cxxtest__TestSuite_h__ - -// -// class TestSuite is the base class for all test suites. -// To define a test suite, derive from this class and add -// member functions called void test*(); -// - -#include -#include -#include -#include -#include -#include -#include - -#if defined(_CXXTEST_HAVE_STD) -# include -#endif // _CXXTEST_HAVE_STD - -namespace CxxTest -{ -class TestSuite -{ -public: - virtual ~TestSuite(); - virtual void setUp(); - virtual void tearDown(); -}; - -class AbortTest {}; -class SkipTest {}; -void doAbortTest(); -# define TS_ABORT() CxxTest::doAbortTest() - -bool abortTestOnFail(); -void setAbortTestOnFail(bool value = CXXTEST_DEFAULT_ABORT); - -unsigned maxDumpSize(); -void setMaxDumpSize(unsigned value = CXXTEST_MAX_DUMP_SIZE); - -void doTrace(const char *file, int line, const char *message); -void doWarn(const char *file, int line, const char *message); -void doSkipTest(const char *file, int line, const char *message); -void doFailTest(const char *file, int line, const char *message); -void doFailAssert(const char *file, int line, const char *expression, const char *message); - -template -struct equals -{ - static bool test(X x, Y y) - { - return (x == y); - } -}; - -template<> -struct equals -{ - static bool test(const char *x, const char *y) - { - if ((x != 0) && (y != 0)) - { - return (CXXTEST_STD(strcmp(x, y)) == 0); - } - else - { - return (x == y); - } - } -}; - -template<> -struct equals -{ - static bool test(char *x, char *y) - { - if ((x != 0) && (y != 0)) - { - return (CXXTEST_STD(strcmp(x, y)) == 0); - } - else - { - return (x == y); - } - } -}; - -template<> -struct equals -{ - static bool test(const char *x, char *y) - { - if ((x != 0) && (y != 0)) - { - return (CXXTEST_STD(strcmp(x, y)) == 0); - } - else - { - return (x == y); - } - } -}; - -template<> -struct equals -{ - static bool test(char *x, const char *y) - { - if ((x != 0) && (y != 0)) - { - return (CXXTEST_STD(strcmp(x, y)) == 0); - } - else - { - return (x == y); - } - } -}; - -template -void doAssertEquals(const char *file, int line, - const char *xExpr, X x, - const char *yExpr, Y y, - const char *message) -{ - if (!equals::test(x, y)) - { - if (message) - { - tracker().failedTest(file, line, message); - } - tracker().failedAssertEquals(file, line, xExpr, yExpr, TS_AS_STRING(x), TS_AS_STRING(y)); - TS_ABORT(); - } -} - -bool sameData(const void *x, const void *y, unsigned size); - -void doAssertSameData(const char *file, int line, - const char *xExpr, const void *x, - const char *yExpr, const void *y, - const char *sizeExpr, unsigned size, - const char *message); - -//#if defined(_CXXTEST_HAVE_STD) -bool sameFiles(const char* file1, const char* file2, std::ostringstream& explanation); -//#endif - -template -struct differs -{ - static bool test(X x, Y y) - { - return !(x == y); - } -}; - -template -void doAssertDiffers(const char *file, int line, - const char *xExpr, X x, - const char *yExpr, Y y, - const char *message) -{ - if (!differs::test(x, y)) - { - if (message) - { - tracker().failedTest(file, line, message); - } - tracker().failedAssertDiffers(file, line, xExpr, yExpr, TS_AS_STRING(x)); - TS_ABORT(); - } -} - -template -struct lessThan -{ - static bool test(X x, Y y) - { - return (x < y); - } -}; - -template -void doAssertLessThan(const char *file, int line, - const char *xExpr, X x, - const char *yExpr, Y y, - const char *message) -{ - if (!lessThan::test(x, y)) - { - if (message) - { - tracker().failedTest(file, line, message); - } - tracker().failedAssertLessThan(file, line, xExpr, yExpr, TS_AS_STRING(x), TS_AS_STRING(y)); - TS_ABORT(); - } -} - -template -struct lessThanEquals -{ - static bool test(X x, Y y) - { - return (x <= y); - } -}; - -template -void doAssertLessThanEquals(const char *file, int line, - const char *xExpr, X x, - const char *yExpr, Y y, - const char *message) -{ - if (!lessThanEquals::test(x, y)) - { - if (message) - { - tracker().failedTest(file, line, message); - } - tracker().failedAssertLessThanEquals(file, line, xExpr, yExpr, TS_AS_STRING(x), TS_AS_STRING(y)); - TS_ABORT(); - } -} - -template -void doAssertPredicate(const char *file, int line, - const char *pExpr, const P &p, - const char *xExpr, X x, - const char *message) -{ - if (!p(x)) - { - if (message) - { - tracker().failedTest(file, line, message); - } - tracker().failedAssertPredicate(file, line, pExpr, xExpr, TS_AS_STRING(x)); - TS_ABORT(); - } -} - -template -void doAssertRelation(const char *file, int line, - const char *rExpr, const R &r, - const char *xExpr, X x, - const char *yExpr, Y y, - const char *message) -{ - if (!r(x, y)) - { - if (message) - { - tracker().failedTest(file, line, message); - } - tracker().failedAssertRelation(file, line, rExpr, xExpr, yExpr, TS_AS_STRING(x), TS_AS_STRING(y)); - TS_ABORT(); - } -} - -// An indirection template so the compiler can determine what type -// "X +/- D" should be -template -bool delta_le_helper(X x, Y y) -{ - return lessThanEquals::test(x, y); -} - -template -struct delta -{ - static bool test(X x, Y y, D d) - { - return delta_le_helper(x, y + d) && delta_le_helper(y, x + d); - //(y >= x - d) && (y <= x + d)); - } -}; - -template -void doAssertDelta(const char *file, int line, - const char *xExpr, X x, - const char *yExpr, Y y, - const char *dExpr, D d, - const char *message) -{ - if (!delta::test(x, y, d)) - { - if (message) - { - tracker().failedTest(file, line, message); - } - - tracker().failedAssertDelta(file, line, xExpr, yExpr, dExpr, - TS_AS_STRING(x), TS_AS_STRING(y), TS_AS_STRING(d)); - TS_ABORT(); - } -} - -void doFailAssertThrows(const char *file, int line, - const char *expr, const char *type, - bool otherThrown, - const char *message, - const char *exception = 0); - -void doFailAssertThrowsNot(const char *file, int line, - const char *expression, const char *message, - const char *exception = 0); - -void doAssertSameFiles(const char* file, int line, - const char* file1, const char* file2, - const char* message); - -# ifdef _CXXTEST_HAVE_EH -# define _TS_TRY try -# define _TS_CATCH_TYPE(t, b) catch t b -# define _TS_CATCH_ABORT(b) _TS_CATCH_TYPE( (const CxxTest::AbortTest &), b ) -# define _TS_CATCH_SKIPPED(b) _TS_CATCH_TYPE( (const CxxTest::SkipTest &), b ) -# define _TS_LAST_CATCH(b) _TS_CATCH_TYPE( (...), b ) -# define _TSM_LAST_CATCH(f,l,m) _TS_LAST_CATCH( { (CxxTest::tracker()).failedTest(f,l,m); } ) -# ifdef _CXXTEST_HAVE_STD -# define _TS_CATCH_STD(e,b) _TS_CATCH_TYPE( (const std::exception& e), b ) -# else // !_CXXTEST_HAVE_STD -# define _TS_CATCH_STD(e,b) -# endif // _CXXTEST_HAVE_STD -# define ___TSM_CATCH(f,l,m) \ - _TS_CATCH_STD(e, { (CxxTest::tracker()).failedTest(f,l,e.what()); }) \ - _TSM_LAST_CATCH(f,l,m) -# define __TSM_CATCH(f,l,m) \ - _TS_CATCH_ABORT( { throw; } ) \ - ___TSM_CATCH(f,l,m) -# define __TS_CATCH(f,l) __TSM_CATCH(f,l,"Unhandled exception") -# define _TS_CATCH __TS_CATCH(__FILE__,__LINE__) -# else // !_CXXTEST_HAVE_EH -# define _TS_TRY -# define ___TSM_CATCH(f,l,m) -# define __TSM_CATCH(f,l,m) -# define __TS_CATCH(f,l) -# define _TS_CATCH -# define _TS_CATCH_TYPE(t, b) -# define _TS_LAST_CATCH(b) -# define _TS_CATCH_STD(e,b) -# define _TS_CATCH_ABORT(b) -# define _TS_CATCH_SKIPPED(b) -# endif // _CXXTEST_HAVE_EH - -// TS_TRACE -# define _TS_TRACE(f,l,e) CxxTest::doTrace( (f), (l), TS_AS_STRING(e) ) -# define TS_TRACE(e) _TS_TRACE( __FILE__, __LINE__, e ) - -// TS_WARN -# define _TS_WARN(f,l,e) CxxTest::doWarn( (f), (l), TS_AS_STRING(e) ) -# define TS_WARN(e) _TS_WARN( __FILE__, __LINE__, e ) - -// TS_SKIP -# define _TS_SKIP(f,l,e) CxxTest::doSkipTest( (f), (l), TS_AS_STRING(e) ) -# define TS_SKIP(e) _TS_SKIP( __FILE__, __LINE__, e ) - -// TS_FAIL -# define _TS_FAIL(f,l,e) CxxTest::doFailTest( (f), (l), TS_AS_STRING(e) ) -# define TS_FAIL(e) _TS_FAIL( __FILE__, __LINE__, e ) - -// TS_ASSERT -# define ___ETS_ASSERT(f,l,e,m) { if ( !(e) ) { CxxTest::doFailAssert( (f), (l), #e, (m) ); } } -# define ___TS_ASSERT(f,l,e,m) { _TS_TRY { ___ETS_ASSERT(f,l,e,m); } __TS_CATCH(f,l) } - -# define _ETS_ASSERT(f,l,e) ___ETS_ASSERT(f,l,e,0) -# define _TS_ASSERT(f,l,e) ___TS_ASSERT(f,l,e,0) - -# define ETS_ASSERT(e) _ETS_ASSERT(__FILE__,__LINE__,e) -# define TS_ASSERT(e) _TS_ASSERT(__FILE__,__LINE__,e) - -# define _ETSM_ASSERT(f,l,m,e) ___ETS_ASSERT(f,l,e,TS_AS_STRING(m) ) -# define _TSM_ASSERT(f,l,m,e) ___TS_ASSERT(f,l,e,TS_AS_STRING(m) ) - -# define ETSM_ASSERT(m,e) _ETSM_ASSERT(__FILE__,__LINE__,m,e) -# define TSM_ASSERT(m,e) _TSM_ASSERT(__FILE__,__LINE__,m,e) - -// TS_ASSERT_EQUALS -# define ___ETS_ASSERT_EQUALS(f,l,x,y,m) CxxTest::doAssertEquals( (f), (l), #x, (x), #y, (y), (m) ) -# define ___TS_ASSERT_EQUALS(f,l,x,y,m) { _TS_TRY { ___ETS_ASSERT_EQUALS(f,l,x,y,m); } __TS_CATCH(f,l) } - -# define _ETS_ASSERT_EQUALS(f,l,x,y) ___ETS_ASSERT_EQUALS(f,l,x,y,0) -# define _TS_ASSERT_EQUALS(f,l,x,y) ___TS_ASSERT_EQUALS(f,l,x,y,0) - -# define ETS_ASSERT_EQUALS(x,y) _ETS_ASSERT_EQUALS(__FILE__,__LINE__,x,y) -# define TS_ASSERT_EQUALS(x,y) _TS_ASSERT_EQUALS(__FILE__,__LINE__,x,y) - -# define _ETSM_ASSERT_EQUALS(f,l,m,x,y) ___ETS_ASSERT_EQUALS(f,l,x,y,TS_AS_STRING(m)) -# define _TSM_ASSERT_EQUALS(f,l,m,x,y) ___TS_ASSERT_EQUALS(f,l,x,y,TS_AS_STRING(m)) - -# define ETSM_ASSERT_EQUALS(m,x,y) _ETSM_ASSERT_EQUALS(__FILE__,__LINE__,m,x,y) -# define TSM_ASSERT_EQUALS(m,x,y) _TSM_ASSERT_EQUALS(__FILE__,__LINE__,m,x,y) - -// Special foating point values support -# define ETS_ASSERT_IS_NAN(x) _ETS_ASSERT(__FILE__,__LINE__,isnan(x)) -# define TS_ASSERT_IS_NAN(x) _TS_ASSERT(__FILE__,__LINE__,isnan(x)) - -# define ETSM_ASSERT_IS_NAN(m,x) _ETSM_ASSERT(__FILE__,__LINE__,m,isnan(x)) -# define TSM_ASSERT_IS_NAN(m,x) _TSM_ASSERT(__FILE__,__LINE__,m,isnan(x)) - -# define ETS_ASSERT_IS_INFINITE(x) _ETS_ASSERT(__FILE__,__LINE__,isinf(x)) -# define TS_ASSERT_IS_INFINITE(x) _TS_ASSERT(__FILE__,__LINE__,isinf(x)) - -# define ETSM_ASSERT_IS_INFINITE(m,x) _ETSM_ASSERT(__FILE__,__LINE__,m,isinf(x)) -# define TSM_ASSERT_IS_INFINITE(m,x) _TSM_ASSERT(__FILE__,__LINE__,m,isinf(x)) - -// TS_ASSERT_SAME_DATA -# define ___ETS_ASSERT_SAME_DATA(f,l,x,y,s,m) CxxTest::doAssertSameData( (f), (l), #x, (x), #y, (y), #s, (s), (m) ) -# define ___TS_ASSERT_SAME_DATA(f,l,x,y,s,m) { _TS_TRY { ___ETS_ASSERT_SAME_DATA(f,l,x,y,s,m); } __TS_CATCH(f,l) } - -# define _ETS_ASSERT_SAME_DATA(f,l,x,y,s) ___ETS_ASSERT_SAME_DATA(f,l,x,y,s,0) -# define _TS_ASSERT_SAME_DATA(f,l,x,y,s) ___TS_ASSERT_SAME_DATA(f,l,x,y,s,0) - -# define ETS_ASSERT_SAME_DATA(x,y,s) _ETS_ASSERT_SAME_DATA(__FILE__,__LINE__,x,y,s) -# define TS_ASSERT_SAME_DATA(x,y,s) _TS_ASSERT_SAME_DATA(__FILE__,__LINE__,x,y,s) - -# define _ETSM_ASSERT_SAME_DATA(f,l,m,x,y,s) ___ETS_ASSERT_SAME_DATA(f,l,x,y,s,TS_AS_STRING(m)) -# define _TSM_ASSERT_SAME_DATA(f,l,m,x,y,s) ___TS_ASSERT_SAME_DATA(f,l,x,y,s,TS_AS_STRING(m)) - -# define ETSM_ASSERT_SAME_DATA(m,x,y,s) _ETSM_ASSERT_SAME_DATA(__FILE__,__LINE__,m,x,y,s) -# define TSM_ASSERT_SAME_DATA(m,x,y,s) _TSM_ASSERT_SAME_DATA(__FILE__,__LINE__,m,x,y,s) - -// TS_ASSERT_DIFFERS -# define ___ETS_ASSERT_DIFFERS(f,l,x,y,m) CxxTest::doAssertDiffers( (f), (l), #x, (x), #y, (y), (m) ) -# define ___TS_ASSERT_DIFFERS(f,l,x,y,m) { _TS_TRY { ___ETS_ASSERT_DIFFERS(f,l,x,y,m); } __TS_CATCH(f,l) } - -# define _ETS_ASSERT_DIFFERS(f,l,x,y) ___ETS_ASSERT_DIFFERS(f,l,x,y,0) -# define _TS_ASSERT_DIFFERS(f,l,x,y) ___TS_ASSERT_DIFFERS(f,l,x,y,0) - -# define ETS_ASSERT_DIFFERS(x,y) _ETS_ASSERT_DIFFERS(__FILE__,__LINE__,x,y) -# define TS_ASSERT_DIFFERS(x,y) _TS_ASSERT_DIFFERS(__FILE__,__LINE__,x,y) - -# define _ETSM_ASSERT_DIFFERS(f,l,m,x,y) ___ETS_ASSERT_DIFFERS(f,l,x,y,TS_AS_STRING(m)) -# define _TSM_ASSERT_DIFFERS(f,l,m,x,y) ___TS_ASSERT_DIFFERS(f,l,x,y,TS_AS_STRING(m)) - -# define ETSM_ASSERT_DIFFERS(m,x,y) _ETSM_ASSERT_DIFFERS(__FILE__,__LINE__,m,x,y) -# define TSM_ASSERT_DIFFERS(m,x,y) _TSM_ASSERT_DIFFERS(__FILE__,__LINE__,m,x,y) - -// TS_ASSERT_LESS_THAN -# define ___ETS_ASSERT_LESS_THAN(f,l,x,y,m) CxxTest::doAssertLessThan( (f), (l), #x, (x), #y, (y), (m) ) -# define ___TS_ASSERT_LESS_THAN(f,l,x,y,m) { _TS_TRY { ___ETS_ASSERT_LESS_THAN(f,l,x,y,m); } __TS_CATCH(f,l) } - -# define _ETS_ASSERT_LESS_THAN(f,l,x,y) ___ETS_ASSERT_LESS_THAN(f,l,x,y,0) -# define _TS_ASSERT_LESS_THAN(f,l,x,y) ___TS_ASSERT_LESS_THAN(f,l,x,y,0) - -# define ETS_ASSERT_LESS_THAN(x,y) _ETS_ASSERT_LESS_THAN(__FILE__,__LINE__,x,y) -# define TS_ASSERT_LESS_THAN(x,y) _TS_ASSERT_LESS_THAN(__FILE__,__LINE__,x,y) - -# define _ETSM_ASSERT_LESS_THAN(f,l,m,x,y) ___ETS_ASSERT_LESS_THAN(f,l,x,y,TS_AS_STRING(m)) -# define _TSM_ASSERT_LESS_THAN(f,l,m,x,y) ___TS_ASSERT_LESS_THAN(f,l,x,y,TS_AS_STRING(m)) - -# define ETSM_ASSERT_LESS_THAN(m,x,y) _ETSM_ASSERT_LESS_THAN(__FILE__,__LINE__,m,x,y) -# define TSM_ASSERT_LESS_THAN(m,x,y) _TSM_ASSERT_LESS_THAN(__FILE__,__LINE__,m,x,y) - -// TS_ASSERT_LESS_THAN_EQUALS -# define ___ETS_ASSERT_LESS_THAN_EQUALS(f,l,x,y,m) \ - CxxTest::doAssertLessThanEquals( (f), (l), #x, (x), #y, (y), (m) ) -# define ___TS_ASSERT_LESS_THAN_EQUALS(f,l,x,y,m) \ - { _TS_TRY { ___ETS_ASSERT_LESS_THAN_EQUALS(f,l,x,y,m); } __TS_CATCH(f,l) } - -# define _ETS_ASSERT_LESS_THAN_EQUALS(f,l,x,y) ___ETS_ASSERT_LESS_THAN_EQUALS(f,l,x,y,0) -# define _TS_ASSERT_LESS_THAN_EQUALS(f,l,x,y) ___TS_ASSERT_LESS_THAN_EQUALS(f,l,x,y,0) - -# define ETS_ASSERT_LESS_THAN_EQUALS(x,y) _ETS_ASSERT_LESS_THAN_EQUALS(__FILE__,__LINE__,x,y) -# define TS_ASSERT_LESS_THAN_EQUALS(x,y) _TS_ASSERT_LESS_THAN_EQUALS(__FILE__,__LINE__,x,y) - -# define _ETSM_ASSERT_LESS_THAN_EQUALS(f,l,m,x,y) ___ETS_ASSERT_LESS_THAN_EQUALS(f,l,x,y,TS_AS_STRING(m)) -# define _TSM_ASSERT_LESS_THAN_EQUALS(f,l,m,x,y) ___TS_ASSERT_LESS_THAN_EQUALS(f,l,x,y,TS_AS_STRING(m)) - -# define ETSM_ASSERT_LESS_THAN_EQUALS(m,x,y) _ETSM_ASSERT_LESS_THAN_EQUALS(__FILE__,__LINE__,m,x,y) -# define TSM_ASSERT_LESS_THAN_EQUALS(m,x,y) _TSM_ASSERT_LESS_THAN_EQUALS(__FILE__,__LINE__,m,x,y) - -// TS_ASSERT_PREDICATE -# define ___ETS_ASSERT_PREDICATE(f,l,p,x,m) \ - CxxTest::doAssertPredicate( (f), (l), #p, p(), #x, (x), (m) ) -# define ___TS_ASSERT_PREDICATE(f,l,p,x,m) \ - { _TS_TRY { ___ETS_ASSERT_PREDICATE(f,l,p,x,m); } __TS_CATCH(f,l) } - -# define _ETS_ASSERT_PREDICATE(f,l,p,x) ___ETS_ASSERT_PREDICATE(f,l,p,x,0) -# define _TS_ASSERT_PREDICATE(f,l,p,x) ___TS_ASSERT_PREDICATE(f,l,p,x,0) - -# define ETS_ASSERT_PREDICATE(p,x) _ETS_ASSERT_PREDICATE(__FILE__,__LINE__,p,x) -# define TS_ASSERT_PREDICATE(p,x) _TS_ASSERT_PREDICATE(__FILE__,__LINE__,p,x) - -# define _ETSM_ASSERT_PREDICATE(f,l,m,p,x) ___ETS_ASSERT_PREDICATE(f,l,p,x,TS_AS_STRING(m)) -# define _TSM_ASSERT_PREDICATE(f,l,m,p,x) ___TS_ASSERT_PREDICATE(f,l,p,x,TS_AS_STRING(m)) - -# define ETSM_ASSERT_PREDICATE(m,p,x) _ETSM_ASSERT_PREDICATE(__FILE__,__LINE__,m,p,x) -# define TSM_ASSERT_PREDICATE(m,p,x) _TSM_ASSERT_PREDICATE(__FILE__,__LINE__,m,p,x) - -// TS_ASSERT_RELATION -# define ___ETS_ASSERT_RELATION(f,l,r,x,y,m) \ - CxxTest::doAssertRelation( (f), (l), #r, r(), #x, (x), #y, (y), (m) ) -# define ___TS_ASSERT_RELATION(f,l,r,x,y,m) \ - { _TS_TRY { ___ETS_ASSERT_RELATION(f,l,r,x,y,m); } __TS_CATCH(f,l) } - -# define _ETS_ASSERT_RELATION(f,l,r,x,y) ___ETS_ASSERT_RELATION(f,l,r,x,y,0) -# define _TS_ASSERT_RELATION(f,l,r,x,y) ___TS_ASSERT_RELATION(f,l,r,x,y,0) - -# define ETS_ASSERT_RELATION(r,x,y) _ETS_ASSERT_RELATION(__FILE__,__LINE__,r,x,y) -# define TS_ASSERT_RELATION(r,x,y) _TS_ASSERT_RELATION(__FILE__,__LINE__,r,x,y) - -# define _ETSM_ASSERT_RELATION(f,l,m,r,x,y) ___ETS_ASSERT_RELATION(f,l,r,x,y,TS_AS_STRING(m)) -# define _TSM_ASSERT_RELATION(f,l,m,r,x,y) ___TS_ASSERT_RELATION(f,l,r,x,y,TS_AS_STRING(m)) - -# define ETSM_ASSERT_RELATION(m,r,x,y) _ETSM_ASSERT_RELATION(__FILE__,__LINE__,m,r,x,y) -# define TSM_ASSERT_RELATION(m,r,x,y) _TSM_ASSERT_RELATION(__FILE__,__LINE__,m,r,x,y) - -// TS_ASSERT_DELTA -# define ___ETS_ASSERT_DELTA(f,l,x,y,d,m) CxxTest::doAssertDelta( (f), (l), #x, (x), #y, (y), #d, (d), (m) ) -# define ___TS_ASSERT_DELTA(f,l,x,y,d,m) { _TS_TRY { ___ETS_ASSERT_DELTA(f,l,x,y,d,m); } __TS_CATCH(f,l) } - -# define _ETS_ASSERT_DELTA(f,l,x,y,d) ___ETS_ASSERT_DELTA(f,l,x,y,d,0) -# define _TS_ASSERT_DELTA(f,l,x,y,d) ___TS_ASSERT_DELTA(f,l,x,y,d,0) - -# define ETS_ASSERT_DELTA(x,y,d) _ETS_ASSERT_DELTA(__FILE__,__LINE__,x,y,d) -# define TS_ASSERT_DELTA(x,y,d) _TS_ASSERT_DELTA(__FILE__,__LINE__,x,y,d) - -# define _ETSM_ASSERT_DELTA(f,l,m,x,y,d) ___ETS_ASSERT_DELTA(f,l,x,y,d,TS_AS_STRING(m)) -# define _TSM_ASSERT_DELTA(f,l,m,x,y,d) ___TS_ASSERT_DELTA(f,l,x,y,d,TS_AS_STRING(m)) - -# define ETSM_ASSERT_DELTA(m,x,y,d) _ETSM_ASSERT_DELTA(__FILE__,__LINE__,m,x,y,d) -# define TSM_ASSERT_DELTA(m,x,y,d) _TSM_ASSERT_DELTA(__FILE__,__LINE__,m,x,y,d) - -// TS_ASSERT_SAME_FILES -# define ___ETS_ASSERT_SAME_FILES(f,l,x,y,m) CxxTest::doAssertSameFiles( (f), (l), (x), (y), (m) ) -# define ___TS_ASSERT_SAME_FILES(f,l,x,y,m) { _TS_TRY { ___ETS_ASSERT_SAME_FILES(f,l,x,y,m); } __TS_CATCH(f,l) } - -# define _ETS_ASSERT_SAME_FILES(f,l,x,y) ___ETS_ASSERT_SAME_FILES(f,l,x,y,0) -# define _TS_ASSERT_SAME_FILES(f,l,x,y) ___TS_ASSERT_SAME_FILES(f,l,x,y,0) - -# define ETS_ASSERT_SAME_FILES(x,y) _ETS_ASSERT_SAME_FILES(__FILE__,__LINE__,x,y) -# define TS_ASSERT_SAME_FILES(x,y) _TS_ASSERT_SAME_FILES(__FILE__,__LINE__,x,y) - -# define _ETSM_ASSERT_SAME_FILES(f,l,m,x,y) ___ETS_ASSERT_SAME_FILES(f,l,x,y,TS_AS_STRING(m)) -# define _TSM_ASSERT_SAME_FILES(f,l,m,x,y) ___TS_ASSERT_SAME_FILES(f,l,x,y,TS_AS_STRING(m)) - -# define ETSM_ASSERT_SAME_FILES(m,x,y) _ETSM_ASSERT_SAME_FILES(__FILE__,__LINE__,m,x,y) -# define TSM_ASSERT_SAME_FILES(m,x,y) _TSM_ASSERT_SAME_FILES(__FILE__,__LINE__,m,x,y) - - -// TS_ASSERT_THROWS -# define ___TS_ASSERT_THROWS(f,l,e,t,m) ___TS_ASSERT_THROWS_ASSERT(f,l,e,t,(void)0,m) - -# define _TS_ASSERT_THROWS(f,l,e,t) ___TS_ASSERT_THROWS(f,l,e,t,0) -# define TS_ASSERT_THROWS(e,t) _TS_ASSERT_THROWS(__FILE__,__LINE__,e,t) - -# define _TSM_ASSERT_THROWS(f,l,m,e,t) ___TS_ASSERT_THROWS(f,l,e,t,TS_AS_STRING(m)) -# define TSM_ASSERT_THROWS(m,e,t) _TSM_ASSERT_THROWS(__FILE__,__LINE__,m,e,t) - -// TS_ASSERT_THROWS_ASSERT -# define ___TS_ASSERT_THROWS_ASSERT(f,l,e,t,a,m) { \ - bool _ts_threw_expected = false, _ts_threw_else = false; \ - _TS_TRY { try{ e; } _TS_CATCH_TYPE( (t), { a; _ts_threw_expected = true; } ) } \ - _TS_CATCH_ABORT( { throw; } ) \ - _TS_CATCH_STD( ex, { _ts_threw_expected = true; CxxTest::doFailAssertThrows((f), (l), #e, #t, true, (m), ex.what() ); } ) \ - _TS_LAST_CATCH( { _ts_threw_else = true; } ) \ - if ( !_ts_threw_expected ) { CxxTest::doFailAssertThrows( (f), (l), #e, #t, _ts_threw_else, (m), 0 ); } } - -# define _TS_ASSERT_THROWS_ASSERT(f,l,e,t,a) ___TS_ASSERT_THROWS_ASSERT(f,l,e,t,a,0) -# define TS_ASSERT_THROWS_ASSERT(e,t,a) _TS_ASSERT_THROWS_ASSERT(__FILE__,__LINE__,e,t,a) - -# define _TSM_ASSERT_THROWS_ASSERT(f,l,m,e,t,a) ___TS_ASSERT_THROWS_ASSERT(f,l,e,t,a,TS_AS_STRING(m)) -# define TSM_ASSERT_THROWS_ASSERT(m,e,t,a) _TSM_ASSERT_THROWS_ASSERT(__FILE__,__LINE__,m,e,t,a) - -// TS_ASSERT_THROWS_EQUALS -# define TS_ASSERT_THROWS_EQUALS(e,t,x,y) TS_ASSERT_THROWS_ASSERT(e,t,TS_ASSERT_EQUALS(x,y)) -# define TSM_ASSERT_THROWS_EQUALS(m,e,t,x,y) TSM_ASSERT_THROWS_ASSERT(m,e,t,TSM_ASSERT_EQUALS(m,x,y)) - -// Special foating point values support -# define TS_ASSERT_THROWS_IS_NAN(e,t,x) TS_ASSERT_THROWS_ASSERT(e,t,TS_ASSERT_IS_NAN(x)) -# define TSM_ASSERT_THROWS_IS_NAN(m,e,t,x) TSM_ASSERT_THROWS_ASSERT(m,e,t,TSM_ASSERT_IS_NAN(m,x)) - -# define TS_ASSERT_THROWS_IS_INFINITE(e,t,x) TS_ASSERT_THROWS_ASSERT(e,t,TS_ASSERT_IS_INFINITE(x)) -# define TSM_ASSERT_THROWS_IS_INFINITE(m,e,t,x) TSM_ASSERT_THROWS_ASSERT(m,e,t,TSM_ASSERT_IS_INFINITE(m,x)) - -// TS_ASSERT_THROWS_DIFFERS -# define TS_ASSERT_THROWS_DIFFERS(e,t,x,y) TS_ASSERT_THROWS_ASSERT(e,t,TS_ASSERT_DIFFERS(x,y)) -# define TSM_ASSERT_THROWS_DIFFERS(m,e,t,x,y) TSM_ASSERT_THROWS_ASSERT(m,e,t,TSM_ASSERT_DIFFERS(m,x,y)) - -// TS_ASSERT_THROWS_DELTA -# define TS_ASSERT_THROWS_DELTA(e,t,x,y,d) TS_ASSERT_THROWS_ASSERT(e,t,TS_ASSERT_DELTA(x,y,d)) -# define TSM_ASSERT_THROWS_DELTA(m,e,t,x,y,d) TSM_ASSERT_THROWS_ASSERT(m,e,t,TSM_ASSERT_DELTA(m,x,y,d)) - -// TS_ASSERT_THROWS_SAME_DATA -# define TS_ASSERT_THROWS_SAME_DATA(e,t,x,y,s) TS_ASSERT_THROWS_ASSERT(e,t,TS_ASSERT_SAME_DATA(x,y,s)) -# define TSM_ASSERT_THROWS_SAME_DATA(m,e,t,x,y,s) TSM_ASSERT_THROWS_ASSERT(m,e,t,TSM_ASSERT_SAME_DATA(m,x,y,s)) - -// TS_ASSERT_THROWS_LESS_THAN -# define TS_ASSERT_THROWS_LESS_THAN(e,t,x,y) TS_ASSERT_THROWS_ASSERT(e,t,TS_ASSERT_LESS_THAN(x,y)) -# define TSM_ASSERT_THROWS_LESS_THAN(m,e,t,x,y) TSM_ASSERT_THROWS_ASSERT(m,e,t,TSM_ASSERT_LESS_THAN(m,x,y)) - -// TS_ASSERT_THROWS_LESS_THAN_EQUALS -# define TS_ASSERT_THROWS_LESS_THAN_EQUALS(e,t,x,y) TS_ASSERT_THROWS_ASSERT(e,t,TS_ASSERT_LESS_THAN_EQUALS(x,y)) -# define TSM_ASSERT_THROWS_LESS_THAN_EQUALS(m,e,t,x,y) TSM_ASSERT_THROWS_ASSERT(m,e,t,TSM_ASSERT_LESS_THAN_EQUALS(m,x,y)) - -// TS_ASSERT_THROWS_PREDICATE -# define TS_ASSERT_THROWS_PREDICATE(e,t,p,v) TS_ASSERT_THROWS_ASSERT(e,t,TS_ASSERT_PREDICATE(p,v)) -# define TSM_ASSERT_THROWS_PREDICATE(m,e,t,p,v) TSM_ASSERT_THROWS_ASSERT(m,e,t,TSM_ASSERT_PREDICATE(m,p,v)) - -// TS_ASSERT_THROWS_RELATION -# define TS_ASSERT_THROWS_RELATION(e,t,r,x,y) TS_ASSERT_THROWS_ASSERT(e,t,TS_ASSERT_RELATION(r,x,y)) -# define TSM_ASSERT_THROWS_RELATION(m,e,t,r,x,y) TSM_ASSERT_THROWS_ASSERT(m,e,t,TSM_ASSERT_RELATION(m,r,x,y)) - -// TS_ASSERT_THROWS_ANYTHING -# define ___TS_ASSERT_THROWS_ANYTHING(f,l,e,m) { \ - bool _ts_threw = false; \ - _TS_TRY { e; } \ - _TS_LAST_CATCH( { _ts_threw = true; } ) \ - if ( !_ts_threw ) { CxxTest::doFailAssertThrows( (f), (l), #e, "...", false, (m) ); } } - -# define _TS_ASSERT_THROWS_ANYTHING(f,l,e) ___TS_ASSERT_THROWS_ANYTHING(f,l,e,0) -# define TS_ASSERT_THROWS_ANYTHING(e) _TS_ASSERT_THROWS_ANYTHING(__FILE__, __LINE__, e) - -# define _TSM_ASSERT_THROWS_ANYTHING(f,l,m,e) ___TS_ASSERT_THROWS_ANYTHING(f,l,e,TS_AS_STRING(m)) -# define TSM_ASSERT_THROWS_ANYTHING(m,e) _TSM_ASSERT_THROWS_ANYTHING(__FILE__,__LINE__,m,e) - -// TS_ASSERT_THROWS_NOTHING -# define ___TS_ASSERT_THROWS_NOTHING(f,l,e,m) { \ - _TS_TRY { e; } \ - _TS_CATCH_ABORT( { throw; } ) \ - _TS_CATCH_STD(ex, { CxxTest::doFailAssertThrowsNot( (f), (l), #e, (m), ex.what() ); } ) \ - _TS_LAST_CATCH( { CxxTest::doFailAssertThrowsNot( (f), (l), #e, (m), 0 ); } ) } - -# define _TS_ASSERT_THROWS_NOTHING(f,l,e) ___TS_ASSERT_THROWS_NOTHING(f,l,e,0) -# define TS_ASSERT_THROWS_NOTHING(e) _TS_ASSERT_THROWS_NOTHING(__FILE__,__LINE__,e) - -# define _TSM_ASSERT_THROWS_NOTHING(f,l,m,e) ___TS_ASSERT_THROWS_NOTHING(f,l,e,TS_AS_STRING(m)) -# define TSM_ASSERT_THROWS_NOTHING(m,e) _TSM_ASSERT_THROWS_NOTHING(__FILE__,__LINE__,m,e) - - -// -// This takes care of "signed <-> unsigned" warnings -// -# define CXXTEST_COMPARISONS(CXXTEST_X, CXXTEST_Y, CXXTEST_T) \ - template<> struct equals { \ - static bool test(CXXTEST_X x,CXXTEST_Y y) { \ - return equals::test((CXXTEST_T)x,(CXXTEST_T)y); } }; \ - template<> struct equals { \ - static bool test(CXXTEST_Y x,CXXTEST_X y) { \ - return equals::test((CXXTEST_T)x,(CXXTEST_T)y); } }; \ - template<> struct differs { \ - static bool test(CXXTEST_X x,CXXTEST_Y y) { \ - return differs::test((CXXTEST_T)x,(CXXTEST_T)y); } }; \ - template<> struct differs { \ - static bool test(CXXTEST_Y x,CXXTEST_X y) { \ - return differs::test((CXXTEST_T)x,(CXXTEST_T)y); } }; \ - template<> struct lessThan { \ - static bool test(CXXTEST_X x,CXXTEST_Y y) { \ - return lessThan::test((CXXTEST_T)x,(CXXTEST_T)y); } }; \ - template<> struct lessThan { \ - static bool test(CXXTEST_Y x,CXXTEST_X y) { \ - return lessThan::test((CXXTEST_T)x,(CXXTEST_T)y); } }; \ - template<> struct lessThanEquals { \ - static bool test(CXXTEST_X x,CXXTEST_Y y) { \ - return lessThanEquals::test((CXXTEST_T)x,(CXXTEST_T)y); } }; \ - template<> struct lessThanEquals { \ - static bool test(CXXTEST_Y x,CXXTEST_X y) { \ - return lessThanEquals::test((CXXTEST_T)x,(CXXTEST_T)y); } } -#if 0 -// These specializations are not needed because delta makes use of -// CxxTest::lessThanEquals for the actual comparison -template struct delta -{ - \ - static bool test(CXXTEST_X x, CXXTEST_Y y, D d) - { - \ - return delta::test((CXXTEST_T)x, (CXXTEST_T)y, d); - } -}; \ -template struct delta -{ - \ - static bool test(CXXTEST_Y x, CXXTEST_X y, D d) - { - \ - return delta::test((CXXTEST_T)x, (CXXTEST_T)y, d); - } -} -#endif - -# define CXXTEST_INTEGRAL(CXXTEST_T) \ - CXXTEST_COMPARISONS( signed CXXTEST_T, unsigned CXXTEST_T, unsigned CXXTEST_T ) - -CXXTEST_INTEGRAL(char); -CXXTEST_INTEGRAL(short); -CXXTEST_INTEGRAL(int); -CXXTEST_INTEGRAL(long); -# ifdef _CXXTEST_LONGLONG -CXXTEST_INTEGRAL(_CXXTEST_LONGLONG); -# endif // _CXXTEST_LONGLONG - -# define CXXTEST_SMALL_BIG(CXXTEST_SMALL, CXXTEST_BIG) \ - CXXTEST_COMPARISONS( signed CXXTEST_SMALL, unsigned CXXTEST_BIG, unsigned CXXTEST_BIG ); \ - CXXTEST_COMPARISONS( signed CXXTEST_BIG, unsigned CXXTEST_SMALL, unsigned CXXTEST_BIG ) - -CXXTEST_SMALL_BIG(char, short); -CXXTEST_SMALL_BIG(char, int); -CXXTEST_SMALL_BIG(short, int); -CXXTEST_SMALL_BIG(char, long); -CXXTEST_SMALL_BIG(short, long); -CXXTEST_SMALL_BIG(int, long); - -# ifdef _CXXTEST_LONGLONG -CXXTEST_SMALL_BIG(char, _CXXTEST_LONGLONG); -CXXTEST_SMALL_BIG(short, _CXXTEST_LONGLONG); -CXXTEST_SMALL_BIG(int, _CXXTEST_LONGLONG); -CXXTEST_SMALL_BIG(long, _CXXTEST_LONGLONG); -# endif // _CXXTEST_LONGLONG -} - -#ifdef _CXXTEST_HAVE_STD -# include -#endif // _CXXTEST_HAVE_STD - -#endif // __cxxtest__TestSuite_h__ - diff --git a/noarch/lib/py/cxxtest/cxxtest/TestTracker.cpp b/noarch/lib/py/cxxtest/cxxtest/TestTracker.cpp deleted file mode 100644 index fbb6dcde..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/TestTracker.cpp +++ /dev/null @@ -1,288 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __cxxtest__TestTracker_cpp__ -#define __cxxtest__TestTracker_cpp__ - -#include - -namespace CxxTest -{ -bool TestTracker::_created = false; -bool TestTracker::print_tracing = false; - -TestTracker::TestTracker() -{ - if (!_created) - { - initialize(); - setListener(0); - _created = true; - } -} - -TestTracker::~TestTracker() -{ -} - -TestTracker & TestTracker::tracker() -{ - static TestTracker theTracker; - return theTracker; -} - -void TestTracker::initialize() -{ - _warnings = 0; - _skippedTests = 0; - _testSkipped = false; - _failedTests = 0; - _testFailedAsserts = 0; - _suiteFailedTests = 0; - _failedSuites = 0; - _world = 0; - _suite = 0; - _test = 0; -} - -const TestDescription *TestTracker::fixTest(const TestDescription *d) const -{ - return d ? d : &dummyTest(); -} - -const SuiteDescription *TestTracker::fixSuite(const SuiteDescription *d) const -{ - return d ? d : &dummySuite(); -} - -const WorldDescription *TestTracker::fixWorld(const WorldDescription *d) const -{ - return d ? d : &dummyWorld(); -} - -const TestDescription &TestTracker::dummyTest() const -{ - return dummySuite().testDescription(0); -} - -const SuiteDescription &TestTracker::dummySuite() const -{ - return dummyWorld().suiteDescription(0); -} - -const WorldDescription &TestTracker::dummyWorld() const -{ - return _dummyWorld; -} - -void TestTracker::setListener(TestListener *l) -{ - _l = l ? l : &_dummyListener; -} - -void TestTracker::enterWorld(const WorldDescription &wd) -{ - setWorld(&wd); - _warnings = _skippedTests = _failedTests = _testFailedAsserts = _suiteFailedTests = _failedSuites = 0; - _testSkipped = false; - _l->enterWorld(wd); -} - -void TestTracker::enterSuite(const SuiteDescription &sd) -{ - setSuite(&sd); - _testFailedAsserts = _suiteFailedTests = 0; - _testSkipped = false; - _l->enterSuite(sd); -} - -void TestTracker::enterTest(const TestDescription &td) -{ - setTest(&td); - _testFailedAsserts = false; - _testSkipped = false; - _l->enterTest(td); -} - -void TestTracker::leaveTest(const TestDescription &td) -{ - _l->leaveTest(td); - setTest(0); -} - -void TestTracker::leaveSuite(const SuiteDescription &sd) -{ - _l->leaveSuite(sd); - setSuite(0); -} - -void TestTracker::leaveWorld(const WorldDescription &wd) -{ - _l->leaveWorld(wd); - setWorld(0); -} - -void TestTracker::trace(const char *file, int line, const char *expression) -{ - _l->trace(file, line, expression); -} - -void TestTracker::warning(const char *file, int line, const char *expression) -{ - countWarning(); - _l->warning(file, line, expression); -} - -void TestTracker::skippedTest(const char *file, int line, const char *expression) -{ - countSkipped(); - _testSkipped = true; - _l->skippedTest(file, line, expression); -} - -void TestTracker::failedTest(const char *file, int line, const char *expression) -{ - countFailure(); - _l->failedTest(file, line, expression); -} - -void TestTracker::failedAssert(const char *file, int line, const char *expression) -{ - countFailure(); - _l->failedAssert(file, line, expression); -} - -void TestTracker::failedAssertEquals(const char *file, int line, - const char *xStr, const char *yStr, - const char *x, const char *y) -{ - countFailure(); - _l->failedAssertEquals(file, line, xStr, yStr, x, y); -} - -void TestTracker::failedAssertSameData(const char *file, int line, - const char *xStr, const char *yStr, - const char *sizeStr, const void *x, - const void *y, unsigned size) -{ - countFailure(); - _l->failedAssertSameData(file, line, xStr, yStr, sizeStr, x, y, size); -} - -void TestTracker::failedAssertDelta(const char *file, int line, - const char *xStr, const char *yStr, const char *dStr, - const char *x, const char *y, const char *d) -{ - countFailure(); - _l->failedAssertDelta(file, line, xStr, yStr, dStr, x, y, d); -} - -void TestTracker::failedAssertDiffers(const char *file, int line, - const char *xStr, const char *yStr, - const char *value) -{ - countFailure(); - _l->failedAssertDiffers(file, line, xStr, yStr, value); -} - -void TestTracker::failedAssertLessThan(const char *file, int line, - const char *xStr, const char *yStr, - const char *x, const char *y) -{ - countFailure(); - _l->failedAssertLessThan(file, line, xStr, yStr, x, y); -} - -void TestTracker::failedAssertLessThanEquals(const char *file, int line, - const char *xStr, const char *yStr, - const char *x, const char *y) -{ - countFailure(); - _l->failedAssertLessThanEquals(file, line, xStr, yStr, x, y); -} - -void TestTracker::failedAssertPredicate(const char *file, int line, - const char *predicate, const char *xStr, const char *x) -{ - countFailure(); - _l->failedAssertPredicate(file, line, predicate, xStr, x); -} - -void TestTracker::failedAssertRelation(const char *file, int line, - const char *relation, const char *xStr, const char *yStr, - const char *x, const char *y) -{ - countFailure(); - _l->failedAssertRelation(file, line, relation, xStr, yStr, x, y); -} - -void TestTracker::failedAssertThrows(const char *file, int line, - const char *expression, const char *type, - bool otherThrown) -{ - countFailure(); - _l->failedAssertThrows(file, line, expression, type, otherThrown); -} - -void TestTracker::failedAssertThrowsNot(const char *file, int line, const char *expression) -{ - countFailure(); - _l->failedAssertThrowsNot(file, line, expression); -} - -void TestTracker::failedAssertSameFiles(const char *file, int line, const char *file1, const char* file2, const char* explanation) -{ - countFailure(); - _l->failedAssertSameFiles(file, line, file1, file2, explanation); -} - -void TestTracker::setWorld(const WorldDescription *w) -{ - _world = fixWorld(w); - setSuite(0); -} - -void TestTracker::setSuite(const SuiteDescription *s) -{ - _suite = fixSuite(s); - setTest(0); -} - -void TestTracker::setTest(const TestDescription *t) -{ - _test = fixTest(t); -} - -void TestTracker::countWarning() -{ - ++ _warnings; -} - -void TestTracker::countSkipped() -{ - ++ _skippedTests; -} - -void TestTracker::countFailure() -{ - if (++ _testFailedAsserts == 1) - { - ++ _failedTests; - if (++ _suiteFailedTests == 1) - { - ++ _failedSuites; - } - } -} -} - -#endif // __cxxtest__TestTracker_cpp__ - diff --git a/noarch/lib/py/cxxtest/cxxtest/TestTracker.h b/noarch/lib/py/cxxtest/cxxtest/TestTracker.h deleted file mode 100644 index 50e59bc8..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/TestTracker.h +++ /dev/null @@ -1,134 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __cxxtest__TestTracker_h__ -#define __cxxtest__TestTracker_h__ - -// -// The TestTracker tracks running tests -// The actual work is done in CountingListenerProxy, -// but this way avoids cyclic references TestListener<->CountingListenerProxy -// - -#include -#include - -namespace CxxTest -{ -class TestListener; - -class TestTracker : public TestListener -{ -public: - virtual ~TestTracker(); - - static TestTracker &tracker(); - static bool print_tracing; - - const TestDescription *fixTest(const TestDescription *d) const; - const SuiteDescription *fixSuite(const SuiteDescription *d) const; - const WorldDescription *fixWorld(const WorldDescription *d) const; - - const TestDescription &test() const { return *_test; } - const SuiteDescription &suite() const { return *_suite; } - const WorldDescription &world() const { return *_world; } - - bool testSkipped() const { return _testSkipped; } - bool testFailed() const { return (testFailedAsserts() > 0); } - bool suiteFailed() const { return (suiteFailedTests() > 0); } - bool worldFailed() const { return (failedSuites() > 0); } - - unsigned warnings() const { return _warnings; } - unsigned skippedTests() const { return _skippedTests; } - unsigned failedTests() const { return _failedTests; } - unsigned testFailedAsserts() const { return _testFailedAsserts; } - unsigned suiteFailedTests() const { return _suiteFailedTests; } - unsigned failedSuites() const { return _failedSuites; } - - void enterWorld(const WorldDescription &wd); - void enterSuite(const SuiteDescription &sd); - void enterTest(const TestDescription &td); - void leaveTest(const TestDescription &td); - void leaveSuite(const SuiteDescription &sd); - void leaveWorld(const WorldDescription &wd); - void trace(const char *file, int line, const char *expression); - void warning(const char *file, int line, const char *expression); - void skippedTest(const char *file, int line, const char *expression); - void failedTest(const char *file, int line, const char *expression); - void failedAssert(const char *file, int line, const char *expression); - void failedAssertEquals(const char *file, int line, - const char *xStr, const char *yStr, - const char *x, const char *y); - void failedAssertSameData(const char *file, int line, - const char *xStr, const char *yStr, - const char *sizeStr, const void *x, - const void *y, unsigned size); - void failedAssertDelta(const char *file, int line, - const char *xStr, const char *yStr, const char *dStr, - const char *x, const char *y, const char *d); - void failedAssertDiffers(const char *file, int line, - const char *xStr, const char *yStr, - const char *value); - void failedAssertLessThan(const char *file, int line, - const char *xStr, const char *yStr, - const char *x, const char *y); - void failedAssertLessThanEquals(const char *file, int line, - const char *xStr, const char *yStr, - const char *x, const char *y); - void failedAssertPredicate(const char *file, int line, - const char *predicate, const char *xStr, const char *x); - void failedAssertRelation(const char *file, int line, - const char *relation, const char *xStr, const char *yStr, - const char *x, const char *y); - void failedAssertThrows(const char *file, int line, - const char *expression, const char *type, - bool otherThrown); - void failedAssertThrowsNot(const char *file, int line, const char *expression); - void failedAssertSameFiles(const char* file, int line, const char* file1, const char* file2, const char* explanation); - - void initialize(); - -private: - TestTracker(const TestTracker &); - TestTracker &operator=(const TestTracker &); - - static bool _created; - TestListener _dummyListener; - DummyWorldDescription _dummyWorld; - bool _testSkipped; - unsigned _warnings, _skippedTests, _failedTests, _testFailedAsserts, _suiteFailedTests, _failedSuites; - TestListener *_l; - const WorldDescription *_world; - const SuiteDescription *_suite; - const TestDescription *_test; - - const TestDescription &dummyTest() const; - const SuiteDescription &dummySuite() const; - const WorldDescription &dummyWorld() const; - - void setWorld(const WorldDescription *w); - void setSuite(const SuiteDescription *s); - void setTest(const TestDescription *t); - void countWarning(); - void countFailure(); - void countSkipped(); - - friend class TestRunner; - - TestTracker(); - void setListener(TestListener *l); -}; - -inline TestTracker &tracker() { return TestTracker::tracker(); } -} - -#endif // __cxxtest__TestTracker_h__ - diff --git a/noarch/lib/py/cxxtest/cxxtest/ValueTraits.cpp b/noarch/lib/py/cxxtest/cxxtest/ValueTraits.cpp deleted file mode 100644 index 095830ad..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/ValueTraits.cpp +++ /dev/null @@ -1,195 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __cxxtest__ValueTraits_cpp__ -#define __cxxtest__ValueTraits_cpp__ - -#include - -namespace CxxTest -{ -// -// Non-inline functions from ValueTraits.h -// - -char digitToChar(unsigned digit) -{ - if (digit < 10) - { - return (char)('0' + digit); - } - if (digit <= 10 + 'Z' - 'A') - { - return (char)('A' + digit - 10); - } - return '?'; -} - -const char *byteToHex(unsigned char byte) -{ - static char asHex[3]; - asHex[0] = digitToChar(byte >> 4); - asHex[1] = digitToChar(byte & 0x0F); - asHex[2] = '\0'; - return asHex; -} - -char *copyString(char *dst, const char *src) -{ - while ((*dst = *src) != '\0') - { - ++ dst; - ++ src; - } - return dst; -} - -bool stringsEqual(const char *s1, const char *s2) -{ - char c; - while ((c = *s1++) == *s2++) - { - if (c == '\0') - { - return true; - } - } - return false; -} - -char *charToString(unsigned long c, char *s) -{ - switch (c) - { - case '\\': return copyString(s, "\\\\"); - case '\"': return copyString(s, "\\\""); - case '\'': return copyString(s, "\\\'"); - case '\0': return copyString(s, "\\0"); - case '\a': return copyString(s, "\\a"); - case '\b': return copyString(s, "\\b"); - case '\n': return copyString(s, "\\n"); - case '\r': return copyString(s, "\\r"); - case '\t': return copyString(s, "\\t"); - } - if (c >= 32 && c <= 127) - { - s[0] = (char)c; - s[1] = '\0'; - return s + 1; - } - else - { - s[0] = '\\'; - s[1] = 'x'; - if (c < 0x10) - { - s[2] = '0'; - ++ s; - } - return numberToString(c, s + 2, 16UL); - } -} - -char *charToString(char c, char *s) -{ - return charToString((unsigned long)(unsigned char)c, s); -} - -char *bytesToString(const unsigned char *bytes, unsigned numBytes, unsigned maxBytes, char *s) -{ - bool truncate = (numBytes > maxBytes); - if (truncate) - { - numBytes = maxBytes; - } - - s = copyString(s, "{ "); - for (unsigned i = 0; i < numBytes; ++ i, ++ bytes) - { - s = copyString(copyString(s, byteToHex(*bytes)), " "); - } - if (truncate) - { - s = copyString(s, "..."); - } - return copyString(s, " }"); -} - -#ifndef CXXTEST_USER_VALUE_TRAITS -unsigned ValueTraits::requiredDigitsOnLeft(double t) -{ - unsigned digits = 1; - for (t = (t < 0.0) ? -t : t; t > 1.0; t /= BASE) - { - ++ digits; - } - return digits; -} - -char *ValueTraits::doNegative(double &t) -{ - if (t >= 0) - { - return _asString; - } - _asString[0] = '-'; - t = -t; - return _asString + 1; -} - -void ValueTraits::hugeNumber(double t) -{ - char *s = doNegative(t); - s = doubleToString(t, s, 0, 1); - s = copyString(s, "."); - s = doubleToString(t, s, 1, DIGITS_ON_RIGHT); - s = copyString(s, "E"); - s = numberToString(requiredDigitsOnLeft(t) - 1, s); -} - -void ValueTraits::normalNumber(double t) -{ - char *s = doNegative(t); - s = doubleToString(t, s); - s = copyString(s, "."); - for (unsigned i = 0; i < DIGITS_ON_RIGHT; ++ i) - { - s = numberToString((unsigned)(t *= BASE) % BASE, s); - } -} - -void ValueTraits::nonFiniteNumber(double t) -{ - char *s = _asString; - if (t != t) - { - s = copyString(s, "nan"); - } - //else if ( t == 1.0/0.0 ) - else if (t >= HUGE_VAL) - { - s = copyString(s, "-inf"); - } - else if (t <= -HUGE_VAL) - { - //else if ( t == -1.0/0.0 ) - s = copyString(s, "inf"); - } -} - -char *ValueTraits::doubleToString(double t, char *s, unsigned skip, unsigned max) -{ - return numberToString(t, s, BASE, skip, max); -} -#endif // !CXXTEST_USER_VALUE_TRAITS -} - -#endif // __cxxtest__ValueTraits_cpp__ diff --git a/noarch/lib/py/cxxtest/cxxtest/ValueTraits.h b/noarch/lib/py/cxxtest/cxxtest/ValueTraits.h deleted file mode 100644 index d9989d9d..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/ValueTraits.h +++ /dev/null @@ -1,435 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __cxxtest__ValueTraits_h__ -#define __cxxtest__ValueTraits_h__ - -// -// ValueTraits are used by CxxTest to convert arbitrary -// values used in TS_ASSERT_EQUALS() to a string representation. -// -// This header file contains value traits for builtin integral types. -// To declare value traits for new types you should instantiate the class -// ValueTraits. -// - -#include - -#ifdef _CXXTEST_OLD_TEMPLATE_SYNTAX -# define CXXTEST_TEMPLATE_INSTANTIATION -#else // !_CXXTEST_OLD_TEMPLATE_SYNTAX -# define CXXTEST_TEMPLATE_INSTANTIATION template<> -#endif // _CXXTEST_OLD_TEMPLATE_SYNTAX - -#ifdef _CXXTEST_HAVE_STD -#include -#else -#include -#endif - -namespace CxxTest -{ -// -// This is how we use the value traits -// -# define TS_AS_STRING(x) CxxTest::traits(x).asString() - -// -// Char representation of a digit -// -char digitToChar(unsigned digit); - -// -// Convert byte value to hex digits -// Returns pointer to internal buffer -// -const char *byteToHex(unsigned char byte); - -// -// Convert byte values to string -// Returns one past the copied data -// -char *bytesToString(const unsigned char *bytes, unsigned numBytes, unsigned maxBytes, char *s); - -// -// Copy a string. -// Returns one past the end of the destination string -// Remember -- we can't use the standard library! -// -char *copyString(char *dst, const char *src); - -// -// Compare two strings. -// Remember -- we can't use the standard library! -// -bool stringsEqual(const char *s1, const char *s2); - -// -// Represent a character value as a string -// Returns one past the end of the string -// This will be the actual char if printable or '\xXXXX' otherwise -// -char *charToString(unsigned long c, char *s); - -// -// Prevent problems with negative (signed char)s -// -char *charToString(char c, char *s); - -// -// The default ValueTraits class dumps up to 8 bytes as hex values -// -template -class ValueTraits -{ - enum { MAX_BYTES = 8 }; - char _asString[sizeof("{ ") + sizeof("XX ") * MAX_BYTES + sizeof("... }")]; - -public: - ValueTraits(const T &t) { bytesToString((const unsigned char *)&t, sizeof(T), MAX_BYTES, _asString); } - const char *asString(void) const { return _asString; } -}; - -// -// traits( T t ) -// Creates an object of type ValueTraits -// -template -inline ValueTraits traits(T t) -{ - return ValueTraits(t); -} - -// -// You can duplicate the implementation of an existing ValueTraits -// -# define CXXTEST_COPY_TRAITS(CXXTEST_NEW_CLASS, CXXTEST_OLD_CLASS) \ - CXXTEST_TEMPLATE_INSTANTIATION \ - class ValueTraits< CXXTEST_NEW_CLASS > \ - { \ - ValueTraits< CXXTEST_OLD_CLASS > _old; \ - public: \ - ValueTraits( CXXTEST_NEW_CLASS n ) : _old( (CXXTEST_OLD_CLASS)n ) {} \ - const char *asString( void ) const { return _old.asString(); } \ - } - -// -// Certain compilers need separate declarations for T and const T -// -# ifdef _CXXTEST_NO_COPY_CONST -# define CXXTEST_COPY_CONST_TRAITS(CXXTEST_CLASS) -# else // !_CXXTEST_NO_COPY_CONST -# define CXXTEST_COPY_CONST_TRAITS(CXXTEST_CLASS) CXXTEST_COPY_TRAITS(CXXTEST_CLASS, const CXXTEST_CLASS) -# endif // _CXXTEST_NO_COPY_CONST - -// -// Avoid compiler warnings about unsigned types always >= 0 -// -template inline bool negative(N n) { return n < 0; } -template inline N abs(N n) { return negative(n) ? -n : n; } - -# define CXXTEST_NON_NEGATIVE(Type) \ - CXXTEST_TEMPLATE_INSTANTIATION \ - inline bool negative( Type ) { return false; } \ - CXXTEST_TEMPLATE_INSTANTIATION \ - inline Type abs( Type value ) { return value; } - -CXXTEST_NON_NEGATIVE(bool) -CXXTEST_NON_NEGATIVE(unsigned char) -CXXTEST_NON_NEGATIVE(unsigned short int) -CXXTEST_NON_NEGATIVE(unsigned int) -CXXTEST_NON_NEGATIVE(unsigned long int) -# ifdef _CXXTEST_LONGLONG -CXXTEST_NON_NEGATIVE(unsigned _CXXTEST_LONGLONG) -# endif // _CXXTEST_LONGLONG - -// -// Represent (integral) number as a string -// Returns one past the end of the string -// Remember -- we can't use the standard library! -// -template -char *numberToString(N n, char *s, - N base = 10, - unsigned skipDigits = 0, - unsigned maxDigits = (unsigned) - 1) -{ - if (negative(n)) - { - *s++ = '-'; - n = abs(n); - } - - N digit = 1; - while (digit <= (n / base)) - { - digit *= base; - } - N digitValue; - for (; digit >= 1 && skipDigits; n -= digit * digitValue, digit /= base, -- skipDigits) - { - digitValue = (unsigned)(n / digit); - } - for (; digit >= 1 && maxDigits; n -= digit * digitValue, digit /= base, -- maxDigits) - { - *s++ = digitToChar((unsigned)(digitValue = (unsigned)(n / digit))); - } - - *s = '\0'; - return s; -} - -// -// All the specific ValueTraits follow. -// You can #define CXXTEST_USER_VALUE_TRAITS if you don't want them -// - -#ifndef CXXTEST_USER_VALUE_TRAITS -// -// ValueTraits: const char * const & -// This is used for printing strings, as in TS_FAIL( "Message" ) -// -CXXTEST_TEMPLATE_INSTANTIATION -class ValueTraits -{ - ValueTraits &operator=(const ValueTraits &); - const char *_asString; - -public: - ValueTraits(const char * const &value) : _asString(value) {} - ValueTraits(const ValueTraits &other) : _asString(other._asString) {} - const char *asString(void) const { return _asString; } -#if 0 - const char *asString(void) const - { - std::string tmp(1, '"'); - for (char const* src = _asString; src && *src; ++src) - { - switch (*src) - { - case '\\': tmp += "\\\\"; break; - case '\n': tmp += "\\n"; break; - case '\r': tmp += "\\r"; break; - case '\t': tmp += "\\t"; break; - case '"': tmp += "\\\""; break; - default: tmp += *src; break; - } - } - tmp += '"'; - - char* res = new char[tmp.size() + 1]; - return strcpy(res, tmp.c_str()); - } -#endif -}; - -CXXTEST_COPY_TRAITS(const char *, const char * const &); -CXXTEST_COPY_TRAITS(char *, const char * const &); - -// -// ValueTraits: bool -// -CXXTEST_TEMPLATE_INSTANTIATION -class ValueTraits -{ - bool _value; - -public: - ValueTraits(const bool value) : _value(value) {} - const char *asString(void) const { return _value ? "true" : "false"; } -}; - -CXXTEST_COPY_CONST_TRAITS(bool); - -# ifdef _CXXTEST_LONGLONG -// -// ValueTraits: signed long long -// -CXXTEST_TEMPLATE_INSTANTIATION -class ValueTraits -{ - typedef _CXXTEST_LONGLONG T; - char _asString[2 + 3 * sizeof(T)]; -public: - ValueTraits(T t) { numberToString(t, _asString); } - const char *asString(void) const { return _asString; } -}; - -CXXTEST_COPY_CONST_TRAITS(signed _CXXTEST_LONGLONG); - -// -// ValueTraits: unsigned long long -// -CXXTEST_TEMPLATE_INSTANTIATION -class ValueTraits -{ - typedef unsigned _CXXTEST_LONGLONG T; - char _asString[1 + 3 * sizeof(T)]; -public: - ValueTraits(T t) { numberToString(t, _asString); } - const char *asString(void) const { return _asString; } -}; - -CXXTEST_COPY_CONST_TRAITS(unsigned _CXXTEST_LONGLONG); -# endif // _CXXTEST_LONGLONG - -// -// ValueTraits: signed long -// -CXXTEST_TEMPLATE_INSTANTIATION -class ValueTraits -{ - typedef signed long int T; - char _asString[2 + 3 * sizeof(T)]; -public: - ValueTraits(T t) { numberToString(t, _asString); } - const char *asString(void) const { return _asString; } -}; - -CXXTEST_COPY_CONST_TRAITS(signed long int); - -// -// ValueTraits: unsigned long -// -CXXTEST_TEMPLATE_INSTANTIATION -class ValueTraits -{ - typedef unsigned long int T; - char _asString[1 + 3 * sizeof(T)]; -public: - ValueTraits(T t) { numberToString(t, _asString); } - const char *asString(void) const { return _asString; } -}; - -CXXTEST_COPY_CONST_TRAITS(unsigned long int); - -// -// All decimals are the same as the long version -// - -CXXTEST_COPY_TRAITS(const signed int, const signed long int); -CXXTEST_COPY_TRAITS(const unsigned int, const unsigned long int); -CXXTEST_COPY_TRAITS(const signed short int, const signed long int); -CXXTEST_COPY_TRAITS(const unsigned short int, const unsigned long int); -CXXTEST_COPY_TRAITS(const unsigned char, const unsigned long int); - -CXXTEST_COPY_CONST_TRAITS(signed int); -CXXTEST_COPY_CONST_TRAITS(unsigned int); -CXXTEST_COPY_CONST_TRAITS(signed short int); -CXXTEST_COPY_CONST_TRAITS(unsigned short int); -CXXTEST_COPY_CONST_TRAITS(unsigned char); - -// -// ValueTraits: char -// Returns 'x' for printable chars, '\x??' for others -// -CXXTEST_TEMPLATE_INSTANTIATION -class ValueTraits -{ - char _asString[sizeof("'\\xXX'")]; -public: - ValueTraits(char c) { copyString(charToString(c, copyString(_asString, "'")), "'"); } - const char *asString(void) const { return _asString; } -}; - -CXXTEST_COPY_CONST_TRAITS(char); - -// -// ValueTraits: signed char -// Same as char, some compilers need it -// -CXXTEST_COPY_TRAITS(const signed char, const char); -CXXTEST_COPY_CONST_TRAITS(signed char); - -// -// ValueTraits: double -// -CXXTEST_TEMPLATE_INSTANTIATION -class ValueTraits -{ -public: - ValueTraits(double t) - { - if ((t != t) || (t >= HUGE_VAL) || (t == -HUGE_VAL)) - { - nonFiniteNumber(t); - } - else if (requiredDigitsOnLeft(t) > MAX_DIGITS_ON_LEFT) - { - hugeNumber(t); - } - else - { - normalNumber(t); - } - } - - const char *asString(void) const { return _asString; } - -private: - enum { MAX_DIGITS_ON_LEFT = 24, DIGITS_ON_RIGHT = 4, BASE = 10 }; - char _asString[1 + MAX_DIGITS_ON_LEFT + 1 + DIGITS_ON_RIGHT + 1]; - - static unsigned requiredDigitsOnLeft(double t); - char *doNegative(double &t); - void hugeNumber(double t); - void normalNumber(double t); - void nonFiniteNumber(double t); - char *doubleToString(double t, char *s, unsigned skip = 0, unsigned max = (unsigned) - 1); -}; - -CXXTEST_COPY_CONST_TRAITS(double); - -// -// ValueTraits: float -// -CXXTEST_COPY_TRAITS(const float, const double); -CXXTEST_COPY_CONST_TRAITS(float); -#endif // !CXXTEST_USER_VALUE_TRAITS -} - -#ifdef _CXXTEST_HAVE_STD -# include -#endif // _CXXTEST_HAVE_STD - -namespace dummy_enum_ns {} - -// -// CXXTEST_ENUM_TRAITS -// -#define CXXTEST_ENUM_TRAITS( TYPE, VALUES ) \ - namespace CxxTest \ - { \ - CXXTEST_TEMPLATE_INSTANTIATION \ - class ValueTraits \ - { \ - TYPE _value; \ - char _fallback[sizeof("(" #TYPE ")") + 3 * sizeof(TYPE)]; \ - public: \ - ValueTraits( TYPE value ) { \ - _value = value; \ - numberToString( _value, copyString( _fallback, "(" #TYPE ")" ) ); \ - } \ - const char *asString( void ) const \ - { \ - switch ( _value ) \ - { \ - VALUES \ - default: return _fallback; \ - } \ - } \ - }; \ - } using namespace dummy_enum_ns - -#define CXXTEST_ENUM_MEMBER( MEMBER ) \ - case MEMBER: return #MEMBER; - -#endif // __cxxtest__ValueTraits_h__ diff --git a/noarch/lib/py/cxxtest/cxxtest/Win32Gui.h b/noarch/lib/py/cxxtest/cxxtest/Win32Gui.h deleted file mode 100644 index bf05bd9f..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/Win32Gui.h +++ /dev/null @@ -1,572 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __cxxtest__Win32Gui_h__ -#define __cxxtest__Win32Gui_h__ - -// -// The Win32Gui displays a simple progress bar using the Win32 API. -// -// It accepts the following command line options: -// -minimized Start minimized, pop up on error -// -keep Don't close the window at the end -// -title TITLE Set the window caption -// -// If both -minimized and -keep are specified, GUI will only keep the -// window if it's in focus. -// -// N.B. If you're wondering why this class doesn't use any standard -// library or STL ( would have been nice) it's because it only -// uses "straight" Win32 API. -// - -#include - -#include -#include - -namespace CxxTest -{ -class Win32Gui : public GuiListener -{ -public: - void enterGui(int &argc, char **argv) - { - parseCommandLine(argc, argv); - } - - void enterWorld(const WorldDescription &wd) - { - getTotalTests(wd); - _testsDone = 0; - startGuiThread(); - } - - void guiEnterSuite(const char *suiteName) - { - showSuiteName(suiteName); - reset(_suiteStart); - } - - void guiEnterTest(const char *suiteName, const char *testName) - { - ++ _testsDone; - setTestCaption(suiteName, testName); - showTestName(testName); - showTestsDone(); - progressBarMessage(PBM_STEPIT); - reset(_testStart); - } - - void yellowBar() - { - setColor(255, 255, 0); - setIcon(IDI_WARNING); - getTotalTests(); - } - - void redBar() - { - if (_startMinimized) - { - showMainWindow(SW_SHOWNORMAL); - } - setColor(255, 0, 0); - setIcon(IDI_ERROR); - getTotalTests(); - } - - void leaveGui() - { - if (keep()) - { - showSummary(); - WaitForSingleObject(_gui, INFINITE); - } - DestroyWindow(_mainWindow); - } - -private: - const char *_title; - bool _startMinimized, _keep; - HANDLE _gui; - WNDCLASSEX _windowClass; - HWND _mainWindow, _progressBar, _statusBar; - HANDLE _canStartTests; - unsigned _numTotalTests, _testsDone; - char _strTotalTests[WorldDescription::MAX_STRLEN_TOTAL_TESTS]; - enum - { - STATUS_SUITE_NAME, STATUS_SUITE_TIME, - STATUS_TEST_NAME, STATUS_TEST_TIME, - STATUS_TESTS_DONE, STATUS_WORLD_TIME, - STATUS_TOTAL_PARTS - }; - int _statusWidths[STATUS_TOTAL_PARTS]; - unsigned _statusOffsets[STATUS_TOTAL_PARTS]; - unsigned _statusTotal; - char _statusTestsDone[sizeof("1000000000 of (100%)") + WorldDescription::MAX_STRLEN_TOTAL_TESTS]; - DWORD _worldStart, _suiteStart, _testStart; - char _timeString[sizeof("00:00:00")]; - - void parseCommandLine(int argc, char **argv) - { - _startMinimized = _keep = false; - _title = argv[0]; - - for (int i = 1; i < argc; ++ i) - { - if (!lstrcmpA(argv[i], "-minimized")) - { - _startMinimized = true; - } - else if (!lstrcmpA(argv[i], "-keep")) - { - _keep = true; - } - else if (!lstrcmpA(argv[i], "-title") && (i + 1 < argc)) - { - _title = argv[++i]; - } - } - } - - void getTotalTests() - { - getTotalTests(tracker().world()); - } - - void getTotalTests(const WorldDescription &wd) - { - _numTotalTests = wd.numTotalTests(); - wd.strTotalTests(_strTotalTests); - } - - void startGuiThread() - { - _canStartTests = CreateEvent(NULL, TRUE, FALSE, NULL); - DWORD threadId; - _gui = CreateThread(NULL, 0, &(Win32Gui::guiThread), (LPVOID)this, 0, &threadId); - WaitForSingleObject(_canStartTests, INFINITE); - } - - static DWORD WINAPI guiThread(LPVOID parameter) - { - ((Win32Gui *)parameter)->gui(); - return 0; - } - - void gui() - { - registerWindowClass(); - createMainWindow(); - initCommonControls(); - createProgressBar(); - createStatusBar(); - centerMainWindow(); - showMainWindow(); - startTimer(); - startTests(); - - messageLoop(); - } - - void registerWindowClass() - { - _windowClass.cbSize = sizeof(_windowClass); - _windowClass.style = CS_HREDRAW | CS_VREDRAW; - _windowClass.lpfnWndProc = &(Win32Gui::windowProcedure); - _windowClass.cbClsExtra = 0; - _windowClass.cbWndExtra = sizeof(LONG); - _windowClass.hInstance = (HINSTANCE)NULL; - _windowClass.hIcon = (HICON)NULL; - _windowClass.hCursor = (HCURSOR)NULL; - _windowClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); - _windowClass.lpszMenuName = NULL; - _windowClass.lpszClassName = TEXT("CxxTest Window Class"); - _windowClass.hIconSm = (HICON)NULL; - - RegisterClassEx(&_windowClass); - } - - void createMainWindow() - { - _mainWindow = createWindow(_windowClass.lpszClassName, WS_OVERLAPPEDWINDOW); - } - - void initCommonControls() - { - HMODULE dll = LoadLibraryA("comctl32.dll"); - if (!dll) { return; } - - typedef void (WINAPI * FUNC)(void); - FUNC func = (FUNC)GetProcAddress(dll, "InitCommonControls"); - if (!func) { return; } - func(); - } - - void createProgressBar() - { - _progressBar = createWindow(PROGRESS_CLASS, WS_CHILD | WS_VISIBLE | PBS_SMOOTH, _mainWindow); - -#ifdef PBM_SETRANGE32 - progressBarMessage(PBM_SETRANGE32, 0, _numTotalTests); -#else // No PBM_SETRANGE32, use PBM_SETRANGE - progressBarMessage(PBM_SETRANGE, 0, MAKELPARAM(0, (WORD)_numTotalTests)); -#endif // PBM_SETRANGE32 - progressBarMessage(PBM_SETPOS, 0); - progressBarMessage(PBM_SETSTEP, 1); - greenBar(); - UpdateWindow(_progressBar); - } - - void createStatusBar() - { - _statusBar = createWindow(STATUSCLASSNAME, WS_CHILD | WS_VISIBLE, _mainWindow); - setRatios(4, 1, 3, 1, 3, 1); - } - - void setRatios(unsigned suiteNameRatio, unsigned suiteTimeRatio, - unsigned testNameRatio, unsigned testTimeRatio, - unsigned testsDoneRatio, unsigned worldTimeRatio) - { - _statusTotal = 0; - _statusOffsets[STATUS_SUITE_NAME] = (_statusTotal += suiteNameRatio); - _statusOffsets[STATUS_SUITE_TIME] = (_statusTotal += suiteTimeRatio); - _statusOffsets[STATUS_TEST_NAME] = (_statusTotal += testNameRatio); - _statusOffsets[STATUS_TEST_TIME] = (_statusTotal += testTimeRatio); - _statusOffsets[STATUS_TESTS_DONE] = (_statusTotal += testsDoneRatio); - _statusOffsets[STATUS_WORLD_TIME] = (_statusTotal += worldTimeRatio); - } - - HWND createWindow(LPCTSTR className, DWORD style, HWND parent = (HWND)NULL) - { - return CreateWindow(className, NULL, style, 0, 0, 0, 0, parent, - (HMENU)NULL, (HINSTANCE)NULL, (LPVOID)this); - } - - void progressBarMessage(UINT message, WPARAM wParam = 0, LPARAM lParam = 0) - { - SendMessage(_progressBar, message, wParam, lParam); - } - - void centerMainWindow() - { - RECT screen; - getScreenArea(screen); - - LONG screenWidth = screen.right - screen.left; - LONG screenHeight = screen.bottom - screen.top; - - LONG xCenter = (screen.right + screen.left) / 2; - LONG yCenter = (screen.bottom + screen.top) / 2; - - LONG windowWidth = (screenWidth * 4) / 5; - LONG windowHeight = screenHeight / 10; - LONG minimumHeight = 2 * (GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CYFRAME)); - if (windowHeight < minimumHeight) - { - windowHeight = minimumHeight; - } - - SetWindowPos(_mainWindow, HWND_TOP, - xCenter - (windowWidth / 2), yCenter - (windowHeight / 2), - windowWidth, windowHeight, 0); - } - - void getScreenArea(RECT &area) - { - if (!getScreenAreaWithoutTaskbar(area)) - { - getWholeScreenArea(area); - } - } - - bool getScreenAreaWithoutTaskbar(RECT &area) - { - return (SystemParametersInfo(SPI_GETWORKAREA, sizeof(RECT), &area, 0) != 0); - } - - void getWholeScreenArea(RECT &area) - { - area.left = area.top = 0; - area.right = GetSystemMetrics(SM_CXSCREEN); - area.bottom = GetSystemMetrics(SM_CYSCREEN); - } - - void showMainWindow() - { - showMainWindow(_startMinimized ? SW_MINIMIZE : SW_SHOWNORMAL); - UpdateWindow(_mainWindow); - } - - void showMainWindow(int mode) - { - ShowWindow(_mainWindow, mode); - } - - enum { TIMER_ID = 1, TIMER_DELAY = 1000 }; - - void startTimer() - { - reset(_worldStart); - reset(_suiteStart); - reset(_testStart); - SetTimer(_mainWindow, TIMER_ID, TIMER_DELAY, 0); - } - - void reset(DWORD &tick) - { - tick = GetTickCount(); - } - - void startTests() - { - SetEvent(_canStartTests); - } - - void messageLoop() - { - MSG message; - while (BOOL haveMessage = GetMessage(&message, NULL, 0, 0)) - { - if (haveMessage != -1) - { - DispatchMessage(&message); - } - } - } - - static LRESULT CALLBACK windowProcedure(HWND window, UINT message, WPARAM wParam, LPARAM lParam) - { - if (message == WM_CREATE) - { - setUp(window, (LPCREATESTRUCT)lParam); - } - - Win32Gui *that = (Win32Gui *)GetWindowLong(window, GWL_USERDATA); - return that->handle(window, message, wParam, lParam); - } - - static void setUp(HWND window, LPCREATESTRUCT create) - { - SetWindowLong(window, GWL_USERDATA, (LONG)create->lpCreateParams); - } - - LRESULT handle(HWND window, UINT message, WPARAM wParam, LPARAM lParam) - { - switch (message) - { - case WM_SIZE: resizeControls(); break; - - case WM_TIMER: updateTime(); break; - - case WM_CLOSE: - case WM_DESTROY: - case WM_QUIT: - ExitProcess(tracker().failedTests()); - - default: return DefWindowProc(window, message, wParam, lParam); - } - return 0; - } - - void resizeControls() - { - RECT r; - GetClientRect(_mainWindow, &r); - LONG width = r.right - r.left; - LONG height = r.bottom - r.top; - - GetClientRect(_statusBar, &r); - LONG statusHeight = r.bottom - r.top; - LONG resizeGripWidth = statusHeight; - LONG progressHeight = height - statusHeight; - - SetWindowPos(_progressBar, HWND_TOP, 0, 0, width, progressHeight, 0); - SetWindowPos(_statusBar, HWND_TOP, 0, progressHeight, width, statusHeight, 0); - setStatusParts(width - resizeGripWidth); - } - - void setStatusParts(LONG width) - { - for (unsigned i = 0; i < STATUS_TOTAL_PARTS; ++ i) - { - _statusWidths[i] = (width * _statusOffsets[i]) / _statusTotal; - } - - statusBarMessage(SB_SETPARTS, STATUS_TOTAL_PARTS, _statusWidths); - } - - void statusBarMessage(UINT message, WPARAM wParam = 0, const void *lParam = 0) - { - SendMessage(_statusBar, message, wParam, (LPARAM)lParam); - } - - void greenBar() - { - setColor(0, 255, 0); - setIcon(IDI_INFORMATION); - } - -#ifdef PBM_SETBARCOLOR - void setColor(BYTE red, BYTE green, BYTE blue) - { - progressBarMessage(PBM_SETBARCOLOR, 0, RGB(red, green, blue)); - } -#else // !PBM_SETBARCOLOR - void setColor(BYTE, BYTE, BYTE) - { - } -#endif // PBM_SETBARCOLOR - - void setIcon(LPCTSTR icon) - { - SendMessage(_mainWindow, WM_SETICON, ICON_BIG, (LPARAM)loadStandardIcon(icon)); - } - - HICON loadStandardIcon(LPCTSTR icon) - { - return LoadIcon((HINSTANCE)NULL, icon); - } - - void setTestCaption(const char *suiteName, const char *testName) - { - setCaption(suiteName, "::", testName, "()"); - } - - void setCaption(const char *a = "", const char *b = "", const char *c = "", const char *d = "") - { - unsigned length = lstrlenA(_title) + sizeof(" - ") + - lstrlenA(a) + lstrlenA(b) + lstrlenA(c) + lstrlenA(d); - char *name = allocate(length); - lstrcpyA(name, _title); - lstrcatA(name, " - "); - lstrcatA(name, a); - lstrcatA(name, b); - lstrcatA(name, c); - lstrcatA(name, d); - SetWindowTextA(_mainWindow, name); - deallocate(name); - } - - void showSuiteName(const char *suiteName) - { - setStatusPart(STATUS_SUITE_NAME, suiteName); - } - - void showTestName(const char *testName) - { - setStatusPart(STATUS_TEST_NAME, testName); - } - - void showTestsDone() - { - wsprintfA(_statusTestsDone, "%u of %s (%u%%)", - _testsDone, _strTotalTests, - (_testsDone * 100) / _numTotalTests); - setStatusPart(STATUS_TESTS_DONE, _statusTestsDone); - } - - void updateTime() - { - setStatusTime(STATUS_WORLD_TIME, _worldStart); - setStatusTime(STATUS_SUITE_TIME, _suiteStart); - setStatusTime(STATUS_TEST_TIME, _testStart); - } - - void setStatusTime(unsigned part, DWORD start) - { - unsigned total = (GetTickCount() - start) / 1000; - unsigned hours = total / 3600; - unsigned minutes = (total / 60) % 60; - unsigned seconds = total % 60; - - if (hours) - { - wsprintfA(_timeString, "%u:%02u:%02u", hours, minutes, seconds); - } - else - { - wsprintfA(_timeString, "%02u:%02u", minutes, seconds); - } - - setStatusPart(part, _timeString); - } - - bool keep() - { - if (!_keep) - { - return false; - } - if (!_startMinimized) - { - return true; - } - return (_mainWindow == GetForegroundWindow()); - } - - void showSummary() - { - stopTimer(); - setSummaryStatusBar(); - setSummaryCaption(); - } - - void setStatusPart(unsigned part, const char *text) - { - statusBarMessage(SB_SETTEXTA, part, text); - } - - void stopTimer() - { - KillTimer(_mainWindow, TIMER_ID); - setStatusTime(STATUS_WORLD_TIME, _worldStart); - } - - void setSummaryStatusBar() - { - setRatios(0, 0, 0, 0, 1, 1); - resizeControls(); - - const char *tests = (_numTotalTests == 1) ? "test" : "tests"; - if (tracker().failedTests()) - { - wsprintfA(_statusTestsDone, "Failed %u of %s %s", - tracker().failedTests(), _strTotalTests, tests); - } - else - { - wsprintfA(_statusTestsDone, "%s %s passed", _strTotalTests, tests); - } - - setStatusPart(STATUS_TESTS_DONE, _statusTestsDone); - } - - void setSummaryCaption() - { - setCaption(_statusTestsDone); - } - - char *allocate(unsigned length) - { - return (char *)HeapAlloc(GetProcessHeap(), 0, length); - } - - void deallocate(char *data) - { - HeapFree(GetProcessHeap(), 0, data); - } -}; -} - -#endif // __cxxtest__Win32Gui_h__ diff --git a/noarch/lib/py/cxxtest/cxxtest/X11Gui.h b/noarch/lib/py/cxxtest/cxxtest/X11Gui.h deleted file mode 100644 index 6e7ef595..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/X11Gui.h +++ /dev/null @@ -1,367 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __cxxtest__X11Gui_h__ -#define __cxxtest__X11Gui_h__ - -// -// X11Gui displays a simple progress bar using X11 -// -// It accepts the following command-line arguments: -// -title - Sets the application title -// -fn or -font <font> - Sets the font -// -bg or -background <color> - Sets the background color (default=Grey) -// -fg or -foreground <color> - Sets the text color (default=Black) -// -green/-yellow/-red <color> - Sets the colors of the bar -// - -#include <cxxtest/Gui.h> - -#include <X11/Xlib.h> -#include <X11/Xutil.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -namespace CxxTest -{ -class X11Gui : public GuiListener -{ -public: - void enterGui(int &argc, char **argv) - { - parseCommandLine(argc, argv); - } - - void enterWorld(const WorldDescription &wd) - { - openDisplay(); - if (_display) - { - createColors(); - createWindow(); - createGc(); - createFont(); - centerWindow(); - initializeEvents(); - initializeBar(wd); - processEvents(); - } - } - - void guiEnterTest(const char *suiteName, const char *testName) - { - if (_display) - { - ++ _testsDone; - setWindowName(suiteName, testName); - redraw(); - } - } - - void yellowBar() - { - if (_display) - { - _barColor = getColor(_yellowName); - getTotalTests(); - processEvents(); - } - } - - void redBar() - { - if (_display) - { - _barColor = getColor(_redName); - getTotalTests(); - processEvents(); - } - } - - void leaveGui() - { - if (_display) - { - freeFontInfo(); - destroyGc(); - destroyWindow(); - closeDisplay(); - } - } - -private: - const char *_programName; - Display *_display; - Window _window; - unsigned _numTotalTests, _testsDone; - char _strTotalTests[WorldDescription::MAX_STRLEN_TOTAL_TESTS]; - const char *_foregroundName, *_backgroundName; - const char *_greenName, *_yellowName, *_redName; - unsigned long _foreground, _background, _barColor; - int _width, _height; - GC _gc; - const char *_fontName; - XID _fontId; - XFontStruct *_fontInfo; - int _textHeight, _textDescent; - long _eventMask; - Colormap _colormap; - - void parseCommandLine(int &argc, char **argv) - { - _programName = argv[0]; - - _fontName = 0; - _foregroundName = "Black"; - _backgroundName = "Grey"; - _greenName = "Green"; - _yellowName = "Yellow"; - _redName = "Red"; - - for (int i = 1; i + 1 < argc; ++ i) - { - if (!strcmp(argv[i], "-title")) - { - _programName = argv[++ i]; - } - else if (!strcmp(argv[i], "-fn") || !strcmp(argv[i], "-font")) - { - _fontName = argv[++ i]; - } - else if (!strcmp(argv[i], "-fg") || !strcmp(argv[i], "-foreground")) - { - _foregroundName = argv[++ i]; - } - else if (!strcmp(argv[i], "-bg") || !strcmp(argv[i], "-background")) - { - _backgroundName = argv[++ i]; - } - else if (!strcmp(argv[i], "-green")) - { - _greenName = argv[++ i]; - } - else if (!strcmp(argv[i], "-yellow")) - { - _yellowName = argv[++ i]; - } - else if (!strcmp(argv[i], "-red")) - { - _redName = argv[++ i]; - } - } - } - - void openDisplay() - { - _display = XOpenDisplay(NULL); - } - - void createColors() - { - _colormap = DefaultColormap(_display, 0); - _foreground = getColor(_foregroundName); - _background = getColor(_backgroundName); - } - - unsigned long getColor(const char *colorName) - { - XColor color; - XParseColor(_display, _colormap, colorName, &color); - XAllocColor(_display, _colormap, &color); - return color.pixel; - } - - void createWindow() - { - _window = XCreateSimpleWindow(_display, RootWindow(_display, 0), 0, 0, 1, 1, 0, 0, _background); - } - - void createGc() - { - _gc = XCreateGC(_display, _window, 0, 0); - } - - void createFont() - { - if (!loadFont()) - { - useDefaultFont(); - } - getFontInfo(); - _textHeight = _fontInfo->ascent + _fontInfo->descent; - _textDescent = _fontInfo->descent; - } - - bool loadFont() - { - if (!_fontName) - { - return false; - } - _fontId = XLoadFont(_display, _fontName); - return (XSetFont(_display, _gc, _fontId) == Success); - } - - void useDefaultFont() - { - _fontId = XGContextFromGC(_gc); - } - - void getFontInfo() - { - _fontInfo = XQueryFont(_display, _fontId); - } - - void freeFontInfo() - { - XFreeFontInfo(NULL, _fontInfo, 1); - } - - void initializeEvents() - { - _eventMask = ExposureMask; - XSelectInput(_display, _window, _eventMask); - } - - void initializeBar(const WorldDescription &wd) - { - getTotalTests(wd); - _testsDone = 0; - _barColor = getColor(_greenName); - } - - void getTotalTests() - { - getTotalTests(tracker().world()); - } - - void getTotalTests(const WorldDescription &wd) - { - _numTotalTests = wd.numTotalTests(); - wd.strTotalTests(_strTotalTests); - } - - void centerWindow() - { - XMapWindow(_display, _window); - - Screen *screen = XDefaultScreenOfDisplay(_display); - int screenWidth = WidthOfScreen(screen); - int screenHeight = HeightOfScreen(screen); - int xCenter = screenWidth / 2; - int yCenter = screenHeight / 2; - - _width = (screenWidth * 4) / 5; - _height = screenHeight / 14; - - XMoveResizeWindow(_display, _window, xCenter - (_width / 2), yCenter - (_height / 2), _width, _height); - } - - void processEvents() - { - redraw(); - - XEvent event; - while (XCheckMaskEvent(_display, _eventMask, &event)) - { - redraw(); - } - } - - void setWindowName(const char *suiteName, const char *testName) - { - unsigned length = strlen(_programName) + strlen(suiteName) + strlen(testName) + sizeof(" - ::()"); - char *name = (char *)malloc(length); - sprintf(name, "%s - %s::%s()", _programName, suiteName, testName); - XSetStandardProperties(_display, _window, name, 0, 0, 0, 0, 0); - free(name); - } - - void redraw() - { - getWindowSize(); - drawSolidBar(); - drawDividers(); - drawPercentage(); - flush(); - } - - void getWindowSize() - { - XWindowAttributes attributes; - XGetWindowAttributes(_display, _window, &attributes); - _width = attributes.width; - _height = attributes.height; - } - - void drawSolidBar() - { - unsigned barWidth = (_width * _testsDone) / _numTotalTests; - - XSetForeground(_display, _gc, _barColor); - XFillRectangle(_display, _window, _gc, 0, 0, barWidth, _height); - - XSetForeground(_display, _gc, _background); - XFillRectangle(_display, _window, _gc, barWidth, 0, _width + 1 - barWidth, _height); - } - - void drawDividers() - { - if (_width / _numTotalTests < 5) - { - return; - } - for (unsigned i = 1; i < _testsDone; ++ i) - { - int x = (_width * i) / _numTotalTests; - XDrawLine(_display, _window, _gc, x, 0, x, _height); - } - } - - void drawPercentage() - { - XSetForeground(_display, _gc, _foreground); - - char str[sizeof("1000000000 of ") + sizeof(_strTotalTests) + sizeof(" (100%)")]; - sprintf(str, "%u of %s (%u%%)", _testsDone, _strTotalTests, (_testsDone * 100) / _numTotalTests); - unsigned len = strlen(str); - - int textWidth = XTextWidth(_fontInfo, str, len); - - XDrawString(_display, _window, _gc, - (_width - textWidth) / 2, ((_height + _textHeight) / 2) - _textDescent, - str, len); - } - - void flush() - { - XFlush(_display); - } - - void destroyGc() - { - XFreeGC(_display, _gc); - } - - void destroyWindow() - { - XDestroyWindow(_display, _window); - } - - void closeDisplay() - { - XCloseDisplay(_display); - } -}; -} - -#endif //__cxxtest__X11Gui_h__ diff --git a/noarch/lib/py/cxxtest/cxxtest/XUnitPrinter.h b/noarch/lib/py/cxxtest/cxxtest/XUnitPrinter.h deleted file mode 100644 index b82fbffb..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/XUnitPrinter.h +++ /dev/null @@ -1,48 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __CXXTEST__XUNIT_PRINTER_H -#define __CXXTEST__XUNIT_PRINTER_H - -// -// XUnitPrinter combines an ErrorPrinter with an XML formatter. -// - -#include <cxxtest/TeeListener.h> -#include <cxxtest/ErrorPrinter.h> -#include <cxxtest/XmlPrinter.h> - -namespace CxxTest -{ -class XUnitPrinter : public TeeListener -{ -public: - - XmlPrinter xml_printer; - ErrorPrinter error_printer; - - XUnitPrinter(CXXTEST_STD(ostream) &o = CXXTEST_STD(cout)) - : xml_printer(o) - { - setFirst(error_printer); - setSecond(xml_printer); - } - - int run() - { - TestRunner::runAllTests(*this); - return tracker().failedTests(); - } -}; -} - -#endif //__CXXTEST__XUNIT_PRINTER_H - diff --git a/noarch/lib/py/cxxtest/cxxtest/XmlFormatter.h b/noarch/lib/py/cxxtest/cxxtest/XmlFormatter.h deleted file mode 100644 index b6fd1a2f..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/XmlFormatter.h +++ /dev/null @@ -1,664 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -// Licensed under the LGPL, see http://www.gnu.org/licenses/lgpl.html - -#ifndef __CXXTEST__XMLFORMATTER_H -#define __CXXTEST__XMLFORMATTER_H - -// -// The XmlFormatter is a TestListener that -// prints reports of the errors to an output -// stream in the form of an XML document. -// - -// The following definitions are used if stack trace support is enabled, -// to give the traces an easily-parsable XML format. If stack tracing is -// not enabled, then these definitions will be ignored. -#define CXXTEST_STACK_TRACE_ESCAPE_AS_XML -#define CXXTEST_STACK_TRACE_NO_ESCAPE_FILELINE_AFFIXES - -#define CXXTEST_STACK_TRACE_INITIAL_PREFIX "<stack-frame function=\"" -#define CXXTEST_STACK_TRACE_INITIAL_SUFFIX "\"/>\n" -#define CXXTEST_STACK_TRACE_OTHER_PREFIX CXXTEST_STACK_TRACE_INITIAL_PREFIX -#define CXXTEST_STACK_TRACE_OTHER_SUFFIX CXXTEST_STACK_TRACE_INITIAL_SUFFIX -#define CXXTEST_STACK_TRACE_ELLIDED_MESSAGE "" -#define CXXTEST_STACK_TRACE_FILELINE_PREFIX "\" location=\"" -#define CXXTEST_STACK_TRACE_FILELINE_SUFFIX "" - - -#include <cxxtest/TestRunner.h> -#include <cxxtest/TestListener.h> -#include <cxxtest/TestTracker.h> -#include <cxxtest/ValueTraits.h> -#include <cxxtest/ErrorFormatter.h> -#include <cxxtest/StdHeaders.h> -#include <iostream> -#include <sstream> -#include <cstring> -#include <cstdio> -#include <ctime> - -namespace CxxTest -{ -class TeeOutputStreams -{ -private: - class teebuffer : public std::basic_streambuf<char> - { - typedef std::basic_streambuf<char> streambuf_t; - public: - teebuffer(streambuf_t * buf1, streambuf_t * buf2) - : buffer1(buf1), buffer2(buf2) - {} - - virtual int overflow(int c) - { - if (c == EOF) - { - return !EOF; - } - else - { - int const ans1 = buffer1->sputc(c); - int const ans2 = buffer2->sputc(c); - return ans1 == EOF || ans2 == EOF ? EOF : c; - } - } - - virtual int sync() - { - int ans1 = buffer1->pubsync(); - int ans2 = buffer2->pubsync(); - return ans1 || ans2 ? -1 : 0; - } - - streambuf_t * buffer1; - streambuf_t * buffer2; - }; - -public: - TeeOutputStreams(std::ostream& _cout, std::ostream& _cerr) - : out(), - err(), - orig_cout(_cout), - orig_cerr(_cerr), - tee_out(out.rdbuf(), _cout.rdbuf()), - tee_err(err.rdbuf(), _cerr.rdbuf()) - { - orig_cout.rdbuf(&tee_out); - orig_cerr.rdbuf(&tee_err); - } - - ~TeeOutputStreams() - { - orig_cout.rdbuf(tee_out.buffer2); - orig_cerr.rdbuf(tee_err.buffer2); - } - - std::stringstream out; - std::stringstream err; - -private: - std::ostream& orig_cout; - std::ostream& orig_cerr; - teebuffer tee_out; - teebuffer tee_err; -}; - -class ElementInfo -{ -public: - std::string name; - std::stringstream value; - std::map<std::string, std::string> attribute; - - ElementInfo() - : name(), value(), attribute() - {} - - ElementInfo(const ElementInfo& rhs) - : name(rhs.name), value(rhs.value.str()), attribute(rhs.attribute) - {} - - ElementInfo& operator=(const ElementInfo& rhs) - { - name = rhs.name; - value.str(rhs.value.str()); - attribute = rhs.attribute; - return *this; - } - - template <class Type> - void add(const std::string& name_, Type& value_) - { - std::ostringstream os; - os << value_; - attribute[name_] = os.str(); - } - - void write(OutputStream& os) - { - os << " <" << name.c_str() << " "; - std::map<std::string, std::string>::iterator curr = attribute.begin(); - std::map<std::string, std::string>::iterator end = attribute.end(); - while (curr != end) - { - os << curr->first.c_str() - << "=\"" << curr->second.c_str() << "\" "; - curr++; - } - if (value.str().empty()) - { - os << "/>"; - } - else - { - os << ">" << escape(value.str()).c_str() - << "</" << name.c_str() << ">"; - } - os.endl(os); - } - - std::string escape(const std::string& str) - { - std::string escStr = ""; - for (size_t i = 0; i < str.length(); i++) - { - switch (str[i]) - { - case '"': escStr += """; break; - case '\'': escStr += "'"; break; - case '<': escStr += "<"; break; - case '>': escStr += ">"; break; - case '&': escStr += "&"; break; - default: escStr += str[i]; break; - } - } - return escStr; - } - -}; - -class TestCaseInfo -{ -public: - - TestCaseInfo() : fail(false), error(false), runtime(0.0) {} - std::string className; - std::string testName; - std::string line; - bool fail; - bool error; - double runtime; - std::list<ElementInfo> elements; - typedef std::list<ElementInfo>::iterator element_t; - std::string world; - - element_t add_element(const std::string& name) - { - element_t elt = elements.insert(elements.end(), ElementInfo()); - elt->name = name; - return elt; - } - - element_t update_element(const std::string& name) - { - element_t elt = elements.begin(); - while (elt != elements.end()) - { - if (elt->name == name) - { - return elt; - } - elt++; - } - return add_element(name); - } - - void write(OutputStream &o) - { - o << " <testcase classname=\"" << className.c_str() - << "\" name=\"" << testName.c_str() - << "\" line=\"" << line.c_str() << "\""; - bool elts = false; - element_t curr = elements.begin(); - element_t end = elements.end(); - while (curr != end) - { - if (!elts) - { - o << ">"; - o.endl(o); - elts = true; - } - curr->write(o); - curr++; - } - if (elts) - { - o << " </testcase>"; - } - else - { - o << " />"; - } - o.endl(o); - } - -}; - -class XmlFormatter : public TestListener -{ -public: - XmlFormatter(OutputStream *o, OutputStream *ostr, std::ostringstream *os) - : _o(o), _ostr(ostr), _os(os), stream_redirect(NULL) - { - testcase = info.end(); - } - - std::list<TestCaseInfo> info; - std::list<TestCaseInfo>::iterator testcase; - typedef std::list<ElementInfo>::iterator element_t; - std::string classname; - int ntests; - int nfail; - int nerror; - double totaltime; - - int run() - { - TestRunner::runAllTests(*this); - return tracker().failedTests(); - } - - void enterWorld(const WorldDescription & /*desc*/) - { - ntests = 0; - nfail = 0; - nerror = 0; - totaltime = 0; - } - - static void totalTests(OutputStream &o) - { - char s[WorldDescription::MAX_STRLEN_TOTAL_TESTS]; - const WorldDescription &wd = tracker().world(); - o << wd.strTotalTests(s) - << (wd.numTotalTests() == 1 ? " test" : " tests"); - } - - void enterSuite(const SuiteDescription& desc) - { - classname = desc.suiteName(); - // replace "::" namespace with java-style "." - size_t pos = 0; - while ((pos = classname.find("::", pos)) != - CXXTEST_STD(string::npos)) - { - classname.replace(pos, 2, "."); - } - while (! classname.empty() && classname[0] == '.') - { - classname.erase(0, 1); - } - - //CXXTEST_STD(cout) << "HERE " << desc.file() << " " - // << classname << CXXTEST_STD(endl); - - //classname=desc.suiteName(); - //(*_o) << "file=\"" << desc.file() << "\" "; - //(*_o) << "line=\"" << desc.line() << "\""; - //_o->flush(); - } - - void leaveSuite(const SuiteDescription &) - { - std::list<TestCaseInfo>::iterator curr = info.begin(); - std::list<TestCaseInfo>::iterator end = info.end(); - while (curr != end) - { - if (curr->fail) { nfail++; } - if (curr->error) { nerror++; } - totaltime += curr->runtime; - ntests++; - curr++; - } - curr = info.begin(); - end = info.end(); - while (curr != end) - { - (*curr).write(*_ostr); - curr++; - } - info.clear(); - } - - void enterTest(const TestDescription & desc) - { - testcase = info.insert(info.end(), TestCaseInfo()); - testcase->testName = desc.testName(); - testcase->className = classname; - std::ostringstream os; - os << desc.line(); - testcase->line = os.str(); - - if (stream_redirect) - CXXTEST_STD(cerr) << "ERROR: The stream_redirect != NULL" - << CXXTEST_STD(endl); - - stream_redirect = - new TeeOutputStreams(CXXTEST_STD(cout), CXXTEST_STD(cerr)); - } - - void leaveTest(const TestDescription &) - { - if (stream_redirect != NULL) - { - std::string out = stream_redirect->out.str(); - if (! out.empty()) - { - // silently ignore the '.' - if (out[0] != '.' || out.size() > 1) - { - testcase->add_element("system-out")->value << out; - } - } - if (! stream_redirect->err.str().empty()) - { - testcase->add_element("system-err")->value << stream_redirect->err.str(); - } - - delete stream_redirect; - stream_redirect = NULL; - } - } - - void leaveWorld(const WorldDescription& desc) - { - std::ostringstream os; - const std::string currentDateTime = currentDateTimeStr(); - os << totaltime; - (*_o) << "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" << endl; - (*_o) << "<testsuite name=\"" << desc.worldName() << "\" "; - (*_o) << "date=\"" << currentDateTime.c_str(); - (*_o) << "\" tests=\"" << ntests - << "\" errors=\"" << nerror - << "\" failures=\"" << nfail - << "\" time=\"" << os.str().c_str() << "\" >"; - _o->endl(*_o); - (*_o) << _os->str().c_str(); - _os->clear(); - (*_o) << "</testsuite>" << endl; - _o->flush(); - } - - void trace(const char* /*file*/, int line, const char *expression) - { - if (testcase == info.end()) { - return; - } - element_t elt = testcase->add_element("trace"); - elt->add("line", line); - elt->value << expression; - } - - void warning(const char* /*file*/, int line, const char *expression) - { - if (testcase == info.end()) { - return; - } - element_t elt = testcase->add_element("warning"); - elt->add("line", line); - elt->value << expression; - } - - void skippedTest(const char* file, int line, const char* expression) - { - testSkipped(file, line, "skipped") << "Test skipped: " << expression; - } - - void failedTest(const char* file, int line, const char* expression) - { - testFailure(file, line, "failure") << "Test failed: " << expression; - } - - void failedAssert(const char *file, int line, const char *expression) - { - testFailure(file, line, "failedAssert") - << "Assertion failed: " << expression; - } - - void failedAssertEquals(const char *file, int line, - const char* xStr, const char* yStr, - const char *x, const char *y) - { - testFailure(file, line, "failedAssertEquals") - << "Error: Expected (" - << xStr << " == " << yStr << "), found (" - << x << " != " << y << ")"; - } - - void failedAssertSameData(const char *file, int line, - const char *xStr, const char *yStr, const char *sizeStr, - const void* /*x*/, const void* /*y*/, unsigned size) - { - testFailure(file, line, "failedAssertSameData") - << "Error: Expected " << sizeStr - << " (" << size << ") bytes to be equal at (" - << xStr << ") and (" << yStr << "), found"; - } - - void failedAssertSameFiles(const char *file, int line, - const char *, const char *, - const char* explanation - ) - { - testFailure(file, line, "failedAssertSameFiles") - << "Error: " << explanation; - } - - void failedAssertDelta(const char *file, int line, - const char *xStr, const char *yStr, const char *dStr, - const char *x, const char *y, const char *d) - { - testFailure(file, line, "failedAssertDelta") - << "Error: Expected (" - << xStr << " == " << yStr << ") up to " << dStr - << " (" << d << "), found (" - << x << " != " << y << ")"; - } - - void failedAssertDiffers(const char *file, int line, - const char *xStr, const char *yStr, - const char *value) - { - testFailure(file, line, "failedAssertDiffers") - << "Error: Expected (" - << xStr << " != " << yStr << "), found (" - << value << ")"; - } - - void failedAssertLessThan(const char *file, int line, - const char *xStr, const char *yStr, - const char *x, const char *y) - { - testFailure(file, line, "failedAssertLessThan") - << "Error: Expected (" << - xStr << " < " << yStr << "), found (" << - x << " >= " << y << ")"; - } - - void failedAssertLessThanEquals(const char *file, int line, - const char *xStr, const char *yStr, - const char *x, const char *y) - { - testFailure(file, line, "failedAssertLessThanEquals") - << "Error: Expected (" << - xStr << " <= " << yStr << "), found (" << - x << " > " << y << ")"; - } - - void failedAssertRelation(const char *file, int line, - const char *relation, const char *xStr, const char *yStr, - const char *x, const char *y) - { - testFailure(file, line, "failedAssertRelation") - << "Error: Expected " << relation << "( " << - xStr << ", " << yStr << " ), found !" << relation - << "( " << x << ", " << y << " )"; - } - - void failedAssertPredicate(const char *file, int line, - const char *predicate, const char *xStr, const char *x) - { - testFailure(file, line, "failedAssertPredicate") - << "Error: Expected " << predicate << "( " << - xStr << " ), found !" << predicate << "( " << x << " )"; - } - - void failedAssertThrows(const char *file, int line, - const char *expression, const char *type, - bool otherThrown) - { - testFailure(file, line, "failedAssertThrows") - << "Error: Expected (" << expression << ") to throw (" << - type << ") but it " - << (otherThrown ? "threw something else" : "didn't throw"); - } - - void failedAssertThrowsNot(const char *file, int line, const char *expression) - { - testFailure(file, line, "failedAssertThrowsNot") - << "Error: Expected (" << expression - << ") not to throw, but it did"; - } - -protected: - - OutputStream *outputStream() const - { - return _o; - } - - OutputStream *outputFileStream() const - { - return _ostr; - } - -private: - XmlFormatter(const XmlFormatter &); - XmlFormatter &operator=(const XmlFormatter &); - - std::stringstream& testFailure(const char* file, int line, const char *failureType) - { - testcase->fail = true; - element_t elt = testcase->update_element("failure"); - if (elt->value.str().empty()) - { - elt->add("type", failureType); - elt->add("line", line); - elt->add("file", file); - } - else - { - elt->value << CXXTEST_STD(endl); - } - return elt->value; - //failedTest(file,line,message.c_str()); - } - - std::stringstream& testSkipped(const char* file, int line, const char *failureType) - { - //testcase->fail = true; - element_t elt = testcase->update_element("skipped"); - if (elt->value.str().empty()) - { - elt->add("type", failureType); - elt->add("line", line); - elt->add("file", file); - } - else - { - elt->value << CXXTEST_STD(endl); - } - return elt->value; - } - - std::string currentDateTimeStr() - { - std::string retVal; - const time_t now(time(NULL)); - char current_date_string[27]; - -#ifdef WIN32 - if (ctime_s(current_date_string, sizeof(current_date_string)-1, &now) == 0) - { - retVal = current_date_string; - retVal.erase(retVal.find_last_not_of(" \n\r\t")+1); // trim trailing whitespace - } -#else - const size_t n = strlen(ctime_r(&now, current_date_string)); - if (n) - { - current_date_string[n-1] = '\0'; // remove the ending \n - retVal = current_date_string; - } -#endif - return retVal; - } - -#if 0 - void attributeBinary(const char* name, const void *value, unsigned size) - { - (*_o) << name; - (*_o) << "=\""; - dump(value, size); - (*_o) << "\" "; - } - - void dump(const void *buffer, unsigned size) - { - if (!buffer) { return; } - - unsigned dumpSize = size; - if (maxDumpSize() && dumpSize > maxDumpSize()) - { - dumpSize = maxDumpSize(); - } - - const unsigned char *p = (const unsigned char *)buffer; - for (unsigned i = 0; i < dumpSize; ++ i) - { - (*_o) << byteToHex(*p++) << " "; - } - if (dumpSize < size) - { - (*_o) << "... "; - } - } -#endif - - static void endl(OutputStream &o) - { - OutputStream::endl(o); - } - - OutputStream *_o; - OutputStream *_ostr; - std::ostringstream *_os; - - TeeOutputStreams *stream_redirect; -}; -} - -#endif // __CXXTEST__XMLFORMATTER_H - diff --git a/noarch/lib/py/cxxtest/cxxtest/XmlPrinter.h b/noarch/lib/py/cxxtest/cxxtest/XmlPrinter.h deleted file mode 100644 index a3ee08c2..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/XmlPrinter.h +++ /dev/null @@ -1,75 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __cxxtest__XmlPrinter_h__ -#define __cxxtest__XmlPrinter_h__ - -// -// The XmlPrinter is a simple TestListener that -// prints JUnit style xml to the output stream -// - - -#include <cxxtest/Flags.h> - -#ifndef _CXXTEST_HAVE_STD -# define _CXXTEST_HAVE_STD -#endif // _CXXTEST_HAVE_STD - -#include <cxxtest/XmlFormatter.h> -#include <cxxtest/StdValueTraits.h> - -#include <sstream> -#ifdef _CXXTEST_OLD_STD -# include <iostream.h> -#else // !_CXXTEST_OLD_STD -# include <iostream> -#endif // _CXXTEST_OLD_STD - -namespace CxxTest -{ -class XmlPrinter : public XmlFormatter -{ -public: - XmlPrinter(CXXTEST_STD(ostream) &o = CXXTEST_STD(cout), const char* /*preLine*/ = ":", const char* /*postLine*/ = "") : - XmlFormatter(new Adapter(o), new Adapter(ostr), &ostr) {} - - virtual ~XmlPrinter() - { - delete outputStream(); - delete outputFileStream(); - } - -private: - - std::ostringstream ostr; - - class Adapter : public OutputStream - { - CXXTEST_STD(ostream) &_o; - public: - Adapter(CXXTEST_STD(ostream) &o) : _o(o) {} - void flush() { _o.flush(); } - OutputStream &operator<<(const char *s) { _o << s; return *this; } - OutputStream &operator<<(Manipulator m) { return OutputStream::operator<<(m); } - OutputStream &operator<<(unsigned i) - { - char s[1 + 3 * sizeof(unsigned)]; - numberToString(i, s); - _o << s; - return *this; - } - }; -}; -} - -#endif // __cxxtest__XmlPrinter_h__ - diff --git a/noarch/lib/py/cxxtest/cxxtest/YesNoRunner.h b/noarch/lib/py/cxxtest/cxxtest/YesNoRunner.h deleted file mode 100644 index 6c1a921b..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/YesNoRunner.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef __cxxtest__YesNoRunner_h__ -#define __cxxtest__YesNoRunner_h__ - -// -// The YesNoRunner is a simple TestListener that -// just returns true iff all tests passed. -// - -#include <cxxtest/TestRunner.h> -#include <cxxtest/TestListener.h> - -namespace CxxTest -{ -class YesNoRunner : public TestListener -{ -public: - YesNoRunner() - { - } - - int run() - { - TestRunner::runAllTests(*this); - return tracker().failedTests(); - } -}; -} - -#endif // __cxxtest__YesNoRunner_h__ diff --git a/noarch/lib/py/cxxtest/cxxtest/unix.h b/noarch/lib/py/cxxtest/cxxtest/unix.h deleted file mode 100644 index 91f3c6fa..00000000 --- a/noarch/lib/py/cxxtest/cxxtest/unix.h +++ /dev/null @@ -1,311 +0,0 @@ -/* -------------------------------------------------------------------------- - CxxTest: A lightweight C++ unit testing library. - Copyright (c) 2008 Sandia Corporation. - This software is distributed under the LGPL License v3 - For more information, see the COPYING file in the top CxxTest directory. - Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, - the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------- -*/ - -#ifndef UNIX_ERROR_PRINTER_H_N4C6JUX4 -#define UNIX_ERROR_PRINTER_H_N4C6JUX4 - -#ifndef _CXXTEST_HAVE_STD -# define _CXXTEST_HAVE_STD -#endif // _CXXTEST_HAVE_STD - -#include <cxxtest/Flags.h> -#include <cxxtest/TestRunner.h> -#include <cxxtest/TestListener.h> -#include <cxxtest/TestTracker.h> -#include <cxxtest/ValueTraits.h> -#include <cxxtest/StdValueTraits.h> -#include <cxxtest/ErrorFormatter.h> // CxxTest::OutputStream - -namespace CxxTest -{ -class UNIXErrorFormatter : public TestListener -{ -public: - UNIXErrorFormatter(OutputStream *o, const char *preLine = ":", const char *postLine = "") : - _reported(false), - _o(o), - _preLine(preLine), - _postLine(postLine) - { - } - - int run() - { - TestRunner::runAllTests(*this); - return tracker().failedTests(); - } - - static void totalTests(OutputStream &o) - { - char s[WorldDescription::MAX_STRLEN_TOTAL_TESTS]; - const WorldDescription &wd = tracker().world(); - o << wd.strTotalTests(s) << (wd.numTotalTests() == 1 ? " test" : " tests"); - } - - void enterTest(const TestDescription &) - { - _reported = false; - } - - void leaveWorld(const WorldDescription &desc) - { - if (tracker().failedTests()) - { - (*_o) << "Failed " << tracker().failedTests() << " of " << totalTests << endl; - unsigned numPassed = desc.numTotalTests() - tracker().failedTests() - tracer().skippedTests(); - unsigned numTotal = desc.numTotalTests() - tracker().skippedTests(); - if (numTotal == 0) - { - (*_o) << "Success rate: 100%" << endl; - } - else - { - (*_o) << "Success rate: " << (unsigned)(numPassed * 100.0 / numTotal) << "%" << endl; - } - } - } - - void trace(const char *file, int line, const char *expression) - { - stop(file, line) << "Trace: " << - expression << endl; - } - - void warning(const char *file, int line, const char *expression) - { - stop(file, line) << "Warning: " << - expression << endl; - } - - void skippedTest(const char *file, int line, const char *expression) - { - stop(file, line) << "Warning: Test skipped: " << - expression << endl; - } - - void failedTest(const char *file, int line, const char *expression) - { - stop(file, line) << "Error: Test failed: " << - expression << endl; - } - - void failedAssert(const char *file, int line, const char *expression) - { - stop(file, line) << "Error: Assertion failed: " << - expression << endl; - } - - void failedAssertEquals(const char *file, int line, - const char *xStr, const char *yStr, - const char *x, const char *y) - { - stop(file, line) << "Error: Expected (" << - xStr << " == " << yStr << "), found (" << - x << " != " << y << ")" << endl; - } - - void failedAssertSameData(const char *file, int line, - const char *xStr, const char *yStr, - const char *sizeStr, const void *x, - const void *y, unsigned size) - { - stop(file, line) << "Error: Expected " << sizeStr << " (" << size << ") bytes to be equal at (" << - xStr << ") and (" << yStr << "), found:" << endl; - dump(x, size); - (*_o) << " differs from" << endl; - dump(y, size); - } - - void failedAssertSameFiles(const char* file, int line, - const char*, const char*, - const char* explanation - ) - { - stop(file, line) << "Error: " << explanation << endl; - } - - void failedAssertDelta(const char *file, int line, - const char *xStr, const char *yStr, const char *dStr, - const char *x, const char *y, const char *d) - { - stop(file, line) << "Error: Expected (" << - xStr << " == " << yStr << ") up to " << dStr << " (" << d << "), found (" << - x << " != " << y << ")" << endl; - } - - void failedAssertDiffers(const char *file, int line, - const char *xStr, const char *yStr, - const char *value) - { - stop(file, line) << "Error: Expected (" << - xStr << " != " << yStr << "), found (" << - value << ")" << endl; - } - - void failedAssertLessThan(const char *file, int line, - const char *xStr, const char *yStr, - const char *x, const char *y) - { - stop(file, line) << "Error: Expected (" << - xStr << " < " << yStr << "), found (" << - x << " >= " << y << ")" << endl; - } - - void failedAssertLessThanEquals(const char *file, int line, - const char *xStr, const char *yStr, - const char *x, const char *y) - { - stop(file, line) << "Error: Expected (" << - xStr << " <= " << yStr << "), found (" << - x << " > " << y << ")" << endl; - } - - void failedAssertRelation(const char *file, int line, - const char *relation, const char *xStr, const char *yStr, - const char *x, const char *y) - { - stop(file, line) << "Error: Expected " << relation << "( " << - xStr << ", " << yStr << " ), found !" << relation << "( " << x << ", " << y << " )" << endl; - } - - void failedAssertPredicate(const char *file, int line, - const char *predicate, const char *xStr, const char *x) - { - stop(file, line) << "Error: Expected " << predicate << "( " << - xStr << " ), found !" << predicate << "( " << x << " )" << endl; - } - - void failedAssertThrows(const char *file, int line, - const char *expression, const char *type, - bool otherThrown) - { - stop(file, line) << "Error: Expected (" << expression << ") to throw (" << - type << ") but it " << (otherThrown ? "threw something else" : "didn't throw") << - endl; - } - - void failedAssertThrowsNot(const char *file, int line, const char *expression) - { - stop(file, line) << "Error: Expected (" << expression << ") not to throw, but it did" << - endl; - } - -protected: - OutputStream *outputStream() const - { - return _o; - } - -private: - UNIXErrorFormatter(const UNIXErrorFormatter &); - UNIXErrorFormatter &operator=(const UNIXErrorFormatter &); - - OutputStream &stop(const char *file, int line) - { - reportTest(); - return (*_o) << file << _preLine << line << _postLine << ": "; - } - - void reportTest(void) - { - if (_reported) - { - return; - } - (*_o) << tracker().suite().file() << ": In " << tracker().suite().suiteName() << "::" << tracker().test().testName() << ":" << endl; - _reported = true; - } - - void dump(const void *buffer, unsigned size) - { - if (!buffer) - { - dumpNull(); - } - else - { - dumpBuffer(buffer, size); - } - } - - void dumpNull() - { - (*_o) << " (null)" << endl; - } - - void dumpBuffer(const void *buffer, unsigned size) - { - unsigned dumpSize = size; - if (maxDumpSize() && dumpSize > maxDumpSize()) - { - dumpSize = maxDumpSize(); - } - - const unsigned char *p = (const unsigned char *)buffer; - (*_o) << " { "; - for (unsigned i = 0; i < dumpSize; ++ i) - { - (*_o) << byteToHex(*p++) << " "; - } - if (dumpSize < size) - { - (*_o) << "... "; - } - (*_o) << "}" << endl; - } - - static void endl(OutputStream &o) - { - OutputStream::endl(o); - } - - bool _reported; - OutputStream *_o; - const char *_preLine; - const char *_postLine; -}; - -// ======================================================================================== -// = Actual runner is a subclass only because that is how the original ErrorPrinter works = -// ======================================================================================== - -class unix : public UNIXErrorFormatter -{ -public: - unix(CXXTEST_STD(ostream) &o = CXXTEST_STD(cerr), const char *preLine = ":", const char *postLine = "") : - UNIXErrorFormatter(new Adapter(o), preLine, postLine) {} - virtual ~unix() { delete outputStream(); } - -private: - class Adapter : public OutputStream - { - CXXTEST_STD(ostream) &_o; - public: - Adapter(CXXTEST_STD(ostream) &o) : _o(o) {} - void flush() { _o.flush(); } - OutputStream &operator<<(const char *s) { _o << s; return *this; } - OutputStream &operator<<(Manipulator m) { return OutputStream::operator<<(m); } - OutputStream &operator<<(unsigned i) - { - char s[1 + 3 * sizeof(unsigned)]; - numberToString(i, s); - _o << s; - return *this; - } - }; -}; -} - -#endif /* end of include guard: UNIX_ERROR_PRINTER_H_N4C6JUX4 */ - -// Copyright 2008 Sandia Corporation. Under the terms of Contract -// DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government -// retains certain rights in this software. diff --git a/noarch/lib/py/cxxtest/doc/Makefile b/noarch/lib/py/cxxtest/doc/Makefile deleted file mode 100644 index f3e890f1..00000000 --- a/noarch/lib/py/cxxtest/doc/Makefile +++ /dev/null @@ -1,40 +0,0 @@ -.PHONY: all anchors outputs clean manpages - -export XML_CATALOG_FILES = catalog.xml -PY = python -XSLTPROC_OPTS := --stringparam toc.section.depth 2 --stringparam generate.section.toc.level 1 -DBLATEX_OPTS := -P latex.output.revhistory=0 -P doc.collab.show=1 -P toc.section.depth=2 -A2X_OPTS := -a toc -a icons -L -d article -v --xsltproc-opts "$(XSLTPROC_OPTS)" --dblatex-opts "$(DBLATEX_OPTS)" - -%.html: %.txt anchors outputs - asciidoc -a data-uri -v -b html -d article -n -a toc2 -a icons $< - -# Ignore errors (dblatex may not be installed) -%.pdf: %.txt anchors outputs - - a2x -f pdf $(A2X_OPTS) $< - -# Ignore errors -%.epub: %.txt anchors outputs - - a2x -f epub $(A2X_OPTS) $< - -all: guide.html guide.pdf guide.epub - -manpages: - cd man; ./create_manpage; - cd man; asciidoc -v -d manpage ./cxxtestgen.1.txt - -html: guide.html - -pdf: guide.pdf - -epub: guide.epub - -anchors: guide.txt - $(PY) include_anchors.py $< - -outputs: - ../bin/cxxtestgen -h > examples/cxxtestgen.out - -clean: - - \rm -f guide.xml - - \rm -f examples/.*.py examples/.*.h examples/.*.cpp examples/.*.sh examples/runner examples/TEST*.xml examples/parsetab.py examples/*.orig examples/runner.cpp diff --git a/noarch/lib/py/cxxtest/doc/README.txt b/noarch/lib/py/cxxtest/doc/README.txt deleted file mode 100644 index 75254456..00000000 --- a/noarch/lib/py/cxxtest/doc/README.txt +++ /dev/null @@ -1,43 +0,0 @@ -This directory supports the creation of the CxxTest User Guide using -asciidoc and a2x commands. - -HTML - -The command - - make html - -creates the guide.html file. - - -PDF - -The command - - make pdf - -creates the guide.tex file, which generates the guide.pdf file using -dblatex. - - - -EPUB - -The command - - make epub - -creates the file make.epub. Note that the `catalog.xml` file is -used, which configures asciidoc to use the docbook XML data in the -`epub` directory. This is a bit of a hack. It apparently works -around a limitation of the MacPorts installation of asciidoc. - - -MANPAGES - -The command - - make manpages - -creates CxxTest man pages in the doc/man directory. - diff --git a/noarch/lib/py/cxxtest/doc/catalog.xml b/noarch/lib/py/cxxtest/doc/catalog.xml deleted file mode 100644 index fde98a7f..00000000 --- a/noarch/lib/py/cxxtest/doc/catalog.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0"?> -<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" - "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd"> - -<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"> -<nextCatalog catalog="/opt/local/etc/xml/catalog" /> -<nextCatalog catalog="/opt/local/share/xsl/docbook-xsl/catalog.xml" /> -</catalog> diff --git a/noarch/lib/py/cxxtest/doc/epub/README b/noarch/lib/py/cxxtest/doc/epub/README deleted file mode 100644 index 5e2587a1..00000000 --- a/noarch/lib/py/cxxtest/doc/epub/README +++ /dev/null @@ -1,88 +0,0 @@ ----------------------------------------------------------------------- - README file for the DocBook XSL Stylesheets ----------------------------------------------------------------------- - -These are XSL stylesheets for transforming DocBook XML document -instances into .epub format. - -.epub is an open standard of the The International Digital Publishing Forum (IDPF), -a the trade and standards association for the digital publishing industry. - -An alpha-quality reference implementation (dbtoepub) for a DocBook to .epub -converter (written in Ruby) is available under bin/. - -From http://idpf.org - What is EPUB, .epub, OPS/OCF & OEB? - - ".epub" is the file extension of an XML format for reflowable digital - books and publications. ".epub" is composed of three open standards, - the Open Publication Structure (OPS), Open Packaging Format (OPF) and - Open Container Format (OCF), produced by the IDPF. "EPUB" allows - publishers to produce and send a single digital publication file - through distribution and offers consumers interoperability between - software/hardware for unencrypted reflowable digital books and other - publications. The Open eBook Publication Structure or "OEB", - originally produced in 1999, is the precursor to OPS. - ----------------------------------------------------------------------- -.epub Constraints ----------------------------------------------------------------------- - -.epub does not support all of the image formats that DocBook supports. -When an image is available in an accepted format, it will be used. The -accepted @formats are: 'GIF','GIF87a','GIF89a','JPEG','JPG','PNG','SVG' -A mime-type for the image will be guessed from the file extension, -which may not work if your file extensions are non-standard. - -Non-supported elements: - * <mediaobjectco> - * <inlinegraphic>, <graphic>, <textdata>, <imagedata> with text/XML - @filerefs - * <olink> - * <cmdsynopsis> in lists (generic XHTML rendering inability) - * <footnote><para><programlisting> (just make your programlistings - siblings, rather than descendents of paras) - ----------------------------------------------------------------------- -dbtoepub Reference Implementation ----------------------------------------------------------------------- - -An alpha-quality DocBook to .epub conversion program, dbtoepub, is provided -in bin/dbtoepub. - -This tool requires: - - 'xsltproc' in your PATH - - 'zip' in your PATH - - Ruby 1.8.4+ - -Windows compatibility has not been extensively tested; bug reports encouraged. -[See http://www.zlatkovic.com/libxml.en.html and http://unxutils.sourceforge.net/] - -$ dbtoepub --help - Usage: dbtoepub [OPTIONS] [DocBook Files] - - dbtoepub converts DocBook <book> and <article>s into to .epub files. - - .epub is defined by the IDPF at www.idpf.org and is made up of 3 standards: - - Open Publication Structure (OPS) - - Open Packaging Format (OPF) - - Open Container Format (OCF) - - Specific options: - -d, --debug Show debugging output. - -h, --help Display usage info - -v, --verbose Make output verbose - - ----------------------------------------------------------------------- -Validation ----------------------------------------------------------------------- - -The epubcheck project provides limited validation for .epub documents. -See http://code.google.com/p/epubcheck/ for details. - ----------------------------------------------------------------------- -Copyright information ----------------------------------------------------------------------- -See the accompanying file named COPYING. - diff --git a/noarch/lib/py/cxxtest/doc/epub/bin/dbtoepub b/noarch/lib/py/cxxtest/doc/epub/bin/dbtoepub deleted file mode 100644 index 9976f816..00000000 --- a/noarch/lib/py/cxxtest/doc/epub/bin/dbtoepub +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env ruby -# This program converts DocBook documents into .epub files. -# -# Usage: dbtoepub [OPTIONS] [DocBook Files] -# -# .epub is defined by the IDPF at www.idpf.org and is made up of 3 standards: -# - Open Publication Structure (OPS) -# - Open Packaging Format (OPF) -# - Open Container Format (OCF) -# -# Specific options: -# -c, --css [FILE] Use FILE for CSS on generated XHTML. -# -d, --debug Show debugging output. -# -f, --font [OTF FILE] Embed OTF FILE in .epub. -# -h, --help Display usage info. -# -s, --stylesheet [XSL FILE] Use XSL FILE as a customization -# layer (imports epub/docbook.xsl). -# -v, --verbose Make output verbose. - -lib = File.expand_path(File.join(File.dirname(__FILE__), 'lib')) -$LOAD_PATH.unshift(lib) if File.exist?(lib) - -require 'fileutils' -require 'optparse' -require 'tmpdir' - -require 'docbook' - -verbose = false -debug = false -css_file = nil -otf_files = [] -customization_layer = nil -output_file = nil - -#$DEBUG=true - -# Set up the OptionParser -opts = OptionParser.new -opts.banner = "Usage: #{File.basename($0)} [OPTIONS] [DocBook Files] - -#{File.basename($0)} converts DocBook <book> and <article>s into to .epub files. - -.epub is defined by the IDPF at www.idpf.org and is made up of 3 standards: -- Open Publication Structure (OPS) -- Open Packaging Format (OPF) -- Open Container Format (OCF) - -Specific options:" -opts.on("-c", "--css [FILE]", "Use FILE for CSS on generated XHTML.") {|f| css_file = f} -opts.on("-d", "--debug", "Show debugging output.") {debug = true; verbose = true} -opts.on("-f", "--font [OTF FILE]", "Embed OTF FILE in .epub.") {|f| otf_files << f} -opts.on("-h", "--help", "Display usage info.") {puts opts.to_s; exit 0} -opts.on("-o", "--output [OUTPUT FILE]", "Output ePub file as OUTPUT FILE.") {|f| output_file = f} -opts.on("-s", "--stylesheet [XSL FILE]", "Use XSL FILE as a customization layer (imports epub/docbook.xsl).") {|f| customization_layer = f} -opts.on("-v", "--verbose", "Make output verbose.") {verbose = true} - -db_files = opts.parse(ARGV) -if db_files.size == 0 - puts opts.to_s - exit 0 -end - -db_files.each {|docbook_file| - dir = File.expand_path(File.join(Dir.tmpdir, ".epubtmp#{Time.now.to_f.to_s}")) - FileUtils.mkdir_p(dir) - e = DocBook::Epub.new(docbook_file, dir, css_file, customization_layer, otf_files) - - if output_file - epub_file = output_file - else - epub_file = File.basename(docbook_file, ".xml") + ".epub" - end - puts "Rendering DocBook file #{docbook_file} to #{epub_file}" if verbose - e.render_to_file(epub_file) -} diff --git a/noarch/lib/py/cxxtest/doc/epub/bin/xslt/obfuscate.xsl b/noarch/lib/py/cxxtest/doc/epub/bin/xslt/obfuscate.xsl deleted file mode 100644 index 4ea4cd55..00000000 --- a/noarch/lib/py/cxxtest/doc/epub/bin/xslt/obfuscate.xsl +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0"?> -<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> - <xsl:output method="xml" omit-xml-declaration="no" doctype-public="-//OASIS//DTD DocBook XML V4.4//EN" doctype-system="http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" indent="no"/> - <xsl:template match="@*|*|comment()|processing-instruction()"> - <xsl:copy> - <xsl:apply-templates select="@*|node()"/> - </xsl:copy> - </xsl:template> - <xsl:template match="text()"> - <xsl:value-of select="replace(replace(., '[a-z]', 'x'), '[0-9]', 'd')"/> - </xsl:template> -</xsl:stylesheet> diff --git a/noarch/lib/py/cxxtest/doc/epub/docbook.xsl b/noarch/lib/py/cxxtest/doc/epub/docbook.xsl deleted file mode 100644 index 753fcd00..00000000 --- a/noarch/lib/py/cxxtest/doc/epub/docbook.xsl +++ /dev/null @@ -1,1690 +0,0 @@ -<?xml version="1.0"?> -<xsl:stylesheet - xmlns:db="http://docbook.org/ns/docbook" - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:exsl="http://exslt.org/common" - xmlns:h="http://www.w3.org/1999/xhtml" - xmlns:ncx="http://www.daisy.org/z3986/2005/ncx/" - xmlns:ng="http://docbook.org/docbook-ng" - xmlns:opf="http://www.idpf.org/2007/opf" - xmlns:stext="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.TextFactory" - xmlns:str="http://exslt.org/strings" - xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - xmlns:xtext="xalan://com.nwalsh.xalan.Text" - - extension-element-prefixes="stext xtext" - exclude-result-prefixes="exsl db dc h ncx ng opf stext str xtext" - - version="1.0"> - - <xsl:import href="../xhtml-1_1/docbook.xsl" /> - <xsl:import href="../xhtml-1_1/chunk-common.xsl" /> - <xsl:include href="../xhtml-1_1/chunk-code.xsl" /> - - - <!-- We want a separate TOC file, please --> - <xsl:param name="chunk.tocs.and.lots">1</xsl:param> - <xsl:param name="toc.section.depth">2</xsl:param> - <xsl:param name="generate.toc"> - book toc,title - </xsl:param> - - <xsl:param name="ade.extensions" select="0"/> - <xsl:param name="epub.autolabel" select="'1'"/> - <xsl:param name="epub.ncx.depth">4</xsl:param> <!-- Not functional until http://code.google.com/p/epubcheck/issues/detail?id=70 is resolved --> - - - <xsl:param name="manifest.in.base.dir" select="'1'"/> - <xsl:param name="base.dir" select="$epub.oebps.dir"/> - - <xsl:param name="epub.oebps.dir" select="'OEBPS/'"/> - <xsl:param name="epub.ncx.filename" select="'toc.ncx'"/> - <xsl:param name="epub.container.filename" select="'container.xml'"/> - <xsl:param name="epub.opf.filename" select="concat($epub.oebps.dir, 'content.opf')"/> - <xsl:param name="epub.cover.filename" select="concat($epub.oebps.dir, 'cover', $html.ext)"/> - <xsl:param name="epub.cover.id" select="'cover'"/> - <xsl:param name="epub.cover.html" select="'cover.html'" /> - <xsl:param name="epub.cover.image.id" select="'cover-image'"/> - <xsl:param name="epub.cover.linear" select="0" /> - <xsl:param name="epub.ncx.toc.id">ncxtoc</xsl:param> - <xsl:param name="epub.html.toc.id">htmltoc</xsl:param> - <xsl:param name="epub.metainf.dir" select="'META-INF/'"/> - - <xsl:param name="epub.embedded.fonts"></xsl:param> - - <!-- Turning this on crashes ADE, which is unbelievably awesome --> - <xsl:param name="formal.object.break.after">0</xsl:param> - - - <!-- Per Bob Stayton: - """Process your documents with the css.decoration parameter set to zero. - That will avoid the use of style attributes in XHTML elements where they are not permitted.""" - http://www.sagehill.net/docbookxsl/OtherOutputForms.html#StrictXhtmlValid --> - <xsl:param name="css.decoration" select="0"/> - <xsl:param name="custom.css.source"></xsl:param> <!-- FIXME: Align with current CSS parameter design --> - - <xsl:param name="callout.graphics" select="1"/> - <xsl:param name="callout.graphics.extension">.png</xsl:param> - <xsl:param name="callout.graphics.number.limit" select="15"/> - <xsl:param name="callout.graphics.path" select="'images/callouts/'"/> - - <!-- no navigation in .epub --> - <xsl:param name="suppress.navigation" select="'1'"/> - - <xsl:variable name="toc.params"> - <xsl:call-template name="find.path.params"> - <xsl:with-param name="node" select="/*"/> - <xsl:with-param name="table" select="normalize-space($generate.toc)"/> - </xsl:call-template> - </xsl:variable> - <xsl:variable name="root.is.a.chunk"> - <xsl:choose> - <xsl:when test="/*[not(self::book)][not(sect1) or not(section)]"> - <xsl:text>1</xsl:text> - </xsl:when> - <xsl:when test="/book[*[last()][self::bookinfo]]|book[bookinfo]"> - <xsl:text>1</xsl:text> - </xsl:when> - <xsl:when test="/book[*[last()][self::info]]|book[info]"> - <xsl:text>1</xsl:text> - </xsl:when> - <xsl:when test="/bibliography"> - <xsl:text>1</xsl:text> - </xsl:when> - <xsl:otherwise> - <xsl:text>0</xsl:text> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - - <xsl:key name="image-filerefs" match="graphic|inlinegraphic|imagedata" use="@fileref"/> - - <xsl:template match="/"> - <!-- * Get a title for current doc so that we let the user --> - <!-- * know what document we are processing at this point. --> - <xsl:variable name="doc.title"> - <xsl:call-template name="get.doc.title" /> - </xsl:variable> - <xsl:choose> - <!-- Hack! If someone hands us a DocBook V5.x or DocBook NG document, - toss the namespace and continue. Use the docbook5 namespaced - stylesheets for DocBook5 if you don't want to use this feature.--> - <!-- include extra test for Xalan quirk --> - <xsl:when test="$exsl.node.set.available != 0 - and (*/self::ng:* or */self::db:*)"> - <xsl:call-template name="log.message"> - <xsl:with-param name="level">Note</xsl:with-param> - <xsl:with-param name="source" select="$doc.title" /> - <xsl:with-param name="context-desc"> - <xsl:text>namesp. cut</xsl:text> - </xsl:with-param> - <xsl:with-param name="message"> - <xsl:text>stripped namespace before processing</xsl:text> - </xsl:with-param> - </xsl:call-template> - <xsl:variable name="nons"> - <xsl:apply-templates mode="stripNS" /> - </xsl:variable> - <xsl:call-template name="log.message"> - <xsl:with-param name="level">Note</xsl:with-param> - <xsl:with-param name="source" select="$doc.title" /> - <xsl:with-param name="context-desc"> - <xsl:text>namesp. cut</xsl:text> - </xsl:with-param> - <xsl:with-param name="message"> - <xsl:text>processing stripped document</xsl:text> - </xsl:with-param> - </xsl:call-template> - <xsl:apply-templates select="exsl:node-set($nons)" /> - </xsl:when> - <xsl:otherwise> - <xsl:choose> - <xsl:when test="$rootid != ''"> - <xsl:choose> - <xsl:when - test="count(key('id',$rootid)) = 0"> - <xsl:message terminate="yes"> - <xsl:text>ID '</xsl:text> - <xsl:value-of select="$rootid" /> - <xsl:text>' not found in document.</xsl:text> - </xsl:message> - </xsl:when> - <xsl:otherwise> - <xsl:if - test="$collect.xref.targets = 'yes' or - $collect.xref.targets = 'only'"> - <xsl:apply-templates - select="key('id', $rootid)" mode="collect.targets" /> - </xsl:if> - <xsl:if - test="$collect.xref.targets != 'only'"> - <xsl:message> - Formatting from - <xsl:value-of select="$rootid" /> - </xsl:message> - <xsl:apply-templates - select="key('id',$rootid)" mode="process.root" /> - <xsl:call-template name="ncx" /> - </xsl:if> - </xsl:otherwise> - </xsl:choose> - </xsl:when> - <xsl:otherwise> - <xsl:if - test="$collect.xref.targets = 'yes' or - $collect.xref.targets = 'only'"> - <xsl:apply-templates select="/" - mode="collect.targets" /> - </xsl:if> - <xsl:if - test="$collect.xref.targets != 'only'"> - <xsl:apply-templates select="/" - mode="process.root" /> - <xsl:call-template name="ncx" /> - <xsl:call-template name="opf" /> - <xsl:call-template name="cover" /> - <xsl:call-template name="container" /> - </xsl:if> - </xsl:otherwise> - </xsl:choose> - </xsl:otherwise> - </xsl:choose> - </xsl:template> - - <xsl:template name="package-identifier"> - <xsl:choose> - <xsl:when test="/*/*[contains(name(.), 'info')]/biblioid"> - <xsl:if test="/*/*[contains(name(.), 'info')][1]/biblioid[1][@class = 'doi' or - @class = 'isbn' or - @class = 'isrn' or - @class = 'issn']"> - <xsl:text>urn:</xsl:text> - <xsl:value-of select="/*/*[contains(name(.), 'info')][1]/biblioid[1]/@class"/> - <xsl:text>:</xsl:text> - </xsl:if> - <xsl:value-of select="/*/*[contains(name(.), 'info')][1]/biblioid[1]"/> - </xsl:when> - <xsl:when test="/*/*[contains(name(.), 'info')]/isbn"> - <xsl:text>urn:isbn:</xsl:text> - <xsl:value-of select="/*/*[contains(name(.), 'info')][1]/isbn[1]"/> - </xsl:when> - <xsl:when test="/*/*[contains(name(.), 'info')]/issn"> - <xsl:text>urn:issn:</xsl:text> - <xsl:value-of select="/*/*[contains(name(.), 'info')][1]/issn[1]"/> - </xsl:when> - <xsl:otherwise> - <xsl:choose> - <xsl:when test="/*/*[contains(name(.), 'info')]/invpartnumber"> <xsl:value-of select="/*/*[contains(name(.), 'info')][1]/invpartnumber[1]"/> </xsl:when> - <xsl:when test="/*/*[contains(name(.), 'info')]/issuenum"> <xsl:value-of select="/*/*[contains(name(.), 'info')][1]/issuenum[1]"/> </xsl:when> - <xsl:when test="/*/*[contains(name(.), 'info')]/productnumber"> <xsl:value-of select="/*/*[contains(name(.), 'info')][1]/productnumber[1]"/> </xsl:when> - <xsl:when test="/*/*[contains(name(.), 'info')]/seriesvolnums"> <xsl:value-of select="/*/*[contains(name(.), 'info')][1]/seriesvolnums[1]"/> </xsl:when> - <xsl:when test="/*/*[contains(name(.), 'info')]/volumenum"> <xsl:value-of select="/*/*[contains(name(.), 'info')][1]/volumenum[1]"/> </xsl:when> - <!-- Deprecated --> - <xsl:when test="/*/*[contains(name(.), 'info')]/pubsnumber"> <xsl:value-of select="/*/*[contains(name(.), 'info')][1]/pubsnumber[1]"/> </xsl:when> - </xsl:choose> - <xsl:text>_</xsl:text> - <xsl:choose> - <xsl:when test="/*/@id"> - <xsl:value-of select="/*/@id"/> - </xsl:when> - <xsl:when test="/*/@xml:id"> - <xsl:value-of select="/*/@xml:id"/> - </xsl:when> - <xsl:otherwise> - <!-- TODO: Do UUIDs here --> - <xsl:value-of select="generate-id(/*)"/> - </xsl:otherwise> - </xsl:choose> - </xsl:otherwise> - </xsl:choose> - </xsl:template> - - <xsl:template name="opf"> - <xsl:variable name="package-identifier-id"><xsl:value-of select="concat(name(/*), 'id')"/></xsl:variable> - <xsl:variable name="doc.title"> - <xsl:call-template name="get.doc.title" /> - </xsl:variable> - <xsl:call-template name="write.chunk"> - <xsl:with-param name="filename"> - <xsl:value-of select="$epub.opf.filename" /> - </xsl:with-param> - <xsl:with-param name="method" select="'xml'" /> - <xsl:with-param name="encoding" select="'utf-8'" /> - <xsl:with-param name="indent" select="'no'" /> - <xsl:with-param name="quiet" select="$chunk.quietly" /> - <xsl:with-param name="doctype-public" select="''"/> <!-- intentionally blank --> - <xsl:with-param name="doctype-system" select="''"/> <!-- intentionally blank --> - <xsl:with-param name="content"> - <xsl:element namespace="http://www.idpf.org/2007/opf" name="package"> - <xsl:attribute name="version">2.0</xsl:attribute> - <xsl:attribute name="unique-identifier"> <xsl:value-of select="$package-identifier-id"/> </xsl:attribute> - - <xsl:element namespace="http://www.idpf.org/2007/opf" name="metadata"> - <xsl:element name="dc:identifier"> - <xsl:attribute name="id"><xsl:value-of select="$package-identifier-id"/></xsl:attribute> - <xsl:call-template name="package-identifier"/> - </xsl:element> - - <xsl:element name="dc:title"> - <xsl:value-of select="normalize-space($doc.title)"/> - </xsl:element> - - <xsl:apply-templates select="/*/*[contains(name(.), 'info')]/*" - mode="opf.metadata"/> - <xsl:element name="dc:language"> - <xsl:call-template name="l10n.language"> - <xsl:with-param name="target" select="/*"/> - </xsl:call-template> - </xsl:element> - - <xsl:if test="/*/*[cover or contains(name(.), 'info')]//mediaobject[@role='cover' or ancestor::cover]"> - <xsl:element namespace="http://www.idpf.org/2007/opf" name="meta"> - <xsl:attribute name="name">cover</xsl:attribute> - <xsl:attribute name="content"> - <xsl:value-of select="$epub.cover.image.id"/> - </xsl:attribute> - </xsl:element> - </xsl:if> - - </xsl:element> - <xsl:call-template name="opf.manifest"/> - <xsl:call-template name="opf.spine"/> - <xsl:call-template name="opf.guide"/> - - </xsl:element> - </xsl:with-param> - </xsl:call-template> - </xsl:template> - - <xsl:template name="container"> - <xsl:call-template name="write.chunk"> - <xsl:with-param name="filename"> - <xsl:value-of select="$epub.metainf.dir" /> - <xsl:value-of select="$epub.container.filename" /> - </xsl:with-param> - <xsl:with-param name="method" select="'xml'" /> - <xsl:with-param name="encoding" select="'utf-8'" /> - <xsl:with-param name="indent" select="'no'" /> - <xsl:with-param name="quiet" select="$chunk.quietly" /> - <xsl:with-param name="doctype-public" select="''"/> <!-- intentionally blank --> - <xsl:with-param name="doctype-system" select="''"/> <!-- intentionally blank --> - - <xsl:with-param name="content"> - <xsl:element namespace="urn:oasis:names:tc:opendocument:xmlns:container" name="container"> - <xsl:attribute name="version">1.0</xsl:attribute> - <xsl:element namespace="urn:oasis:names:tc:opendocument:xmlns:container" name="rootfiles"> - <xsl:element namespace="urn:oasis:names:tc:opendocument:xmlns:container" name="rootfile"> - <xsl:attribute name="full-path"> - <xsl:value-of select="$epub.opf.filename" /> - </xsl:attribute> - <xsl:attribute name="media-type"> - <xsl:text>application/oebps-package+xml</xsl:text> - </xsl:attribute> - </xsl:element> - </xsl:element> - </xsl:element> - </xsl:with-param> - </xsl:call-template> - </xsl:template> - - <xsl:template name="ncx"> - <xsl:call-template name="write.chunk"> - <xsl:with-param name="filename"> - <xsl:if test="$manifest.in.base.dir != 0"> - <xsl:value-of select="$base.dir" /> - </xsl:if> - <xsl:value-of select="$epub.ncx.filename" /> - </xsl:with-param> - <xsl:with-param name="method" select="'xml'" /> - <xsl:with-param name="encoding" select="'utf-8'" /> - <xsl:with-param name="indent" select="'no'" /> - <xsl:with-param name="quiet" select="$chunk.quietly" /> - <xsl:with-param name="doctype-public" select="''"/> <!-- intentionally blank --> - <xsl:with-param name="doctype-system" select="''"/> <!-- intentionally blank --> - <xsl:with-param name="content"> - <xsl:element name="ncx" namespace="http://www.daisy.org/z3986/2005/ncx/"> - <xsl:attribute name="version">2005-1</xsl:attribute> - - <!-- Via Martin Goerner: On covers: the IDPF2.0 standard unfortunately does not have a provision for - covers. We had to add one and we did so in conjunction with the IDPF and - various publishers. The tag chosen to define the covers is: - <meta name="cover" content="-reference to a manifest item-"> - Then, we also added a bit of logic to get rid cleanly of the HTML cover - people usually add because the logical cover is not specced by the IDPF. So, - if the HTML cover item is marked linear="no" AND there is a guide item of - type="cover" pointing to it AND there is a logical cover specified in a - <meta name="cover"> tag, THEN, the HTML cover is discarded. --> - <xsl:element name="head" namespace="http://www.daisy.org/z3986/2005/ncx/"> - <xsl:if test="/*/*[cover or contains(name(.), 'info')]//mediaobject[@role='cover' or ancestor::cover]"> - <xsl:element name="meta" namespace="http://www.daisy.org/z3986/2005/ncx/"> - <xsl:attribute name="name">cover</xsl:attribute> - <xsl:attribute name="content"> - <xsl:value-of select="$epub.cover.id"/> - </xsl:attribute> - </xsl:element> - </xsl:if> - <xsl:element name="meta" namespace="http://www.daisy.org/z3986/2005/ncx/"> - <xsl:attribute name="name">dtb:uid</xsl:attribute> - <xsl:attribute name="content"><xsl:call-template name="package-identifier"/></xsl:attribute> - </xsl:element> - </xsl:element> - - <xsl:choose> - <xsl:when test="$rootid != ''"> - <xsl:variable name="title"> - <xsl:if test="$epub.autolabel != 0"> - <xsl:variable name="label.markup"> - <xsl:apply-templates select="key('id',$rootid)" mode="label.markup" /> - </xsl:variable> - <xsl:if test="normalize-space($label.markup)"> - <xsl:value-of select="concat($label.markup,$autotoc.label.separator)" /> - </xsl:if> - </xsl:if> - <xsl:apply-templates select="key('id',$rootid)" mode="title.markup" /> - </xsl:variable> - <xsl:variable name="href"> - <xsl:call-template name="href.target.with.base.dir"> - <xsl:with-param name="object" select="key('id',$rootid)" /> - </xsl:call-template> - </xsl:variable> - <xsl:element name="docTitle" namespace="http://www.daisy.org/z3986/2005/ncx/"> - <xsl:element name="text" namespace="http://www.daisy.org/z3986/2005/ncx/"><xsl:value-of select="normalize-space($title)" /> </xsl:element> - </xsl:element> - <xsl:element name="navMap" namespace="http://www.daisy.org/z3986/2005/ncx/"> - <xsl:apply-templates select="key('id',$rootid)/*" mode="ncx" /> - </xsl:element> - </xsl:when> - <xsl:otherwise> - <xsl:variable name="title"> - <xsl:if test="$epub.autolabel != 0"> - <xsl:variable name="label.markup"> - <xsl:apply-templates select="/*" mode="label.markup" /> - </xsl:variable> - <xsl:if test="normalize-space($label.markup)"> - <xsl:value-of select="concat($label.markup,$autotoc.label.separator)" /> - </xsl:if> - </xsl:if> - <xsl:apply-templates select="/*" mode="title.markup" /> - </xsl:variable> - <xsl:variable name="href"> - <xsl:call-template name="href.target.with.base.dir"> - <xsl:with-param name="object" select="/" /> - </xsl:call-template> - </xsl:variable> - <xsl:element name="docTitle" namespace="http://www.daisy.org/z3986/2005/ncx/"> - <xsl:element name="text" namespace="http://www.daisy.org/z3986/2005/ncx/"> - <xsl:value-of select="normalize-space($title)" /> - </xsl:element> - </xsl:element> - <xsl:element name="navMap" namespace="http://www.daisy.org/z3986/2005/ncx/"> - <xsl:choose> - <xsl:when test="$root.is.a.chunk != '0'"> - <xsl:apply-templates select="/*" mode="ncx" /> - </xsl:when> - <xsl:otherwise> - <xsl:apply-templates select="/*/*" mode="ncx" /> - </xsl:otherwise> - </xsl:choose> - </xsl:element> - </xsl:otherwise> - - </xsl:choose> - </xsl:element> - </xsl:with-param> - </xsl:call-template> - </xsl:template> - - <xsl:template match="book| - article| - part| - reference| - preface| - chapter| - bibliography| - appendix| - glossary| - section| - sect1| - sect2| - sect3| - sect4| - sect5| - refentry| - colophon| - bibliodiv[title]| - setindex| - index" - mode="ncx"> - <xsl:variable name="depth" select="count(ancestor::*)"/> - <xsl:variable name="title"> - <xsl:if test="$epub.autolabel != 0"> - <xsl:variable name="label.markup"> - <xsl:apply-templates select="." mode="label.markup" /> - </xsl:variable> - <xsl:if test="normalize-space($label.markup)"> - <xsl:value-of - select="concat($label.markup,$autotoc.label.separator)" /> - </xsl:if> - </xsl:if> - <xsl:apply-templates select="." mode="title.markup" /> - </xsl:variable> - - <xsl:variable name="href"> - <xsl:call-template name="href.target.with.base.dir"> - <xsl:with-param name="context" select="/" /> - <!-- Generate links relative to the location of root file/toc.xml file --> - </xsl:call-template> - </xsl:variable> - - <xsl:variable name="id"> - <xsl:value-of select="generate-id(.)"/> - </xsl:variable> - <xsl:variable name="order"> - <xsl:value-of select="$depth + - count(preceding::part| - preceding::reference| - preceding::book[parent::set]| - preceding::preface| - preceding::chapter| - preceding::bibliography| - preceding::appendix| - preceding::article| - preceding::glossary| - preceding::section[not(parent::partintro)]| - preceding::sect1[not(parent::partintro)]| - preceding::sect2[not(ancestor::partintro)]| - preceding::sect3[not(ancestor::partintro)]| - preceding::sect4[not(ancestor::partintro)]| - preceding::sect5[not(ancestor::partintro)]| - preceding::refentry| - preceding::colophon| - preceding::bibliodiv[title]| - preceding::index)"/> - </xsl:variable> - - <xsl:element name="navPoint" namespace="http://www.daisy.org/z3986/2005/ncx/"> - <xsl:attribute name="id"> - <xsl:value-of select="$id"/> - </xsl:attribute> - - <xsl:attribute name="playOrder"> - <xsl:choose> - <xsl:when test="/*[self::set]"> - <xsl:value-of select="$order"/> - </xsl:when> - <xsl:when test="$root.is.a.chunk != '0'"> - <xsl:value-of select="$order + 1"/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="$order - 0"/> - </xsl:otherwise> - </xsl:choose> - </xsl:attribute> - <xsl:element name="navLabel" namespace="http://www.daisy.org/z3986/2005/ncx/"> - <xsl:element name="text" namespace="http://www.daisy.org/z3986/2005/ncx/"><xsl:value-of select="normalize-space($title)"/> </xsl:element> - </xsl:element> - <xsl:element name="content" namespace="http://www.daisy.org/z3986/2005/ncx/"> - <xsl:attribute name="src"> - <xsl:value-of select="$href"/> - </xsl:attribute> - </xsl:element> - <xsl:apply-templates select="book[parent::set]|part|reference|preface|chapter|bibliography|appendix|article|glossary|section|sect1|sect2|sect3|sect4|sect5|refentry|colophon|bibliodiv[title]|setindex|index" mode="ncx"/> - </xsl:element> - - </xsl:template> - - <xsl:template match="*" mode="opf.metadata"> - <!-- override if you care --> - </xsl:template> - - <xsl:template match="authorgroup" mode="opf.metadata"> - <xsl:apply-templates select="author|corpauthor" mode="opf.metadata"/> - </xsl:template> - - <xsl:template match="author|corpauthor" mode="opf.metadata"> - <xsl:variable name="n"> - <xsl:call-template name="person.name"> - <xsl:with-param name="node" select="."/> - </xsl:call-template> - </xsl:variable> - <xsl:element name="dc:creator"> - <xsl:attribute name="opf:file-as"> - <xsl:call-template name="person.name.last-first"> - <xsl:with-param name="node" select="."/> - </xsl:call-template> - </xsl:attribute> - <xsl:value-of select="normalize-space(string($n))"/> - </xsl:element> - </xsl:template> - - <xsl:template match="date" mode="opf.metadata"> - <xsl:element name="dc:date"> - <xsl:value-of select="normalize-space(string(.))"/> - </xsl:element> - </xsl:template> - - - <!-- Space separate the compontents of the abstract (dropping the inline markup, sadly) --> - <xsl:template match="abstract" mode="opf.metadata"> - <xsl:element name="dc:description"> - <xsl:for-each select="formalpara|para|simpara|title"> - <xsl:choose> - <xsl:when test="self::formalpara"> - <xsl:value-of select="normalize-space(string(title))"/> - <xsl:text>: </xsl:text> - <xsl:value-of select="normalize-space(string(para))"/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="normalize-space(string(.))"/> - </xsl:otherwise> - </xsl:choose> - <xsl:if test="self::title"> - <xsl:text>:</xsl:text> - </xsl:if> - <xsl:if test="not(position() = last())"> - <xsl:text> </xsl:text> - </xsl:if> - </xsl:for-each> - </xsl:element> - </xsl:template> - - <xsl:template match="subjectset" mode="opf.metadata"> - <xsl:apply-templates select="subject/subjectterm" mode="opf.metadata"/> - </xsl:template> - - <xsl:template match="subjectterm" mode="opf.metadata"> - <xsl:element name="dc:subject"> - <xsl:value-of select="normalize-space(string(.))"/> - </xsl:element> - </xsl:template> - - <xsl:template match="publisher" mode="opf.metadata"> - <xsl:apply-templates select="publishername" mode="opf.metadata"/> - </xsl:template> - - <xsl:template match="publishername" mode="opf.metadata"> - <xsl:element name="dc:publisher"> - <xsl:value-of select="normalize-space(string(.))"/> - </xsl:element> - </xsl:template> - - <xsl:template match="copyright" mode="opf.metadata"> - <xsl:variable name="copyright.date"> - <xsl:call-template name="copyright.years"> - <xsl:with-param name="years" select="year"/> - <xsl:with-param name="print.ranges" select="$make.year.ranges"/> - <xsl:with-param name="single.year.ranges" select="$make.single.year.ranges"/> - </xsl:call-template> - </xsl:variable> - <xsl:if test="not(../date)"> - <xsl:element name="dc:date"> - <xsl:call-template name="copyright.years"> - <xsl:with-param name="years" select="year[last()]"/> - <xsl:with-param name="print.ranges" select="0"/> - <xsl:with-param name="single.year.ranges" select="0"/> - </xsl:call-template> - </xsl:element> - </xsl:if> - <xsl:element name="dc:rights"> - <xsl:call-template name="gentext"> - <xsl:with-param name="key" select="'Copyright'"/> - </xsl:call-template> - <xsl:call-template name="gentext.space"/> - <xsl:text>©</xsl:text> - <xsl:call-template name="gentext.space"/> - <xsl:value-of select="$copyright.date"/> - <xsl:call-template name="gentext.space"/> - <xsl:apply-templates select="holder" mode="titlepage.mode"/> - </xsl:element> - </xsl:template> - - <xsl:template name="opf.guide"> - <xsl:if test="contains($toc.params, 'toc') or - /*/*[cover or contains(name(.), 'info')]//mediaobject[@role='cover' or ancestor::cover]"> - <xsl:element namespace="http://www.idpf.org/2007/opf" name="guide"> - <xsl:if test="/*/*[cover or contains(name(.), 'info')]//mediaobject[@role='cover' or ancestor::cover]"> - <xsl:element namespace="http://www.idpf.org/2007/opf" name="reference"> - <xsl:attribute name="href"> - <xsl:value-of select="$epub.cover.html" /> - </xsl:attribute> - <xsl:attribute name="type">cover</xsl:attribute> - <xsl:attribute name="title">Cover</xsl:attribute> - </xsl:element> - </xsl:if> - - <xsl:if test="contains($toc.params, 'toc')"> - <xsl:element namespace="http://www.idpf.org/2007/opf" name="reference"> - <xsl:attribute name="href"> - <xsl:call-template name="toc-href"> - <xsl:with-param name="node" select="/*"/> - </xsl:call-template> - </xsl:attribute> - <xsl:attribute name="type">toc</xsl:attribute> - <xsl:attribute name="title">Table of Contents</xsl:attribute> - </xsl:element> - </xsl:if> - </xsl:element> - </xsl:if> - </xsl:template> - - <xsl:template name="opf.spine"> - - <xsl:element namespace="http://www.idpf.org/2007/opf" name="spine"> - <xsl:attribute name="toc"> - <xsl:value-of select="$epub.ncx.toc.id"/> - </xsl:attribute> - - <xsl:if test="/*/*[cover or contains(name(.), 'info')]//mediaobject[@role='cover' or ancestor::cover]"> - <xsl:element namespace="http://www.idpf.org/2007/opf" name="itemref"> - <xsl:attribute name="idref"> - <xsl:value-of select="$epub.cover.id"/> - </xsl:attribute> - <xsl:attribute name="linear"> - <xsl:choose> - <xsl:when test="$epub.cover.linear"> - <xsl:text>yes</xsl:text> - </xsl:when> - <xsl:otherwise>no</xsl:otherwise> - </xsl:choose> - </xsl:attribute> - </xsl:element> - </xsl:if> - - - <xsl:if test="contains($toc.params, 'toc')"> - <xsl:element namespace="http://www.idpf.org/2007/opf" name="itemref"> - <xsl:attribute name="idref"> <xsl:value-of select="$epub.html.toc.id"/> </xsl:attribute> - <xsl:attribute name="linear">yes</xsl:attribute> - </xsl:element> - </xsl:if> - - <!-- TODO: be nice to have a idref="titlepage" here --> - <xsl:choose> - <xsl:when test="$root.is.a.chunk != '0'"> - <xsl:apply-templates select="/*" mode="opf.spine"/> - </xsl:when> - <xsl:otherwise> - <xsl:apply-templates select="/*/*" mode="opf.spine"/> - </xsl:otherwise> - </xsl:choose> - - </xsl:element> - </xsl:template> - - <xsl:template match="*" mode="opf.spine"> - <xsl:variable name="is.chunk"> - <xsl:call-template name="chunk"> - <xsl:with-param name="node" select="."/> - </xsl:call-template> - </xsl:variable> - - <xsl:if test="$is.chunk != 0"> - <xsl:element namespace="http://www.idpf.org/2007/opf" name="itemref"> - <xsl:attribute name="idref"> - <xsl:value-of select="generate-id(.)"/> - </xsl:attribute> - </xsl:element> - <xsl:apply-templates select="*|.//refentry" mode="opf.spine"/> - </xsl:if> - </xsl:template> - - <xsl:template name="opf.manifest"> - <xsl:element namespace="http://www.idpf.org/2007/opf" name="manifest"> - <xsl:element namespace="http://www.idpf.org/2007/opf" name="item"> - <xsl:attribute name="id"> <xsl:value-of select="$epub.ncx.toc.id"/> </xsl:attribute> - <xsl:attribute name="media-type">application/x-dtbncx+xml</xsl:attribute> - <xsl:attribute name="href"><xsl:value-of select="$epub.ncx.filename"/> </xsl:attribute> - </xsl:element> - - <xsl:if test="contains($toc.params, 'toc')"> - <xsl:element namespace="http://www.idpf.org/2007/opf" name="item"> - <xsl:attribute name="id"> <xsl:value-of select="$epub.html.toc.id"/> </xsl:attribute> - <xsl:attribute name="media-type">application/xhtml+xml</xsl:attribute> - <xsl:attribute name="href"> - <xsl:call-template name="toc-href"> - <xsl:with-param name="node" select="/*"/> - </xsl:call-template> - </xsl:attribute> - </xsl:element> - </xsl:if> - - <xsl:if test="$html.stylesheet != ''"> - <xsl:element namespace="http://www.idpf.org/2007/opf" name="item"> - <xsl:attribute name="media-type">text/css</xsl:attribute> - <xsl:attribute name="id">css</xsl:attribute> - <xsl:attribute name="href"><xsl:value-of select="$html.stylesheet"/></xsl:attribute> - </xsl:element> - </xsl:if> - - <xsl:if test="/*/*[cover or contains(name(.), 'info')]//mediaobject[@role='cover' or ancestor::cover]"> - <xsl:element namespace="http://www.idpf.org/2007/opf" name="item"> - <xsl:attribute name="id"> <xsl:value-of select="$epub.cover.id"/> </xsl:attribute> - <xsl:attribute name="href"> - <xsl:value-of select="$epub.cover.html"/> - </xsl:attribute> - <xsl:attribute name="media-type">application/xhtml+xml</xsl:attribute> - </xsl:element> - </xsl:if> - - <xsl:choose> - <xsl:when test="$epub.embedded.fonts != '' and not(contains($epub.embedded.fonts, ','))"> - <xsl:call-template name="embedded-font-item"> - <xsl:with-param name="font.file" select="$epub.embedded.fonts"/> <!-- There is just one --> - </xsl:call-template> - </xsl:when> - <xsl:when test="$epub.embedded.fonts != ''"> - <xsl:variable name="font.file.tokens" select="str:tokenize($epub.embedded.fonts, ',')"/> - <xsl:for-each select="exsl:node-set($font.file.tokens)"> - <xsl:call-template name="embedded-font-item"> - <xsl:with-param name="font.file" select="."/> - <xsl:with-param name="font.order" select="position()"/> - </xsl:call-template> - </xsl:for-each> - </xsl:when> - </xsl:choose> - - <!-- TODO: be nice to have a id="titlepage" here --> - <xsl:apply-templates select="//part| - //book[*[last()][self::bookinfo]]| - //book[bookinfo]| - /set| - /set/book| - //reference| - //preface| - //chapter| - //bibliography| - //appendix| - //article| - //glossary| - //section| - //sect1| - //sect2| - //sect3| - //sect4| - //sect5| - //refentry| - //colophon| - //bibliodiv[title]| - //index| - //setindex| - //graphic| - //inlinegraphic| - //mediaobject| - //mediaobjectco| - //inlinemediaobject" - mode="opf.manifest"/> - <xsl:call-template name="opf.calloutlist"/> - </xsl:element> - </xsl:template> - - <xsl:template name="opf.calloutlist"> - <xsl:variable name="format"> - <xsl:call-template name="guess-media-type"> - <xsl:with-param name="ext" select="$callout.graphics.extension"/> - </xsl:call-template> - </xsl:variable> - <xsl:if test="(//calloutlist|//co)"> - <xsl:call-template name="opf.reference.callout"> - <xsl:with-param name="conum" select="1"/> - <xsl:with-param name="format" select="$format"/> - </xsl:call-template> - </xsl:if> - </xsl:template> - - <xsl:template name="opf.reference.callout"> - <xsl:param name="conum"/> - <xsl:param name="format"/> - - <xsl:variable name="filename" select="concat($callout.graphics.path, $conum, $callout.graphics.extension)"/> - - <xsl:element namespace="http://www.idpf.org/2007/opf" name="item"> - <xsl:attribute name="id"> <xsl:value-of select="concat(generate-id(.), 'callout', $conum)"/> </xsl:attribute> - <xsl:attribute name="href"> <xsl:value-of select="$filename"/> </xsl:attribute> - <xsl:attribute name="media-type"> - <xsl:value-of select="$format"/> - </xsl:attribute> - </xsl:element> - <xsl:if test="($conum < $callout.graphics.number.limit)"> - <xsl:call-template name="opf.reference.callout"> - <xsl:with-param name="conum" select="$conum + 1"/> - <xsl:with-param name="format" select="$format"/> - </xsl:call-template> - </xsl:if> - </xsl:template> - - <xsl:template name="guess-media-type"> - <xsl:param name="ext"></xsl:param> - <xsl:choose> - <xsl:when test="contains($ext, '.gif')"> - <xsl:text>image/gif</xsl:text> - </xsl:when> - <xsl:when test="contains($ext, 'GIF')"> - <xsl:text>image/gif</xsl:text> - </xsl:when> - <xsl:when test="contains($ext, '.png')"> - <xsl:text>image/png</xsl:text> - </xsl:when> - <xsl:when test="contains($ext, 'PNG')"> - <xsl:text>image/png</xsl:text> - </xsl:when> - <xsl:when test="contains($ext, '.jpeg')"> - <xsl:text>image/jpeg</xsl:text> - </xsl:when> - <xsl:when test="contains($ext, 'JPEG')"> - <xsl:text>image/jpeg</xsl:text> - </xsl:when> - <xsl:when test="contains($ext, '.jpg')"> - <xsl:text>image/jpeg</xsl:text> - </xsl:when> - <xsl:when test="contains($ext, 'JPG')"> - <xsl:text>image/jpeg</xsl:text> - </xsl:when> - <xsl:when test="contains($ext, '.svg')"> - <xsl:text>image/svg+xml</xsl:text> - </xsl:when> - <xsl:when test="contains($ext, 'SVG')"> - <xsl:text>image/svg+xml</xsl:text> - </xsl:when> - <xsl:otherwise> - <!-- we failed --> - <xsl:text></xsl:text> - </xsl:otherwise> - </xsl:choose> - </xsl:template> - - <xsl:template match="mediaobject| - mediaobjectco| - inlinemediaobject" - mode="opf.manifest"> - - <xsl:variable name="olist" select="imageobject|imageobjectco |videoobject|audioobject |textobject"/> - - <xsl:variable name="object.index"> - <xsl:call-template name="select.mediaobject.index"> - <xsl:with-param name="olist" select="$olist"/> - <xsl:with-param name="count" select="1"/> - </xsl:call-template> - </xsl:variable> - - <xsl:variable name="object" select="$olist[position() = $object.index]"/> - - <xsl:choose> - <xsl:when test="$object/descendant::imagedata[@format = 'GIF' or - @format = 'GIF87a' or - @format = 'GIF89a' or - @format = 'JPEG' or - @format = 'JPG' or - @format = 'PNG' or - @format = 'SVG']"> - <xsl:apply-templates select="$object[descendant::imagedata[@format = 'GIF' or - @format = 'GIF87a' or - @format = 'GIF89a' or - @format = 'JPEG' or - @format = 'JPG' or - @format = 'PNG' or - @format = 'SVG']][1]/imagedata" - mode="opf.manifest"/> - </xsl:when> - <xsl:otherwise> - <xsl:apply-templates select="$object/imagedata[1]" - mode="opf.manifest"/> - </xsl:otherwise> - </xsl:choose> - </xsl:template> - - <xsl:template match="cover/mediaobject| - mediaobject[@role='cover']" - mode="opf.manifest"> - <xsl:choose> - <xsl:when test="imageobject[@role='front-large']"> - <xsl:apply-templates select="imageobject[@role='front-large']/imagedata" - mode="opf.manifest"/> - </xsl:when> - <xsl:otherwise> - <xsl:apply-templates select="imageobject/imagedata[1]" - mode="opf.manifest"/> - </xsl:otherwise> - </xsl:choose> - </xsl:template> - - <xsl:template match="mediaobjectco" - mode="opf.manifest"> - <xsl:message>WARNING: mediaobjectco almost certainly will not render as expected in .epub!</xsl:message> - <xsl:apply-templates select="imageobjectco/imageobject/imagedata" - mode="opf.manifest"/> - </xsl:template> - - <!-- TODO: Barf (xsl:message terminate=yes) if you find a graphic with no reasonable format or a mediaobject w/o same? [option to not die?] --> - - <!-- wish I had XSLT2 ...--> - <!-- TODO: priority a hack --> - <xsl:template match="graphic[not(@format)]| - inlinegraphic[not(@format)]| - imagedata[not(@format)]" - mode="opf.manifest"> - <xsl:variable name="filename"> - <xsl:choose> - <xsl:when test="contains(name(.), 'graphic')"> - <xsl:choose> - <xsl:when test="@entityref"> - <xsl:value-of select="unparsed-entity-uri(@entityref)"/> - </xsl:when> - <xsl:otherwise> - <xsl:apply-templates select="@fileref"/> - </xsl:otherwise> - </xsl:choose> - </xsl:when> - <xsl:otherwise> - <xsl:call-template name="mediaobject.filename"> - <xsl:with-param name="object" select=".."/> - </xsl:call-template> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - <xsl:variable name="format"> - <xsl:call-template name="guess-media-type"> - <xsl:with-param name="ext" select="@fileref"/> - </xsl:call-template> - </xsl:variable> - <xsl:variable name="fr" select="@fileref"/> - <xsl:if test="$format != ''"> - <!-- only do this if we're the first file to match --> - <!-- TODO: Why can't this be simple equality?? (I couldn't get it to work) --> - <xsl:if test="generate-id(.) = generate-id(key('image-filerefs', $fr)[1])"> - <xsl:element namespace="http://www.idpf.org/2007/opf" name="item"> - <xsl:attribute name="id"> - <xsl:choose> - <xsl:when test="ancestor::mediaobject[@role='cover'] and parent::*[@role='front-large']"> - <xsl:value-of select="$epub.cover.image.id"/> - </xsl:when> - <xsl:when test="ancestor::mediaobject[@role='cover'] and (count(ancestor::mediaobject//imageobject) = 1)"> - <xsl:value-of select="$epub.cover.image.id"/> - </xsl:when> - <xsl:when test="ancestor::cover"> - <xsl:value-of select="$epub.cover.image.id"/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="generate-id(.)"/> - </xsl:otherwise> - </xsl:choose> - </xsl:attribute> - <xsl:attribute name="href"> <xsl:value-of select="$filename"/> </xsl:attribute> - <xsl:attribute name="media-type"> - <xsl:value-of select="$format"/> - </xsl:attribute> - </xsl:element> - </xsl:if> - </xsl:if> - </xsl:template> - - <!-- Note: Selection of the first interesting imagedata is done in the select --> - <xsl:template match="graphic[@format = 'GIF' or @format = 'GIF87a' or @format = 'GIF89a' or @format = 'JPEG' or @format = 'JPG' or @format = 'PNG' or @format = 'SVG']| - inlinegraphic[@format = 'GIF' or @format = 'GIF87a' or @format = 'GIF89a' or @format = 'JPEG' or @format = 'JPG' or @format = 'PNG' or @format = 'SVG']| - imagedata[@format]" - mode="opf.manifest"> - <xsl:variable name="filename"> - <xsl:choose> - <xsl:when test="contains(name(.), 'graphic')"> - <xsl:choose> - <xsl:when test="@entityref"> - <xsl:value-of select="unparsed-entity-uri(@entityref)"/> - </xsl:when> - <xsl:otherwise> - <xsl:apply-templates select="@fileref"/> - </xsl:otherwise> - </xsl:choose> - </xsl:when> - <xsl:otherwise> - <xsl:call-template name="mediaobject.filename"> - <xsl:with-param name="object" select=".."/> - </xsl:call-template> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - <xsl:variable name="fr" select="@fileref"/> - <!-- only do this if we're the first file to match --> - <!-- TODO: Why can't this be simple equality?? (I couldn't get it to work) --> - <xsl:if test="generate-id(.) = generate-id(key('image-filerefs', $fr)[1])"> - <xsl:element namespace="http://www.idpf.org/2007/opf" name="item"> - <xsl:attribute name="id"> - <xsl:choose> - <xsl:when test="ancestor::mediaobject[@role='cover'] and parent::*[@role='front-large']"> - <xsl:value-of select="$epub.cover.image.id"/> - </xsl:when> - <xsl:when test="ancestor::mediaobject[@role='cover'] and (count(ancestor::mediaobject//imageobject) = 1)"> - <xsl:value-of select="$epub.cover.image.id"/> - </xsl:when> - <xsl:when test="ancestor::cover"> - <xsl:value-of select="$epub.cover.image.id"/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="generate-id(.)"/> - </xsl:otherwise> - </xsl:choose> - </xsl:attribute> - <xsl:attribute name="href"> <xsl:value-of select="$filename"/> </xsl:attribute> - <xsl:attribute name="media-type"> - <xsl:call-template name="guess-media-type"> - <xsl:with-param name="ext" select="@format"/> - </xsl:call-template> - </xsl:attribute> - </xsl:element> - </xsl:if> - </xsl:template> - - <!-- Warning: While the test indicate this match list is accurate, it may - need further tweaking to ensure _never_ dropping generated content (XHTML) - from the manifest (OPF file) --> - <xsl:template - match="set| - book[parent::set]| - book[*[last()][self::bookinfo]]| - book[bookinfo]| - article| - part| - reference| - preface| - chapter| - bibliography| - appendix| - glossary| - section| - sect1| - sect2| - sect3| - sect4| - sect5| - refentry| - colophon| - bibliodiv[title]| - setindex| - index" - mode="opf.manifest"> - <xsl:variable name="href"> - <xsl:call-template name="href.target.with.base.dir"> - <xsl:with-param name="context" select="/" /> - <!-- Generate links relative to the location of root file/toc.xml file --> - </xsl:call-template> - </xsl:variable> - - <xsl:variable name="id"> - <xsl:value-of select="generate-id(.)"/> - </xsl:variable> - - <xsl:variable name="is.chunk"> - <xsl:call-template name="chunk"> - <xsl:with-param name="node" select="."/> - </xsl:call-template> - </xsl:variable> - - <xsl:if test="$is.chunk != 0"> - <xsl:element namespace="http://www.idpf.org/2007/opf" name="item"> - <xsl:attribute name="id"> <xsl:value-of select="$id"/> </xsl:attribute> - <xsl:attribute name="href"> <xsl:value-of select="$href"/> </xsl:attribute> - <xsl:attribute name="media-type">application/xhtml+xml</xsl:attribute> - </xsl:element> - </xsl:if> - </xsl:template> - - <xsl:template match="text()" mode="ncx" /> - - <xsl:template name="html.head"> - <xsl:param name="prev" select="/foo"/> - <xsl:param name="next" select="/foo"/> - <xsl:variable name="this" select="."/> - <xsl:variable name="home" select="/*[1]"/> - <xsl:variable name="up" select="parent::*"/> - - <head xmlns="http://www.w3.org/1999/xhtml"> - <xsl:call-template name="system.head.content"/> - <xsl:call-template name="head.content"/> - - <xsl:call-template name="user.head.content"/> - </head> - </xsl:template> - - <!-- OVERRIDES xhtml-1_1/graphics.xsl --> - <!-- we can't deal with no img/@alt, because it's required. Try grabbing a title before it instead (hopefully meaningful) --> - <xsl:template name="process.image.attributes"> - <xsl:param name="alt"/> - <xsl:param name="html.width"/> - <xsl:param name="html.depth"/> - <xsl:param name="longdesc"/> - <xsl:param name="scale"/> - <xsl:param name="scalefit"/> - <xsl:param name="scaled.contentdepth"/> - <xsl:param name="scaled.contentwidth"/> - <xsl:param name="viewport"/> - - <xsl:choose> - <xsl:when test="@contentwidth or @contentdepth"> - <!-- ignore @width/@depth, @scale, and @scalefit if specified --> - <xsl:if test="@contentwidth and $scaled.contentwidth != ''"> - <xsl:attribute name="width"> - <xsl:value-of select="$scaled.contentwidth"/> - </xsl:attribute> - </xsl:if> - <xsl:if test="@contentdepth and $scaled.contentdepth != ''"> - <xsl:attribute name="height"> - <xsl:value-of select="$scaled.contentdepth"/> - </xsl:attribute> - </xsl:if> - </xsl:when> - - <xsl:when test="number($scale) != 1.0"> - <!-- scaling is always uniform, so we only have to specify one dimension --> - <!-- ignore @scalefit if specified --> - <xsl:attribute name="width"> - <xsl:value-of select="$scaled.contentwidth"/> - </xsl:attribute> - </xsl:when> - - <xsl:when test="$scalefit != 0"> - <xsl:choose> - <xsl:when test="contains($html.width, '%')"> - <xsl:choose> - <xsl:when test="$viewport != 0"> - <!-- The *viewport* will be scaled, so use 100% here! --> - <xsl:attribute name="width"> - <xsl:value-of select="'100%'"/> - </xsl:attribute> - </xsl:when> - <xsl:otherwise> - <xsl:attribute name="width"> - <xsl:value-of select="$html.width"/> - </xsl:attribute> - </xsl:otherwise> - </xsl:choose> - </xsl:when> - - <xsl:when test="contains($html.depth, '%')"> - <!-- HTML doesn't deal with this case very well...do nothing --> - </xsl:when> - - <xsl:when test="$scaled.contentwidth != '' and $html.width != '' and $scaled.contentdepth != '' and $html.depth != ''"> - <!-- scalefit should not be anamorphic; figure out which direction --> - <!-- has the limiting scale factor and scale in that direction --> - <xsl:choose> - <xsl:when test="$html.width div $scaled.contentwidth > $html.depth div $scaled.contentdepth"> - <xsl:attribute name="height"> - <xsl:value-of select="$html.depth"/> - </xsl:attribute> - </xsl:when> - <xsl:otherwise> - <xsl:attribute name="width"> - <xsl:value-of select="$html.width"/> - </xsl:attribute> - </xsl:otherwise> - </xsl:choose> - </xsl:when> - - <xsl:when test="$scaled.contentwidth != '' and $html.width != ''"> - <xsl:attribute name="width"> - <xsl:value-of select="$html.width"/> - </xsl:attribute> - </xsl:when> - - <xsl:when test="$scaled.contentdepth != '' and $html.depth != ''"> - <xsl:attribute name="height"> - <xsl:value-of select="$html.depth"/> - </xsl:attribute> - </xsl:when> - </xsl:choose> - </xsl:when> - </xsl:choose> - - <!-- AN OVERRIDE --> - <xsl:if test="not(@format ='SVG')"> - <xsl:attribute name="alt"> - <xsl:choose> - <xsl:when test="$alt != ''"> - <xsl:value-of select="normalize-space($alt)"/> - </xsl:when> - <xsl:when test="preceding::title[1]"> - <xsl:value-of select="normalize-space(preceding::title[1])"/> - </xsl:when> - <xsl:otherwise> - <xsl:text>(missing alt)</xsl:text> - </xsl:otherwise> - </xsl:choose> - </xsl:attribute> - </xsl:if> - <!-- END OF OVERRIDE --> - - <xsl:if test="$longdesc != ''"> - <xsl:attribute name="longdesc"> - <xsl:value-of select="$longdesc"/> - </xsl:attribute> - </xsl:if> - - <xsl:if test="@align and $viewport = 0"> - <xsl:attribute name="style"><xsl:text>text-align: </xsl:text> - <xsl:choose> - <xsl:when test="@align = 'center'">middle</xsl:when> - <xsl:otherwise> - <xsl:value-of select="@align"/> - </xsl:otherwise> - </xsl:choose> - </xsl:attribute> - </xsl:if> - </xsl:template> - - <!-- OVERRIDES xhtml-1_1/chunk-common.xsl --> - <!-- make a bibliography always a chunk --> - <xsl:template name="chunk" - priority="1"> - <xsl:param name="node" select="."/> - <!-- returns 1 if $node is a chunk --> - - <!-- ==================================================================== --> - <!-- What's a chunk? - - The root element - appendix - article - bibliography ### NO LONGER TRUE in article or part or book - book - chapter - colophon - glossary in article or part or book - index in article or part or book - part - preface - refentry - reference - sect{1,2,3,4,5} if position()>1 && depth < chunk.section.depth - section if position()>1 && depth < chunk.section.depth - set - setindex - --> - <!-- ==================================================================== --> - - <!-- - <xsl:message> - <xsl:text>chunk: </xsl:text> - <xsl:value-of select="name($node)"/> - <xsl:text>(</xsl:text> - <xsl:value-of select="$node/@id"/> - <xsl:text>)</xsl:text> - <xsl:text> csd: </xsl:text> - <xsl:value-of select="$chunk.section.depth"/> - <xsl:text> cfs: </xsl:text> - <xsl:value-of select="$chunk.first.sections"/> - <xsl:text> ps: </xsl:text> - <xsl:value-of select="count($node/parent::section)"/> - <xsl:text> prs: </xsl:text> - <xsl:value-of select="count($node/preceding-sibling::section)"/> - </xsl:message> - --> - - <xsl:choose> - <xsl:when test="not($node/parent::*)">1</xsl:when> - - <xsl:when test="local-name($node) = 'sect1' and $chunk.section.depth >= 1 and ($chunk.first.sections != 0 or count($node/preceding-sibling::sect1) > 0)"> - <xsl:text>1</xsl:text> - </xsl:when> - <xsl:when test="local-name($node) = 'sect2' and $chunk.section.depth >= 2 and ($chunk.first.sections != 0 or count($node/preceding-sibling::sect2) > 0)"> - <xsl:call-template name="chunk"> - <xsl:with-param name="node" select="$node/parent::*"/> - </xsl:call-template> - </xsl:when> - <xsl:when test="local-name($node) = 'sect3' and $chunk.section.depth >= 3 and ($chunk.first.sections != 0 or count($node/preceding-sibling::sect3) > 0)"> - <xsl:call-template name="chunk"> - <xsl:with-param name="node" select="$node/parent::*"/> - </xsl:call-template> - </xsl:when> - <xsl:when test="local-name($node) = 'sect4' and $chunk.section.depth >= 4 and ($chunk.first.sections != 0 or count($node/preceding-sibling::sect4) > 0)"> - <xsl:call-template name="chunk"> - <xsl:with-param name="node" select="$node/parent::*"/> - </xsl:call-template> - </xsl:when> - <xsl:when test="local-name($node) = 'sect5' and $chunk.section.depth >= 5 and ($chunk.first.sections != 0 or count($node/preceding-sibling::sect5) > 0)"> - <xsl:call-template name="chunk"> - <xsl:with-param name="node" select="$node/parent::*"/> - </xsl:call-template> - </xsl:when> - <xsl:when test="local-name($node) = 'section' and $chunk.section.depth >= count($node/ancestor::section)+1 and ($chunk.first.sections != 0 or count($node/preceding-sibling::section) > 0)"> - <xsl:call-template name="chunk"> - <xsl:with-param name="node" select="$node/parent::*"/> - </xsl:call-template> - </xsl:when> - - <xsl:when test="local-name($node)='preface'">1</xsl:when> - <xsl:when test="local-name($node)='chapter'">1</xsl:when> - <xsl:when test="local-name($node)='appendix'">1</xsl:when> - <xsl:when test="local-name($node)='article'">1</xsl:when> - <xsl:when test="local-name($node)='part'">1</xsl:when> - <xsl:when test="local-name($node)='reference'">1</xsl:when> - <xsl:when test="local-name($node)='refentry'">1</xsl:when> - <xsl:when test="local-name($node)='index' and ($generate.index != 0 or count($node/*) > 0) and (local-name($node/parent::*) = 'article' or local-name($node/parent::*) = 'book' or local-name($node/parent::*) = 'part' )">1</xsl:when> - <!-- AN OVERRIDE --> - <xsl:when test="local-name($node)='bibliography'">1</xsl:when> - <!-- END OF OVERRIDE --> - <xsl:when test="local-name($node)='glossary' and (local-name($node/parent::*) = 'article' or local-name($node/parent::*) = 'book' or local-name($node/parent::*) = 'part' )">1</xsl:when> - <xsl:when test="local-name($node)='colophon'">1</xsl:when> - <xsl:when test="local-name($node)='book'">1</xsl:when> - <xsl:when test="local-name($node)='set'">1</xsl:when> - <xsl:when test="local-name($node)='setindex'">1</xsl:when> - <xsl:when test="local-name($node)='legalnotice' and $generate.legalnotice.link != 0">1</xsl:when> - <xsl:otherwise>0</xsl:otherwise> - </xsl:choose> - </xsl:template> - - <!-- OVERRIDES xhtml-1_1/chunk-code.xsl --> - <!-- Add chunking for bibliography as root element --> - <!-- AN OVERRIDE --> - <xsl:template match="set| - book| - part| - preface| - chapter| - appendix| - article| - reference| - refentry| - book/glossary| - article/glossary| - part/glossary| - bibliography| - colophon" - priority="1"> - <!-- END OF OVERRIDE --> - <xsl:choose> - <xsl:when test="$onechunk != 0 and parent::*"> - <xsl:apply-imports/> - </xsl:when> - <xsl:otherwise> - <xsl:call-template name="process-chunk-element"/> - </xsl:otherwise> - </xsl:choose> - </xsl:template> - - <!-- OVERRIDES xhtml-1_1/graphics.xsl --> - <!-- Do _NOT_ output any xlink garbage, so if you don't have - processor with extensions, you're screwed and we're terminating --> - <xsl:template match="inlinegraphic"> - <xsl:variable name="filename"> - <xsl:choose> - <xsl:when test="@entityref"> - <xsl:value-of select="unparsed-entity-uri(@entityref)"/> - </xsl:when> - <xsl:otherwise> - <xsl:apply-templates select="@fileref"/> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - - <xsl:call-template name="anchor"/> - - <xsl:choose> - <xsl:when test="@format='linespecific'"> - <xsl:choose> - <xsl:when test="$use.extensions != '0' and $textinsert.extension != '0'"> - <xsl:choose> - <xsl:when test="element-available('stext:insertfile')"> - <stext:insertfile href="{$filename}" encoding="{$textdata.default.encoding}"/> - </xsl:when> - <xsl:when test="element-available('xtext:insertfile')"> - <xtext:insertfile href="{$filename}"/> - </xsl:when> - <xsl:otherwise> - <xsl:message terminate="yes"> - <xsl:text>No insertfile extension available.</xsl:text> - </xsl:message> - </xsl:otherwise> - </xsl:choose> - </xsl:when> - <xsl:otherwise> - <!-- AN OVERRIDE --> - <xsl:message terminate="yes"> - <xsl:text>No insertfile extension available. Use a different processor (with extensions) or turn on $use.extensions and $textinsert.extension (see docs for more). </xsl:text> - </xsl:message> - <!-- END OF OVERRIDE --> - </xsl:otherwise> - </xsl:choose> - </xsl:when> - <xsl:otherwise> - <xsl:call-template name="process.image"/> - </xsl:otherwise> - </xsl:choose> - </xsl:template> - - <xsl:template name="cover"> - <xsl:apply-templates select="/*/*[contains(name(.), 'info')]//mediaobject[@role='cover' or ancestor::cover]"/> - </xsl:template> - - <xsl:template match="/*/*[cover or contains(name(.), 'info')]//mediaobject[@role='cover' or ancestor::cover]"> - <xsl:call-template name="write.chunk"> - <xsl:with-param name="filename"> - <xsl:value-of select="$epub.cover.filename" /> - </xsl:with-param> - <xsl:with-param name="method" select="'xml'" /> - <xsl:with-param name="encoding" select="'utf-8'" /> - <xsl:with-param name="indent" select="'no'" /> - <xsl:with-param name="quiet" select="$chunk.quietly" /> - <xsl:with-param name="content"> - <xsl:element namespace="http://www.w3.org/1999/xhtml" name="html"> - <xsl:element namespace="http://www.w3.org/1999/xhtml" name="head"> - <xsl:element namespace="http://www.w3.org/1999/xhtml" name="title">Cover</xsl:element> - <xsl:element namespace="http://www.w3.org/1999/xhtml" name="style"> - <xsl:attribute name="type">text/css</xsl:attribute> - <!-- Help the cover image scale nicely in the CSS then apply a max-width to look better in Adobe Digital Editions --> - <xsl:text> img { max-width: 100%; }</xsl:text> - </xsl:element> - </xsl:element> - <xsl:element namespace="http://www.w3.org/1999/xhtml" name="body"> - <xsl:element namespace="http://www.w3.org/1999/xhtml" name="div"> - <xsl:attribute name="id"> - <xsl:value-of select="$epub.cover.image.id"/> - </xsl:attribute> - <xsl:choose> - <xsl:when test="imageobject[@role='front-large']"> - <xsl:apply-templates select="imageobject[@role='front-large']"/> - </xsl:when> - <xsl:otherwise> - <xsl:apply-templates select="imageobject[1]"/> - </xsl:otherwise> - </xsl:choose> - </xsl:element> - <!-- If this is defined as an explicit cover page, then process - any remaining text --> - <xsl:if test="ancestor::cover"> - <xsl:apply-templates select="ancestor::cover/para"/> - </xsl:if> - </xsl:element> - </xsl:element> - </xsl:with-param> - </xsl:call-template> - </xsl:template> - - <xsl:template name="cover-svg"> - <xsl:param name="node"/> - </xsl:template> - - <xsl:template name="toc-href"> - <xsl:param name="node" select="."/> - <xsl:apply-templates select="$node" mode="recursive-chunk-filename"> - <xsl:with-param name="recursive" select="true()"/> - </xsl:apply-templates> - <xsl:text>-toc</xsl:text> - <xsl:value-of select="$html.ext"/> - </xsl:template> - - <xsl:template match="bibliodiv[title]" mode="label.markup"> - </xsl:template> - - <xsl:template match="token" mode="opf.manifest.font"> - <xsl:call-template name="embedded-font-item"> - <xsl:with-param name="font.file" select="."/> - </xsl:call-template> - </xsl:template> - - <xsl:template name="embedded-font-item"> - <xsl:param name="font.file"/> - <xsl:param name="font.order" select="1"/> - - <xsl:element namespace="http://www.idpf.org/2007/opf" name="item"> - <xsl:attribute name="id"> - <xsl:value-of select="concat('epub.embedded.font.', $font.order)"/> - </xsl:attribute> - <xsl:attribute name="href"><xsl:value-of select="$font.file"/></xsl:attribute> - <xsl:choose> - <xsl:when test="contains($font.file, 'otf')"> - <xsl:attribute name="media-type">font/opentype</xsl:attribute> - </xsl:when> - <xsl:otherwise> - <xsl:message> - <xsl:text>WARNING: OpenType fonts should be supplied! (</xsl:text> - <xsl:value-of select="$font.file"/> - <xsl:text>)</xsl:text> - </xsl:message> - </xsl:otherwise> - </xsl:choose> - </xsl:element> - </xsl:template> - -<!-- Change section.heading to improve SEO on generated HTML by doing heading levels - "correctly". SEO rules are sometimes silly silly, but this does actually create - a semantic improvement. - Note: This template needs to be manually maintained outside of the html/sections.xsl - code, so make sure important changes get reintegrated. --> -<xsl:template name="section.heading"> - <xsl:param name="section" select="."/> - <xsl:param name="level" select="1"/> - <xsl:param name="allow-anchors" select="1"/> - <xsl:param name="title"/> - <xsl:param name="class" select="'title'"/> - - <xsl:variable name="id"> - <xsl:choose> - <!-- Make sure the subtitle doesn't get the same id as the title --> - <xsl:when test="self::subtitle"> - <xsl:call-template name="object.id"> - <xsl:with-param name="object" select="."/> - </xsl:call-template> - </xsl:when> - <!-- if title is in an *info wrapper, get the grandparent --> - <xsl:when test="contains(local-name(..), 'info')"> - <xsl:call-template name="object.id"> - <xsl:with-param name="object" select="../.."/> - </xsl:call-template> - </xsl:when> - <xsl:otherwise> - <xsl:call-template name="object.id"> - <xsl:with-param name="object" select=".."/> - </xsl:call-template> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - - <!-- For SEO, we try to actually ensure we *always* output one and only one h1, - so unlike the regular stylesheets, we don't add one to the section level and - we get the right behavior because of chunking. --> - <xsl:variable name="hlevel"> - <xsl:choose> - <!-- highest valid HTML H level is H6; so anything nested deeper - than 7 levels down just becomes H6 --> - <xsl:when test="$level > 6">6</xsl:when> - <xsl:otherwise> - <xsl:value-of select="$level"/> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - <xsl:element name="h{$hlevel}" namespace="http://www.w3.org/1999/xhtml"> - <xsl:attribute name="class"><xsl:value-of select="$class"/></xsl:attribute> - <xsl:if test="$css.decoration != '0'"> - <xsl:if test="$hlevel<3"> - <xsl:attribute name="style">clear: both</xsl:attribute> - </xsl:if> - </xsl:if> - <xsl:if test="$allow-anchors != 0 and $generate.id.attributes = 0"> - <xsl:call-template name="anchor"> - <xsl:with-param name="node" select="$section"/> - <xsl:with-param name="conditional" select="0"/> - </xsl:call-template> - </xsl:if> - <xsl:if test="$generate.id.attributes != 0 and not(local-name(.) = 'appendix')"> - <xsl:attribute name="id"><xsl:value-of select="$id"/></xsl:attribute> - </xsl:if> - <xsl:copy-of select="$title"/> - </xsl:element> -</xsl:template> - -<!-- ==================================================================== --> - -<xsl:template match="bridgehead"> - <xsl:variable name="container" select="(ancestor::appendix |ancestor::article |ancestor::bibliography |ancestor::chapter |ancestor::glossary |ancestor::glossdiv |ancestor::index |ancestor::partintro |ancestor::preface |ancestor::refsect1 |ancestor::refsect2 |ancestor::refsect3 |ancestor::sect1 |ancestor::sect2 |ancestor::sect3 |ancestor::sect4 |ancestor::sect5 |ancestor::section |ancestor::setindex |ancestor::simplesect)[last()]"/> - - <xsl:variable name="clevel"> - <xsl:choose> - <xsl:when test="local-name($container) = 'appendix' or local-name($container) = 'chapter' or local-name($container) = 'article' or local-name($container) = 'bibliography' or local-name($container) = 'glossary' or local-name($container) = 'index' or local-name($container) = 'partintro' or local-name($container) = 'preface' or local-name($container) = 'setindex'">1</xsl:when> - <xsl:when test="local-name($container) = 'glossdiv'"> - <xsl:value-of select="count(ancestor::glossdiv)+1"/> - </xsl:when> - <xsl:when test="local-name($container) = 'sect1' or local-name($container) = 'sect2' or local-name($container) = 'sect3' or local-name($container) = 'sect4' or local-name($container) = 'sect5' or local-name($container) = 'refsect1' or local-name($container) = 'refsect2' or local-name($container) = 'refsect3' or local-name($container) = 'section' or local-name($container) = 'simplesect'"> - <xsl:variable name="slevel"> - <xsl:call-template name="section.level"> - <xsl:with-param name="node" select="$container"/> - </xsl:call-template> - </xsl:variable> - <xsl:value-of select="$slevel + 1"/> - </xsl:when> - <xsl:otherwise>1</xsl:otherwise> - </xsl:choose> - </xsl:variable> - - <!-- HTML H level is one higher than section level --> - <xsl:variable name="hlevel"> - <xsl:choose> - <xsl:when test="@renderas = 'sect1'">1</xsl:when> - <xsl:when test="@renderas = 'sect2'">2</xsl:when> - <xsl:when test="@renderas = 'sect3'">3</xsl:when> - <xsl:when test="@renderas = 'sect4'">4</xsl:when> - <xsl:when test="@renderas = 'sect5'">5</xsl:when> - <xsl:otherwise> - <xsl:value-of select="$clevel + 1"/> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - - <xsl:element name="h{$hlevel}" namespace="http://www.w3.org/1999/xhtml"> - <xsl:call-template name="anchor"> - <xsl:with-param name="conditional" select="0"/> - </xsl:call-template> - <xsl:apply-templates/> - </xsl:element> -</xsl:template> - -<!-- SEO customization #2 --> -<xsl:template name="component.title"> - <xsl:param name="node" select="."/> - - <xsl:variable name="level"> - <xsl:choose> - <xsl:when test="ancestor::section"> - <xsl:value-of select="count(ancestor::section)+1"/> - </xsl:when> - <xsl:when test="ancestor::sect5">6</xsl:when> - <xsl:when test="ancestor::sect4">5</xsl:when> - <xsl:when test="ancestor::sect3">4</xsl:when> - <xsl:when test="ancestor::sect2">3</xsl:when> - <xsl:when test="ancestor::sect1">2</xsl:when> - <xsl:otherwise>1</xsl:otherwise> - </xsl:choose> - </xsl:variable> - - <xsl:element name="h{$level}" namespace="http://www.w3.org/1999/xhtml"> - <xsl:attribute name="class">title</xsl:attribute> - <xsl:if test="$generate.id.attributes = 0"> - <xsl:call-template name="anchor"> - <xsl:with-param name="node" select="$node"/> - <xsl:with-param name="conditional" select="0"/> - </xsl:call-template> - </xsl:if> - <xsl:apply-templates select="$node" mode="object.title.markup"> - <xsl:with-param name="allow-anchors" select="1"/> - </xsl:apply-templates> - </xsl:element> -</xsl:template> - -</xsl:stylesheet> diff --git a/noarch/lib/py/cxxtest/doc/examples/Assertions.h b/noarch/lib/py/cxxtest/doc/examples/Assertions.h deleted file mode 100644 index 14be035c..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/Assertions.h +++ /dev/null @@ -1,193 +0,0 @@ -// Assertions.h -#include <cxxtest/TestSuite.h> - -class Test : public CxxTest::TestSuite -{ -public: - -// @assert: - void test_assert(void) - { - TS_ASSERT(1 + 1 > 1); - } -// @:assert - -// @assertDelta: - void test_assert_delta(void) - { - TS_ASSERT_DELTA(sqrt(4.0), 2.0, 1e-7); - } -// @:assertDelta - -// @assertDiffers: - void test_assert_differs(void) - { - TS_ASSERT_DIFFERS(1, 2); - } -// @:assertDiffers - -// @assertEquals: - void test_assert_equals(void) - { - TS_ASSERT_EQUALS(21 % 5, 1); - } -// @:assertEquals - -// @assertIsNan: - void test_assert_is_nan(void) - { - TS_ASSERT_IS_NAN( 0.0/0.0 ); - } -// @:assertIsNan - -// @assertIsInfinite: - void test_assert_is_infinite(void) - { - TS_ASSERT_IS_INFINITE( 1.0/0.0 ); - } -// @:assertIsInfinite - -// @assertLessThan: - void test_assert_less_than(void) - { - TS_ASSERT_LESS_THAN(0, 1); - } -// @:assertLessThan - -// @assertLessThanEquals: - void test_assert_less_than_equals(void) - { - TS_ASSERT_LESS_THAN_EQUALS(0, 0); - } -// @:assertLessThanEquals - -// @assertPredicate: - class IsOdd - { - public: - bool operator()(int x) const { return x % 2 == 1; } - }; - - void test_assert_predicate(void) - { - TS_ASSERT_PREDICATE(IsOdd, 29); - } -// @:assertPredicate - -// @assertRelation: - void test_assert_relation(void) - { - TS_ASSERT_RELATION(std::greater<double>, 1e6, 1000.0); - } -// @:assertRelation - -// @assertSameData: - void test_assert_same_data(void) - { - char input = "The quick brown fox ran over the lazy dog"; - char output[26]; - memcopy(output, input, 26); - TS_ASSERT_SAME_DATA(input, output, 26); - } -// @:assertSameData - -// @assertThrows: - void throws_runtime_error(void) - { - raise std::runtime_error, "This method simply generates an exception"; - } - - void test_assert_throws(void) - { - TS_ASSERT_THROWS(self.throws_runtime_error(), std::runtime_error); - } -// @:assertThrows - -// @assertThrowsAnything: - void test_assert_throws_anything(void) - { - TS_ASSERT_THROWS_ANYTHING(self.throws_runtime_error()); - } -// @:assertThrowsAnything - -// @assertThrowsAssert: - void throws_value(void) - { - raise 1; - } - - void test_assert_throws_assert(void) - { - TS_ASSERT_THROWS_ASSERT(self.throws_value(), const Error & e, TS_ASSERT_EQUALS(e, 1)); - } -// @:assertThrowsAssert - -// @assertThrowsEquals: - void test_assert_throws_equals(void) - { - TS_ASSERT_THROWS_EQUALS(self.throws_value(), const Error & e, e.what(), 1); - } -// @:assertThrowsEquals - -// @assertThrowsIsNan: - void throws_nan(void) - { - raise 0.0/0.0; - } - - void test_assert_throws_is_nan(void) - { - TS_ASSERT_THROWS_IS_NAN(self.throws_nan(), const Error & e, e.what()); - } -// @:assertThrowsIsNan - -// @assertThrowsIsInfinite: - void throws_infinite(void) - { - raise 1.0/0.0; - } - - void test_assert_throws_is_infinite(void) - { - TS_ASSERT_THROWS_IS_INFINITE(self.throws_infinite(), const Error & e, e.what()); - } -// @:assertThrowsIsInfinite - -// @assertThrowsNothing: - void throws_nothing(void) - { } - - void test_assert_throws_nothing(void) - { - TS_ASSERT_THROWS_ASSERT(self.throws_nothing()); - } -// @:assertThrowsNothing - -// @fail: - void test_fail(void) - { - TS_FAIL("This test has failed."); - } -// @:fail - -// @skip: - void test_skip(void) - { - TS_SKIP("This test has been skipped."); - } -// @:skip - -// @trace: - void test_trace(void) - { - TS_TRACE("This is a test tracing message."); - } -// @:trace - -// @warn: - void test_warn(void) - { - TS_WARN("This is a warning message."); - } -// @:warn -}; diff --git a/noarch/lib/py/cxxtest/doc/examples/BadTestSuite1.h b/noarch/lib/py/cxxtest/doc/examples/BadTestSuite1.h deleted file mode 100644 index 21cd8fc6..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/BadTestSuite1.h +++ /dev/null @@ -1,19 +0,0 @@ -// BadTestSuite1.h -#include <cxxtest/TestSuite.h> - -class BadTestSuite1 : public CxxTest::TestSuite -{ -public: - void testAddition(void) - { - TS_ASSERT(1 + 1 > 1); - TS_ASSERT_EQUALS(1 + 1, 2); - } -#if 0 - void testSubtraction(void) - { - TS_ASSERT(1 - 1 < 1); - TS_ASSERT_EQUALS(1 - 1, 0); - } -#endif -}; diff --git a/noarch/lib/py/cxxtest/doc/examples/GetGlobals.sh b/noarch/lib/py/cxxtest/doc/examples/GetGlobals.sh deleted file mode 100644 index 27d59f84..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/GetGlobals.sh +++ /dev/null @@ -1,4 +0,0 @@ -if [[ "x$CXXTEST" -eq "x" ]] -then - CXXTEST="../../" -fi diff --git a/noarch/lib/py/cxxtest/doc/examples/MockTestSuite.h b/noarch/lib/py/cxxtest/doc/examples/MockTestSuite.h deleted file mode 100644 index 5de32498..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/MockTestSuite.h +++ /dev/null @@ -1,26 +0,0 @@ -// MockTestSuite.h -#include <cxxtest/TestSuite.h> -#include <time_mock.h> - -int generateRandomNumber(); - - -class MockObject : public T::Base_time -{ -public: - MockObject(int initial) : counter(initial) {} - int counter; - time_t time(time_t *) { return counter++; } -}; - -class TestRandom : public CxxTest::TestSuite -{ -public: - void test_generateRandomNumber() - { - MockObject t(1); - TS_ASSERT_EQUALS(generateRandomNumber(), 3); - TS_ASSERT_EQUALS(generateRandomNumber(), 6); - TS_ASSERT_EQUALS(generateRandomNumber(), 9); - } -}; diff --git a/noarch/lib/py/cxxtest/doc/examples/MyClass.h b/noarch/lib/py/cxxtest/doc/examples/MyClass.h deleted file mode 100644 index 6cad25de..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/MyClass.h +++ /dev/null @@ -1,38 +0,0 @@ -// MyClass.h - -class MyClass -{ -public: - - int value; - - MyClass(int value_) : value(value_) {} - - // CxxTest requires a copy constructor - MyClass(const MyClass& other) : value(other.value) {} - - // This is required if you want to use TS_ASSERT_EQUALS - bool operator==(const MyClass& other) const { return value == other.value; } - - // If you want to use TS_ASSERT_LESS_THAN - bool operator<(const MyClass& other) const { return value < other.value; } -}; - -#ifdef CXXTEST_RUNNING -// This declaration is only activated when building a CxxTest test suite -#include <cxxtest/ValueTraits.h> -#include <stdio.h> - -namespace CxxTest -{ -CXXTEST_TEMPLATE_INSTANTIATION -class ValueTraits<MyClass> -{ - char _s[256]; - -public: - ValueTraits(const MyClass& m) { sprintf(_s, "MyClass( %i )", m.value); } - const char *asString() const { return _s; } -}; -}; -#endif // CXXTEST_RUNNING diff --git a/noarch/lib/py/cxxtest/doc/examples/MyTestSuite1.h b/noarch/lib/py/cxxtest/doc/examples/MyTestSuite1.h deleted file mode 100644 index f437d112..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/MyTestSuite1.h +++ /dev/null @@ -1,12 +0,0 @@ -// MyTestSuite1.h -#include <cxxtest/TestSuite.h> - -class MyTestSuite1 : public CxxTest::TestSuite -{ -public: - void testAddition(void) - { - TS_ASSERT(1 + 1 > 1); - TS_ASSERT_EQUALS(1 + 1, 2); - } -}; diff --git a/noarch/lib/py/cxxtest/doc/examples/MyTestSuite10.h b/noarch/lib/py/cxxtest/doc/examples/MyTestSuite10.h deleted file mode 100644 index d3681fc9..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/MyTestSuite10.h +++ /dev/null @@ -1,20 +0,0 @@ -// MyTestSuite10.h -#include <cxxtest/TestSuite.h> -#include <MyClass.h> - -class MyTestSuite10 : public CxxTest::TestSuite -{ -public: - void test_le() - { - MyClass x(1), y(2); - TS_ASSERT_LESS_THAN(x, y); - } - - void test_eq() - { - MyClass x(1), y(2); - TS_ASSERT_EQUALS(x, y); - } -}; - diff --git a/noarch/lib/py/cxxtest/doc/examples/MyTestSuite11.h b/noarch/lib/py/cxxtest/doc/examples/MyTestSuite11.h deleted file mode 100644 index 2d0083e8..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/MyTestSuite11.h +++ /dev/null @@ -1,20 +0,0 @@ -// MyTestSuite11.h -#include <cxxtest/TestSuite.h> -#include <TMyClass.h> - -class MyTestSuite11 : public CxxTest::TestSuite -{ -public: - void test_le() - { - TMyClass<int> x(1), y(2); - TS_ASSERT_LESS_THAN(x, y); - } - - void test_eq() - { - TMyClass<int> x(1), y(2); - TS_ASSERT_EQUALS(x, y); - } -}; - diff --git a/noarch/lib/py/cxxtest/doc/examples/MyTestSuite12.h b/noarch/lib/py/cxxtest/doc/examples/MyTestSuite12.h deleted file mode 100644 index aae9ac24..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/MyTestSuite12.h +++ /dev/null @@ -1,24 +0,0 @@ -// MyTestSuite12.h -#include <cxxtest/TestSuite.h> - -class MyTestSuite1 : public CxxTest::TestSuite -{ -public: - void testAddition(void) - { - TS_ASSERT(1 + 1 > 1); - TS_ASSERT_EQUALS(1 + 1, 2); - } -}; - - -#ifndef CXXTEST_RUNNING -#include <iostream> - -int main(int argc, char *argv[]) -{ - - std::cout << "Non-CxxTest stuff is happening now." << std::endl; - -} -#endif diff --git a/noarch/lib/py/cxxtest/doc/examples/MyTestSuite2.h b/noarch/lib/py/cxxtest/doc/examples/MyTestSuite2.h deleted file mode 100644 index b5def59b..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/MyTestSuite2.h +++ /dev/null @@ -1,19 +0,0 @@ -// MyTestSuite2.h -#include <cxxtest/TestSuite.h> - -class MyTestSuite2 : public CxxTest::TestSuite -{ -public: - void testAddition(void) - { - TS_ASSERT(1 + 1 > 1); - TS_ASSERT_EQUALS(1 + 1, 2); - } - - void testMultiplication(void) - { - TS_TRACE("Starting multiplication test"); - TS_ASSERT_EQUALS(2 * 2, 5); - TS_TRACE("Finishing multiplication test"); - } -}; diff --git a/noarch/lib/py/cxxtest/doc/examples/MyTestSuite3.h b/noarch/lib/py/cxxtest/doc/examples/MyTestSuite3.h deleted file mode 100644 index 2505ab63..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/MyTestSuite3.h +++ /dev/null @@ -1,32 +0,0 @@ -// MyTestSuite3.h -#include <cxxtest/TestSuite.h> - -class MyTestSuite3 : public CxxTest::TestSuite -{ -public: - void testAddition(void) - { - TS_ASSERT(1 + 1 > 1); - TS_ASSERT_EQUALS(1 + 1, 2); - } - -// void testMultiplication( void ) -// { -// TS_ASSERT( 1 * 1 < 2 ); -// TS_ASSERT_EQUALS( 1 * 1, 2 ); -// } - - /* - void testSubtraction( void ) - { - TS_ASSERT( 1 - 1 < 1 ); - TS_ASSERT_EQUALS( 1 - 1, 0 ); - } - */ - - void XtestDivision(void) - { - TS_ASSERT(1 / 1 < 2); - TS_ASSERT_EQUALS(1 / 1, 1); - } -}; diff --git a/noarch/lib/py/cxxtest/doc/examples/MyTestSuite4.h b/noarch/lib/py/cxxtest/doc/examples/MyTestSuite4.h deleted file mode 100644 index 89236ee9..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/MyTestSuite4.h +++ /dev/null @@ -1,14 +0,0 @@ -// MyTestSuite4.h -#include <cxxtest/TestSuite.h> - -class MyTestSuite4 - : -public CxxTest::TestSuite -{ -public: - void testAddition(void) - { - TS_ASSERT(1 + 1 > 1); - TS_ASSERT_EQUALS(1 + 1, 2); - } -}; diff --git a/noarch/lib/py/cxxtest/doc/examples/MyTestSuite5.h b/noarch/lib/py/cxxtest/doc/examples/MyTestSuite5.h deleted file mode 100644 index 788c2ec8..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/MyTestSuite5.h +++ /dev/null @@ -1,35 +0,0 @@ -// MyTestSuite5.h -#include <cxxtest/TestSuite.h> -#include <string.h> - -class MyTestSuite5 : public CxxTest::TestSuite -{ - char *_buffer; - -public: - - void setUp() - { - _buffer = new char[1024]; - } - - void tearDown() - { - delete [] _buffer; - } - - void test_strcpy() - { - strcpy(_buffer, "Hello, world!"); - TS_ASSERT_EQUALS(_buffer[0], 'H'); - TS_ASSERT_EQUALS(_buffer[1], 'e'); - } - - void test_memcpy() - { - memcpy(_buffer, "Hello, world!", sizeof(char)); - TS_ASSERT_EQUALS(_buffer[0], 'H'); - TS_ASSERT_EQUALS(_buffer[1], 'e'); - } -}; - diff --git a/noarch/lib/py/cxxtest/doc/examples/MyTestSuite6.h b/noarch/lib/py/cxxtest/doc/examples/MyTestSuite6.h deleted file mode 100644 index 6cafb457..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/MyTestSuite6.h +++ /dev/null @@ -1,24 +0,0 @@ -// MyTestSuite6.h -#include <cxxtest/TestSuite.h> - -class MyTestSuite6 : public CxxTest::TestSuite -{ -public: - - static MyTestSuite6* createSuite() - { -#ifdef _MSC_VER - return new MyTestSuite6(); -#else - return 0; -#endif - } - - static void destroySuite(MyTestSuite6* suite) - { delete suite; } - - void test_nothing() - { - TS_FAIL("Nothing to test"); - } -}; diff --git a/noarch/lib/py/cxxtest/doc/examples/MyTestSuite7.h b/noarch/lib/py/cxxtest/doc/examples/MyTestSuite7.h deleted file mode 100644 index 0fd38ac0..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/MyTestSuite7.h +++ /dev/null @@ -1,36 +0,0 @@ -// MyTestSuite7.h -#include <cxxtest/TestSuite.h> -#include <iostream> - -class MyTestSuite7 : public CxxTest::TestSuite -{ -public: - - struct Data - { - char data[3]; - bool operator==(Data o) - { - return (memcmp(this, &o, sizeof(o)) == 0); - } - }; - - struct Data2 - { - char data[3]; - }; - - void testCompareData() - { - Data x, y; - memset(x.data, 0x12, sizeof(x.data)); - memset(y.data, 0xF6, sizeof(y.data)); - TS_ASSERT_EQUALS(x, y); - - Data2 z, w; - memset(z.data, 0x12, sizeof(x.data)); - memset(w.data, 0xF6, sizeof(y.data)); - TS_ASSERT_SAME_DATA(&z, &w, sizeof(z)) - } -}; - diff --git a/noarch/lib/py/cxxtest/doc/examples/MyTestSuite8.h b/noarch/lib/py/cxxtest/doc/examples/MyTestSuite8.h deleted file mode 100644 index 6a457dc6..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/MyTestSuite8.h +++ /dev/null @@ -1,71 +0,0 @@ -// MyTestSuite8.h -#include <cstdio> -#include <cxxtest/TestSuite.h> -#include <cxxtest/GlobalFixture.h> - -// -// Fixture1 counts its setUp()s and tearDown()s -// -class Fixture1 : public CxxTest::GlobalFixture -{ -public: - unsigned setUpCount; - unsigned tearDownCount; - - Fixture1() { setUpCount = tearDownCount = 0; } - - bool setUp() { ++ setUpCount; return true; } - bool tearDown() { ++ tearDownCount; return true; } - - bool setUpWorld() { printf("Starting a test suite\n"); return true;} - bool tearDownWorld() { printf("Finishing a test suite\n"); return true;} -}; -static Fixture1 fixture1; - - -// -// Fixture2 counts its setUp()s and tearDown()s and makes sure -// its setUp() is called after Fixture1 and its tearDown() before. -// -class Fixture2 : public Fixture1 -{ -public: - bool setUp() - { - TS_ASSERT_EQUALS(setUpCount, fixture1.setUpCount - 1); - TS_ASSERT_EQUALS(tearDownCount, fixture1.tearDownCount); - return Fixture1::setUp(); - } - - bool tearDown() - { - TS_ASSERT_EQUALS(setUpCount, fixture1.setUpCount); - TS_ASSERT_EQUALS(tearDownCount, fixture1.tearDownCount); - return Fixture1::tearDown(); - } -}; -static Fixture2 fixture2; - - -// -// Verify the counts for the global fixtures -// -class MyTestSuite8 : public CxxTest::TestSuite -{ -public: - void testCountsFirstTime() - { - TS_ASSERT_EQUALS(fixture1.setUpCount, 1); - TS_ASSERT_EQUALS(fixture1.tearDownCount, 0); - TS_ASSERT_EQUALS(fixture2.setUpCount, 1); - TS_ASSERT_EQUALS(fixture2.tearDownCount, 0); - } - - void testCountsSecondTime() - { - TS_ASSERT_EQUALS(fixture1.setUpCount, 2); - TS_ASSERT_EQUALS(fixture1.tearDownCount, 1); - TS_ASSERT_EQUALS(fixture2.setUpCount, 2); - TS_ASSERT_EQUALS(fixture2.tearDownCount, 1); - } -}; diff --git a/noarch/lib/py/cxxtest/doc/examples/MyTestSuite9.h b/noarch/lib/py/cxxtest/doc/examples/MyTestSuite9.h deleted file mode 100644 index 040f3828..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/MyTestSuite9.h +++ /dev/null @@ -1,34 +0,0 @@ -// MyTestSuite9.h -#include <cxxtest/TestSuite.h> - -enum Answer -{ - Yes, - No, - Maybe, - DontKnow, - DontCare -}; - -// Declare value traits for the Answer enumeration -CXXTEST_ENUM_TRAITS(Answer, - CXXTEST_ENUM_MEMBER(Yes) - CXXTEST_ENUM_MEMBER(No) - CXXTEST_ENUM_MEMBER(Maybe) - CXXTEST_ENUM_MEMBER(DontKnow) - CXXTEST_ENUM_MEMBER(DontCare)); - -// Test the trait values -class EnumTraits : public CxxTest::TestSuite -{ -public: - void test_Enum_traits() - { - TS_FAIL(Yes); - TS_FAIL(No); - TS_FAIL(Maybe); - TS_FAIL(DontKnow); - TS_FAIL(DontCare); - TS_FAIL((Answer)1000); - } -}; diff --git a/noarch/lib/py/cxxtest/doc/examples/Namespace1.h b/noarch/lib/py/cxxtest/doc/examples/Namespace1.h deleted file mode 100644 index a0e4f44d..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/Namespace1.h +++ /dev/null @@ -1,39 +0,0 @@ -// Namespace1.h -#include <cxxtest/TestSuite.h> - -namespace foo -{ -namespace bar -{ - -class MyTestSuite1 : public CxxTest::TestSuite -{ -public: - void testAddition(void) - { - TS_ASSERT(1 + 1 > 1); - TS_ASSERT_EQUALS(1 + 1, 2); - } -}; - -} -} - - -namespace FOO -{ -namespace BAR -{ - -class MyTestSuite1 : public CxxTest::TestSuite -{ -public: - void testAddition(void) - { - TS_ASSERT(1 + 1 > 1); - TS_ASSERT_EQUALS(1 + 1, 2); - } -}; - -} -} diff --git a/noarch/lib/py/cxxtest/doc/examples/Namespace2.h b/noarch/lib/py/cxxtest/doc/examples/Namespace2.h deleted file mode 100644 index ee1bfec5..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/Namespace2.h +++ /dev/null @@ -1,28 +0,0 @@ -// Namespace2.h -#include <cxxtest/TestSuite.h> - -namespace foo { namespace bar { class MyTestSuite1; } } - -class foo::bar::MyTestSuite1 : public CxxTest::TestSuite -{ -public: - void testAddition(void) - { - TS_ASSERT(1 + 1 > 1); - TS_ASSERT_EQUALS(1 + 1, 2); - } -}; - - -namespace FOO { namespace BAR { class MyTestSuite1; } } - -class MyTestSuite1 : public CxxTest::TestSuite -{ -public: - void testAddition(void) - { - TS_ASSERT(1 + 1 > 1); - TS_ASSERT_EQUALS(1 + 1, 2); - } -}; - diff --git a/noarch/lib/py/cxxtest/doc/examples/TMyClass.h b/noarch/lib/py/cxxtest/doc/examples/TMyClass.h deleted file mode 100644 index e4772498..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/TMyClass.h +++ /dev/null @@ -1,43 +0,0 @@ -// TMyClass.h - -template<class T> -class TMyClass -{ -public: - - T value; - - TMyClass(const T& value_) : value(value_) {} - - // CxxTest requires a copy constructor - TMyClass(const TMyClass<T>& other) : value(other.value) {} - - // This is required if you want to use TS_ASSERT_EQUALS - bool operator==(const TMyClass<T>& other) const { return value == other.value; } - - // If you want to use TS_ASSERT_LESS_THAN - bool operator<(const TMyClass<T>& other) const { return value < other.value; } -}; - -#ifdef CXXTEST_RUNNING -// This declaration is only activated when building a CxxTest test suite -#include <cxxtest/ValueTraits.h> -#include <typeinfo> -#include <sstream> - -namespace CxxTest -{ -template <class T> -class ValueTraits< TMyClass<T> > -{ -public: - std::ostringstream _s; - - ValueTraits(const TMyClass<T>& t) { _s << typeid(t).name() << "( " << t.value << " )"; } - - ValueTraits(const ValueTraits< TMyClass<T> >& value) { _s << value._s.rdbuf(); } - - const char *asString() const { return _s.str().c_str(); } -}; -}; -#endif // CXXTEST_RUNNING diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner.log b/noarch/lib/py/cxxtest/doc/examples/buildRunner.log deleted file mode 100644 index 653dfd09..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner.log +++ /dev/null @@ -1 +0,0 @@ -Running cxxtest tests (1 test).OK! diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner.sh b/noarch/lib/py/cxxtest/doc/examples/buildRunner.sh deleted file mode 100644 index f82d77f8..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -. GetGlobals.sh -export PATH=$CXXTEST/bin:$PATH - -# @main: -cxxtestgen --error-printer -o runner.cpp MyTestSuite1.h -# @:main - -# @compile: -g++ -o runner -I$CXXTEST runner.cpp -# @:compile - -./runner > buildRunner.log -# @run: -./runner -# @:run -\rm -f runner runner.cpp diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner.txt b/noarch/lib/py/cxxtest/doc/examples/buildRunner.txt deleted file mode 100644 index 653dfd09..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner.txt +++ /dev/null @@ -1 +0,0 @@ -Running cxxtest tests (1 test).OK! diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner10.sh b/noarch/lib/py/cxxtest/doc/examples/buildRunner10.sh deleted file mode 100644 index eab85287..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner10.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -. GetGlobals.sh -export PATH=$CXXTEST/bin:$PATH - -# @main: -cxxtestgen -o runner.cpp --template runner10.tpl MyTestSuite2.h -# @:main - -# @compile: -g++ -o runner -I$CXXTEST runner.cpp -# @:compile - -./runner -\rm -f runner runner.cpp diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner10.txt b/noarch/lib/py/cxxtest/doc/examples/buildRunner10.txt deleted file mode 100644 index 0d6601ae..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner10.txt +++ /dev/null @@ -1,7 +0,0 @@ -Starting test runner -Running cxxtest tests (2 tests). -In MyTestSuite2::testMultiplication: -MyTestSuite2.h:16: Error: Expected (2 * 2 == 5), found (4 != 5) -Failed 1 and Skipped 0 of 2 tests -Success rate: 50% -Stopping test runner diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner11.sh b/noarch/lib/py/cxxtest/doc/examples/buildRunner11.sh deleted file mode 100644 index dd354f9d..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner11.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -. GetGlobals.sh - -export PATH=$CXXTEST/bin:$PATH - -# @main: -cxxtestgen -f --error-printer -o runner.cpp MyTestSuite3.h -# @:main - -# @compile: -g++ -o runner -I$CXXTEST runner.cpp -# @:compile - -./runner -\rm -f runner runner.cpp diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner11.txt b/noarch/lib/py/cxxtest/doc/examples/buildRunner11.txt deleted file mode 100644 index 8c58f7cd..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner11.txt +++ /dev/null @@ -1,2 +0,0 @@ -Parsing file MyTestSuite3.h done. -Running cxxtest tests (1 test).OK! diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner12.sh b/noarch/lib/py/cxxtest/doc/examples/buildRunner12.sh deleted file mode 100644 index 3c4278eb..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner12.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -. GetGlobals.sh - -export PATH=$CXXTEST/bin:$PATH - -# @main: -cxxtestgen -f --error-printer -o runner.cpp MyTestSuite4.h -# @:main - -# @compile: -g++ -o runner -I$CXXTEST runner.cpp -# @:compile - -./runner -\rm -f runner runner.cpp diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner12.txt b/noarch/lib/py/cxxtest/doc/examples/buildRunner12.txt deleted file mode 100644 index 5f6cafd0..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner12.txt +++ /dev/null @@ -1,2 +0,0 @@ -Parsing file MyTestSuite4.h done. -Running cxxtest tests (1 test).OK! diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner13.sh b/noarch/lib/py/cxxtest/doc/examples/buildRunner13.sh deleted file mode 100644 index ae3e5bab..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner13.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash - -. GetGlobals.sh -export PATH=$CXXTEST/bin:$PATH - -# @main: -cxxtestgen -f --error-printer -o runner.cpp MyTestSuite1.h MyTestSuite2.h MyTestSuite4.h -# @:main - -# @compile: -g++ -o runner -I$CXXTEST runner.cpp -# @:compile - -# @help: -./runner --help -# @:help -./runner --help &> runner13.help.txt - -# @helpTests: -./runner --help-tests -# @:helpTests -./runner --help-tests &> runner13.helpTests.txt - -# @MyTestSuite2: -./runner MyTestSuite2 -# @:MyTestSuite2 -./runner MyTestSuite2 &> runner13.MyTestSuite2.txt - -# @testMultiplication: -./runner MyTestSuite2 testMultiplication -# @:testMultiplication -./runner MyTestSuite2 testMultiplication &> runner13.testMultiplication.txt - -# @testMultiplicationVerbose: -./runner -v MyTestSuite2 testMultiplication -# @:testMultiplicationVerbose -./runner -v MyTestSuite2 testMultiplication &> runner13.testMultiplicationVerbose.txt - -\rm -f runner runner.cpp - diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner14.sh b/noarch/lib/py/cxxtest/doc/examples/buildRunner14.sh deleted file mode 100644 index 215b2ce8..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner14.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -. GetGlobals.sh -export PATH=$CXXTEST/bin:$PATH - -# @main: -cxxtestgen --error-printer -o runner.cpp MyTestSuite5.h -# @:main - -# @compile: -g++ -o runner -I$CXXTEST runner.cpp -# @:compile - -./runner -\rm -f runner runner.cpp diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner14.txt b/noarch/lib/py/cxxtest/doc/examples/buildRunner14.txt deleted file mode 100644 index 9785efdd..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner14.txt +++ /dev/null @@ -1 +0,0 @@ -Running cxxtest tests (2 tests)..OK! diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner15.sh b/noarch/lib/py/cxxtest/doc/examples/buildRunner15.sh deleted file mode 100644 index 20c0ce06..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner15.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -. GetGlobals.sh -export PATH=$CXXTEST/bin:$PATH - -# @main: -cxxtestgen --error-printer -o runner.cpp MyTestSuite6.h -# @:main - -# @compile: -g++ -o runner -I$CXXTEST runner.cpp -# @:compile - -./runner -\rm -f runner runner.cpp diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner15.txt b/noarch/lib/py/cxxtest/doc/examples/buildRunner15.txt deleted file mode 100644 index 1103fe19..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner15.txt +++ /dev/null @@ -1,6 +0,0 @@ -Running cxxtest tests (1 test) -In MyTestSuite6::<no test>: -MyTestSuite6.h:8: Error: Test failed: createSuite() failed -MyTestSuite6.h:8: Error: Assertion failed: suite() != 0 -Failed 1 and Skipped 0 of 1 test -Success rate: 0% diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner16.sh b/noarch/lib/py/cxxtest/doc/examples/buildRunner16.sh deleted file mode 100644 index ba420e67..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner16.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -. GetGlobals.sh -export PATH=$CXXTEST/bin:$PATH - -# @main: -cxxtestgen --error-printer -o runner.cpp MockTestSuite.h -# @:main - -# @compile: -g++ -o runner -I. -I$CXXTEST runner.cpp time_mock.cpp rand_example.cpp -# @:compile - -./runner -\rm -f runner runner.cpp diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner16.txt b/noarch/lib/py/cxxtest/doc/examples/buildRunner16.txt deleted file mode 100644 index 653dfd09..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner16.txt +++ /dev/null @@ -1 +0,0 @@ -Running cxxtest tests (1 test).OK! diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner17.sh b/noarch/lib/py/cxxtest/doc/examples/buildRunner17.sh deleted file mode 100644 index 649da617..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner17.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -. GetGlobals.sh -export PATH=$CXXTEST/bin:$PATH - -# @main: -cxxtestgen --error-printer -o runner.cpp MyTestSuite7.h -# @:main - -# @compile: -g++ -o runner -I$CXXTEST runner.cpp -# @:compile - -./runner -\rm -f runner runner.cpp - diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner17.txt b/noarch/lib/py/cxxtest/doc/examples/buildRunner17.txt deleted file mode 100644 index 3440276e..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner17.txt +++ /dev/null @@ -1,9 +0,0 @@ -Running cxxtest tests (1 test) -In MyTestSuite7::testCompareData: -MyTestSuite7.h:28: Error: Expected (x == y), found ({ 12 12 12 } != { F6 F6 F6 }) -MyTestSuite7.h:33: Error: Expected sizeof(z) (3) bytes to be equal at (&z) and (&w), found: - { 12 12 12 } - differs from - { F6 F6 F6 } -Failed 1 and Skipped 0 of 1 test -Success rate: 0% diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner18.sh b/noarch/lib/py/cxxtest/doc/examples/buildRunner18.sh deleted file mode 100644 index d34b9133..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner18.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -. GetGlobals.sh -export PATH=$CXXTEST/bin:$PATH - -# @main: -cxxtestgen --error-printer -o runner.cpp MyTestSuite8.h -# @:main - -# @compile: -g++ -o runner -I$CXXTEST runner.cpp -# @:compile - -./runner -\rm -f runner runner.cpp - diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner18.txt b/noarch/lib/py/cxxtest/doc/examples/buildRunner18.txt deleted file mode 100644 index d10e665a..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner18.txt +++ /dev/null @@ -1,5 +0,0 @@ -Running cxxtest tests (2 tests)Starting a test suite -Starting a test suite -..Finishing a test suite -Finishing a test suite -OK! diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner19.sh b/noarch/lib/py/cxxtest/doc/examples/buildRunner19.sh deleted file mode 100644 index 64402fc0..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner19.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -. GetGlobals.sh -export PATH=$CXXTEST/bin:$PATH - -# @main: -cxxtestgen --error-printer -o runner.cpp MyTestSuite9.h -# @:main - -# @compile: -g++ -o runner -I$CXXTEST runner.cpp -# @:compile - -./runner -\rm -f runner runner.cpp - diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner19.txt b/noarch/lib/py/cxxtest/doc/examples/buildRunner19.txt deleted file mode 100644 index 9da0e25e..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner19.txt +++ /dev/null @@ -1,10 +0,0 @@ -Running cxxtest tests (1 test) -In EnumTraits::test_Enum_traits: -MyTestSuite9.h:27: Error: Test failed: Yes -MyTestSuite9.h:28: Error: Test failed: No -MyTestSuite9.h:29: Error: Test failed: Maybe -MyTestSuite9.h:30: Error: Test failed: DontKnow -MyTestSuite9.h:31: Error: Test failed: DontCare -MyTestSuite9.h:32: Error: Test failed: (Answer)1000 -Failed 1 and Skipped 0 of 1 test -Success rate: 0% diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner2.log b/noarch/lib/py/cxxtest/doc/examples/buildRunner2.log deleted file mode 100644 index 0c8b4a26..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner2.log +++ /dev/null @@ -1,5 +0,0 @@ -Running cxxtest tests (2 tests). -In MyTestSuite2::testMultiplication: -/Users/wehart/home/mac/src/cxxtest/doc/examples/MyTestSuite2.h:16: Error: Expected (2 * 2 == 5), found (4 != 5) -Failed 1 and Skipped 0 of 2 tests -Success rate: 50% diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner2.sh b/noarch/lib/py/cxxtest/doc/examples/buildRunner2.sh deleted file mode 100644 index 623d806b..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner2.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -. GetGlobals.sh -export PATH=$CXXTEST/bin:$PATH - -# @main: -cxxtestgen --error-printer -o runner.cpp MyTestSuite2.h -# @:main - -# @compile: -g++ -o runner -I$CXXTEST runner.cpp -# @:compile - -./runner > buildRunner2.log -cat buildRunner2.log -\rm -f runner runner.cpp diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner2.txt b/noarch/lib/py/cxxtest/doc/examples/buildRunner2.txt deleted file mode 100644 index c0467088..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner2.txt +++ /dev/null @@ -1,5 +0,0 @@ -Running cxxtest tests (2 tests). -In MyTestSuite2::testMultiplication: -MyTestSuite2.h:16: Error: Expected (2 * 2 == 5), found (4 != 5) -Failed 1 and Skipped 0 of 2 tests -Success rate: 50% diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner20.sh b/noarch/lib/py/cxxtest/doc/examples/buildRunner20.sh deleted file mode 100644 index 55c4794d..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner20.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -. GetGlobals.sh -export PATH=$CXXTEST/bin:$PATH - -# @main: -cxxtestgen --error-printer -o runner.cpp MyTestSuite10.h -# @:main - -# @compile: -g++ -o runner -I$CXXTEST -I. runner.cpp -# @:compile - -./runner -\rm -f runner runner.cpp - diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner20.txt b/noarch/lib/py/cxxtest/doc/examples/buildRunner20.txt deleted file mode 100644 index e5531593..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner20.txt +++ /dev/null @@ -1,5 +0,0 @@ -Running cxxtest tests (2 tests). -In MyTestSuite10::test_eq: -MyTestSuite10.h:17: Error: Expected (x == y), found (MyClass( 1 ) != MyClass( 2 )) -Failed 1 and Skipped 0 of 2 tests -Success rate: 50% diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner21.sh b/noarch/lib/py/cxxtest/doc/examples/buildRunner21.sh deleted file mode 100644 index a9f1dafc..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner21.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -. GetGlobals.sh -export PATH=$CXXTEST/bin:$PATH - -# @main: -cxxtestgen --error-printer -o runner.cpp MyTestSuite11.h -# @:main - -# @compile: -g++ -o runner -I$CXXTEST -I. runner.cpp -# @:compile - -./runner -\rm -f runner runner.cpp - diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner21.txt b/noarch/lib/py/cxxtest/doc/examples/buildRunner21.txt deleted file mode 100644 index 1f8d72bb..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner21.txt +++ /dev/null @@ -1,5 +0,0 @@ -Running cxxtest tests (2 tests). -In MyTestSuite11::test_eq: -MyTestSuite11.h:17: Error: Expected (x == y), found (8TMyClassIiE( 1 ) != 8TMyClassIiE( 1 )) -Failed 1 and Skipped 0 of 2 tests -Success rate: 50% diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner22.sh b/noarch/lib/py/cxxtest/doc/examples/buildRunner22.sh deleted file mode 100644 index fc5d4aa0..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner22.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -. GetGlobals.sh -export PATH=$CXXTEST/bin:$PATH - -# @main: -cxxtestgen --fog --error-printer -o runner.cpp Namespace1.h -# @:main - -# @compile: -g++ -o runner -I$CXXTEST -I. runner.cpp -# @:compile - -./runner -#\rm -f runner runner.cpp - diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner22.txt b/noarch/lib/py/cxxtest/doc/examples/buildRunner22.txt deleted file mode 100644 index 78d8f488..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner22.txt +++ /dev/null @@ -1,2 +0,0 @@ -Parsing file Namespace1.h done. -Running cxxtest tests (2 tests)..OK! diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner23.sh b/noarch/lib/py/cxxtest/doc/examples/buildRunner23.sh deleted file mode 100644 index af0e3055..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner23.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -. GetGlobals.sh -export PATH=$CXXTEST/bin:$PATH - -# @main: -cxxtestgen --error-printer -o runner.cpp Namespace2.h -# @:main - -# @compile: -g++ -o runner -I$CXXTEST -I. runner.cpp -# @:compile - -./runner -\rm -f runner runner.cpp - diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner23.txt b/noarch/lib/py/cxxtest/doc/examples/buildRunner23.txt deleted file mode 100644 index 9785efdd..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner23.txt +++ /dev/null @@ -1 +0,0 @@ -Running cxxtest tests (2 tests)..OK! diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner24.sh b/noarch/lib/py/cxxtest/doc/examples/buildRunner24.sh deleted file mode 100644 index 8cb11b15..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner24.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -. GetGlobals.sh -export PATH=$CXXTEST/bin:$PATH - -# @main: -cxxtestgen --fog --error-printer -o runner.cpp Namespace2.h -# @:main - -# @compile: -g++ -o runner -I$CXXTEST -I. runner.cpp -# @:compile - -./runner -\rm -f runner runner.cpp - diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner24.txt b/noarch/lib/py/cxxtest/doc/examples/buildRunner24.txt deleted file mode 100644 index fac84af3..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner24.txt +++ /dev/null @@ -1,2 +0,0 @@ -Parsing file Namespace2.h done. -Running cxxtest tests (2 tests)..OK! diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner25.sh b/noarch/lib/py/cxxtest/doc/examples/buildRunner25.sh deleted file mode 100644 index 30cde5de..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner25.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -. GetGlobals.sh -export PATH=$CXXTEST/bin:$PATH - -# @main: -cxxtestgen --error-printer -o runner.cpp MyTestSuite12.h -# @:main - -# @compile: -g++ -o runner -I$CXXTEST runner.cpp -# @:compile - -./runner > buildRunner.log -# @run: -./runner -# @:run -\rm -f runner runner.cpp - - -cp MyTestSuite12.h runner2.cpp -g++ -o runner2 -I$CXXTEST runner2.cpp -./runner2 -\rm -f runner2 runner2.cpp diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner25.txt b/noarch/lib/py/cxxtest/doc/examples/buildRunner25.txt deleted file mode 100644 index 31c75a4f..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner25.txt +++ /dev/null @@ -1,2 +0,0 @@ -Running cxxtest tests (1 test).OK! -Non-CxxTest stuff is happening now. diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner3.sh b/noarch/lib/py/cxxtest/doc/examples/buildRunner3.sh deleted file mode 100644 index f5f5c695..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner3.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -. GetGlobals.sh -export PATH=$CXXTEST/bin:$PATH - -# @main: -cxxtestgen --runner=ParenPrinter -o runner.cpp MyTestSuite2.h -# @:main - -# @compile: -g++ -o runner -I$CXXTEST runner.cpp -# @:compile - -./runner -\rm -f runner runner.cpp diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner3.txt b/noarch/lib/py/cxxtest/doc/examples/buildRunner3.txt deleted file mode 100644 index 1362f9f3..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner3.txt +++ /dev/null @@ -1,5 +0,0 @@ -Running cxxtest tests (2 tests). -In MyTestSuite2::testMultiplication: -MyTestSuite2.h(16): Error: Expected (2 * 2 == 5), found (4 != 5) -Failed 1 and Skipped 0 of 2 tests -Success rate: 50% diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner4.sh b/noarch/lib/py/cxxtest/doc/examples/buildRunner4.sh deleted file mode 100644 index 44a6d535..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner4.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -. GetGlobals.sh -export PATH=$CXXTEST/bin:$PATH - -# @main: -cxxtestgen --runner=StdioPrinter -o runner.cpp MyTestSuite2.h -# @:main - -# @compile: -g++ -o runner -I$CXXTEST runner.cpp -# @:compile - -./runner -\rm -f runner runner.cpp diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner4.txt b/noarch/lib/py/cxxtest/doc/examples/buildRunner4.txt deleted file mode 100644 index c0467088..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner4.txt +++ /dev/null @@ -1,5 +0,0 @@ -Running cxxtest tests (2 tests). -In MyTestSuite2::testMultiplication: -MyTestSuite2.h:16: Error: Expected (2 * 2 == 5), found (4 != 5) -Failed 1 and Skipped 0 of 2 tests -Success rate: 50% diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner5.sh b/noarch/lib/py/cxxtest/doc/examples/buildRunner5.sh deleted file mode 100644 index f3c5db0f..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner5.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -. GetGlobals.sh -export PATH=$CXXTEST/bin:$PATH - -# @main: -cxxtestgen --runner=YesNoRunner -o runner.cpp MyTestSuite2.h -# @:main - -# @compile: -g++ -o runner -I$CXXTEST runner.cpp -# @:compile - -./runner -echo $? - -\rm -f runner runner.cpp diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner5.txt b/noarch/lib/py/cxxtest/doc/examples/buildRunner5.txt deleted file mode 100644 index d00491fd..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner5.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner6.sh b/noarch/lib/py/cxxtest/doc/examples/buildRunner6.sh deleted file mode 100644 index 3fd180cc..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner6.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -. GetGlobals.sh -export PATH=$CXXTEST/bin:$PATH - -# @main: -cxxtestgen --runner=XmlPrinter -o runner.cpp MyTestSuite2.h -# @:main - -# @compile: -g++ -o runner -I$CXXTEST runner.cpp -# @:compile - -./runner -\rm -f runner runner.cpp diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner6.txt b/noarch/lib/py/cxxtest/doc/examples/buildRunner6.txt deleted file mode 100644 index bad004d8..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner6.txt +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<testsuite name="cxxtest" date="Tue Apr 23 23:28:43 2013" tests="2" errors="0" failures="1" time="0" > - <testcase classname="MyTestSuite2" name="testAddition" line="7" /> - <testcase classname="MyTestSuite2" name="testMultiplication" line="13"> - <failure file="MyTestSuite2.h" line="16" type="failedAssertEquals" >Error: Expected (2 * 2 == 5), found (4 != 5)</failure> - </testcase> -</testsuite> diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner7.sh b/noarch/lib/py/cxxtest/doc/examples/buildRunner7.sh deleted file mode 100644 index 12a25d0a..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner7.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -. GetGlobals.sh -export PATH=$CXXTEST/bin:$PATH - -# @main: -cxxtestgen --xunit-printer -o runner.cpp MyTestSuite2.h -# @:main - -# @compile: -g++ -o runner -I$CXXTEST runner.cpp -# @:compile - -./runner -\rm -f runner runner.cpp diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner7.txt b/noarch/lib/py/cxxtest/doc/examples/buildRunner7.txt deleted file mode 100644 index c0467088..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner7.txt +++ /dev/null @@ -1,5 +0,0 @@ -Running cxxtest tests (2 tests). -In MyTestSuite2::testMultiplication: -MyTestSuite2.h:16: Error: Expected (2 * 2 == 5), found (4 != 5) -Failed 1 and Skipped 0 of 2 tests -Success rate: 50% diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner8.sh b/noarch/lib/py/cxxtest/doc/examples/buildRunner8.sh deleted file mode 100644 index 6ecd7968..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner8.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -. GetGlobals.sh -export PATH=$CXXTEST/bin:$PATH - -# @main: -cxxtestgen --gui=X11Gui -o runner.cpp MyTestSuite2.h ../../sample/gui/GreenYellowRed.h -# @:main - -# @compile: -/opt/local/bin/g++-mp-4.4 -o runner -I$CXXTEST runner.cpp -L/opt/local/lib -lX11 -# @:compile - -./runner -\rm -f runner runner.cpp diff --git a/noarch/lib/py/cxxtest/doc/examples/buildRunner9.sh b/noarch/lib/py/cxxtest/doc/examples/buildRunner9.sh deleted file mode 100644 index 3c77bcce..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/buildRunner9.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -. GetGlobals.sh -export PATH=$CXXTEST/bin:$PATH - -# @part: -cxxtestgen --part --error-printer -o MyTestSuite1.cpp MyTestSuite1.h -cxxtestgen --part --error-printer -o MyTestSuite2.cpp MyTestSuite2.h -# @:part - -# @root: -cxxtestgen --root --error-printer -o runner.cpp -# @:root - -# @compile: -g++ -o runner -I$CXXTEST runner.cpp MyTestSuite1.cpp MyTestSuite2.cpp -# @:compile - -./runner -v - -rm -f MyTestSuite1.cpp MyTestSuite2.cpp runner.cpp runner diff --git a/noarch/lib/py/cxxtest/doc/examples/rand_example.cpp b/noarch/lib/py/cxxtest/doc/examples/rand_example.cpp deleted file mode 100644 index 01f92201..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/rand_example.cpp +++ /dev/null @@ -1,7 +0,0 @@ -// rand_example.cpp -#include <time_mock.h> - -int generateRandomNumber() -{ - return T::time(NULL) * 3; -} diff --git a/noarch/lib/py/cxxtest/doc/examples/runner10.tpl b/noarch/lib/py/cxxtest/doc/examples/runner10.tpl deleted file mode 100644 index 4d3ebb77..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/runner10.tpl +++ /dev/null @@ -1,14 +0,0 @@ -#define CXXTEST_HAVE_EH -#define CXXTEST_ABORT_TEST_ON_FAIL -#include <cxxtest/ErrorPrinter.h> - -int main() -{ - std::cout << "Starting test runner" << std::endl; - int status = CxxTest::ErrorPrinter().run(); - std::cout << "Stopping test runner" << std::endl; - return status; -} - -// The CxxTest "world" -<CxxTest world> diff --git a/noarch/lib/py/cxxtest/doc/examples/runner13.MyTestSuite2.txt b/noarch/lib/py/cxxtest/doc/examples/runner13.MyTestSuite2.txt deleted file mode 100644 index 0c8b4a26..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/runner13.MyTestSuite2.txt +++ /dev/null @@ -1,5 +0,0 @@ -Running cxxtest tests (2 tests). -In MyTestSuite2::testMultiplication: -/Users/wehart/home/mac/src/cxxtest/doc/examples/MyTestSuite2.h:16: Error: Expected (2 * 2 == 5), found (4 != 5) -Failed 1 and Skipped 0 of 2 tests -Success rate: 50% diff --git a/noarch/lib/py/cxxtest/doc/examples/runner13.help.txt b/noarch/lib/py/cxxtest/doc/examples/runner13.help.txt deleted file mode 100644 index 41a61969..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/runner13.help.txt +++ /dev/null @@ -1,6 +0,0 @@ -./runner <suitename> -./runner <suitename> <testname> -./runner -h -./runner --help -./runner --help-tests -./runner -v Enable tracing output. diff --git a/noarch/lib/py/cxxtest/doc/examples/runner13.helpTests.txt b/noarch/lib/py/cxxtest/doc/examples/runner13.helpTests.txt deleted file mode 100644 index 872cce9f..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/runner13.helpTests.txt +++ /dev/null @@ -1,6 +0,0 @@ -Suite/Test Names ---------------------------------------------------------------------------- -MyTestSuite1 testAddition -MyTestSuite2 testAddition -MyTestSuite2 testMultiplication -MyTestSuite4 testAddition diff --git a/noarch/lib/py/cxxtest/doc/examples/runner13.testMultiplication.txt b/noarch/lib/py/cxxtest/doc/examples/runner13.testMultiplication.txt deleted file mode 100644 index 1f18f7e6..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/runner13.testMultiplication.txt +++ /dev/null @@ -1,5 +0,0 @@ -Running cxxtest tests (1 test) -In MyTestSuite2::testMultiplication: -/Users/wehart/home/mac/src/cxxtest/doc/examples/MyTestSuite2.h:16: Error: Expected (2 * 2 == 5), found (4 != 5) -Failed 1 and Skipped 0 of 1 test -Success rate: 0% diff --git a/noarch/lib/py/cxxtest/doc/examples/runner13.testMultiplicationVerbose.txt b/noarch/lib/py/cxxtest/doc/examples/runner13.testMultiplicationVerbose.txt deleted file mode 100644 index 92549ab0..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/runner13.testMultiplicationVerbose.txt +++ /dev/null @@ -1,7 +0,0 @@ -Running cxxtest tests (1 test) -In MyTestSuite2::testMultiplication: -/Users/wehart/home/mac/src/cxxtest/doc/examples/MyTestSuite2.h:15: Trace: Starting multiplication test -/Users/wehart/home/mac/src/cxxtest/doc/examples/MyTestSuite2.h:16: Error: Expected (2 * 2 == 5), found (4 != 5) -/Users/wehart/home/mac/src/cxxtest/doc/examples/MyTestSuite2.h:17: Trace: Finishing multiplication test -Failed 1 and Skipped 0 of 1 test -Success rate: 0% diff --git a/noarch/lib/py/cxxtest/doc/examples/test_examples.py b/noarch/lib/py/cxxtest/doc/examples/test_examples.py deleted file mode 100644 index 059b9115..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/test_examples.py +++ /dev/null @@ -1,68 +0,0 @@ -#------------------------------------------------------------------------- -# CxxTest: A lightweight C++ unit testing library. -# Copyright (c) 2008 Sandia Corporation. -# This software is distributed under the LGPL License v3 -# For more information, see the COPYING file in the top CxxTest directory. -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -#------------------------------------------------------------------------- - -# Imports -import pyutilib.th as unittest -import glob -import os -from os.path import dirname, abspath, basename -import sys -import re - -currdir = dirname(abspath(__file__))+os.sep -datadir = currdir - -compilerre = re.compile("^(?P<path>[^:]+)(?P<rest>:.*)$") -dirre = re.compile("^([^%s]*/)*" % re.escape(os.sep)) -xmlre = re.compile("\"(?P<path>[^\"]*/[^\"]*)\"") -datere = re.compile("date=\"[^\"]*\"") -failure = re.compile("^(?P<prefix>.+)file=\"(?P<path>[^\"]+)\"(?P<suffix>.*)$") - -#print "FOO", dirre -def filter(line): - # for xml, remove prefixes from everything that looks like a - # file path inside "" - line = xmlre.sub( - lambda match: '"'+re.sub("^[^/]+/", "", match.group(1))+'"', - line - ) - # Remove date info - line = datere.sub( lambda match: 'date=""', line) - - if 'Running' in line: - return False - if "IGNORE" in line: - return True - pathmatch = compilerre.match(line) # see if we can remove the basedir - failmatch = failure.match(line) # see if we can remove the basedir - #print "HERE", pathmatch, failmatch - if failmatch: - parts = failmatch.groupdict() - #print "X", parts - line = "%s file=\"%s\" %s" % (parts['prefix'], dirre.sub("", parts['path']), parts['suffix']) - elif pathmatch: - parts = pathmatch.groupdict() - #print "Y", parts - line = dirre.sub("", parts['path']) + parts['rest'] - return line - -# Declare an empty TestCase class -class Test(unittest.TestCase): pass - -if not sys.platform.startswith('win'): - # Find all *.sh files, and use them to define baseline tests - for file in glob.glob(datadir+'*.sh'): - bname = basename(file) - name=bname.split('.')[0] - if os.path.exists(datadir+name+'.txt'): - Test.add_baseline_test(cwd=datadir, cmd=file, baseline=datadir+name+'.txt', name=name, filter=filter) - -# Execute the tests -if __name__ == '__main__': - unittest.main() diff --git a/noarch/lib/py/cxxtest/doc/examples/time_mock.cpp b/noarch/lib/py/cxxtest/doc/examples/time_mock.cpp deleted file mode 100644 index 38d9bd48..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/time_mock.cpp +++ /dev/null @@ -1,3 +0,0 @@ -// time_mock.cpp -#define CXXTEST_MOCK_TEST_SOURCE_FILE -#include <time_mock.h> diff --git a/noarch/lib/py/cxxtest/doc/examples/time_mock.h b/noarch/lib/py/cxxtest/doc/examples/time_mock.h deleted file mode 100644 index a637ca2f..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/time_mock.h +++ /dev/null @@ -1,8 +0,0 @@ -// time_mock.h -#include <time.h> -#include <cxxtest/Mock.h> - -CXXTEST_MOCK_GLOBAL(time_t, /* Return type */ - time, /* Name of the function */ - (time_t *t), /* Prototype */ - (t) /* Argument list */); diff --git a/noarch/lib/py/cxxtest/doc/examples/time_real.cpp b/noarch/lib/py/cxxtest/doc/examples/time_real.cpp deleted file mode 100644 index 8503f797..00000000 --- a/noarch/lib/py/cxxtest/doc/examples/time_real.cpp +++ /dev/null @@ -1,3 +0,0 @@ -// time_real.cpp -#define CXXTEST_MOCK_REAL_SOURCE_FILE -#include <time_mock.h> diff --git a/noarch/lib/py/cxxtest/doc/guide.txt b/noarch/lib/py/cxxtest/doc/guide.txt deleted file mode 100644 index 7eb1e1a7..00000000 --- a/noarch/lib/py/cxxtest/doc/guide.txt +++ /dev/null @@ -1,1841 +0,0 @@ -CxxTest User Guide -================== -:doctype: article - -:cpp: {basebackend@docbook:c++:cpp} -:makefile: {basebackend@docbook:make:makefile} - -:numbered!: -[abstract] -Abstract --------- -CxxTest is a unit testing framework for C\++ that is similar in -spirit to http://junit.org/[JUnit], -http://cppunit.sourceforge.net[CppUnit], and -http://xprogramming.com/software.html[xUnit]. CxxTest is easy to -use because it does not require precompiling a CxxTest testing -library, it employs no advanced features of C++ (e.g. RTTI) and it -supports a very flexible form of test discovery. This documentation -describes CxxTest 4.4, which is an incremental release that includes -a variety of bug fixes and minor enhancements. - -:numbered: - -Overview --------- - -CxxTest is a unit testing framework for C++ that is similar in -spirit to http://junit.org/[JUnit], -http://cppunit.sourceforge.net[CppUnit], and -http://xprogramming.com/software.html[xUnit]. -CxxTest is designed to be as portable as possible; it does not require - - - RTTI - - Member template functions - - Exception handling - - External libraries (including memory management, file/console I/O, graphics libraries) - -In particular, the design of CxxTest was tailored for C\++ compilers -on embedded systems, for which many of these features are not -supported. However, CxxTest can also leverage standard C++ features -when they are supported by a compiler (e.g. catch unhandled -exceptions). - -Additionally, CxxTest supports _test discovery_. Tests are defined -in C\++ header files, which are parsed by CxxTest to automatically -generate a test runner. Thus, CxxTest is somewhat easier to use -than alternative C++ testing frameworks, since you do not need to -_register_ tests. - -The http://cxxtest.com[CxxTest Home Page] is -http://cxxtest.com[http://cxxtest.com]. This webpage contains links -for https://sourceforge.net/projects/cxxtest/files/[release downloads], -the https://groups.google.com/forum/?hl=en#!forum/cxxtest-forum[CxxTest -discussion list], and documentation in -http://cxxtest.com/guide.html[HTML], -http://cxxtest.com/guide.pdf[PDF], and -http://cxxtest.com/guide.epub[EPUB] formats. The -http://cxxtest.com[CxxTest Home Page] also includes developer -resources (e.g. https://software.sandia.gov/hudson/view/CxxTest/[automated -test results]). CxxTest is available under the -http://www.gnu.org/licenses/lgpl.html[GNU Lesser General Public] -license. - -The CxxTest User Guide provides the following documentation: - - - <<gettingStarted,Getting Started>>: Some simple examples that illustrate how to use CxxTest - - <<testAssertions,Test Assertions>>: The test assertions supported by CxxTest - - <<cxxtestgen,The CxxTestGen Command>>: Documentation for the +cxxtestgen+ command - - <<runner,Test Runner Syntax>>: Discussion of command line options for test runners - - <<advanced,Advanced Testing Features>>: Advanced features of CxxTest - - <<traits,Value Traits>>: Customizing data traits for error messages - - <<mock,Testing with Mock Objects>>: How to test with mock global functions - - <<installation,Installation>>: How to install CxxTest - - <<discussion,Status and Future Plans>>: Comments on the past, present and future of CxxTest - - - -[[gettingStarted]] -Getting Started ---------------- - -Testing is performed with CxxTest in a four-step process: - - 1. Tests are defined in C++ header files - 2. The +cxxtestgen+ command processes header files to generate files for the test runner. - 3. Compile the test runner. - 4. Execute the test runner to run all test suites. - -CxxTest supports test automation, sharing of setup -and shutdown code for tests, aggregation of tests into collections, -and independence of the tests from the reporting framework. To -achieve this, CxxTest supports some important concepts that are common to xUnit frameworks ( -e.g. http://junit.org/[JUnit], http://cppunit.sourceforge.net[CppUnit], and -http://xprogramming.com/software.html[xUnit]): - -test fixture:: - A 'test fixture' represents the preparation needed to perform one or more - tests, and any associate cleanup actions. This may involve, for example, - creating temporary or proxy databases, directories, or starting a server - process. - -///// -test case:: - A 'test case' is the smallest unit of testing. It checks for a specific - response to a particular set of inputs. CxxTest provides a base class, - +TestCase+, which may be used to create new test cases. -///// - -test suite:: - A 'test suite' is a collection of test cases, which represent - the smallest unit of testing. A test suite is defined by a class - that inherits from the +CxxTest::TestSuite+ class, and the tests - in a test suite are executed together. - -test:: - A test is a public member function of a test suite whose name - starts with +test+, e.g. +testDirectoryScanner()+, - +test_cool_feature()+ and +TestImportantBugFix()+. - -test runner:: - A 'test runner' is a component which orchestrates the execution - of tests across one or more test suites and provides the outcome - to the user. - -When building test fixtures using +TestSuite+, the +TestSuite.setUp+ -and +TestSuite.tearDown+ methods can be overridden to provide -initialization and cleanup for the fixture. The +TestSuite.setUp+ -method is run before each test is executed, and the +TestSuite.tearDown+ -method is run after each test is executed. - - -A First Example -~~~~~~~~~~~~~~~ - -The following is a simple example of a -test suite with a single test, +testAddition+, which perform two test assertions: -[source,{cpp}] ----- -include::examples/MyTestSuite1.h[] ----- - -You use the +cxxtestgen+ script to generate a _test runner_ for test suites in C++ header files: -[source,bash] ----- -include::examples/.buildRunner_main.sh[] ----- -This command generates the file +runner.cpp+, which can be compiled. -[source,bash] ----- -include::examples/.buildRunner_compile.sh[] ----- -Note that additional compiler flags may be needed to include headers -and libraries that are used during testing. - - -This runner can be executed to perform the specified tests: -[source,bash] ----- -include::examples/.buildRunner_run.sh[] ----- -which generates the following output: ----- -include::examples/buildRunner.log[] ----- - - -A Second Example -~~~~~~~~~~~~~~~~ - -The following header file extends the previous example to -include a test that generates an error: -[source,{cpp}] ----- -include::examples/.MyTestSuite2_.h[] ----- - -The test runner generated by +cxxtestgen+ for this test suite generates the following output: ----- -include::examples/buildRunner2.log[] ----- - - -Sample Problems -~~~~~~~~~~~~~~~ - -CxxTest comes with example test suites in the `cxxtest/sample` subdirectory of -the distribution. If you look in that directory, you will see three -Makefiles: `Makefile.unix`, `Makefile.msvc` and -`Makefile.bcc32` which are for Linux/Unix, MS Visual C\++ and Borland C++, repectively. These files are provided as a starting point, -and some options may need to be tweaked in them for your system. - -//// -WEH - I think we should omit these command line unless they are tested... - -If you are running under Windows, a good guess would be to run -`nmake -fMakefile.msvc run_win32` (you may need to run -`VCVARS32.BAT` first). -Under Linux, `make -fMakefile.unix run_x11` should probably work. -//// - - -[[testAssertions]] -Test Assertions ---------------- - -The following table summarizes the test assertions supported by CxxTest. -<<appendix_A,Appendix A>> provides examples that illustrate the use of these test assertions. - -[options="header"] -|==================================================================================== -| Macro | Description -| <<ts_assert,+TS_ASSERT(expr)+>> | Verify +expr+ is true -| xref:ts_assert_delta[+TS_ASSERT_DELTA(x,y,d)+] | Verify that +abs(x-y) < d+ -| xref:ts_assert_differs[+TS_ASSERT_DIFFERS(x,y)+] | Verify that +x != y+ -| xref:ts_assert_equals[+TS_ASSERT_EQUALS(x,y)+] | Verify that +x == y+ -| <<ts_assert_is_nan,+TS_ASSERT_IS_NAN(x)+>> | Verify that +x+ is NaN -| <<ts_assert_is_infinite,+TS_ASSERT_IS_INFINITE(x)+>> | Verify that +x+ is infinite -| xref:ts_assert_less_than[+TS_ASSERT_LESS_THAN(x,y)+] | Verify that +x < y+ -| xref:ts_assert_less_than_equals[+TS_ASSERT_LESS_THAN_EQUALS(x,y)+] | Verify that +x <= y+ -| xref:ts_assert_predicate[+TS_ASSERT_PREDICATE(P,x)+] | Verify +P(x)+ -| xref:ts_assert_relation[+TS_ASSERT_RELATION(x,R,y)+] | Verify +x R y+ -| xref:ts_assert_same_data[+TS_ASSERT_SAME_DATA(x,y,size)+] | Verify two buffers are equal -| xref:ts_assert_throws[+TS_ASSERT_THROWS(expr,type)+] | Verify that +expr+ throws the specified exception type -| <<ts_assert_throws_anything,+TS_ASSERT_THROWS_ANYTHING(expr)+>> | Verify that +expr+ throws an exception -| xref:ts_assert_throws_assert[+TS_ASSERT_THROWS_ASSERT(expr,arg,assertion)+] | Verify type and value of what +expr+ throws -| xref:ts_assert_throws_equals[+TS_ASSERT_THROWS_EQUALS(expr,arg,x,y)+] | Verify type and value of what +expr+ throws -| xref:ts_assert_throws_is_nan[+TS_ASSERT_THROWS_IS_NAN(expr,arg,x)+] | Verify type and value of what +expr+ throws -| xref:ts_assert_throws_is_infinite[+TS_ASSERT_THROWS_IS_INFINITE(expr,arg,x)+] | Verify type and value of what +expr+ throws -| <<ts_assert_throws_nothing,+TS_ASSERT_THROWS_NOTHING(expr)+>> | Verify that +expr+ doesn't throw anything -| <<ts_fail,+TS_FAIL(message)+>> | Fail unconditionally -| <<ts_skip,+TS_SKIP(message)+>> | Skip this test -| <<ts_trace,+TS_TRACE(message)+>> | Print +message+ as an informational message -| <<ts_warn,+TS_WARN(message)+>> | Print +message+ as a warning -|==================================================================================== - -The test assertions supported by CxxTest are defined as macros, -which eliminates the need for certain templates within CxxTest and -allows tests to catch exceptions. There are four categories of -test assertions in CxxTest, which are distinguished by their prefixes: - -TS_:: These test assertions perform a test. Catch exceptions generated -during testing will cause the test to fail, except for tests that -check for exceptions. - -TSM_:: These test assertions perform the same tests as the corresponding -+TS+ assertions, but their first argument is a +const char*+ message -buffer that is printed when the test fails. - -ETS_:: These test assertions perform the same tests as the corresponding -+TS+ assertions. However, these test assertions do not catch -exceptions generated during testing. - -ETSM_:: These test assertions perform the same tests as the -corresponding +TS+ assertions, but (1) their first argument is a -+const char*+ message buffer is printed when the test fails, and -(2) these assertions do not catch exceptions generated during -testing. - - -[[cxxtestgen]] -The CxxTestGen Command ----------------------- - -The +cxxtestgen+ command processes one or more C++ header files to -generate a test runner. The +cxxtestgen+ command performs test -discovery by parsing the header files to find test classes, which -inherit from the class +CxxTest::TestSuite+. - -The +--help+ option generates the following summary of the +cxxtestgen+ command line options: - ----- -include::examples/cxxtestgen.out[] ----- -The following section describe illustrate the use of these command line options. - - -General Options -~~~~~~~~~~~~~~~ - -The default behavior of +cxxtestgen+ is to send the source for the -test runner to the standard output stream. The +--output+ (+-o+) -option indicates a filename for the test runner. - -The +--world+ (+-w+) option specifies the value of the +CxxTest::RealWorldDescription::_worldName+ -variable. This option also customizes the filename used for XML output files (see below). - -The +--include+ option defines a filename that is included in the runner before all other headers. - -The +--abort-on-fail+ option forces an abort if a test fails, rather than continuing execution -to the next test. - -The +--main+ option specifies an alternate name for the +main()+ function. - -Test Listener Options -~~~~~~~~~~~~~~~~~~~~~ - -The test runner behavior is controlled by a _test listener_ class -that is used to define to the +main+ function. The test listener -class is a subclass of +TestListener+ that receives notifications -about the testing process, notably which assertions failed. The -+--runner+ option is used to specify the test listener that is used -in the test runner. The following test listeners are defined in -CxxTest: - - +ErrorPrinter+:: - This is the standard error printer, which formats its output to the standard output stream (+std::cout+). - +StdioPrinter+:: - The same as +ErrorPrinter+ except that it uses +printf+ instead of +std::cout+. - +ParenPrinter+:: - Identical to +ErrorPrinter+ except that it prints line numbers in parantheses. This is the way Visual Studio expects it. - +XmlPrinter+:: - Print test results to an XML file. - +XUnitPrinter+:: - This test listener generates output using both +ErrorPrinter+ and +XmlPrinter+. - -ErrorPrinter -^^^^^^^^^^^^ - -The +--error-printer+ option creates a runner using the +ErrorPrinter+ -test listener, and it indicates that the standard library is used -in the test runner. The +ErrorPrinter+ test listener prints dots -to summarize test execution, along with a summary of the test -results. For example, the command -[source,bash] ----- -include::examples/.buildRunner2_main.sh[] ----- -generates the following output: - ----- -include::examples/buildRunner2.log[] ----- - -StdioPrinter -^^^^^^^^^^^^ - -If your compiler does not support +std::cout+, then the +ErrorPrinter+ test listener cannot be used. -In this case, the +StdioPrinter+ test listener can be used; it provides the same output as +ErrorPrinter+ but it uses the +printf+ function. For example, the command line: -[source,bash] ----- -include::examples/.buildRunner4_main.sh[] ----- -generates the following output: - ----- -include::examples/buildRunner4.txt[] ----- - -ParenPrinter -^^^^^^^^^^^^ - -The +--runner=ParenPrinter+ option creates a similar test runner: -[source,bash] ----- -include::examples/.buildRunner3_main.sh[] ----- -This test runner generates output that is similar to the +ErrorPrinter+ test listener: - ----- -include::examples/buildRunner3.txt[] ----- -The only difference is the parentheses used in the output. This test listener provides a format that can be recognized by Visual Studio. - -//// -The +StdioPrinter+ makes reference to +stdout+ as the default output -stream. In some environments, the +stdio.h+ header may be defined -but not +stdout+. The +StdioFilePrinter+ test listener can be used -in this case, though the main() function needs to be adapted to specify the -stream that is used in output. -//// - -XmlPrinter -^^^^^^^^^^ - -The +--runner=XmlPrinter+ option creates a test runner whose output is an XML summary of the test results. For example, the command: -[source,bash] ----- -include::examples/.buildRunner6_main.sh[] ----- -generates the following output: - ----- -include::examples/buildRunner6.txt[] ----- -This XML format is conforms to the XML standard used by other xUnit tools. Thus, this output can be used as input in other tools, like http://jenkins-ci.org/[Jenkins], to generate test summaries. - - -XUnitPrinter -^^^^^^^^^^^^ - -The +XUnitPrinter+ test listener generates output using both the -ErrorPrinter+ and +XmlPrinter+ test listeners. This allows the -user to interactively view a simple test summary, while simultaneously -generating an XML summary of the test results. The +--xunit-printer+ -option specifies the use of +XUnitPrinter+: -[source,bash] ----- -include::examples/.buildRunner7_main.sh[] ----- -This test runner generates the following output: - ----- -include::examples/buildRunner7.txt[] ----- -The default filename for the XML results is +TEST-cxxtest.xml+. The +--xunit-file+ option can be used to specify an alternative filename. Additionally, the value of the +--world+ option can be used to specify the filename +TEST-<world>.xml+. - - -Language Options -~~~~~~~~~~~~~~~~ - -When +cxxtestgen+ performs test discovery, it also performs checks -to detect whether (1) the standard library is used and (2) exceptions -are used. These checks configure CxxTest to _not_ assume that these -C++ language features are used when generating the test driver. -Thus, CxxTest can naturally be used with compilers that do not -support these features. - -The +cxxtestgen+ command includes several options that override -these checks and define features of C++ that are used by the test -runner. The +--have-std+ option indicates that the test runner -should use the standard library, and the +--no-std+ option indicates -that the test runner should not use the standard library. The ---have-eh+ options indicates that the test runner should use -exception handling, and the +--no-eh+ indicates that the test runner -should not not use exception handling. - -The +--longlong+ option specifies the type used for long long -integers. The default is for _no_ long long integer type to be specified, -which is consistent with the current C++ standard. - -CxxTest test runners depend quite heavily on static initialization -of objects that are used to define and execute tests. The ---no-static-init+ option can be used to avoid static initialization -for compilers or linkers that have trouble compiling the default test runner. - - -Creating Test Runners from Parts -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The default behavior of +cxxtestgen+ is to generate a test runner -that directly integrates classes that define the tests along with -a +main()+ function that executes all test suites. It is often useful to -allow test suites to be processes separately and then linked together. The +--root+ and +--part+ options -support this logic. For example, suppose that we wish to define a test runner for tests in the headers -MyTestSuite1.h+ and +MyTestSuite2.h+. We execute +cxxtestgen+ with the +--part+ option to generate source files for each of the test suites: -[source,bash] ----- -include::examples/.buildRunner9_part.sh[] ----- -Similarly, we execute +cxxtestgen+ with the +--root+ opiton to generate the +main()+ routine: -[source,bash] ----- -include::examples/.buildRunner9_root.sh[] ----- -Finally, the test runner is built by compiling all of these source files together: -[source,bash] ----- -include::examples/.buildRunner9_compile.sh[] ----- - - -Template Files -~~~~~~~~~~~~~~ - -CxxTest supports the use of _template files_ to provide a custom -main()+ function. This may be useful when using a custom test -listener, or when using an existing CxxTest test listener in a -nonstandard manner. A template file is an ordinary source files -with the embedded declaration +<CxxTest world>+, which tells -cxxtestgen+ to insert the world definition at that point. - -The +--template+ option is used to specify the use of a template file: -[source,bash] ----- -include::examples/.buildRunner10_main.sh[] ----- -For example, consider the following template file: -[source,{cpp}] ----- -include::examples/runner10.tpl[] ----- -This file specifies macros that customize the test runner, and output is generated before and after the tests are run. - -Note that CxxTest needs to insert certain definitions and +#include+ -directives in the runner file. It normally does that before the -first +#include <cxxtest/*.h>+ found in the template file. If this -behavior is not what you need, use the directive +<CxxTest preamble>+ -to specify where this preamble is inserted. - - -Test Discovery Options -~~~~~~~~~~~~~~~~~~~~~~ - -The +cxxtestgen+ command performs test discovery by searching C++ -header files for CxxTest test classes. The default process for -test discovery is a simple process that analyzes each line in a -header file sequentially, looking for a sequence of lines that -represent class definitions and test method definitions. - -There are many limitations to this simple process for test discovery, -and in CxxTest 4.0 a new test discovery mechanism was added based -on the a parser for the -http://www.computing.surrey.ac.uk/research/dsrg/fog/[Flexible Object -Generator (FOG)] language, which is a superset of C+\+. The grammar -for the FOG language was adapted to parse C++ header files to -identify class definitions and class inheritance relationships, -class and namespace nesting of declarations, and class methods. -This allows +cxxtestgen+ to identify test classes that are defined -with complex inheritance relationships. - -The +--fog+ option is used to specify the use of the FOG parser for -test discovery. Although the FOG parser is more powerful, the -simpler +cxxtestgen+ test discover process is the default because -the FOG parser is slower to execute. Additionally, the FOG parser -requires the installation of +ply+ and, for Python version 2.6, -ordereddict+. If these packages are not available, then the +--fog+ -option is automatically disabled. - -The following sections illustrate differences between these two test discovery mechanisms, along with -general limitations of the test discovery process. - -Unexpected Test Suite Format -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -The default test discovery mechanism does a very simple analysis -of the input files, which can easily fail when test classes are not -formated in a standard manner. For example, consider the following -test suite: -[source,{cpp}] ------ -include::examples/MyTestSuite4.h[] ----- -This test suite is not recognized by the default test discovery -mechanism, but the FOG parser correctly parsers this file and -recognizes the test suite. A variety of similar discovery failures -arise due to the simple process used by the test discovery mechanism. - - -Commenting Out Tests -^^^^^^^^^^^^^^^^^^^^ - -Adding and disabling tests are two common steps in test development. -The process of test discovery makes adding tests very easy. However, -disabling tests is somewhat more complicated. Consider the following -header file, which defines four tests (three of which are disabled): -[source,{cpp}] ------ -include::examples/MyTestSuite3.h[] ----- - -The first is commented out with C\++-style comments, the second -test is commented out with C-style comments, and the third test is -named in a manner that is not recognized through test discovery -(i.e., it does not start with +test+). - -The default test discovery mechanism only works with the first and -third methods for disabling tests, but the FOG parser works with -all three. The FOG parser performs a complex, multi-line parse of -the source file, so it can identify multi-line C-style comments. - -Note, however, that the use of C macros will not work: -[source,{cpp}] ------ -include::examples/BadTestSuite1.h[] ----- -The +cxxtestgen+ discovery mechanisms do not perform a C preprocessing -step, since that would generally require using externally defined -preprocessing variable definitions. Additionally, preprocessor macros that act like functions will -cause the FOG parser to fail unless they are followed by a semicolon. - - -Test Classes Nested in Namespaces -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -In some contexts, it is appropriate to nest test classes in namespaces. -This allows the same class name to be used without creating conflicts -in the test runner. The default test discovery mechanism can only do -this by declaring the namespaces with the class name, and then declaring the -class with the explicit namespace prefix. For example: -[source,{cpp}] ------ -include::examples/Namespace2.h[] ----- -However, the default test discovery mechanism cannot recognize the more typical -declaration of test classes within nested namespaces: -[source,{cpp}] ------ -include::examples/Namespace1.h[] ----- -The FOG parser can discover tests nested within arbitrary namespaces, and unique -names are used within the test runner to distinguish the test classes in different namespaces. - - - -[[runner]] -Test Runner Syntax ------------------- - -The default behavior of the CxxTest test runner is to execute all -tests in all of the test suites that are linked into the runner. -However, CxxTest test runners process command line options that -allow individual tests and test suites to be selected. - -For example, consider a test runner defined as follows: -[source,bash] ----- -include::examples/.buildRunner13_main.sh[] ----- -The +--help+ (+-h+) option can be used to print the command line options for a test runner. The command - ----- -include::examples/.buildRunner13_help.sh[] ----- -generates the following output: - ----- -include::examples/runner13.help.txt[] ----- - -The +--help-tests+ option is used to list all test suites that are defined in a test runner. The command -[source,bash] ----- -include::examples/.buildRunner13_helpTests.sh[] ----- -generates the following output: - ----- -include::examples/runner13.helpTests.txt[] ----- -The first column is the test suite name, and the second column is the test name. - -All tests in a test suite can be executed by simply specifying the test suite name. For example -[source,bash] ----- -include::examples/.buildRunner13_MyTestSuite2.sh[] ----- -executes the tests in test suite +MyTestSuite2+: - ----- -include::examples/runner13.MyTestSuite2.txt[] ----- - -Similarly, a single test can be executed by specifying the test suite followed by the test name. For example -[source,bash] ----- -include::examples/.buildRunner13_testMultiplication.sh[] ----- -executes the +testMultiplication+ test in test suite +MyTestSuite2+: - ----- -include::examples/runner13.testMultiplication.txt[] ----- - -The +-v+ option enables the printing of trace information generated -by the +TS_TRACE+ function. For example, the +testMultiplication+ test contains trace declarations -before and after the multiplication test. Thus, the command -[source,bash] ----- -include::examples/.buildRunner13_testMultiplicationVerbose.sh[] ----- -generates this trace output before and after the test: - ----- -include::examples/runner13.testMultiplicationVerbose.txt[] ----- - - -[[advanced]] -Advanced Testing Features -------------------------- - -Preprocessor Macros -~~~~~~~~~~~~~~~~~~~ - -CxxTest recognizes a variety of preprocessor macros that can be used to modify the behavior of a test runner. Many of these mimic the options of the +cxxtestgen+ command. - -[options="header"] -|==================================================================================== -| Preprocessor Macro | Description -| +CXXTEST_HAVE_STD+ | Use the standard library. -| +CXXTEST_HAVE_EH+ | Use exception handling. -| +CXXTEST_ABORT_TEST_ON_FAIL+ | Abort tests on failed asserts. -| +CXXTEST_USER_VALUE_TRAITS+ | Enable user-defined value traits. The default traits dump up to 8 bytes of the data as hex values. -| +CXXTEST_OLD_TEMPLATE_SYNTAX+ | Use old template syntax that is used by some compilers (e.g. Borland C++ 5). -| +CXXTEST_OLD_STD+ | Use old syntax for libraries where +std::+ is not recognized. -| +CXXTEST_MAX_DUMP_SIZE+ | The value of this macro defines the maximum number of bytes to dump if +TS_ASSERT_SAME_DATA()+ fails. The default is 0, which indicates no limit. -| +CXXTEST_DEFAULT_ABORT+ | The value of this macro is the default value of the dynamic _abort on fail_ flag. -| +CXXTEST_LONGLONG+ | The value of this macro is used to define long long integers. -|===================================== - -These preprocessor macros must be defined before the CxxTest header -files are included in the test runner. For example, the following -template file defines +CXXTEST_HAVE_EH+ and +CXXTEST_ABORT_TEST_ON_FAIL+ -before other headers are included: -[source,{cpp}] ----- -include::examples/runner10.tpl[] ----- - -Several of these macros concern whether modern C++ conventions are -supported by the compiler. If tests need to be ported to multiple -compilers, then one important convention is whether the namespace -+std::+ is supported. For example, switching between +cout+ and -+std::cout+ typically needs to be done throughout a code. CxxTest -supports this with the +CXXTEST_STD()+ macro. For example, -+CXXTEST_STD(cout)+ can be used within a test suite, and CxxTest -handles the mapping of this to +cout+ or +std::cout+ depending on -options provided to +cxxtestgen+. - -Finally, CxxTest defines the +CXXTEST_RUNNING+ preprocessor macro. -This can be used in a test header file to define code that is -executed when the header is not used in a test runner. For example: -[source,{cpp}] ------ -include::examples/MyTestSuite12.h[] ----- -Note that test suites derived from +CxxTest::TestSuite+ class cannot -easily be built outside of the test runner. - - - -Customizing Test Fixtures -~~~~~~~~~~~~~~~~~~~~~~~~~ - -Setup and Teardown -^^^^^^^^^^^^^^^^^^ - -CxxTest test fixtures can be customized in several ways to manage -the environment for test suites and individual tests. A common -feature of test suites is that they share a common logic for setting -up data used in the tests. Thus, there may be duplicate code for -creating objects, files, inputs, etc. Similarly, the tests may -share common logic for cleaning up after the test is finished (e.g. deleting temporary objects). - -You can put this shared code in a common place by overriding the -virtual functions `TestSuite::setUp()` and `TestSuite::tearDown()`. -The `setUp()` function is called before each test, and `tearDown()` -is called after each test. - -For example, the following test suite employs +setUp()+ and +tearDown()+ methods to -allocate and deallocate memory for a string buffer: -[source,{cpp}] ------ -include::examples/MyTestSuite5.h[] ------ - -Note that test assertions cannot be used in within the +setUp()+ -or +tearDown()+ methods. The scope of these methods is outside any -test case, so an assertion failure does not have a clear semantics. -Similarly, test assertions cannot be used in -world setup and teardown or in +createSuite()+ or +destroySuite()+ methods for for -dynamicly created test suites (see below). - - -Dynamically Created Test Suites -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -CxxTest test fixtures can also be customized during the construction -and deconstruction of test suites. By default, CxxTest test suites -are instantiated statically in the test runner. However, dynamically -created test suites can be used to perform suite-level setup and -teardown operations, verify the environment needed to execute a -test suite, and construct test suites that require a nontrivial -constructor. - -CxxTest instantiates a test suite dynamically if the +createSuite()+ -or +destroySuite()+ methods are defined. For example, the following -test suite checks to see if it is being compiled with Microsoft -Visual Studio. If not, the +createSuite()+ returns a null pointer, -indicating that the test suite was not created. -[source,{cpp}] ------ -include::examples/MyTestSuite6.h[] ------ - -Global and World Fixtures -^^^^^^^^^^^^^^^^^^^^^^^^^ - -CxxTest supports two related mechanisms for performing _global_ -setup and teardown operations. _Global fixtures_ are classes that -inherit from `CxxTest::GlobalFixture`, and they define `setUp` and -`tearDown` methods. The `setUp` method for all global fixtures is -called before each test is executed, and the `tearDown` method for -all global fixtures is called after each test is completed. Thus, -this mechanism provides a convenient way of defining setup and -teardown operations that apply to all test suites. - -For example, consider the following test suite: -[source,{cpp}] ------ -include::examples/MyTestSuite8.h[] ------ -This test suite defines a runner that generates the following output: - ------ -include::examples/buildRunner18.txt[] ------ - -Note that the global fixtures are instantiated with static global -values. This ensures that these fixtures are created before the -runner is initialized. Also, note that the `setUp` methods are -called in the same sequence that the global fixtures are instantiated, -and the `tearDown` methods are called in the reverse sequence. -Finally, note that the `setUp` and `tearDown` methods in global -fixtures return a boolean value, which indicates success or failure -of that operation. - -This example also illustrates the use of _world fixtures_, which -perform setup and teardown operations that are executed once each -when beginning and finishing tests in each test suite. World -fixtures are defined with the `setUpWorld` and `tearDownWorld` -methods in a global fixture. - - -Runtime Test Customization -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -CxxTest defines several functions that can be called in a test suite to modify the default behavior of CxxTest. - -[options="header"] -|================================== -| Test Suite Method | Description -| +setAbortTestOnFail(bool)+ | This function specifies whether tests abort after a failure. The default value of the flag is +false+. This function only has an effect if exception handling is enabled. -| +setMaxDumpSize(unsigned)+ | This function sets the maximum number of bytes that are dumped when -+TS_ASSERT_SAME_DATA()+ fails. The default is 0, which indicates no limit. -|============= - -Note that the the configuration parameters are reset to their default -values after each test is executed (more precisely, after +tearDown()+ -is called). Consequently, calling these functions in the +setUp()+ -function has the effect of setting that value for the entire test -suite. - - - -[[traits]] -Value Traits ------------- - -CxxTest's test assertions like <<ts_assert_equals,TS_ASSERT_EQUALS>> -work for built-in types, but they will not likely work for user-defined -data types. This is because CxxTest needs a way to compare objects -and to convert them to strings when printing test failure summaries. -Thus, user-defined data types need to have the `operator=` method -defined to ensure that test assertions can be applied. - -For example, the following code -[source,{cpp}] ------ -include::examples/MyTestSuite7.h[] ------ -defines a test runner that generates the following output - ------ -include::examples/buildRunner17.txt[] ------ -The `operator=` method is required to apply -<<ts_assert_equals,TS_ASSERT_EQUALS>> to `Data` objects. However, -the <<ts_assert_same_data,TS_ASSERT_SAME_DATA>> assertion can be -applied to `Data2` objects that do not have `operator=` defined. - -Since CxxTest does not rely on any external library, conversion -from arbitrary data types to strings is done using _value traits_. -For example, to convert an integer to a string, CxxTest does the following: -[source,{cpp}] ----- -int i = 10; -CxxTest::ValueTraits<int> converter(i); -const char* string = converter.asString(); ----- -The CxxTest header file `cxxtest/ValueTraits.h` defines value traits -for standard types like `int`, `char`, `double`, etc. The default -`ValueTraits` class for unknown types dumps up to 8 bytes of the value -in hex format. - -If the macro `CXXTEST_USER_VALUE_TRAITS` is defined, then CxxTest will -omit the default definitions for `ValueTraits`. This allows a user to define their own trait specifications to customize the display of trait information. - - - -Enumeration Traits -~~~~~~~~~~~~~~~~~~ - -CxxTest provides a simple way to define value traits for enumeration -types. The `CXXTEST_ENUM_TRAITS` macro is used to define value -traits for all members of an enumeration set. - -For example, the following code -[source,{cpp}] ------ -include::examples/MyTestSuite9.h[] ------ -defines a test runner that generates the following output - ------ -include::examples/buildRunner19.txt[] ------ -The enumeration value traits print strings that represent the elements of the enumeration, except where a numeric value is provided. - -Note that the `CXXTEST_ENUM_TRAITS` macros has two arguments; the list of `CXXTEST_ENUM_MEMBER` macros is not separated by commas! - - -Defining New Value Traits -~~~~~~~~~~~~~~~~~~~~~~~~~ - -Defining value traits for a new class is done by providing a class -specialization of `ValueTraits` that converts an object of the new -class to a string. For example, consider the definition of the -`MyClass` class: -[source,{cpp}] ------ -include::examples/MyClass.h[] ------ -This class includes definitions of `operator==` and `operator<` -that support comparisons with <<ts_assert_equals,TS_ASSERT_EQUALS>> -and <<ts_assert_less_than,TS_ASSERT_LESS_THAN>>. Additionally, -this header contains a specialization of `ValueTraits` (in the -`CxxTest` namespace) that generates a string description of a `MyClass` -instance. - -The following test suite illustrates how these definitions can be -used to define a test runner: -[source,{cpp}] ------ -include::examples/MyTestSuite10.h[] ------ -This runner for this test suite generates the following output: - ------ -include::examples/buildRunner20.txt[] ------ -The test failure print logic uses the specialization of `ValueTraits` to create -the string description of `MyClass` that appears in the output. - - -Defining Value Traits for Template Classes -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -A simple modification to the above example illustrates how a trait can be defined for a -template class: -[source,{cpp}] ------ -include::examples/MyTestSuite11.h[] ------ -Unfortunately, this example employs partial template specialization, which is not supported by all C++ compilers. - - -[[mock]] -Testing with Mock Objects -------------------------- - -Mock Objects are a very useful concept for testing complex software. -The key idea is to pass special objects to tested code that facilitates -the testing process. For instance, a class that implements a -protocol over TCP might rely on an abstract `ISocket` interface. -Then a mock testing strategy could pass a `MockSocket` object that -does anything that is useful for testing (e.g., keep a log of all -data ``sent'' to verify later). - -However, when a challenge for C/C++ developers is that you may need -to call _global_ functions which you cannot override. Consider any -code that uses `fopen()`, `fwrite()` and `fclose()`. It is not -very elegant to have this code actually create files while being -tested. Even more importantly, you need to test how the code behaves -when ``bad'' things happen (e.g., when `fopen()` fails). Handling -these types of exceptional conditions is often a very challenging -issue for software testing. - -CxxTest addresses this challenge by providing a generic mechanism for -defining mock global functions. The next section illustrates this mechanism for a single -global function. The following section provides more detail about specific features of CxxTest's -support for mock testing. - - -Example: A Mock +time()+ Function -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Suppose that we want to perform mock testing using the well known -standard library function `time()`. Setting up a test suite with -a mock global function for `time()` can be broken down into the -following steps. - -Declare Mock Functions -^^^^^^^^^^^^^^^^^^^^^^ - -The `CXXTEST_MOCK_GLOBAL` macro is used to declare mock global functions. It is often convenient to include -these declarations in a header file, which is used in both the test suite as well as the code that is being tested: -[source,{cpp}] ------ -include::examples/time_mock.h[] ------ - -Mock Functions in Tested Code -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -The tested code uses mock global functions, rather than using the global functions directly. -You access mock functions in the `T` (for _Test_) namespace, so the tested code calls `T::time()` instead of -`time()`. This is the equivalent of using abstract interfaces -instead of concrete classes. -[source,{cpp}] ------ -include::examples/rand_example.cpp[] ------ - - -Mock Source Files -^^^^^^^^^^^^^^^^^ - -A source file needs to be defined that implements `T::time()` by -calling the real global function. This definition is performed automatically by -defining `CXXTEST_MOCK_REAL_SOURCE_FILE` before the header file is defined: -[source,{cpp}] ------ -include::examples/time_real.cpp[] ------ -This source file is not used for testing, but instead it supports normal use of the tested code. - -Similarly, a source file needs to be defined that implements `T::time()` by calling the mock -global function. This definition is performed automatically by defining `CXXTEST_MOCK_TEST_SOURCE_FILE` before the header file is defined: -[source,{cpp}] ------ -include::examples/time_mock.cpp[] ------ - - -Test Suites using Mock Functions -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -A mock object for the `time()` function is created using the `T::Base_time` class, -which is automatically created by CxxTest. This class includes a `time()` method whose -API is the same as the global `time()` function. Thus, this method can be defined to have -whatever behavior is desired during testing. For example, the following example defines a -mock object that increments a counter to define an incremental value for `time()`. -[source,{cpp}] ------ -include::examples/MockTestSuite.h[] ------ -Note that CxxTest uses global data to associate calls made with `T::time()` -to calls to `MockObject::time()`. The `MockObject` class simply -needs to be instantiated prior to the call to `T::time()`. - - -Building the Test Runner -^^^^^^^^^^^^^^^^^^^^^^^^ - -The +cxxtestgen+ command is used to create a test runner with mock functions in a normal manner: -[source,bash] ------ -include::examples/.buildRunner16_main.sh[] ------ -The test runner source file, `runner.cpp`, needs to be compiled an linked to the mock function definition, `time_mock.cpp`, as well as the code being tested, `rand_example.cpp`: -[source,bash] ------ -include::examples/.buildRunner16_compile.sh[] ------ -This generates a test runner that generates the following output: - ------ -include::examples/buildRunner16.txt[] ------ - - -Advanced Topics -~~~~~~~~~~~~~~~ - -Void Functions -^^^^^^^^^^^^^^ - -The `CXXTEST_MOCK_VOID_GLOBAL` is used to define mock global functions that return `void`. -This is identical to -`CXXTEST_MOCK_GLOBAL` except that it does not specify the return -type. Take a look in `sample/mock/T/stdlib.h` for a demonstation. - -Calling the Real Functions While Testing -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -During testing it is sometimes necessary to call the real global -function instead of the mock global function. CxxTest allows a -user to do this by creating a special mock object. For a global -mock function of `time()`, the object `T::Real_time` represents the -real function. If this class is created, then `T::time()` will be -redirected to the real function. - -Mocking Nonexistent Functions -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Sometimes the tested code calls functions that are not available -when testing. For example, this can happen when testing driver -code that calls kernel functions that are not available to a user-mode -test runner. CxxTest can provide mock global function definitions -for the test code while using the original functions in the tested code. - - -The `CXXTEST_SUPPLY_GLOBAL` and `CXXTEST_SUPPLY_VOID_GLOBAL` macros are used to provide mock global function definitions. For example, the following declaration creates a mock global function for the Win32 kernel function `IoCallDriver`: -[source,{cpp}] ------ -CXXTEST_SUPPLY_GLOBAL( NTSTATUS, /* Return type */ - IoCallDriver, /* Name */ - ( PDEVICE_OBJECT Device, /* Prototype */ - PIRP Irp ), - ( Device, Irp ) /* How to call */ ); ------ -The tested driver code calls `IoCallDriver()` normally; there is no need for the `T::` syntax. -The test suite is defined using the `T::Base_IoCallDriver` as with normal mock objects. - -CxxTest also provides the macros `CXXTEST_SUPPLY_GLOBAL_C` and -`CXXTEST_SUPPLY_GLOBAL_VOID_C` that declare the functions with `C` -linkage (i.e., using `extern "C"`). These macros are used to declare -function prototypes, since you may not be able to include the header -files in the test suite that are associated with the mock global function. - - -Functions in Namespaces -^^^^^^^^^^^^^^^^^^^^^^^ - -The `CXXTEST_MOCK` macro is used to declare a mock global function that is associated -with a function in a namespace, including static class member functions. -For example, consider the function `bool Files::FileExists( const -String &name )`; the namespace `Files` contains the function -`FileExists`. The mock class will be called `T::Base_Files_FileExists` -and the function to implemented would be `fileExists`. The `CXXTEST_MOCK` macro declares this mock global function as follows: -[source,{cpp}] ------ -CXXTEST_MOCK( Files_FileExists, /* Suffix of mock class */ - bool, /* Return type */ - fileExists, /* Name of mock member */ - ( const String &name ), /* Prototype */ - Files::FileExists, /* Name of real function */ - ( name ) /* Parameter list */ ); ------ -Similarly, the `CXXTEST_MOCK_VOID` macro is used to declare a mock global function that returns `void`. - -The `CXXTEST_SUPPLY` and `CXXTEST_SUPPLY_VOID` macros are used to provide mock global function definitions for nonexistent functions. For example: -[source,{cpp}] ------ -CXXTEST_SUPPLY( AllocateIrp, /* => T::Base_AllocateIrp */ - PIRP, /* Return type */ - allocateIrp, /* Name of mock member */ - ( CCHAR StackSize ), /* Prototype */ - IoAllocateIrp, /* Name of real function */ - ( StackSize ) /* Parameter list */ ); ------ -Similarly, the `CXXTEST_SUPPLY_C` and `CXXTEST_SUPPLY_VOID_C` macros declare the functions with `C` linkage. - -Overloaded Functions -^^^^^^^^^^^^^^^^^^^^ - -The `CXXTEST_MOCK` and `CXXTEST_MOCK_VOID` macros have a flexible -interface that can provide mock global function definitions for -overloaded functions. The arguments simply need to specify different -mock class names, mock member names and different prototype definitions. -These different mock declarations will generate different mock objects that can be explicitly -referenced in a test suite. - -The Mock Namespace -^^^^^^^^^^^^^^^^^^ - -The default namespace for mock functions is `T::`. This namespace can be changed by defining the -`CXXTEST_MOCK_NAMESPACE` macro. - - -[[installation]] -Installation ------------- - -A key feature of CxxTest is that it does has virtually no installation -process. The +cxxtestgen+ script can be directly executed from the -+cxxtest/bin+ directory. Simply adding this directory to the PATH -environment of a command shell is sufficient for many applications. -Beyond that, the build process for test runners simply needs to -reference the +cxxtest+ root directory to enable proper includes -during compilation. - -The FOG parser requires two Python packages: - - - +ply+ - - +ordereddict+ (This is needed when running Python 2.4, 2.5 or 2.6) - -If these packages are not available, then +cxxtestgen+ will generate an error when the -FOG parser option is selected. -If you have -http://pypi.python.org/pypi/setuptools[setuptools] or -http://pypi.python.org/pypi/distribute[distribute] -installed, then -you can install these packages from PyPI by executing -[source,bash] ----- -easy_install ply -easy_install ordereddict ----- - -The +cxxtestgen+ script has been tested with many different versions -of Python: 2.4 - 3.3, though future releases will not support -Python 2.4. Note that this script has only been tested with the -CPython implementation. CxxTest has been tested on Linux and -Mac platforms using the `g++` and `clang++` compilers. - - -//// - -WEH - I thought about moving this section into the Getting Started -section. However, it makes sense to leave this here to reference -future installations in Debian, Mac Ports, etc. I think that that -distribution model is very strategic for cxxtest. - -//// - - - -[[discussion]] -Status and Future Plans ------------------------ - -The CxxTest 4.4 release is an incremental release that was driven -by a variety of bug fixes and minor enhancements. The CxxTest 4.0 -release reflected major changes in the management and focus of -CxxTest: - - - Perl is no longer used to support CxxTest scripts. Python is now the only scripting language used by CxxTest. - - The testing scripts have been rewritten using the PyUnit framework. - - The installation process for CxxTest now leverages and integrates with the system Python installation. - - A more comprehensive C++ parser is now available, which supports testing of templates. - - The CxxTest GUI is no longer supported, and the <<ts_warn,TS_WARN>> is deprecated. - - CxxTest runners now have a command-line interface that facilitates interative use of the test runner. - - A new user guide is now available in PDF, HTML and Ebook formats. - - Updated the +cxxtestgen+ script to work with Python 2.6 through 3.2 - -Additionally, CxxTest is now validated with continuous integration -tests. Yes, the CxxTest developers eat their own dog food! - -Although the GUI option for +cxxtestgen+ appears to work fine, this -GUI is rather primitive. It simply provides a visual summary of -the test results, and not the interactive test execution that a -user would expect. This capability is deprecated since none of the -current developers use this feature. CxxTest users should consider -using CxxTest with http://jenkins-ci.org/[Jenkins]. The +XUnitPrinter+ -test listener generates XML files that can be easily integrated by -http://jenkins-ci.org/[Jenkins], which creates a visual summary of -test results with links to drill-down into test outputs. - -This documentation has highlighted the commonly used test listeners. -There are a variety of other test listeners provided by CxxTest -that support advanced Cxxtest applications. For example, the -+YesNoRunner+ is perhaps the simplest test listener; it simply -returns the number of test failures. The +StdioFilePrinter+ is -used by +StdioPrinter+, but it does not assume that +stdio+ is the -default output stream. This test listener can be used in contexts -where a custom output stream must be specified. - -//// -WEH - I'd like to say more about future support for CxxTest, but I don't know more basic things like how we should plan to host CxxTest in the future. - -Discuss support for ... - - - embedded compilers... (Macros vs templates) - - SCONS - -Future work: - - - ply cpp - - ignore template test classes using the FOG parser - -//// - -//// -NOTE: we do not have test coverage for the following macros: -CXXTEST_OLD_TEMPLATE_SYNTAX -CXXTEST_OLD_STD -CXXTEST_LONGLONG -//// - - -:numbered!: - -[[acknowledgements]] -Acknowledgements ----------------- - -CxxTest was originally developed by Erez Volk. The following -developers contributed to the CxxTest 4.x releases: - -* GaÅ¡per Ažman -* Andrey Batyiev -* Olivier Charloton -* Dave Elcock -* Kevin Fitch -* William Hart -* Allan Odgaard -* Lionel Orry -* John Siirola -* Jon Schlueter -* Andrei Korostelev -* Sebastian Rettenberger -* Piotr Kasprzyk -* Gluttton -* Pawel Tomulik - -The CxxTest documentation is generated using -http://www.methods.co.nz/asciidoc/[AsciiDoc]. - -A major advancement in CxxTest's capability is the new test discovery -mechanism that is based on a parser of the Flexible Object Language -(FOG). FOG generalizes the C++ syntax, which enables CxxTest to -extract high-level class structure for test discovery. FOG was -developed by Edward Willink: - -* Edward D. Willink. 'Meta-Compilation for C++', PhD Thesis, Computer Science Research Group, University of Surrey, January 2000. - -The FOG parser in CxxTest critically relies on the excellent LALR -parser provided by Dave Beazley's `ply` Python package. The scalable -performance of `ply` is critical for CxxTest. - -CxxTest has greatly benefited from the support of the open source -community. We would like to thank the following organizations for -providing web hosting and computing resources: GitHub, SourceForge, -Tigris.org, Sandia National Laboratories, Google and COIN-OR. The development -of CxxTest has been partially supported by Sandia National Laboratories. -Sandia National Laboratories is a multi-program laboratory managed -and operated by Sandia Corporation, a wholly owned subsidiary of -Lockheed Martin Corporation, for the U.S. Department of Energy's -National Nuclear Security Administration under contract DE-AC04-94AL85000. - - -[appendix] -[[appendix_A]] -Test Assertion Examples ------------------------ - -[[ts_assert]] TS_ASSERT:: -This is the most basic test assertion, which simply verifies that the +expr+ argument is true: -[source,{cpp}] ----- -include::examples/.Assertions_assert.h[] ----- -[[ts_assert_delta]] TS_ASSERT_DELTA:: -This test assertion verifies two floating point values are within a specified absolute difference: -[source,{cpp}] ----- -include::examples/.Assertions_assertDelta.h[] ----- - -[[ts_assert_differs]] TS_ASSERT_DIFFERS:: -This test assertion verifies that the two arguments are not equal: -[source,{cpp}] ----- -include::examples/.Assertions_assertDiffers.h[] ----- - -[[ts_assert_equals]] TS_ASSERT_EQUALS:: - This test assertion verifies that the two arguments are equal: -[source,{cpp}] ----- -include::examples/.Assertions_assertEquals.h[] ----- -Note that this test is performed using the C++ +==+ operator, whose behavior may be redefined for the two argument types. - -[[ts_assert_is_nan]] TS_ASSERT_IS_NAN:: - This test assertion verifies that the argument is NaN: -[source,{cpp}] ----- -include::examples/.Assertions_assertIsNan.h[] ----- - -[[ts_assert_is_infinite]] TS_ASSERT_IS_INFINITE:: - This test assertion verifies that the argument is infinite: -[source,{cpp}] ----- -include::examples/.Assertions_assertIsInfinite.h[] ----- - -[[ts_assert_less_than]] TS_ASSERT_LESS_THAN:: -This test assertion verifies that the first argument is strictly less than the second argument: -[source,{cpp}] ----- -include::examples/.Assertions_assertLessThan.h[] ----- - -[[ts_assert_less_than_equals]] TS_ASSERT_LESS_THAN_EQUALS:: -This test assertion verifies that the first argument is less than or equal to the second argument: -[source,{cpp}] ----- -include::examples/.Assertions_assertLessThanEquals.h[] ----- - -[[ts_assert_predicate]] TS_ASSERT_PREDICATE:: -This test assertion takes as an argument the name of a class, similar to a STL +unary_function+, and evaluates the +operator()+ method: -[source,{cpp}] ----- -include::examples/.Assertions_assertPredicate.h[] ----- -This test assertion can be seen as a generalization of <<ts_assert,TS_ASSERT>>, but it -allows the tester to see the failed value. - -[[ts_assert_relation]] TS_ASSERT_RELATION:: -It takes as an argument the name of a class, similar to a STL +binary_function+, and evaluates the +operator()+ method: -[source,{cpp}] ----- -include::examples/.Assertions_assertRelation.h[] ----- -This test assertion can be seen as a generalization of <<ts_assert_equals,TS_ASSERT_EQUALS>>, <<ts_assert_differs,TS_ASSERT_DIFFERS>>, <<ts_assert_less_than,TS_ASSERT_LESS_THAN>> and <<ts_assert_less_than_equals,TS_ASSERT_LESS_THAN_EQUALS>>. -This can be used to assert comparisons which are not covered by the builtin test assertions. - -[[ts_assert_same_data]] TS_ASSERT_SAME_DATA:: -This test assertion is similar to <<ts_assert_equals,TS_ASSERT_EQUALS>>, -except that it compares the contents of two buffers in memory: -[source,{cpp}] ----- -include::examples/.Assertions_assertSameData.h[] ----- -The standard runner dumps the contents of both buffers as hex values when this test fails. - -[[ts_assert_throws]] TS_ASSERT_THROWS:: -This test assertion verifies that the specified exception is thrown when the first argument is executed: -[source,{cpp}] ----- -include::examples/.Assertions_assertThrows.h[] ----- - -[[ts_assert_throws_anything]] TS_ASSERT_THROWS_ANYTHING:: -This test assertion verifies that _some_ exception is thrown when the first argument is executed: -[source,{cpp}] ----- -include::examples/.Assertions_assertThrowsAnything.h[] ----- - -[[ts_assert_throws_assert]] TS_ASSERT_THROWS_ASSERT:: -This test assertion verifies that an exception is thrown when executing the first argument. The second argument specifies a variable declaration for the exception, and the third argument is executed to test that -exception value: -[source,{cpp}] ----- -include::examples/.Assertions_assertThrowsAssert.h[] ----- -Note that this can be viewed as a generalization of <<ts_assert_throws_equals,TS_ASSERT_THROWS_EQUALS>>. - -[[ts_assert_throws_equals]] TS_ASSERT_THROWS_EQUALS:: -This test assertion verifies that an exception is thrown when executing the first argument. The second argument specifies a variable declaration for the exception, and the third and fourth arguments are values that are asserted equal after the exception is thrown: -[source,{cpp}] ----- -include::examples/.Assertions_assertThrowsEquals.h[] ----- - -[[ts_assert_throws_is_nan]] TS_ASSERT_THROWS_IS_NAN:: -This test assertion verifies that an exception is thrown when executing the first argument. The second argument specifies a variable declaration for the exception, and the third argument is a value that are asserted to be NaN after the exception is thrown: -[source,{cpp}] ----- -include::examples/.Assertions_assertThrowsIsNan.h[] ----- - -[[ts_assert_throws_is_infinite]] TS_ASSERT_THROWS_IS_INFINITE:: -This test assertion verifies that an exception is thrown when executing the first argument. The second argument specifies a variable declaration for the exception, and the third argument is a value that are asserted to be infinite after the exception is thrown: -[source,{cpp}] ----- -include::examples/.Assertions_assertThrowsIsInfinite.h[] ----- - -[[ts_assert_throws_nothing]] TS_ASSERT_THROWS_NOTHING:: -This test assertion verifies that an exception is _not_ thrown when executing the first argument: -[source,{cpp}] ----- -include::examples/.Assertions_assertThrowsNothing.h[] ----- - -[[ts_fail]] TS_FAIL:: -This function triggers a test failure with an associated message: -[source,{cpp}] ----- -include::examples/.Assertions_fail.h[] ----- - -[[ts_skip]] TS_SKIP:: -This function causes the current test to be skipped with an associated warning message: -[source,{cpp}] ----- -include::examples/.Assertions_skip.h[] ----- - -[[ts_trace]] TS_TRACE:: -This function prints an informational message: -[source,{cpp}] ----- -include::examples/.Assertions_trace.h[] ----- - -[[ts_warn]] TS_WARN:: -This function prints a message as a warning: -[source,{cpp}] ----- -include::examples/.Assertions_warn.h[] ----- - - -[appendix] -[[appendix_B]] -Integrating with Your Build Environment ---------------------------------------- - -CxxTest can be integrated into a variety of build environments to -automate the generation, compilation and execution of test runners. -Here is a rough breakdown of this process: - -* Split the application into a library and a main module that just - calls the library classes. This way, the test runner will be - able to access all your classes through the library. -* Create another application (or target, or project, or whatever) - for the test runner. Make the build tool generate it automatically. -* Configure the build tool to run the tests automatically. - -Unfortunately, different build tools and IDEs need to setup this -process in different ways. The following sections provide rough -guidance for doing this for some come use cases. - -[NOTE] -These examples (except for the SCons ones) are not actively maintained and -tested. Please send suggestions to the CxxTest developers for updating this -documentation. - -[[scons]] -SCons -~~~~~ - -CxxTest provides built-in support for the SCons build system. This part -documents this feature. - -[[scons_installation]] -Installation -^^^^^^^^^^^^ - -The script is located at +build_tools/SCons/cxxtest.py+. -You need SCons to be able to find this file, so do one of the following: - -- add the file to your project site_tools directory (default: +#/site_scons/site_tools/+) -- link the file to your project site_tools directory -- add +build_tools/SCons/cxxtest.py+ to your SCons toolpath. - -[NOTE] -'#' means the project root, using the SCons convention of marking it that way. - -Preparing the tests for use with the builder -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -This builder assumes that tests have a different suffix than other files in your -project (by default: +.t.h+, configure via 'CXXTEST_SUFFIX'). This isn't a bad -idea to begin with, since test "header files" are not really header files in the -traditional sense. This is how it separates files it should run through -cxxtestgen from the ones it should not. - -[NOTE] -Test header files' filenames should end with +.t.h+. - -Compiling and Running the Tests -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -By default, you build and run the tests by issuing the following command: - -.Building and running the tests in the shell -=================== -[source,bash] -scons check -=================== - -Of course, the actual name of the target is configurable (+CXXTEST_TARGET+). - -Using the Builder -^^^^^^^^^^^^^^^^^ - -This section describes what you do in your SConstruct file in order to be able -to use the builder. - -First, you must tell the environment that you want to use the 'cxxtest' tool and -how it should set itself up. - -The easiest way to set the environment up is to pray the defaults are ok. -The builder does some autodetection and tries its best to figure everything out. -In the event this works, setting up the environment is as easy as telling SCons -it should use the 'cxxtest' tool. - -.Configuring the environment if defaults are ok -=================== -[source,python] -env = Environment(tools = ['default', 'cxxtest']) -=================== - -If this doesn't work, the builder tries its best to tell you what went wrong. In -most cases, it just wasn't able to find where you installed cxxtest. You can fix -this like so (assuming you have CxxTest in +#/extern_libs/cxxtest/+): - -.Configuring the environment: telling the builder where CxxTest is installed -=================== -[source,python] -env = Environment(tools = [ - 'default', - ('cxxtest', {'CXXTEST_INSTALL_DIR' : '#/extern_libs/cxxtest/'}) - ]) -=================== - -[NOTE] -If you want to pass other options to the builder, just append them to the -dictionary. - -It is advisable to pass most options to the builder at creation time, although -the 'CxxTest' call can also accept most of them if you need to do some weird -thing with a particular test. - -You can use the builder the same way you would the 'Program' builder. - -.Setting up tests with SCons and the cxxtest builder -=================== -[source,python] ---------------------------------------------------------------------------- -# ... set up the environment as above, with your favorite options -# and then tell the builder to build some tests -env.CxxTest('my_test_suite', source='mytests.t.h') #<1> -env.CxxTest('the_other_suite', ['test_header.t.h', '../utilities.cpp']) #<2> -env.CxxTest('the_third_suite', - ['testsuite1.t.h', 'testsuite2.t.h', - 'testsuite3.t.h', 'required_libs.cpp']) #<3> -env.CxxTest('the_fourth_suite', - ['reginold_never_checks_for_warnings.t.h'], - CXXFLAGS='-Wall -Wextra -Weffc++ -pedantic') #<4> ---------------------------------------------------------------------------- - -<1> Normal, 1-source file tests -<2> This is how a single testsuite needing implementations is compilied -<3> If you want multiple testsuites in a single runner, this is how it's done -<4> unrecognised options are passed through to the Program builder unchanged - -=================== - -Configuration Options -^^^^^^^^^^^^^^^^^^^^^ - -===== +CXXTEST_RUNNER+ - -Default: "ErrorPrinter". - -This is what is passed to the +--runner+ option of +cxxtestgen+. See the section -about runners to see what the other options are. - -===== +CXXTEST_OPTS+ - -Default: empty. - -Any other commandline options to pass to +cxxtestgen+. - -Do not pass +--runner+, +--error-printer+ and friends, and +--root+ or +--part+ -here. - -===== +CXXTEST_SUFFIX+ - -Default: ".t.h" - -The suffix test suite files have. Should be different from other header files. -If you never mean to pass any header files that are not test suites to the -builder, you can set this to ".h" and use plain ".h" files. - -===== +CXXTEST_TARGET+ - -Default: "check" - -This is the target that scons tests are added to in order to run them. If you -want something else, this is the place. - -===== +CXXTEST_INSTALL_DIR+ - -Default: autodetect - -If cxxtest isn't found automatically, you need to set this. Normal SCons path -expansion rules apply. - -===== +CXXTEST_CPPPATH+ - -Default: autodetect - -If you don't want to clutter your normal +CPPPATH+ with CxxTest headers and this -isn't autodetected even after you set +CXXTEST_INSTALL_DIR+, then set this. - -===== +CXXTEST+ - -Default: autodetect - -If +cxxtestgen+ isn't found even after you set +CXXTEST_INSTALL_DIR+, then set -this to the path of the +cxxtestgen+ script. - -===== +CXXTEST_SKIP_ERRORS+ - -Default: False - -When running tests with +scons check+, if you want to continue even if tests -fail, set this to True. - -===== +CXXTEST_PYTHON+ - -Default: the same python interpreter that is running scons. - -If you want to use a particular python interpreter to run +cxxtestgen+, set its -path here. - -===== +CXXTEST_CXXFLAGS_REMOVE+ - -Default: a list of flags with which no test compiles. Changes as we fix bugs. - -Do you want your tests to compile without some flags and don't want gymnastics -to get them out for tests only? This is the way. Just add them to here and they -will be stripped. (This is a list, by the way, not a string.) - -===== +CXXTEST_CCFLAGS_REMOVE+ - -Same as above, but for +CCFLAGS+. - -===== +CXXTEST_CXXTESTGEN_SCRIPT_NAME+ - -If you are crazy and have changed the name of the cxxtestgen executable and want -autodetection to work otherwise, set this to the new name. - - -Using Makefiles -~~~~~~~~~~~~~~~ - -Generating the tests with a makefile is pretty straightforward. -Simply add rules to generate, compile and run the test runner. - -[source,{makefile}] ------ -all: lib run_tests app - -# Rules to build your targets -lib: ... - -app: ... - -# A rule that runs the unit tests -run_tests: runner - ./runner - -# How to build the test runner -runner: runner.cpp lib - $(CXX) -o $@ $< - -# How to generate the test runner -runner.cpp: SimpleTest.h ComplicatedTest.h - cxxtestgen -o $@ --error-printer $^ ------ - - -Using Cons -~~~~~~~~~~ - -http://dsmit.com/cons/[Cons] is a powerful and -versatile make replacement which uses Perl scripts instead of Makefiles. - -See `cxxtest/sample/Construct` in the CxxTest distribution for an -example of building CxxTest test runners with Cons. - - -Using Microsoft Visual Studio -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -See `cxxtest/sample/msvc` in the distribution -to see a reasonable integration of CxxTest with Microsoft Visual Studio's IDE. -Basically, the workspace has three -projects: - -* The project `CxxTest_3_Generate` runs `cxxtestgen`. -* The project `CxxTest_2_Build` compiles the generated file. -* The project `CxxTest_1_Run` runs the tests. - -This method certainly works, and the test results are conveniently -displayed as compilation errors and warnings (for <<ts_warn,TS_WARN>>. -However, there are still a few things missing; to integrate this -approach with your own project, you usually need to work a little -bit and tweak some makefiles and project options. The script -`sample/msvc/FixFiles.bat` can automate some of this process. - - -Using Microsoft Windows DDK -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -To use CxxTest with the `build` utility for device drivers, you add -the generated tests file as an extra dependency using the -`NTBUILDTARGET0` macro and the `Makefile.inc` file. An example of -how to do this is in the CxxTest distribution under `sample/winddk`. - - -[appendix] -[[appendix_C]] -Testing CxxTest ---------------- - -In the +cxxtest/test+ directory, you can execute -[source,bash] ----- -python test_cxxtest.py ----- -to launch all tests. By default, this script executes test suites -for a variety of compilers if they are found on the user's path: -`g++`, `clang++`, +cl+ (the Microsoft Visual Studio compiler). -Additionally, this test script includes separate test suites for -the default test discovery mechanism as well as test discovery using -the new FOG parser. - -You can execute a specific test suite by giving its name as an -argument to this test script. For example, the command -[source,bash] ----- -python test_cxxtest.py TestGpp ----- -executes the +TestGpp+ test suite, which tests CxxTest with the -`g++` compiler. Similarly, the command -[source,bash] ----- -python test_cxxtest.py TestGppFOG ----- -executes the test suite that tests CxxTest using the `g++` compiler -and the FOG parser. - -The +test_cxxtest.py+ script should work with versions Python 2.7 -or newer. If you are running Python 2.6, you will need to install -the +unittest2+ package. If you have -http://pypi.python.org/pypi/setuptools[setuptools] or -http://pypi.python.org/pypi/distribute[distribute] -installed, then -you can install this package from PyPI by executing -[source,bash] ----- -easy_install unittest2 ----- -Similarly, the tests for this document rely on the `PyUtilib` Python package. - -The FOG parser requires two Python packages: - - - +ply+ - - +ordereddict+ (This is only needed when running Python 2.6) - -If these packages are not available, then +test_cxxtest.py+ will skip the FOG tests. - - -[appendix] -[[appendix_D]] -include::../Versions[] - -// vim: ft=asciidoc diff --git a/noarch/lib/py/cxxtest/doc/images/icons/README b/noarch/lib/py/cxxtest/doc/images/icons/README deleted file mode 100644 index f12b2a73..00000000 --- a/noarch/lib/py/cxxtest/doc/images/icons/README +++ /dev/null @@ -1,5 +0,0 @@ -Replaced the plain DocBook XSL admonition icons with Jimmac's DocBook -icons (http://jimmac.musichall.cz/ikony.php3). I dropped transparency -from the Jimmac icons to get round MS IE and FOP PNG incompatibilies. - -Stuart Rackham diff --git a/noarch/lib/py/cxxtest/doc/images/icons/callouts/1.png b/noarch/lib/py/cxxtest/doc/images/icons/callouts/1.png deleted file mode 100644 index 7d473430b7bec514f7de12f5769fe7c5859e8c5d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 329 zcmeAS@N?(olHy`uVBq!ia0vp^JRr;gBp8b2n5}^nQ<As43j@QdUS%U7FWJ+@F{I*F zXx~QO0|p!{`<Hx?($n1Ql(x9!rI~U{@0x=gQ&>C}X^4DKU-G|w_t}fLBA)Suv#nrW z!^h2QnY_`l!B<x?#cqSRfyQ~Q1@<4<=dkIYNUpteZJn&Cq*Q53=dm6u@dFh)Vs8$H zYyn#5T;dv05}cn_Ql40p%HW`(tm&DXn4apJn4X!Otze>Oq-UXEX{m2up>JTQkX)2m zTvF+fTUlI^nXH#utd~++ke^qgmz<wFahKu_pmADY<1*9p5=%;f=9yX~8kifU8kifT zBpMl|nHd_JCMTsBr<xd=n3|ZSS!QG@z6I*y1L+C?TFYQ)RAFeOZJ=$?lDoSWD8u0C L>gTe~DWM4ffP81J diff --git a/noarch/lib/py/cxxtest/doc/images/icons/callouts/10.png b/noarch/lib/py/cxxtest/doc/images/icons/callouts/10.png deleted file mode 100644 index 997bbc8246a316e040e0804174ba260e219d7d33..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 361 zcmeAS@N?(olHy`uVBq!ia0vp^JRr;gBp8b2n5}^nQ<As43j@QdUS%U7ui4YZF{I*_ zYTrUp7DWMP<%u3TLY;HO{NlKy4{a+D>WtZ~+OvdJMW|Y+^UT?O-M{rKJsmzxdayJ{ zDCQA!%%@7Jj$q%-wf8e0_jRx8Dqi$}^?K=?6FriQFLv>>oc^CE+aVHhW<k9IkK}je z)E~Fj9=KEXbDR6NEa}#hinfbWM4tz3wYI;z$T{gWXSN{FInE`n5hcO-X(i=}MX3x9 z8p@iUxrynizKQ9X$=M1fdPaH{3YM1o1{V4Th6>3=nZ+fQ4!M=ZC7H>3sl|FJr3LwU zC3?yExf6FO?f@F61vV}-Juk7O6lk8Yg;}bFaZ-|HQc7A<qOp;Yd77z3Qj&$Gd8$#e sMWU&|d~IH!E<TX10HC!DhDH^JM%o721}(X}Yk@Khp00i_>zopr01?u8M*si- diff --git a/noarch/lib/py/cxxtest/doc/images/icons/callouts/11.png b/noarch/lib/py/cxxtest/doc/images/icons/callouts/11.png deleted file mode 100644 index ce47dac3f52ac49017749a3fea53db57d006993c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 565 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1SD^YpWXnZI14-?iy0V%N<f(LUYdLbP>{XE z)7O>#600DeuDZ?5tOl@<Yeb1-X-P(Y5yQ%LXFPyHJS9LOm(=3qqRfJl%=|nCVNOM5 zpg0#u+&RCXvM4h>ql94%{~0TwC?8m~C^ZqJRG}m@H<iKkJ3l8-h7%+coS#-wo>-L1 z5L@scq?{XUcxG{OP9jig5ySQaTl#^*93bKF#G<^+ymW>G($Cs~V(bw8rA5i93}62@ zzlJGu&d<$F%`0K}c4pdspcorSSx9C{PAbEScbC)|7#JBmT^vIy=9KoYUDZ+`aP)jU z&ny=ErrK^#Gw!AcR}pdfMERuV^@&0$@(#^6b8c@rn<LW0_3F-o*HeFg>^6RWX3pUb z4*6@PZ+H0#u=rjsXzS?6n6*sBGbHqGTU%mCsH?n#%j;eD^2}qe=iX*J@VQ3BRpz+u z{PX#N(^9X${`$90+;!pWs>o@z_n8G)7Uo7PJz`jrS+)QE@=PWHmc~UIw=WmUe73o7 z>^bR(M752aYoNg~ozu7U7&{(U>{s!;bn#<MSv2DVhKhOZ^&e{Mx0l7LpZ=8J`g+&t zO>f?ItjL^o`e{*EOQHqO;ccnz9hLK5@2cAyw@AaPFL~Cp#02|E|4xeQteNtB7waMs QVCXP-y85}Sb4q9e0GRUFb^rhX diff --git a/noarch/lib/py/cxxtest/doc/images/icons/callouts/12.png b/noarch/lib/py/cxxtest/doc/images/icons/callouts/12.png deleted file mode 100644 index 31daf4e2f25b6712499ee32de9c2e3b050b691ca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 617 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1SD^YpWXnZI14-?iy0V%N<f(LUYdLbP>{XE z)7O>#600De9$%>2LVd81Yeb1-X-P(Y5yQ%LXFPyHJS9LOm(=3qqRfJl%=|nCVNOM5 zpg0#u+&RCXvM4h>ql94%{~0TwC?8m~C^ZqJRG}m@H<iKkJ3l8-h7%+coS#-wo>-L1 z5L@scq?{XUcxG{OP9jig5ySQaTl#^*93bKF#G<^+ymW>G($Cs~V(bw8rA5i93}62@ zzlJGu&d<$F%`0K}c4pdspcorSSx9C{PAbEScbC)|7#JBmT^vIy=Cn>wTzx1(qV@bS z0hYvspf(--lM>otrqbK$7p{3DzJ|+KN8%5ows)AI?zWk_n>jwEHXrTJecpEW_0xL= z?}N`*R`T~d2{AN${y8T#GEn4hUb&52^}Op@TW4{oc)A6)%<pkqeEjjnB?>$5=G}h# z?O{QLj@aRcAIf&y&OiUN=H2gq=_}V|pWfuReDV|{jwXw~>#w)I|9$<nsKdPHDvB)( z4|cuF+s@s@;IRC%rCfjJET#y(=_;n0sl^w4E|%8rzn?wpS*2XV_1CNpvOH{i<KFKz z?@~Hm*dpLL$wZz(LnVB5s6^Z4mtX4kOSdITur;h&r8nJs-t$$fno=UCZNB+ty84GW zS77L9fWo4wZhySU(d|r=f=-=HGoI<=b9qayHIK6*%l?3S$NoF~-Ol)cIh$j3X@|eb QE}$L;Pgg&ebxsLQ05&S^(*OVf diff --git a/noarch/lib/py/cxxtest/doc/images/icons/callouts/13.png b/noarch/lib/py/cxxtest/doc/images/icons/callouts/13.png deleted file mode 100644 index 14021a89c2ed3d4881afea6e3a315bce4f95efce..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 623 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1SD^YpWXnZI14-?iy0V%N<f(LUYdLbP>{XE z)7O>#600Dep5bGK9wD%hYeb1-X-P(Y5yQ%LXFPyHJS9LOm(=3qqRfJl%=|nCVNOM5 zpg0#u+&RCXvM4h>ql94%{~0TwC?8m~C^ZqJRG}m@H<iKkJ3l8-h7%+coS#-wo>-L1 z5L@scq?{XUcxG{OP9jig5ySQaTl#^*93bKF#G<^+ymW>G($Cs~V(bw8rA5i93}62@ zzlJGu&d<$F%`0K}c4pdspcorSSx9C{PAbEScbC)|7#JBmT^vIy=Cn>w>~AWNX^a2R zbkveVY|45D7UnZ&JtjPwvdCCs<Alzfp7)2{9w~d2s4=-7`}gvFiIm9q-3RX8iQQ5C zN%-D#(GCs<!PLlU%Q8blyB3{EGrqlz)zN`l(A0Nx-1?7`uV!5};T04V?9k{^ik!yZ z-u&2N^2rv%V-mCdmM2PVn{>cZp0EA*<G{cvN0Sm~sXdPgy&AXvdF8#AC6iP<&wTz< zwtMHg=xM4A3LI?B2lKYCe*LR%|NHON438dvWSH>0()#GOw<?~~PA`4Ei(%e*^#=aK z23B*=z5be|dc5%1W5eV%8eD-QrLq54-Ok(2@a*%?43k%7yXQUsx$pk_@8+}5?tYiS zylOcxbo4-BQDc`q>)UH4-^&)y^E*4%UC)*|J}q_Ss;tN`nd8$>x9$_Xb^O2EpX&@C ZI46EzbLxq-voTO7gQu&X%Q~loCIF_C`w;*D diff --git a/noarch/lib/py/cxxtest/doc/images/icons/callouts/14.png b/noarch/lib/py/cxxtest/doc/images/icons/callouts/14.png deleted file mode 100644 index 64014b75fe2e84d45ed861974c72462727979360..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 411 zcmV;M0c8G(P)<h;3K|Lk000e1NJLTq000aC000aK0ssI2*%!;O00006VoOIv0RI60 z0RN!9r;`8x010qNS#tmY5_13m5_18JBDn_u000McNliru(ghI@10bk)oHzgg0VqjC zK~#90eULq>!ax*-PXaQ9e~6^e1gu=a6a&KSz}bR`+prYG9ayB$BDjWGfIE;t#wl!+ zR3S(jA%y#i_@eOOedXoc%RQe%L;wH~k+s%ZI~)!<=dD%?4MaplaU9QPGski2q3`>r z(}{j@0a$CLl+)={2vLWml*i-oa5#J}DW$gCZB<pv<q`nr{PlXR*Xw@2pXWIdxkXWE zt%D#i#sFxy+ffu1MFHUXd}^%$xR1x9EX&1Wk)|nt-EP<EbZ)ns5Te`d-tTt+?sz=@ zE|TZ@`F!>~Z!(!M#)2St|1_V^0qpmCrBof=Y&NUas@LmfSw=)4B4f;8Fu)(eFsv24 zJzXxBrayquXcR?J<H`9po+Qcjdi6YybIurRc0Qqh_yL28ryr7W9)17-002ovPDHLk FV1h9xuy+6e diff --git a/noarch/lib/py/cxxtest/doc/images/icons/callouts/15.png b/noarch/lib/py/cxxtest/doc/images/icons/callouts/15.png deleted file mode 100644 index 0d65765fcf13dcfd87914744dec8bda115e4adf1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 640 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1SD^YpWXnZI14-?iy0V%N<f(LUYdLbP>{XE z)7O>#600De0j~t#c`vY#Yeb1-X-P(Y5yQ%LXFPyHJS9LOm(=3qqRfJl%=|nCVNOM5 zpg0#u+&RCXvM4h>ql94%{~0TwC?8m~C^ZqJRG}m@H<iKkJ3l8-h7%+coS#-wo>-L1 z5L@scq?{XUcxG{OP9jig5ySQaTl#^*93bKF#G<^+ymW>G($Cs~V(bw8rA5i93}62@ zzlJGu&d<$F%`0K}c4pdspcorSSx9C{PAbEScbC)|7#JBmT^vIy=9Eq_Jl&Ka(%QdX zh{H8O%#_7)Tc@t$mM`p4(Ne7omR*~(>gd8_8AZH{=3ms$Fmzm^yL@_+(#aQQ5>7QW z>3g2fIsH(ugM)!V$x4Rr_+!J_XU%4xbz0aE;^N{m@42Z|@0S@TQ=WbP`TMV5Ok;<| z^Ihv+@6tQ{sciRF9dD7Nr=KobwJJ68zJK$<1Pd9rz%4O)*;}Jzj&~nTGMecz>B%lV zK|`fmIc8mp-h8iSXiGFW=C(L+XH4DRxZQX87^-dLuD>odo6YLT@Sw)dfBEIG)v2@6 zR)%mL7GRj1x-&v&+2q@A%a&h0`Lw7|#(w_!tgT!PoJ|+re`l<i_x$(1#}?af=bo4{ z(FYhh_MouX8r6IJ@$bL)UVq(p*z)<TWe@vvZu<$;SkCoZp0{1QD=8^lYwFjkzlSx~ r7M+W|e)jq2uT{3X3_m#kF6Te4xNglP0gn|xqZmA0{an^LB{Ts5RmK1q diff --git a/noarch/lib/py/cxxtest/doc/images/icons/callouts/2.png b/noarch/lib/py/cxxtest/doc/images/icons/callouts/2.png deleted file mode 100644 index 5d09341b2f6d2ea2d1d5dad5d980f14b4b05dfd2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 353 zcmeAS@N?(olHy`uVBq!ia0vp^JRr;gBp8b2n5}^nQ<As43j@QdUS%U7uiDeaF{I*_ zY~MoB!v;Jq_9iAeraB^DxMCM?*l<CcgRL#CWz7XaCU0JD*3gsgOR9H$FWqtbTK3!B zJ0Ax>xaY7e*=hH)_rZeB4|imU1$R#1`!P>&$poQl;nzm}mD5ZFopaX|GsS%q*{P~< z;WtmO%lhToBL0i}yfkaOt?EN=nkLNGuU`ywhI5H)L`iUdT1k0gQ7VIjhO(w-Zen_> zZ(@38a<+nro{^q~f~BRtfrY+-p+a&|W^qZSLvCepNoKNMYO!8QX+eHoiC%Jk?!;Y+ zJAlS%fsM;d&r2*R1)67JkeZlkYGj#gX_9E3W@4U_nw*@Ln38B@k(iuhnUeN2e<LqY k7avGh0MJ?nL!$~qBW(k1gO=RgwLlpLPgg&ebxsLQ0Qb~(A^-pY diff --git a/noarch/lib/py/cxxtest/doc/images/icons/callouts/3.png b/noarch/lib/py/cxxtest/doc/images/icons/callouts/3.png deleted file mode 100644 index ef7b70047158970cf4e09f1bab2954d39c2d596b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 350 zcmeAS@N?(olHy`uVBq!ia0vp^JRr;gBp8b2n5}^nQ<As43j@QdUS%U7ufo&CF{I*_ zs^4nS!wx*cCSRl)+v1jPG1#CjBFFQFi+#6SLc)r~1q-#8t4+IinLl*r&Q<lBxJ20s z#Un&6EqGq|j?0_pf#{;GO&1tq3xr=CoL%_g^!y*j*VU%jzPP<#S6O2E&#&(q`sU3H zw%V0+F!xQ+IZ3rF>F0kK0(Y1u|9Rc(19XFPiEBhjaDG}zd16s2gM)^$re|(qda7?? zdS-IAf{C7yo`r&?rM`iMzJZ}aa#3b+Nu@(>WpPPnvR-PjUP@^}eqM=Qa(?c_U5Yz^ z#%Y0#%S_KpEGY$=XJL?(l#*y<Ze*5{l9-%ok(gwWXkeITYMGL1l$w;1#POG}6sU_2 iq$>buErX#^g`ttQfwn<Q?(SNk41=eupUXO@geCwT(|9KU diff --git a/noarch/lib/py/cxxtest/doc/images/icons/callouts/4.png b/noarch/lib/py/cxxtest/doc/images/icons/callouts/4.png deleted file mode 100644 index adb8364eb5d21ecdd4086e16110b62ddcb42aa4a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 345 zcmeAS@N?(olHy`uVBq!ia0vp^JRr;gBp8b2n5}^nQ<As43j@QdUS%VYpr?ytNX0GL zUPYl+0|95{iBls|Qd8FlbRJQf7_<1(>3r>K)tuC)r#2`iJ>Prt42#Ndx#Uc~1)>aw z3jE@Q4|!9Z%lVv}<iEVg^%4quAaPKo`?T5njMAwhb3$fi)!D?aJ+$e`&YIH)e$M>- zc=48cF7H)t`(Ck`^+mtha~Np7bBSw2NpOBzNqJ&XDuaWDvZiNlVtT4?VtQtBwt|VC zk)DNurKP@sg}#BILUK`NaY>~^Ze?*vX0l#tv0h4PL4IC|UUGi!#9fLzfW~Qojmu2W zODrh`nrE42VU(7fm~5G9U~HM3l#*m_WNcxOXkuz<Xl!JXX4<g(M;TBTA4pdK&{_sV bqY6VKZ3AtCmfYR7Kp6&4S3j3^P6<r_d?9q` diff --git a/noarch/lib/py/cxxtest/doc/images/icons/callouts/5.png b/noarch/lib/py/cxxtest/doc/images/icons/callouts/5.png deleted file mode 100644 index 4d7eb460021e845981861d77614539314f553993..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 348 zcmeAS@N?(olHy`uVBq!ia0vp^JRr;gBp8b2n5}^nQ<As43j@QdUS%U7ugufMF{I*_ zXx~D?BL+My{9ICPQc_Z@Sf_vZD#0ez##W~t@077%!Nb3vIq7BJSSC%EKYHG`>EX4g z+-vfUhb0A>b04=Im{6XiQd1v%r%>h0$G8U7E1If8OQ!N~xOYY5h0NDT$p9(iZ?Q&e z18-(+l~J8O`)kc}e&uL$eW&>P-#`~Qm$*ih1m~xflqVLYGB{``YkKA;rl<NQre`K+ zE12jR=~*aPTIw5E=o=U+Bo}2CmsC3BRu-3JChMgZ>!p+y<mZ*>CFkc(+@-h!Xq*<< zxXkpt#FA2=d1<L;mIfwf#>VEBsYynrsitN|Y01eJ$;p;U#>wWX2KP5v&I9V=1L+C? fTFYQ)RAFeOZJ=$?lDoSWD8u0C>gTe~DWM4f^}upZ diff --git a/noarch/lib/py/cxxtest/doc/images/icons/callouts/6.png b/noarch/lib/py/cxxtest/doc/images/icons/callouts/6.png deleted file mode 100644 index 0ba694af6c07d947d219b45a629bd32c60a0f5fe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 355 zcmeAS@N?(olHy`uVBq!ia0vp^JRr;gBp8b2n5}^nQ<As43j@QdUS%U7uh!GWF{I*_ zXs@EsVFMl(aW1i0Y+P)=xEuevCGHE5h=|CVp+1G}7w5vZrlwVA@}B2?>*)Bra@SU# zmiz#bR~{$s<it3Y`rTM7vigH!_v%d1grx^I-22U(a_Fw$ZS^N_t}odCT<7rVX{mBD zKd$UZU+Cwva*5A-8{Yq66Tg1wu-{y4@rrAQbR^Ir&Lyr9CBgY=CFO}lsSFMp%9@_J ziRr1niRqci*$O6lMtT+smX`Vk7WxK;3du#8#U+&vxs}BwnaO&o#d;~F1^Ia;ddc~@ z6L%@@02-$SHZC(gFR`Q)XkLnuX^Od_xmk*td7^=_MPgdAVX~>2si{S(aY|Z}Vd7tb ouUmn-_&~Y>fYve?8dVq?X&Y!8wB+ut1<EjZy85}Sb4q9e0I5@azW@LL diff --git a/noarch/lib/py/cxxtest/doc/images/icons/callouts/7.png b/noarch/lib/py/cxxtest/doc/images/icons/callouts/7.png deleted file mode 100644 index 472e96f8ac36862c5645732f2fff19d06ee11a8e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 344 zcmeAS@N?(olHy`uVBq!ia0vp^JRr;gBp8b2n5}^nQ<As43j@QdUS%U7ugKHIF{I*_ zYTsJMRs)_E|1hOU#Z8;UI@i4Mnd-k!bi&j%2e~{_o=nv4^w{_06Z53Sv);B(UT{5? zH~y6Dg#wr9;+r0~<m{FH;5^$PMEk_4)!Iw=*EMoZ5)E@~%ep&xL34GF|5VE#ImPlm z?kDR#Pgd>u%w%U~xZhnMEEs6JbBSw2NpOBzNqJ&XDuaWDvZiNlVtT4?VtQtBwt|VC zk)DNurKP@sg}#BILUK`NaY>~^Ze?*vX0l#tv0h4PL4IC|UUGi!#9fLzfW~Qojmu2W zODrh`nrCEbVQgk$XkwI@Y+{_8nv`N>YGIaQkz#0QY@Te9lBQ<)awbq0A4pdK&{_sV bqY6VKZ3AtCmfYR7Kp6&4S3j3^P6<r_9#?Y1 diff --git a/noarch/lib/py/cxxtest/doc/images/icons/callouts/8.png b/noarch/lib/py/cxxtest/doc/images/icons/callouts/8.png deleted file mode 100644 index 5e60973c213b37df93666c5a00724f34493974ae..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 357 zcmeAS@N?(olHy`uVBq!ia0vp^JRr;gBp8b2n5}^nQ<As43j@QdUS%U7uin$eF{I*_ zY~MoB!v;L8{9IDgq}bTnq@>u&S`V$cAh@R~F=4@V4jxkzlaQrcFYWK{)(`o5XZnut z=nE4SU2g1ZW%;@@I$>_e3F8a=8WK~|CVXt1DqisQxtIX|`<?0gJCe5^yeVUR&~Vy~ z{dxvlr`UDv_!a+ZGp}~&TFYZk-v41(Jl}GcThd!Tpi`VnTq8<?^V3So6N^$A95j?Q zJ#!P&Q+*TDGn2CwO!SQOEEFs)^$jfa4Ga~Mi!zH#Djjkwi%T+-^-_!VQc4T*^GfuR z^K&QeQrrPFP77>YW_n&?Nh#1gQ}d)$LrYTw(_{nVG)tp2V+#}WG*e^KRLdkoLz7g? qn<m-LKwW$wT>(IA84Qgo42`r6v<+Hvch>@C7(8A5T-G@yGywn*$#_oy diff --git a/noarch/lib/py/cxxtest/doc/images/icons/callouts/9.png b/noarch/lib/py/cxxtest/doc/images/icons/callouts/9.png deleted file mode 100644 index a0676d26cc2ff1de12c4ecdeefb44a0d71bc6bde..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 357 zcmeAS@N?(olHy`uVBq!ia0vp^JRr;gBp8b2n5}^nQ<As43j@QdUS%U7uin$eF{I*_ zXrH23ivbU-yIWYmdRn}l|TM|3{nIuXYhxpPu>NRqa;^5&H%t0&v*|C|wdb9$wI zR@+N9#RIowg@Uqn&z-__Tzhhz!sG|vTxA7?=O|Y?u(d4T{!RM9c7chr6d%1?R=i16 z?@Ic{f32<?<=Wp~dhLI<h(}0&{b%-`0E?uXmwt-_o#I^L8c`CQpH@<ySd_}(prNek znVXoN>YJFJnVhX)qGzOMp<rpLZ(yNsV5pE>lv!L->5yAlT#}irms+fsQd*FoSE84k zpF44v;trs3T43Wc)AJHbN`dAXo0u6Hr<$gkq?lM38ycjV7+5A5Sr{ayr5c%-n;95g pF*H#D>f!_G3IJNmU}#ifXryhRZP1dtyA~+J;OXk;vd$@?2>@J{cB%jX diff --git a/noarch/lib/py/cxxtest/doc/images/icons/caution.png b/noarch/lib/py/cxxtest/doc/images/icons/caution.png deleted file mode 100644 index 9a8c515a109faf9159777ac9e6861c2b8e7df383..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2734 zcmV;f3Q_fmP)<h;3K|Lk000e1NJLTq001xm001xu1^@s6R|5Hm000VgNkl<ZXo2ln zdr%eE9sbVUyY~Si4PclXG*yz?n$*E2n%34wZKrX3RIM=9SN=$-ZLm-UADK)Nl1`QQ zKnVy$0_pgm!H{ZZ)N!imAGPMuWEw>qRJ4X9M6U>%D6f0(?w()&*gbo9@8u#OnM`JS zW_EV>-1GRp-+RwxM1*g0b9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cVT7%kN_7c-N?Hv%S`MY34Xu?teOB|i$>OGYx)=OR!{=8aL8Ut zWub-J9`p{1K*W2m*_ttC0vG*e@^Ly%kfL8aTZtIYeUcc|9~`m1Pa_kM1w^mUF+ufb okQh4{0;0ttGLSY9u)Vea0c2b7c|xT9mjD0&07*qoM6N<$f;>?xtpET3 diff --git a/noarch/lib/py/cxxtest/doc/images/icons/example.png b/noarch/lib/py/cxxtest/doc/images/icons/example.png deleted file mode 100644 index 1199e864f8502a57c3b8def7c2e1d90c5f760a73..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2599 zcmV+?3fT3DP)<h;3K|Lk000e1NJLTq001xm001xu1^@s6R|5Hm000T@Nkl<ZXo2mS zX^d588OMKTyZ79=v(SnOrDCb2M!FbUZ555J)LJDWDkSZPrb}ow7PVhclQOk_F%<-A zwY1>!p-mb;RMJu+ROx1c5(5$li%g&}q%h1d>z%pFnYriP{BV|;p>t;=6`S-)-nl2| zyytoU|7Urh=RIQ?WB4eGeW?Lltb9!1Qp?8#F15I|9!M$8(xpo|a^wh^Oy+-y34kyR znKNe&n>TM})~s1pt$8&Glu9Lp5UgCelCG|<4+mupF&Hp#=ImJtg#xo?&8j)KCV@(& z0)X%Pw6(Q;2q+B(i0Y8RnCRLVurL^{(LjHH|F~*u=0Lezo-~#xpM0`5&KRWD8l^N! zDWsH08T~3H5TQf}i4X!Q1wsfyDUniAC=|wByQT*c0;N)ELIPJ_d1Y!n;>xZu(X|1C zLhG22F;R%<Bvghyq0yit+L1nM`UH{?8W<Qz?->#oj{p)|S4tU!)We`g05yP#StRp@ zbtInB(S_D16Rp_W+dDl1d-m+1E?-BfR6;35Q&SVmmoKNjz8=r>ShsE+h5iC2wyY3> z1q&8%{P=N#N(B=eGm~-n>B^t+nX9kn<t<xyZTog2Y!UI~IwGOdT!@HjdU|@MN1$9T zlk;<FOg1++vvcQ8_U+rpwbx$D-FM&3#*G`%T2m|*S+%N}n{HY_dwV<U)~=<s^)v>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q!%0UF*6onM{UkHXHT! zw#@~_bCm2qwwIT-zrdfKe~wLSo~K%^0+7vS$>nl*o|lsGeIM5y4S7NWnM?-Tw()&G zJw^TNz)qx4eBs7ha2yBMbw@4Y`+iCwF8?+4fAg!~=EYb30Kkc}Eqv~(>jB8;^W^h+ zve_(-<6zr%y3UjcBo;{G^Us?%5>|)k?I^PJ!LQ*sPD&z|%aP0FQt%g6&06y4Lyz&t zzx<A;pIgg|&u+%H?UX=bz{C(2hR}q&kZs$RZQCi(9dEyi2o3YE{yd8pEy4GF>g(%i zYHFgfv61@v`cWhjtBp4ned$iZYP7o@Z9PO?T^+vflgVUK9r60sh0R>rzD{Ont<9bH z+-$C2IL{n7aKLnQbePW0PSe-dXUgTW85$ZgQc9z>HdE27lrnGZ`G>jlo}0}L3+I~t z{(ch#!K8FexQ$*w)@ZHc@AxwDQ0ko#uAVq<#?YG_Uz1%g4#9DCO^LwB#gg}u*qjdV zvGgVq8)HI!QznosHcH7w0I#KYvO1?l;QvWJ^8Y9Pn82l${{opPvZfw590vdZ002ov JPDHLkV1oa#`7Hnd diff --git a/noarch/lib/py/cxxtest/doc/images/icons/home.png b/noarch/lib/py/cxxtest/doc/images/icons/home.png deleted file mode 100644 index 37a5231bacc905886c9351a291e0d5eed68dd60e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1340 zcmV-C1;hG@P)<h;3K|Lk000e1NJLTq000&M000&U1^@s6#I$TX00006VoOIv0RI60 z0RN!9r;`8x010qNS#tmY3k?7O3k?D72f!=<000McNliru(+LR^4+y_SU=9EP1j$K6 zK~#9!g_YZDTtyhbe>3OI*>m>ZTpH8MCNbI~p>5o#SPG&Qk<#jef)uMh2myWbj}ZD7 zh{6HICtr#Pz6cdXyitu?V_PlNrfJekvdJcU$;sK>bIyzp+pD(v!N&~4H^1*P^UVnU zL&|T@DlmhfhcPA%1~4H;FDc!up7NjT-fyq?59og26)=+sN(hw!KzBAV$s#Z-bbO+0 zKK$PI{p5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1yHF}%#QN0xlY6*S|=mh`z_%)0<ATP z)+lL6DMQNcjc|Ki5OHClscUPEnf~P5`$ci>9MHP;2puk~TFsPZ8lgSW+>A$aX+>Yo z#!(W-7XMOZ!D=Jo%v^(|mFCP~eEN7vR(=Lnecw-Rfh(1YIW(1CtC`W$jnGQ3G@{Yg zX6(3jEHa*rEhSQbF$uNxfV1<P`usv`qh4=*(Vv`q{|2<``+juKv!0%wmO$nVFCUC$ z_9cy)kWviiJj(-Ug-Kf{x@yzD;3mr_cgrt-0G5IJoj=Gu`*wPIS^!Qp87($Nsf6W} y1mpx-3KMsv4wj1M^7VqXx(2j>(D!|PC*yC+v?X>F4_x{H0000<MNUMnLSTYjAAXVm diff --git a/noarch/lib/py/cxxtest/doc/images/icons/important.png b/noarch/lib/py/cxxtest/doc/images/icons/important.png deleted file mode 100644 index be685cc4ecc7dc1e102fe1cd1e4ca799e03d5c9e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2980 zcmV;V3tRMwP)<h;3K|Lk000e1NJLTq001xm001xu1^@s6R|5Hm000YXNkl<ZXo1z4 zYiu0V6~})wJ3IScKi9RranhJaW5;$L4oMmpq(mtcLJ%~B6xk7t)Rs!f0@^C5MQV#c zsHz|sH8kV{h{uPvL<mAeQA^agX>1?~3KW7}x7eu@+roC%Uaxm|c6T2Ausf4o+iQDG z)T&oH+Sz&B`~RPF?m73|D;S2s|8o=n*8sk3lde`rM!Er@>pC+nD+mIjC?W^~f*=T2 zYuqnQzyux|9OR=TN4W6bdz^pc4ePl-7$mr11FP@6lcrs}kYyR0&1PIJGQv{lKsN9b z2M*Bvo8K(>jb2f~nzlA>f8-JTem{~VVYAu36p1AfFbu=cG>sDn4)DiE9$EZ%Kpe0I z0(|GW=U98oEjSzw>~{N-tx+%mUDu7!;2<yW*~6vNr*odAfFvLQGWq>82}FQhPe08! z?z<1S+l}3BUy?NnBB1NKF@E6!&)swrQ$s^J&lDgAxXa54wzLqaugC3l5`O=EK7Z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L;_6oq&^j-n_iib5ihut+46NmNy}WUiBXlZXl4Znx)vcQ_n4olcxi zCoY%Ex|U_xI>DUl#3t_vjY&k;bu>-O0ca94uV;dvkANtO)&X}m5mU^2<~!y$z%20d z638Z!`L%$Vq)f2c|L0oWT7zXRGfa0ftzrV5WBIZ4GqQyUWrLmhn|Htrp6p*!GXD!o a>Hh&|72YQi3HMz90000<MNUMnLSTZ0a-R_Z diff --git a/noarch/lib/py/cxxtest/doc/images/icons/next.png b/noarch/lib/py/cxxtest/doc/images/icons/next.png deleted file mode 100644 index 64e126bdda3f2e611199744494367ad0c1a1f9ca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1302 zcmV+x1?l>UP)<h;3K|Lk000e1NJLTq000&M000&U1^@s6#I$TX00006VoOIv0RI60 z0RN!9r;`8x010qNS#tmY3k(1N3k(52KqANh000McNliru(+Ua}2oov4DDVIP1fxkr zK~#9!m6h3#6jc<5zk6$$-l}_coDkXp6k>43u_u#=F)kQX1Ygwnpu`6aE^j<Y{0B^U zHpKWai3y28C18v`Km;QOSrlk8nbCn^A8?rNS$nPOuBv-|m<0xq$Vtvi-8$d--O8`d z5!@#-9}ifd+dy@obqqA1U9=jvR59Pp-g<w3|2=EPeW2@sw?OwGNF%H`0IF6+hu47t zp@MxG{narbyt9G02XHlr?HJbEiFmB>q1L2a))HZDYl)~8a%noj)x2VIVnR(9Tvr9| zF-w;}>(<|#0D^@E<{i+7LF~d#Zt7VT<<&lit`(a0Mgv1O0dpT?rW9~_yj>p1dhw%! zGcVO$v0_NQ`RU_&-vJ<4qIh2Eu0%5V@+*BQxg}%M>=+0k@amcqBLM(Utucw(b7d7T z<oIxvZ;wpt{M76PJDh&Mi~Yv|b(><n1KZiOF_U8RlNOdKD7gxNVih)YM*ui7=+c#z zn1%o}eUC=*gJ!Y&uv$|sg&&|90LsRk+B55g(XjK0)yc@FjD?g?_Z6P6sQHSvltH@9 z#)(RnH=F!2SR-aD{6JF=G|dS~rEW4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py/cxxtest/doc/images/icons/note.png deleted file mode 100644 index 7c1f3e2fa7ef8897bb55ee0e0dda088dc49d6408..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2494 zcmV;v2|@OWP)<h;3K|Lk000e1NJLTq001xm001xu1^@s6R|5Hm000SvNkl<ZXo2mS zS!|qF6~}+)+<U+8oAH_$Ctl)`G-(M*3rP{QO-s{4TP%p!;Rzm4A6Om`2qaL1#0v^i zK|CM<MLdAiBB(({AkhU%f(j{x6cB-=C9%_D8fS5~N!+nLp6?zWzM09=W^rREh#u)^ z{LPH-J^yq5XSsL8%=ljxeYp*|TzLh+%Ps%k07gbeY<PIsdU|@Sr>Dn;hlg!sWaK|u z738H>q0O5&+vt7wuzAz%lqL_6pE$;`=_$TGUSZXTKE{?UTV#Q4eNlNy5f~X6vC;eP zVar?IL^}QqvwNN<9++V9)D&M@mNI(ZJ=}l){r{0jyrc*W4-ebj%iAbbjxqbUooH}4 zuZUNi7mlaxe8H{Yp@$wSHWB%^MdKw!V8@OfbY&U!zwaWH1ECZMSs=**Axr2VTE>nY zJBTp?U=3MN%Nye7^JNh+5usEnkslf-lmqG&b&3m$`XUlKILOS*6L|lE<xNBo5u9^p zeUKyxX_~hFr(Um9tJOGl>eL0JH(vmpIP@3Z^}f3}I(e8SSttw+1qk&H*S&}e3GMAA ze*25>uxL>y9qlEuEJammu}RJZ5CH{IL<&-v!LqCF#LVnM6r2|T?>)7XyLk5<SMZhZ zY~`zKy71)$ZE)WYEGO^1l5cO@$;rw|rVc-bpUu#Y5-|%nCk+7SFjpLCf@p?FC;(uj zX-bUo1<^WF=9L3Qc$K%`el6`cujRA5D@@h{x}+cX`i&fK8|3pNk1{p7i)fMBTuzLT z$4D~;q6vn>G&`*lKvIwdGy#_(nzjI3(5CqS2q6%0s89LCN8ZARpWMe?PmD9V?HS<r z+|bv}rgEK?J%PuwrA$3vqq8F;nvzGw;Q=W;Zl?_sO%M%*N&=#oMA9@R&vQZu=e22G z5h#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ihmSqeL4N)qU&YRH}y<V@^>sGJVnVz0zW@d(3twxNo#p`CGHJ_WD_uk{2YrQse z#LSqPnK|p?*UYHb>#ak)bB-iQNRot7sf73b^6y4fwdLW$YlU&m+vcV=Lw@G-xp$l1 z`?IJaBE%S5qeD}ZB)L2a{V&M>_pg-y4e|<rms?%|@N&z)0Nv}k@MM7xb^rhX07*qo IM6N<$f;qRg9{>OV diff --git a/noarch/lib/py/cxxtest/doc/images/icons/prev.png b/noarch/lib/py/cxxtest/doc/images/icons/prev.png deleted file mode 100644 index 3e8f12fe24c6e042bc7ef4badb15449f71529ace..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1348 zcmV-K1-tr*P)<h;3K|Lk000e1NJLTq000&M000&U1^@s6#I$TX00006VoOIv0RI60 z0RN!9r;`8x010qNS#tmY3k?7O3k?D72f!=<000McNliru(+LR^6CE_~*|-1z1kp)E zK~#9!jg{MrTvZmve|w*^Pt~bgSJK^fsxzr{8=5eai=j$~2?#UHAVa(a#t{((9|i*E zEe`|wEJE-PkUSI!B8)GB!VE-EpCr+7l8Qa)#7rQ!PRDdtcU9N@axQ!M&`D1;iMn9F zee1`!Ss!aDexgc8=MBgt*a9Lc5I_cqT{gB|`*-E3;9<S$C!hy`7eNl7D56Xn06Xd< z@l9Y}+33TPynCursl-1EE*+iU1?m`%c{!6#<+n}b^wfBg-4h*r6LY1J;d;%owz_H? zt--)XgHuMjZ|#>4zN}O#(F4Jyqw_mKoxsZ-I`F8^(@$jCw?lX&Z*cU6RDktP#MR}H zlhq+#oL?sxw7*T*#_N0K!;^R6&X1hFlgZ`&eE8s)di4)Ja|MTlarpRjgN5sT7OwZ1 znM&el#YE0!-%i8S7Q?lgOtgpU@w&`b50(9;YPBkx;KCEH9mmVQ^vrMb>bbJPGnyb0 zKC3o)?sr@H{r)lLrjvYhs?N48hEXJl2-8~)*_2Tim*VkZAZD6#pO(wz(AjW%_MmbS z#~<63OCBm2w1yzGeEq);PnGi&#yzxB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n GLSTYic!t&h diff --git a/noarch/lib/py/cxxtest/doc/images/icons/tip.png b/noarch/lib/py/cxxtest/doc/images/icons/tip.png deleted file mode 100644 index f087c73b7aef4ae1e4e30df11debe4cd25a73b48..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2718 zcmV;P3Ssq$P)<h;3K|Lk000e1NJLTq001xm001xu1^@s6R|5Hm000VQNkl<ZXo2mT zYj9NM8GxU2+q1XqCTs#kViS`{RV+{~HEJsAkRnq@3TcPh=_phAgLq-IF!W#iL4TAo z{-85-I-?U6={N{&?Q|Ngpm8k2r51&PVkF@rf!wqAJ@@`d&bpiIZWi$}&h(pk=j?9w zy!$@qy?o#Iei0nU;hQ|fuiJpD9sdXTy2m#jK>nf>Ig{1EaU9&jkXs-GLC9WnUJF<I zyH^e1IF4i6Hm+Efg=JY;5XW({Mhk*~BuPk;geZ!LqUeaCcvT>u8^E@0$2HhAO}e_e z=<e?3*s){u_VzL|GJ>XQsH#dN5}~1?frSef(%RZeTU#57qGUyqBxe%nia~@cod?_} zZki^2eSPfQxs%<ycT-h&15G#G!kpT91Va^gJt~qU;y4bPu9HY47`%Luo)hmeeC{Nx zSFdK>x^*-*HlnI39*+lEmbp@oToHh6+m2;f7=}SdM+e)sZR4KRk1+qH#Z(0S#FA-Z z@f3+vhKz1tm=-t=q9~$z6ntI}p@1Jn5jp?KDc*SH53FCmo-JFp5C{bD`FyTN%JxRt z0Jd#ArfG8I$PpfY{Be|;W|rK3H-4X&{=rcOMxtbNBQM_b1oGbdydJ7Tem*&Vn6Y!m z*}8QrEiEks0s&N2b-ghoL|J9jHGbc|eJoqHjO&)H;I4b`Bbm{8?^G}6`iIbT15pqV zivft@giOBIbd!ORI5mxnXu9ow)~s2>o;`brMx&(DX-w0^w(S|8?u<#CYy2-BdYGR- z_6)OU*U)?6G6N&g&x|YZl(QwXghzD4LhyuH@z7?TdU_MKZL@0CDgb;wAF?bvr94qG zgdE3lOw;7>;lnIjwv088b`Ytl=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=mLB+fqncc8}U}zQ|)jRFU76UPLjbv<;_}DO#EHn6NA49$Gv0=jo7B5~* zBoblPtXYJ^VYf3^vPW80b2k?v9*;9VKF;>-+v)7=<hJ`Bq-u5@syBew7eG<H$clm} zN;o*!mWgTT=$SNHI)R=}A;}W)v0>hMt&{flcGj+4OE?^+s;Y|0%1SCKD#|jxY=B${ zP18swlf+^%dU|@;wQCn$U0u}FFJMmne0=^21X0AXZG?%~L6YQ&bAoh&{=N^neC9Yy zmo8=H%9YgD*Aohb2#3RjLZK_}PJiz6fpj`eGMOZiNRUV*=<e?3=+UE`K7E@0{(hp- zD28F6C<>uah}zm(nwpwev}h46EiL$bKKy<^!C;VJF!<%454a=ughtnOG)*I&PLocj z$xLo!G)>Ff0=nxfS(fp5Jb1m{>=MD}^L=$EG`S=9jLa~MthgI+7r-4ZfD19@jLe<Y zzx*?@+~G`&Y%9jHtnAhOEEm9?;YCr*UURC{=Q^ppDuAgllh?2GocId^_`1e7{$CCL Y2We&g=&DVkQvd(}07*qoM6N<$g7MQu$p8QV diff --git a/noarch/lib/py/cxxtest/doc/images/icons/up.png b/noarch/lib/py/cxxtest/doc/images/icons/up.png deleted file mode 100644 index 2db1ce62fa575fd990108b15b0de18a64cae19ca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1320 zcmV+@1=sqCP)<h;3K|Lk000e1NJLTq000&M000&U1^@s6#I$TX00006VoOIv0RI60 z0RN!9r;`8x010qNS#tmY3k?7O3k?D72f!=<000McNliru(+LR`4krl$5TpPA1hq*- zK~#9!g_TQe8$}q$e>1zYw%4)aycz=34IrN7Q8_?WBoG2YRoWs12q8e+irO1DxN$-1 zg)8b|5m$tW;J~4XB7`Ub0mW7NptQ6peTXD>;&}bqwRd-hgWI%$wv04~nfc~7|M|X| z?-SghmG;akFk_%6FvbM~m;j>}lx|dh_MYioZ?CukbPMnbm`w<Z2$cmucRQHm0x&Cd zJY6y$&v>4f{4cn)XZ8*dZ)2&~2C{D9rq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d)bg?^9`XZwW1|yK=3K>a&c;y^#}@Qr!+b5G-cE3AfwEx9k2pH# zvrugu8jBC_Ez0t*z>?>A$tt*9E}LyrZf)629`*yvt@_bqvlBaMI~LiDjV&cofH4Wn zD{YSb)zN>PZ?@|7##bZB@qL$|70>gcYgUk5yLL$+dz6=+isitI8nsbMF_Fty8GvSx zggVg`oA6XRSv+vbr;9-Sx)tOqxB#3=GFfPdViC(J3djkx6ejLU-Cih|bMu4NQVnPV ef#-Q^63Rc48$x8f$~3$H0000<MNUMnLSTZ{XL5}I diff --git a/noarch/lib/py/cxxtest/doc/images/icons/warning.png b/noarch/lib/py/cxxtest/doc/images/icons/warning.png deleted file mode 100644 index d41edb9adbf24fb53cb80a10fbfd0932f87cd874..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3214 zcmV;93~}>`P)<h;3K|Lk000e1NJLTq001xm001xu1^@s6R|5Hm000bCNkl<ZXo1z4 zd2rQLmd8K8-`lc5!qP~HArVAbTgQ=Z9U9RF3qi3GFbE^77Gb7{Fk@j;WkOgYLNz)f zGC0JtaT)$l8l3`dr|q)s(T47tVS1n~nidks^2js$OWyW-zvbTf<K@M-CNE6?GpFiQ zQup59z2EP-=bU@)eTtNl|IcE-nU7>d5JJSZ-4p;tQ2<a?6-7}{q750!hzUq3Wp{Ts z+qP}PvMemiinfn*DgbOY8&y?R%$_})yu3W@cDo!A2`Od9Duj?-U0rg^mM!wqrAsm@ zLWm*NvaGb~cDv<MPdz2ioH-*s9*+!%!%_$#GsQGw@RgO7vaPM{F9P1OENPmiY;A3o z>(;H4XU?3FZEbBMB9Srp8#ivqs;a6%@Ub8@O_QNeC{BaH;Gi0YAq~Sw2|iX=u3R}{ z63TGCE2We@Jw3ee!V4Tbb}Y`{bzLVA2+-NtiD4Ln-?&^Z?DqKZQdO0loSZ?w&(F_C z2!X1qgJV1%56?gUJgZl)X71d%j2kx&hr=;sU=K+^N+~@a4}13P;n=Zbae*2Ng=lYY z=i0A+g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KG6!9$wo z^+b0{7ZZJbeSB74&NpYzCiM*`(|`0MRu3eEMDXX%onyz29h8-o4GBIifkYBJckZOB zs)`35cwn$U_PbQi9+^lqRmRHs^XJ*Rbt@}YtQZ#jkOUG*)YR1Q?6c1@fByVoL1h9w zm7G6+p68x>j^)djGiAz@VZjeeAdy5}T^)}<{x}sC6*mQbsQ%NZPjm3#!HnEyL<AB^ z95`@*Wy_Yabm`K+2zW(N_~MH%*uQ^2Wo2a<TYf|Y5=m^|zMYPa4nm>C^LFIoa=8#f zux8B~N=r*e1b##W;5!m6EiGKTc8$KizQH%j|BFO_H=Z(O3X>;K&KNw5kN`wT1cO2P z`ufl`EvXd08BtZ0tgI~Z^Yh8c$w5`sjDPI>U*&+9vOrPmY5)KL07*qoM6N<$f*8*h AfdBvi diff --git a/noarch/lib/py/cxxtest/doc/include_anchors.py b/noarch/lib/py/cxxtest/doc/include_anchors.py deleted file mode 100644 index 8279cadc..00000000 --- a/noarch/lib/py/cxxtest/doc/include_anchors.py +++ /dev/null @@ -1,90 +0,0 @@ -#------------------------------------------------------------------------- -# CxxTest: A lightweight C++ unit testing library. -# Copyright (c) 2008 Sandia Corporation. -# This software is distributed under the LGPL License v3 -# For more information, see the COPYING file in the top CxxTest directory. -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -#------------------------------------------------------------------------- - -import re -import sys -import os.path -import os - - -pat1a = re.compile('include::([a-zA-Z0-9_\.\-/\/]+\/)\.([^\_]+)\_[a-zA-Z0-9]*\.py\[\]') -pat1b = re.compile('include::([a-zA-Z0-9_\.\-/\/]+\/)\.([^\_]+)\_[a-zA-Z0-9]*\.sh\[\]') -pat1c = re.compile('include::([a-zA-Z0-9_\.\-/\/]+\/)\.([^\_]+)\_[a-zA-Z0-9]*\.h\[\]') -pat1d = re.compile('include::([a-zA-Z0-9_\.\-/\/]+\/)\.([^\_]+)\_[a-zA-Z0-9]*\.cpp\[\]') -pat2 = re.compile('([^@]+)@([a-zA-Z0-9]+):') -pat3 = re.compile('([^@]+)@:([a-zA-Z0-9]+)') - -processed = set() - -def process(dir, root, suffix): - #print "PROCESS ",root, suffix - bname = "%s%s" % (dir, root) - global processed - if bname in processed: - return - # - anchors = {} - anchors[''] = open('%s.%s_.%s' % (dir, root, suffix), 'w') - INPUT = open('%s%s.%s' % (dir, root, suffix), 'r') - for line in INPUT: - m2 = pat2.match(line) - m3 = pat3.match(line) - if m2: - anchor = m2.group(2) - anchors[anchor] = open('%s.%s_%s.%s' % (dir, root, anchor, suffix), 'w') - elif m3: - anchor = m3.group(2) - anchors[anchor].close() - del anchors[anchor] - else: - for anchor in anchors: - os.write(anchors[anchor].fileno(), line) - INPUT.close() - for anchor in anchors: - if anchor != '': - print "ERROR: anchor '%s' did not terminate" % anchor - anchors[anchor].close() - # - processed.add(bname) - - -for file in sys.argv[1:]: - print "Processing file '%s' ..." % file - INPUT = open(file, 'r') - for line in INPUT: - suffix = None - m = pat1a.match(line) - if m: - suffix = 'py' - # - if suffix is None: - m = pat1b.match(line) - if m: - suffix = 'sh' - # - if suffix is None: - m = pat1c.match(line) - if m: - suffix = 'h' - # - if suffix is None: - m = pat1d.match(line) - if m: - suffix = 'cpp' - # - if not suffix is None: - #print "HERE", line, suffix - fname = m.group(1)+m.group(2)+'.'+suffix - if not os.path.exists(fname): - print line - print "ERROR: file '%s' does not exist!" % fname - sys.exit(1) - process(m.group(1), m.group(2), suffix) - INPUT.close() - diff --git a/noarch/lib/py/cxxtest/python/README.txt b/noarch/lib/py/cxxtest/python/README.txt deleted file mode 100644 index 1cd84b90..00000000 --- a/noarch/lib/py/cxxtest/python/README.txt +++ /dev/null @@ -1,8 +0,0 @@ -CxxTest Python Package -====================== - -The CxxTest Python package includes utilities that are used by the -CxxTest unit testing framework. Specifically, this Python package -supports C++ parsing and code generation done in the cxxtestgen -script. - diff --git a/noarch/lib/py/cxxtest/python/convert.py b/noarch/lib/py/cxxtest/python/convert.py deleted file mode 100644 index b7265156..00000000 --- a/noarch/lib/py/cxxtest/python/convert.py +++ /dev/null @@ -1,27 +0,0 @@ -#------------------------------------------------------------------------- -# CxxTest: A lightweight C++ unit testing library. -# Copyright (c) 2008 Sandia Corporation. -# This software is distributed under the LGPL License v3 -# For more information, see the COPYING file in the top CxxTest directory. -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -#------------------------------------------------------------------------- -# -# Execute this script to copy the cxxtest/*.py files -# and run 2to3 to convert them to Python 3. -# - -import glob -import subprocess -import os -import shutil - -os.chdir('cxxtest') -for file in glob.glob('*.py'): - shutil.copyfile(file, '../python3/cxxtest/'+file) -# -os.chdir('../python3/cxxtest') -# -for file in glob.glob('*.py'): - subprocess.call('2to3 -w '+file, shell=True) - diff --git a/noarch/lib/py/cxxtest/python/cxxtest/__init__.py b/noarch/lib/py/cxxtest/python/cxxtest/__init__.py deleted file mode 100644 index 669f8bbf..00000000 --- a/noarch/lib/py/cxxtest/python/cxxtest/__init__.py +++ /dev/null @@ -1,33 +0,0 @@ -#------------------------------------------------------------------------- -# CxxTest: A lightweight C++ unit testing library. -# Copyright (c) 2008 Sandia Corporation. -# This software is distributed under the LGPL License v3 -# For more information, see the COPYING file in the top CxxTest directory. -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -#------------------------------------------------------------------------- - -"""cxxtest: A Python package that supports the CxxTest test framework for C/C++. - -.. _CxxTest: http://cxxtest.com/ - -CxxTest is a unit testing framework for C++ that is similar in -spirit to JUnit, CppUnit, and xUnit. CxxTest is easy to use because -it does not require precompiling a CxxTest testing library, it -employs no advanced features of C++ (e.g. RTTI) and it supports a -very flexible form of test discovery. - -The cxxtest Python package includes capabilities for parsing C/C++ source files and generating -CxxTest drivers. -""" - -from cxxtest.__release__ import __version__, __date__ -__date__ -__version__ - -__maintainer__ = "William E. Hart" -__maintainer_email__ = "whart222@gmail.com" -__license__ = "LGPL" -__url__ = "http://cxxtest.com" - -from cxxtest.cxxtestgen import * diff --git a/noarch/lib/py/cxxtest/python/cxxtest/__release__.py b/noarch/lib/py/cxxtest/python/cxxtest/__release__.py deleted file mode 100644 index 1369c60c..00000000 --- a/noarch/lib/py/cxxtest/python/cxxtest/__release__.py +++ /dev/null @@ -1,13 +0,0 @@ -#------------------------------------------------------------------------- -# CxxTest: A lightweight C++ unit testing library. -# Copyright (c) 2008 Sandia Corporation. -# This software is distributed under the LGPL License v3 -# For more information, see the COPYING file in the top CxxTest directory. -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -#------------------------------------------------------------------------- - -""" Release Information for cxxtest """ - -__version__ = '4.4' -__date__ = "2014-06-03" diff --git a/noarch/lib/py/cxxtest/python/cxxtest/cxx_parser.py b/noarch/lib/py/cxxtest/python/cxxtest/cxx_parser.py deleted file mode 100644 index b9761b32..00000000 --- a/noarch/lib/py/cxxtest/python/cxxtest/cxx_parser.py +++ /dev/null @@ -1,2204 +0,0 @@ -#------------------------------------------------------------------------- -# CxxTest: A lightweight C++ unit testing library. -# Copyright (c) 2008 Sandia Corporation. -# This software is distributed under the LGPL License v3 -# For more information, see the COPYING file in the top CxxTest directory. -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -#------------------------------------------------------------------------- - -# vim: fileencoding=utf-8 - -# -# This is a PLY parser for the entire ANSI C++ grammar. This grammar was -# adapted from the FOG grammar developed by E. D. Willink. See -# -# http://www.computing.surrey.ac.uk/research/dsrg/fog/ -# -# for further details. -# -# The goal of this grammar is to extract information about class, function and -# class method declarations, along with their associated scope. Thus, this -# grammar can be used to analyze classes in an inheritance heirarchy, and then -# enumerate the methods in a derived class. -# -# This grammar parses blocks of <>, (), [] and {} in a generic manner. Thus, -# There are several capabilities that this grammar does not support: -# -# 1. Ambiguous template specification. This grammar cannot parse template -# specifications that do not have paired <>'s in their declaration. In -# particular, ambiguous declarations like -# -# foo<A, c<3 >(); -# -# cannot be correctly parsed. -# -# 2. Template class specialization. Although the goal of this grammar is to -# extract class information, specialization of templated classes is -# not supported. When a template class definition is parsed, it's -# declaration is archived without information about the template -# parameters. Class specializations will be stored separately, and -# thus they can be processed after the fact. However, this grammar -# does not attempt to correctly process properties of class inheritence -# when template class specialization is employed. -# - -# -# TODO: document usage of this file -# - -from __future__ import division - -import os -import ply.lex as lex -import ply.yacc as yacc -import re -try: - from collections import OrderedDict -except ImportError: #pragma: no cover - from ordereddict import OrderedDict - -# global data -lexer = None -scope_lineno = 0 -identifier_lineno = {} -_parse_info=None -_parsedata=None -noExceptionLogic = True - - -def ply_init(data): - global _parsedata - _parsedata=data - - -class Scope(object): - - def __init__(self,name,abs_name,scope_t,base_classes,lineno): - self.function=[] - self.name=name - self.scope_t=scope_t - self.sub_scopes=[] - self.base_classes=base_classes - self.abs_name=abs_name - self.lineno=lineno - - def insert(self,scope): - self.sub_scopes.append(scope) - - -class CppInfo(object): - - def __init__(self, filter=None): - self.verbose=0 - if filter is None: - self.filter=re.compile("[Tt][Ee][Ss][Tt]|createSuite|destroySuite") - else: - self.filter=filter - self.scopes=[""] - self.index=OrderedDict() - self.index[""]=Scope("","::","namespace",[],1) - self.function=[] - - def push_scope(self,ns,scope_t,base_classes=[]): - name = self.scopes[-1]+"::"+ns - if self.verbose>=2: - print "-- Starting "+scope_t+" "+name - self.scopes.append(name) - self.index[name] = Scope(ns,name,scope_t,base_classes,scope_lineno-1) - - def pop_scope(self): - scope = self.scopes.pop() - if self.verbose>=2: - print "-- Stopping "+scope - return scope - - def add_function(self, fn): - fn = str(fn) - if self.filter.search(fn): - self.index[self.scopes[-1]].function.append((fn, identifier_lineno.get(fn,lexer.lineno-1))) - tmp = self.scopes[-1]+"::"+fn - if self.verbose==2: - print "-- Function declaration "+fn+" "+tmp - elif self.verbose==1: - print "-- Function declaration "+tmp - - def get_functions(self,name,quiet=False): - if name == "::": - name = "" - scope = self.index[name] - fns=scope.function - for key in scope.base_classes: - cname = self.find_class(key,scope) - if cname is None: - if not quiet: - print "Defined classes: ",list(self.index.keys()) - print "WARNING: Unknown class "+key - else: - fns += self.get_functions(cname,quiet) - return fns - - def find_class(self,name,scope): - if ':' in name: - if name in self.index: - return name - else: - return None - tmp = scope.abs_name.split(':') - name1 = ":".join(tmp[:-1] + [name]) - if name1 in self.index: - return name1 - name2 = "::"+name - if name2 in self.index: - return name2 - return None - - def __repr__(self): - return str(self) - - def is_baseclass(self,cls,base): - '''Returns true if base is a base-class of cls''' - if cls in self.index: - bases = self.index[cls] - elif "::"+cls in self.index: - bases = self.index["::"+cls] - else: - return False - #raise IOError, "Unknown class "+cls - if base in bases.base_classes: - return True - for name in bases.base_classes: - if self.is_baseclass(name,base): - return True - return False - - def __str__(self): - ans="" - keys = list(self.index.keys()) - keys.sort() - for key in keys: - scope = self.index[key] - ans += scope.scope_t+" "+scope.abs_name+"\n" - if scope.scope_t == "class": - ans += " Base Classes: "+str(scope.base_classes)+"\n" - for fn in self.get_functions(scope.abs_name): - ans += " "+fn+"\n" - else: - for fn in scope.function: - ans += " "+fn+"\n" - return ans - - -def flatten(x): - """Flatten nested list""" - try: - strtypes = basestring - except: # for python3 etc - strtypes = (str, bytes) - - result = [] - for el in x: - if hasattr(el, "__iter__") and not isinstance(el, strtypes): - result.extend(flatten(el)) - else: - result.append(el) - return result - -# -# The lexer (and/or a preprocessor) is expected to identify the following -# -# Punctuation: -# -# -literals = "+-*/%^&|~!<>=:()?.\'\"\\@$;," - -# -reserved = { - 'private' : 'PRIVATE', - 'protected' : 'PROTECTED', - 'public' : 'PUBLIC', - - 'bool' : 'BOOL', - 'char' : 'CHAR', - 'double' : 'DOUBLE', - 'float' : 'FLOAT', - 'int' : 'INT', - 'long' : 'LONG', - 'short' : 'SHORT', - 'signed' : 'SIGNED', - 'unsigned' : 'UNSIGNED', - 'void' : 'VOID', - 'wchar_t' : 'WCHAR_T', - - 'class' : 'CLASS', - 'enum' : 'ENUM', - 'namespace' : 'NAMESPACE', - 'struct' : 'STRUCT', - 'typename' : 'TYPENAME', - 'union' : 'UNION', - - 'const' : 'CONST', - 'volatile' : 'VOLATILE', - - 'auto' : 'AUTO', - 'explicit' : 'EXPLICIT', - 'export' : 'EXPORT', - 'extern' : 'EXTERN', - '__extension__' : 'EXTENSION', - 'friend' : 'FRIEND', - 'inline' : 'INLINE', - 'mutable' : 'MUTABLE', - 'register' : 'REGISTER', - 'static' : 'STATIC', - 'template' : 'TEMPLATE', - 'typedef' : 'TYPEDEF', - 'using' : 'USING', - 'virtual' : 'VIRTUAL', - - 'asm' : 'ASM', - 'break' : 'BREAK', - 'case' : 'CASE', - 'catch' : 'CATCH', - 'const_cast' : 'CONST_CAST', - 'continue' : 'CONTINUE', - 'default' : 'DEFAULT', - 'delete' : 'DELETE', - 'do' : 'DO', - 'dynamic_cast' : 'DYNAMIC_CAST', - 'else' : 'ELSE', - 'false' : 'FALSE', - 'for' : 'FOR', - 'goto' : 'GOTO', - 'if' : 'IF', - 'new' : 'NEW', - 'operator' : 'OPERATOR', - 'reinterpret_cast' : 'REINTERPRET_CAST', - 'return' : 'RETURN', - 'sizeof' : 'SIZEOF', - 'static_cast' : 'STATIC_CAST', - 'switch' : 'SWITCH', - 'this' : 'THIS', - 'throw' : 'THROW', - 'true' : 'TRUE', - 'try' : 'TRY', - 'typeid' : 'TYPEID', - 'while' : 'WHILE', - '"C"' : 'CLiteral', - '"C++"' : 'CppLiteral', - - '__attribute__' : 'ATTRIBUTE', - '__cdecl__' : 'CDECL', - '__typeof' : 'uTYPEOF', - 'typeof' : 'TYPEOF', - - 'CXXTEST_STD' : 'CXXTEST_STD' -} - -tokens = [ - "CharacterLiteral", - "FloatingLiteral", - "Identifier", - "IntegerLiteral", - "StringLiteral", - "RBRACE", - "LBRACE", - "RBRACKET", - "LBRACKET", - "ARROW", - "ARROW_STAR", - "DEC", - "EQ", - "GE", - "INC", - "LE", - "LOG_AND", - "LOG_OR", - "NE", - "SHL", - "SHR", - "ASS_ADD", - "ASS_AND", - "ASS_DIV", - "ASS_MOD", - "ASS_MUL", - "ASS_OR", - "ASS_SHL", - "ASS_SHR", - "ASS_SUB", - "ASS_XOR", - "DOT_STAR", - "ELLIPSIS", - "SCOPE", -] + list(reserved.values()) - -t_ignore = " \t\r" - -t_LBRACE = r"(\{)|(<%)" -t_RBRACE = r"(\})|(%>)" -t_LBRACKET = r"(\[)|(<:)" -t_RBRACKET = r"(\])|(:>)" -t_ARROW = r"->" -t_ARROW_STAR = r"->\*" -t_DEC = r"--" -t_EQ = r"==" -t_GE = r">=" -t_INC = r"\+\+" -t_LE = r"<=" -t_LOG_AND = r"&&" -t_LOG_OR = r"\|\|" -t_NE = r"!=" -t_SHL = r"<<" -t_SHR = r">>" -t_ASS_ADD = r"\+=" -t_ASS_AND = r"&=" -t_ASS_DIV = r"/=" -t_ASS_MOD = r"%=" -t_ASS_MUL = r"\*=" -t_ASS_OR = r"\|=" -t_ASS_SHL = r"<<=" -t_ASS_SHR = r">>=" -t_ASS_SUB = r"-=" -t_ASS_XOR = r"^=" -t_DOT_STAR = r"\.\*" -t_ELLIPSIS = r"\.\.\." -t_SCOPE = r"::" - -# Discard comments -def t_COMMENT(t): - r'(/\*(.|\n)*?\*/)|(//.*?\n)|(\#.*?\n)' - t.lexer.lineno += t.value.count("\n") - -t_IntegerLiteral = r'(0x[0-9A-F]+)|([0-9]+(L){0,1})' -t_FloatingLiteral = r"[0-9]+[eE\.\+-]+[eE\.\+\-0-9]+" -t_CharacterLiteral = r'\'([^\'\\]|\\.)*\'' -#t_StringLiteral = r'"([^"\\]|\\.)*"' -def t_StringLiteral(t): - r'"([^"\\]|\\.)*"' - t.type = reserved.get(t.value,'StringLiteral') - return t - -def t_Identifier(t): - r"[a-zA-Z_][a-zA-Z_0-9\.]*" - t.type = reserved.get(t.value,'Identifier') - return t - - -def t_error(t): - print "Illegal character '%s'" % t.value[0] - #raise IOError, "Parse error" - #t.lexer.skip() - -def t_newline(t): - r'[\n]+' - t.lexer.lineno += len(t.value) - -precedence = ( - ( 'right', 'SHIFT_THERE', 'REDUCE_HERE_MOSTLY', 'SCOPE'), - ( 'nonassoc', 'ELSE', 'INC', 'DEC', '+', '-', '*', '&', 'LBRACKET', 'LBRACE', '<', ':', ')') - ) - -start = 'translation_unit' - -# -# The %prec resolves the 14.2-3 ambiguity: -# Identifier '<' is forced to go through the is-it-a-template-name test -# All names absorb TEMPLATE with the name, so that no template_test is -# performed for them. This requires all potential declarations within an -# expression to perpetuate this policy and thereby guarantee the ultimate -# coverage of explicit_instantiation. -# -# The %prec also resolves a conflict in identifier : which is forced to be a -# shift of a label for a labeled-statement rather than a reduction for the -# name of a bit-field or generalised constructor. This is pretty dubious -# syntactically but correct for all semantic possibilities. The shift is -# only activated when the ambiguity exists at the start of a statement. -# In this context a bit-field declaration or constructor definition are not -# allowed. -# - -def p_identifier(p): - '''identifier : Identifier - | CXXTEST_STD '(' Identifier ')' - ''' - if p[1][0] in ('t','T','c','d'): - identifier_lineno[p[1]] = p.lineno(1) - p[0] = p[1] - -def p_id(p): - '''id : identifier %prec SHIFT_THERE - | template_decl - | TEMPLATE id - ''' - p[0] = get_rest(p) - -def p_global_scope(p): - '''global_scope : SCOPE - ''' - p[0] = get_rest(p) - -def p_id_scope(p): - '''id_scope : id SCOPE''' - p[0] = get_rest(p) - -def p_id_scope_seq(p): - '''id_scope_seq : id_scope - | id_scope id_scope_seq - ''' - p[0] = get_rest(p) - -# -# A :: B :: C; is ambiguous How much is type and how much name ? -# The %prec maximises the (type) length which is the 7.1-2 semantic constraint. -# -def p_nested_id(p): - '''nested_id : id %prec SHIFT_THERE - | id_scope nested_id - ''' - p[0] = get_rest(p) - -def p_scoped_id(p): - '''scoped_id : nested_id - | global_scope nested_id - | id_scope_seq - | global_scope id_scope_seq - ''' - global scope_lineno - scope_lineno = lexer.lineno - data = flatten(get_rest(p)) - if data[0] != None: - p[0] = "".join(data) - -# -# destructor_id has to be held back to avoid a conflict with a one's -# complement as per 5.3.1-9, It gets put back only when scoped or in a -# declarator_id, which is only used as an explicit member name. -# Declarations of an unscoped destructor are always parsed as a one's -# complement. -# -def p_destructor_id(p): - '''destructor_id : '~' id - | TEMPLATE destructor_id - ''' - p[0]=get_rest(p) - -#def p_template_id(p): -# '''template_id : empty -# | TEMPLATE -# ''' -# pass - -def p_template_decl(p): - '''template_decl : identifier '<' nonlgt_seq_opt '>' - ''' - # - # WEH: should we include the lt/gt symbols to indicate that this is a - # template class? How is that going to be used later??? - # - #p[0] = [p[1] ,"<",">"] - p[0] = p[1] - -def p_special_function_id(p): - '''special_function_id : conversion_function_id - | operator_function_id - | TEMPLATE special_function_id - ''' - p[0]=get_rest(p) - -def p_nested_special_function_id(p): - '''nested_special_function_id : special_function_id - | id_scope destructor_id - | id_scope nested_special_function_id - ''' - p[0]=get_rest(p) - -def p_scoped_special_function_id(p): - '''scoped_special_function_id : nested_special_function_id - | global_scope nested_special_function_id - ''' - p[0]=get_rest(p) - -# declarator-id is all names in all scopes, except reserved words -def p_declarator_id(p): - '''declarator_id : scoped_id - | scoped_special_function_id - | destructor_id - ''' - p[0]=p[1] - -# -# The standard defines pseudo-destructors in terms of type-name, which is -# class/enum/typedef, of which class-name is covered by a normal destructor. -# pseudo-destructors are supposed to support ~int() in templates, so the -# grammar here covers built-in names. Other names are covered by the lack -# of identifier/type discrimination. -# -def p_built_in_type_id(p): - '''built_in_type_id : built_in_type_specifier - | built_in_type_id built_in_type_specifier - ''' - pass - -def p_pseudo_destructor_id(p): - '''pseudo_destructor_id : built_in_type_id SCOPE '~' built_in_type_id - | '~' built_in_type_id - | TEMPLATE pseudo_destructor_id - ''' - pass - -def p_nested_pseudo_destructor_id(p): - '''nested_pseudo_destructor_id : pseudo_destructor_id - | id_scope nested_pseudo_destructor_id - ''' - pass - -def p_scoped_pseudo_destructor_id(p): - '''scoped_pseudo_destructor_id : nested_pseudo_destructor_id - | global_scope scoped_pseudo_destructor_id - ''' - pass - -#------------------------------------------------------------------------------- -# A.2 Lexical conventions -#------------------------------------------------------------------------------- -# - -def p_literal(p): - '''literal : IntegerLiteral - | CharacterLiteral - | FloatingLiteral - | StringLiteral - | TRUE - | FALSE - ''' - pass - -#------------------------------------------------------------------------------- -# A.3 Basic concepts -#------------------------------------------------------------------------------- -def p_translation_unit(p): - '''translation_unit : declaration_seq_opt - ''' - pass - -#------------------------------------------------------------------------------- -# A.4 Expressions -#------------------------------------------------------------------------------- -# -# primary_expression covers an arbitrary sequence of all names with the -# exception of an unscoped destructor, which is parsed as its unary expression -# which is the correct disambiguation (when ambiguous). This eliminates the -# traditional A(B) meaning A B ambiguity, since we never have to tack an A -# onto the front of something that might start with (. The name length got -# maximised ab initio. The downside is that semantic interpretation must split -# the names up again. -# -# Unification of the declaration and expression syntax means that unary and -# binary pointer declarator operators: -# int * * name -# are parsed as binary and unary arithmetic operators (int) * (*name). Since -# type information is not used -# ambiguities resulting from a cast -# (cast)*(value) -# are resolved to favour the binary rather than the cast unary to ease AST -# clean-up. The cast-call ambiguity must be resolved to the cast to ensure -# that (a)(b)c can be parsed. -# -# The problem of the functional cast ambiguity -# name(arg) -# as call or declaration is avoided by maximising the name within the parsing -# kernel. So primary_id_expression picks up -# extern long int const var = 5; -# as an assignment to the syntax parsed as "extern long int const var". The -# presence of two names is parsed so that "extern long into const" is -# distinguished from "var" considerably simplifying subsequent -# semantic resolution. -# -# The generalised name is a concatenation of potential type-names (scoped -# identifiers or built-in sequences) plus optionally one of the special names -# such as an operator-function-id, conversion-function-id or destructor as the -# final name. -# - -def get_rest(p): - return [p[i] for i in range(1, len(p))] - -def p_primary_expression(p): - '''primary_expression : literal - | THIS - | suffix_decl_specified_ids - | abstract_expression %prec REDUCE_HERE_MOSTLY - ''' - p[0] = get_rest(p) - -# -# Abstract-expression covers the () and [] of abstract-declarators. -# -def p_abstract_expression(p): - '''abstract_expression : parenthesis_clause - | LBRACKET bexpression_opt RBRACKET - | TEMPLATE abstract_expression - ''' - pass - -def p_postfix_expression(p): - '''postfix_expression : primary_expression - | postfix_expression parenthesis_clause - | postfix_expression LBRACKET bexpression_opt RBRACKET - | postfix_expression LBRACKET bexpression_opt RBRACKET attributes - | postfix_expression '.' declarator_id - | postfix_expression '.' scoped_pseudo_destructor_id - | postfix_expression ARROW declarator_id - | postfix_expression ARROW scoped_pseudo_destructor_id - | postfix_expression INC - | postfix_expression DEC - | DYNAMIC_CAST '<' nonlgt_seq_opt '>' '(' expression ')' - | STATIC_CAST '<' nonlgt_seq_opt '>' '(' expression ')' - | REINTERPRET_CAST '<' nonlgt_seq_opt '>' '(' expression ')' - | CONST_CAST '<' nonlgt_seq_opt '>' '(' expression ')' - | TYPEID parameters_clause - ''' - #print "HERE",str(p[1]) - p[0] = get_rest(p) - -def p_bexpression_opt(p): - '''bexpression_opt : empty - | bexpression - ''' - pass - -def p_bexpression(p): - '''bexpression : nonbracket_seq - | nonbracket_seq bexpression_seq bexpression_clause nonbracket_seq_opt - | bexpression_seq bexpression_clause nonbracket_seq_opt - ''' - pass - -def p_bexpression_seq(p): - '''bexpression_seq : empty - | bexpression_seq bexpression_clause nonbracket_seq_opt - ''' - pass - -def p_bexpression_clause(p): - '''bexpression_clause : LBRACKET bexpression_opt RBRACKET - ''' - pass - - - -def p_expression_list_opt(p): - '''expression_list_opt : empty - | expression_list - ''' - pass - -def p_expression_list(p): - '''expression_list : assignment_expression - | expression_list ',' assignment_expression - ''' - pass - -def p_unary_expression(p): - '''unary_expression : postfix_expression - | INC cast_expression - | DEC cast_expression - | ptr_operator cast_expression - | suffix_decl_specified_scope star_ptr_operator cast_expression - | '+' cast_expression - | '-' cast_expression - | '!' cast_expression - | '~' cast_expression - | SIZEOF unary_expression - | new_expression - | global_scope new_expression - | delete_expression - | global_scope delete_expression - ''' - p[0] = get_rest(p) - -def p_delete_expression(p): - '''delete_expression : DELETE cast_expression - ''' - pass - -def p_new_expression(p): - '''new_expression : NEW new_type_id new_initializer_opt - | NEW parameters_clause new_type_id new_initializer_opt - | NEW parameters_clause - | NEW parameters_clause parameters_clause new_initializer_opt - ''' - pass - -def p_new_type_id(p): - '''new_type_id : type_specifier ptr_operator_seq_opt - | type_specifier new_declarator - | type_specifier new_type_id - ''' - pass - -def p_new_declarator(p): - '''new_declarator : ptr_operator new_declarator - | direct_new_declarator - ''' - pass - -def p_direct_new_declarator(p): - '''direct_new_declarator : LBRACKET bexpression_opt RBRACKET - | direct_new_declarator LBRACKET bexpression RBRACKET - ''' - pass - -def p_new_initializer_opt(p): - '''new_initializer_opt : empty - | '(' expression_list_opt ')' - ''' - pass - -# -# cast-expression is generalised to support a [] as well as a () prefix. This covers the omission of -# DELETE[] which when followed by a parenthesised expression was ambiguous. It also covers the gcc -# indexed array initialisation for free. -# -def p_cast_expression(p): - '''cast_expression : unary_expression - | abstract_expression cast_expression - ''' - p[0] = get_rest(p) - -def p_pm_expression(p): - '''pm_expression : cast_expression - | pm_expression DOT_STAR cast_expression - | pm_expression ARROW_STAR cast_expression - ''' - p[0] = get_rest(p) - -def p_multiplicative_expression(p): - '''multiplicative_expression : pm_expression - | multiplicative_expression star_ptr_operator pm_expression - | multiplicative_expression '/' pm_expression - | multiplicative_expression '%' pm_expression - ''' - p[0] = get_rest(p) - -def p_additive_expression(p): - '''additive_expression : multiplicative_expression - | additive_expression '+' multiplicative_expression - | additive_expression '-' multiplicative_expression - ''' - p[0] = get_rest(p) - -def p_shift_expression(p): - '''shift_expression : additive_expression - | shift_expression SHL additive_expression - | shift_expression SHR additive_expression - ''' - p[0] = get_rest(p) - -# | relational_expression '<' shift_expression -# | relational_expression '>' shift_expression -# | relational_expression LE shift_expression -# | relational_expression GE shift_expression -def p_relational_expression(p): - '''relational_expression : shift_expression - ''' - p[0] = get_rest(p) - -def p_equality_expression(p): - '''equality_expression : relational_expression - | equality_expression EQ relational_expression - | equality_expression NE relational_expression - ''' - p[0] = get_rest(p) - -def p_and_expression(p): - '''and_expression : equality_expression - | and_expression '&' equality_expression - ''' - p[0] = get_rest(p) - -def p_exclusive_or_expression(p): - '''exclusive_or_expression : and_expression - | exclusive_or_expression '^' and_expression - ''' - p[0] = get_rest(p) - -def p_inclusive_or_expression(p): - '''inclusive_or_expression : exclusive_or_expression - | inclusive_or_expression '|' exclusive_or_expression - ''' - p[0] = get_rest(p) - -def p_logical_and_expression(p): - '''logical_and_expression : inclusive_or_expression - | logical_and_expression LOG_AND inclusive_or_expression - ''' - p[0] = get_rest(p) - -def p_logical_or_expression(p): - '''logical_or_expression : logical_and_expression - | logical_or_expression LOG_OR logical_and_expression - ''' - p[0] = get_rest(p) - -def p_conditional_expression(p): - '''conditional_expression : logical_or_expression - | logical_or_expression '?' expression ':' assignment_expression - ''' - p[0] = get_rest(p) - - -# -# assignment-expression is generalised to cover the simple assignment of a braced initializer in order to -# contribute to the coverage of parameter-declaration and init-declaration. -# -# | logical_or_expression assignment_operator assignment_expression -def p_assignment_expression(p): - '''assignment_expression : conditional_expression - | logical_or_expression assignment_operator nonsemicolon_seq - | logical_or_expression '=' braced_initializer - | throw_expression - ''' - p[0]=get_rest(p) - -def p_assignment_operator(p): - '''assignment_operator : '=' - | ASS_ADD - | ASS_AND - | ASS_DIV - | ASS_MOD - | ASS_MUL - | ASS_OR - | ASS_SHL - | ASS_SHR - | ASS_SUB - | ASS_XOR - ''' - pass - -# -# expression is widely used and usually single-element, so the reductions are arranged so that a -# single-element expression is returned as is. Multi-element expressions are parsed as a list that -# may then behave polymorphically as an element or be compacted to an element. -# - -def p_expression(p): - '''expression : assignment_expression - | expression_list ',' assignment_expression - ''' - p[0] = get_rest(p) - -def p_constant_expression(p): - '''constant_expression : conditional_expression - ''' - pass - -#--------------------------------------------------------------------------------------------------- -# A.5 Statements -#--------------------------------------------------------------------------------------------------- -# Parsing statements is easy once simple_declaration has been generalised to cover expression_statement. -# -# -# The use of extern here is a hack. The 'extern "C" {}' block gets parsed -# as a function, so when nested 'extern "C"' declarations exist, they don't -# work because the block is viewed as a list of statements... :( -# -def p_statement(p): - '''statement : compound_statement - | declaration_statement - | try_block - | labeled_statement - | selection_statement - | iteration_statement - | jump_statement - ''' - pass - -def p_compound_statement(p): - '''compound_statement : LBRACE statement_seq_opt RBRACE - ''' - pass - -def p_statement_seq_opt(p): - '''statement_seq_opt : empty - | statement_seq_opt statement - ''' - pass - -# -# The dangling else conflict is resolved to the innermost if. -# -def p_selection_statement(p): - '''selection_statement : IF '(' condition ')' statement %prec SHIFT_THERE - | IF '(' condition ')' statement ELSE statement - | SWITCH '(' condition ')' statement - ''' - pass - -def p_condition_opt(p): - '''condition_opt : empty - | condition - ''' - pass - -def p_condition(p): - '''condition : nonparen_seq - | nonparen_seq condition_seq parameters_clause nonparen_seq_opt - | condition_seq parameters_clause nonparen_seq_opt - ''' - pass - -def p_condition_seq(p): - '''condition_seq : empty - | condition_seq parameters_clause nonparen_seq_opt - ''' - pass - -def p_labeled_statement(p): - '''labeled_statement : identifier ':' statement - | CASE constant_expression ':' statement - | DEFAULT ':' statement - ''' - pass - -def p_try_block(p): - '''try_block : TRY compound_statement handler_seq - ''' - global noExceptionLogic - noExceptionLogic=False - -def p_jump_statement(p): - '''jump_statement : BREAK ';' - | CONTINUE ';' - | RETURN nonsemicolon_seq ';' - | GOTO identifier ';' - ''' - pass - -def p_iteration_statement(p): - '''iteration_statement : WHILE '(' condition ')' statement - | DO statement WHILE '(' expression ')' ';' - | FOR '(' nonparen_seq_opt ')' statement - ''' - pass - -def p_declaration_statement(p): - '''declaration_statement : block_declaration - ''' - pass - -#--------------------------------------------------------------------------------------------------- -# A.6 Declarations -#--------------------------------------------------------------------------------------------------- -def p_compound_declaration(p): - '''compound_declaration : LBRACE declaration_seq_opt RBRACE - ''' - pass - -def p_declaration_seq_opt(p): - '''declaration_seq_opt : empty - | declaration_seq_opt declaration - ''' - pass - -def p_declaration(p): - '''declaration : block_declaration - | function_definition - | template_declaration - | explicit_specialization - | specialised_declaration - ''' - pass - -def p_specialised_declaration(p): - '''specialised_declaration : linkage_specification - | namespace_definition - | TEMPLATE specialised_declaration - ''' - pass - -def p_block_declaration(p): - '''block_declaration : simple_declaration - | specialised_block_declaration - ''' - pass - -def p_specialised_block_declaration(p): - '''specialised_block_declaration : asm_definition - | namespace_alias_definition - | using_declaration - | using_directive - | TEMPLATE specialised_block_declaration - ''' - pass - -def p_simple_declaration(p): - '''simple_declaration : ';' - | init_declaration ';' - | init_declarations ';' - | decl_specifier_prefix simple_declaration - ''' - global _parse_info - if len(p) == 3: - if p[2] == ";": - decl = p[1] - else: - decl = p[2] - if decl is not None: - fp = flatten(decl) - if len(fp) >= 2 and fp[0] is not None and fp[0]!="operator" and fp[1] == '(': - p[0] = fp[0] - _parse_info.add_function(fp[0]) - -# -# A decl-specifier following a ptr_operator provokes a shift-reduce conflict for * const name which is resolved in favour of the pointer, and implemented by providing versions of decl-specifier guaranteed not to start with a cv_qualifier. decl-specifiers are implemented type-centrically. That is the semantic constraint that there must be a type is exploited to impose structure, but actually eliminate very little syntax. built-in types are multi-name and so need a different policy. -# -# non-type decl-specifiers are bound to the left-most type in a decl-specifier-seq, by parsing from the right and attaching suffixes to the right-hand type. Finally residual prefixes attach to the left. -# -def p_suffix_built_in_decl_specifier_raw(p): - '''suffix_built_in_decl_specifier_raw : built_in_type_specifier - | suffix_built_in_decl_specifier_raw built_in_type_specifier - | suffix_built_in_decl_specifier_raw decl_specifier_suffix - ''' - pass - -def p_suffix_built_in_decl_specifier(p): - '''suffix_built_in_decl_specifier : suffix_built_in_decl_specifier_raw - | TEMPLATE suffix_built_in_decl_specifier - ''' - pass - -# | id_scope_seq -# | SCOPE id_scope_seq -def p_suffix_named_decl_specifier(p): - '''suffix_named_decl_specifier : scoped_id - | elaborate_type_specifier - | suffix_named_decl_specifier decl_specifier_suffix - ''' - p[0]=get_rest(p) - -def p_suffix_named_decl_specifier_bi(p): - '''suffix_named_decl_specifier_bi : suffix_named_decl_specifier - | suffix_named_decl_specifier suffix_built_in_decl_specifier_raw - ''' - p[0] = get_rest(p) - #print "HERE",get_rest(p) - -def p_suffix_named_decl_specifiers(p): - '''suffix_named_decl_specifiers : suffix_named_decl_specifier_bi - | suffix_named_decl_specifiers suffix_named_decl_specifier_bi - ''' - p[0] = get_rest(p) - -def p_suffix_named_decl_specifiers_sf(p): - '''suffix_named_decl_specifiers_sf : scoped_special_function_id - | suffix_named_decl_specifiers - | suffix_named_decl_specifiers scoped_special_function_id - ''' - #print "HERE",get_rest(p) - p[0] = get_rest(p) - -def p_suffix_decl_specified_ids(p): - '''suffix_decl_specified_ids : suffix_built_in_decl_specifier - | suffix_built_in_decl_specifier suffix_named_decl_specifiers_sf - | suffix_named_decl_specifiers_sf - ''' - if len(p) == 3: - p[0] = p[2] - else: - p[0] = p[1] - -def p_suffix_decl_specified_scope(p): - '''suffix_decl_specified_scope : suffix_named_decl_specifiers SCOPE - | suffix_built_in_decl_specifier suffix_named_decl_specifiers SCOPE - | suffix_built_in_decl_specifier SCOPE - ''' - p[0] = get_rest(p) - -def p_decl_specifier_affix(p): - '''decl_specifier_affix : storage_class_specifier - | function_specifier - | FRIEND - | TYPEDEF - | cv_qualifier - ''' - pass - -def p_decl_specifier_suffix(p): - '''decl_specifier_suffix : decl_specifier_affix - ''' - pass - -def p_decl_specifier_prefix(p): - '''decl_specifier_prefix : decl_specifier_affix - | TEMPLATE decl_specifier_prefix - ''' - pass - -def p_storage_class_specifier(p): - '''storage_class_specifier : REGISTER - | STATIC - | MUTABLE - | EXTERN %prec SHIFT_THERE - | EXTENSION - | AUTO - ''' - pass - -def p_function_specifier(p): - '''function_specifier : EXPLICIT - | INLINE - | VIRTUAL - ''' - pass - -def p_type_specifier(p): - '''type_specifier : simple_type_specifier - | elaborate_type_specifier - | cv_qualifier - ''' - pass - -def p_elaborate_type_specifier(p): - '''elaborate_type_specifier : class_specifier - | enum_specifier - | elaborated_type_specifier - | TEMPLATE elaborate_type_specifier - ''' - pass - -def p_simple_type_specifier(p): - '''simple_type_specifier : scoped_id - | scoped_id attributes - | built_in_type_specifier - ''' - p[0] = p[1] - -def p_built_in_type_specifier(p): - '''built_in_type_specifier : Xbuilt_in_type_specifier - | Xbuilt_in_type_specifier attributes - ''' - pass - -def p_attributes(p): - '''attributes : attribute - | attributes attribute - ''' - pass - -def p_attribute(p): - '''attribute : ATTRIBUTE '(' parameters_clause ')' - ''' - -def p_Xbuilt_in_type_specifier(p): - '''Xbuilt_in_type_specifier : CHAR - | WCHAR_T - | BOOL - | SHORT - | INT - | LONG - | SIGNED - | UNSIGNED - | FLOAT - | DOUBLE - | VOID - | uTYPEOF parameters_clause - | TYPEOF parameters_clause - ''' - pass - -# -# The over-general use of declaration_expression to cover decl-specifier-seq_opt declarator in a function-definition means that -# class X { }; -# could be a function-definition or a class-specifier. -# enum X { }; -# could be a function-definition or an enum-specifier. -# The function-definition is not syntactically valid so resolving the false conflict in favour of the -# elaborated_type_specifier is correct. -# -def p_elaborated_type_specifier(p): - '''elaborated_type_specifier : class_key scoped_id %prec SHIFT_THERE - | elaborated_enum_specifier - | TYPENAME scoped_id - ''' - pass - -def p_elaborated_enum_specifier(p): - '''elaborated_enum_specifier : ENUM scoped_id %prec SHIFT_THERE - ''' - pass - -def p_enum_specifier(p): - '''enum_specifier : ENUM scoped_id enumerator_clause - | ENUM enumerator_clause - ''' - pass - -def p_enumerator_clause(p): - '''enumerator_clause : LBRACE enumerator_list_ecarb - | LBRACE enumerator_list enumerator_list_ecarb - | LBRACE enumerator_list ',' enumerator_definition_ecarb - ''' - pass - -def p_enumerator_list_ecarb(p): - '''enumerator_list_ecarb : RBRACE - ''' - pass - -def p_enumerator_definition_ecarb(p): - '''enumerator_definition_ecarb : RBRACE - ''' - pass - -def p_enumerator_definition_filler(p): - '''enumerator_definition_filler : empty - ''' - pass - -def p_enumerator_list_head(p): - '''enumerator_list_head : enumerator_definition_filler - | enumerator_list ',' enumerator_definition_filler - ''' - pass - -def p_enumerator_list(p): - '''enumerator_list : enumerator_list_head enumerator_definition - ''' - pass - -def p_enumerator_definition(p): - '''enumerator_definition : enumerator - | enumerator '=' constant_expression - ''' - pass - -def p_enumerator(p): - '''enumerator : identifier - ''' - pass - -def p_namespace_definition(p): - '''namespace_definition : NAMESPACE scoped_id push_scope compound_declaration - | NAMESPACE push_scope compound_declaration - ''' - global _parse_info - scope = _parse_info.pop_scope() - -def p_namespace_alias_definition(p): - '''namespace_alias_definition : NAMESPACE scoped_id '=' scoped_id ';' - ''' - pass - -def p_push_scope(p): - '''push_scope : empty''' - global _parse_info - if p[-2] == "namespace": - scope=p[-1] - else: - scope="" - _parse_info.push_scope(scope,"namespace") - -def p_using_declaration(p): - '''using_declaration : USING declarator_id ';' - | USING TYPENAME declarator_id ';' - ''' - pass - -def p_using_directive(p): - '''using_directive : USING NAMESPACE scoped_id ';' - ''' - pass - -# '''asm_definition : ASM '(' StringLiteral ')' ';' -def p_asm_definition(p): - '''asm_definition : ASM '(' nonparen_seq_opt ')' ';' - ''' - pass - -def p_linkage_specification(p): - '''linkage_specification : EXTERN CLiteral declaration - | EXTERN CLiteral compound_declaration - | EXTERN CppLiteral declaration - | EXTERN CppLiteral compound_declaration - ''' - pass - -#--------------------------------------------------------------------------------------------------- -# A.7 Declarators -#--------------------------------------------------------------------------------------------------- -# -# init-declarator is named init_declaration to reflect the embedded decl-specifier-seq_opt -# - -def p_init_declarations(p): - '''init_declarations : assignment_expression ',' init_declaration - | init_declarations ',' init_declaration - ''' - p[0]=get_rest(p) - -def p_init_declaration(p): - '''init_declaration : assignment_expression - ''' - p[0]=get_rest(p) - -def p_star_ptr_operator(p): - '''star_ptr_operator : '*' - | star_ptr_operator cv_qualifier - ''' - pass - -def p_nested_ptr_operator(p): - '''nested_ptr_operator : star_ptr_operator - | id_scope nested_ptr_operator - ''' - pass - -def p_ptr_operator(p): - '''ptr_operator : '&' - | nested_ptr_operator - | global_scope nested_ptr_operator - ''' - pass - -def p_ptr_operator_seq(p): - '''ptr_operator_seq : ptr_operator - | ptr_operator ptr_operator_seq - ''' - pass - -# -# Independently coded to localise the shift-reduce conflict: sharing just needs another %prec -# -def p_ptr_operator_seq_opt(p): - '''ptr_operator_seq_opt : empty %prec SHIFT_THERE - | ptr_operator ptr_operator_seq_opt - ''' - pass - -def p_cv_qualifier_seq_opt(p): - '''cv_qualifier_seq_opt : empty - | cv_qualifier_seq_opt cv_qualifier - ''' - pass - -# TODO: verify that we should include attributes here -def p_cv_qualifier(p): - '''cv_qualifier : CONST - | VOLATILE - | attributes - ''' - pass - -def p_type_id(p): - '''type_id : type_specifier abstract_declarator_opt - | type_specifier type_id - ''' - pass - -def p_abstract_declarator_opt(p): - '''abstract_declarator_opt : empty - | ptr_operator abstract_declarator_opt - | direct_abstract_declarator - ''' - pass - -def p_direct_abstract_declarator_opt(p): - '''direct_abstract_declarator_opt : empty - | direct_abstract_declarator - ''' - pass - -def p_direct_abstract_declarator(p): - '''direct_abstract_declarator : direct_abstract_declarator_opt parenthesis_clause - | direct_abstract_declarator_opt LBRACKET RBRACKET - | direct_abstract_declarator_opt LBRACKET bexpression RBRACKET - ''' - pass - -def p_parenthesis_clause(p): - '''parenthesis_clause : parameters_clause cv_qualifier_seq_opt - | parameters_clause cv_qualifier_seq_opt exception_specification - ''' - p[0] = ['(',')'] - -def p_parameters_clause(p): - '''parameters_clause : '(' condition_opt ')' - ''' - p[0] = ['(',')'] - -# -# A typed abstract qualifier such as -# Class * ... -# looks like a multiply, so pointers are parsed as their binary operation equivalents that -# ultimately terminate with a degenerate right hand term. -# -def p_abstract_pointer_declaration(p): - '''abstract_pointer_declaration : ptr_operator_seq - | multiplicative_expression star_ptr_operator ptr_operator_seq_opt - ''' - pass - -def p_abstract_parameter_declaration(p): - '''abstract_parameter_declaration : abstract_pointer_declaration - | and_expression '&' - | and_expression '&' abstract_pointer_declaration - ''' - pass - -def p_special_parameter_declaration(p): - '''special_parameter_declaration : abstract_parameter_declaration - | abstract_parameter_declaration '=' assignment_expression - | ELLIPSIS - ''' - pass - -def p_parameter_declaration(p): - '''parameter_declaration : assignment_expression - | special_parameter_declaration - | decl_specifier_prefix parameter_declaration - ''' - pass - -# -# function_definition includes constructor, destructor, implicit int definitions too. A local destructor is successfully parsed as a function-declaration but the ~ was treated as a unary operator. constructor_head is the prefix ambiguity between a constructor and a member-init-list starting with a bit-field. -# -def p_function_definition(p): - '''function_definition : ctor_definition - | func_definition - ''' - pass - -def p_func_definition(p): - '''func_definition : assignment_expression function_try_block - | assignment_expression function_body - | decl_specifier_prefix func_definition - ''' - global _parse_info - if p[2] is not None and p[2][0] == '{': - decl = flatten(p[1]) - #print "HERE",decl - if decl[-1] == ')': - decl=decl[-3] - else: - decl=decl[-1] - p[0] = decl - if decl != "operator": - _parse_info.add_function(decl) - else: - p[0] = p[2] - -def p_ctor_definition(p): - '''ctor_definition : constructor_head function_try_block - | constructor_head function_body - | decl_specifier_prefix ctor_definition - ''' - if p[2] is None or p[2][0] == "try" or p[2][0] == '{': - p[0]=p[1] - else: - p[0]=p[1] - -def p_constructor_head(p): - '''constructor_head : bit_field_init_declaration - | constructor_head ',' assignment_expression - ''' - p[0]=p[1] - -def p_function_try_block(p): - '''function_try_block : TRY function_block handler_seq - ''' - global noExceptionLogic - noExceptionLogic=False - p[0] = ['try'] - -def p_function_block(p): - '''function_block : ctor_initializer_opt function_body - ''' - pass - -def p_function_body(p): - '''function_body : LBRACE nonbrace_seq_opt RBRACE - ''' - p[0] = ['{','}'] - -def p_initializer_clause(p): - '''initializer_clause : assignment_expression - | braced_initializer - ''' - pass - -def p_braced_initializer(p): - '''braced_initializer : LBRACE initializer_list RBRACE - | LBRACE initializer_list ',' RBRACE - | LBRACE RBRACE - ''' - pass - -def p_initializer_list(p): - '''initializer_list : initializer_clause - | initializer_list ',' initializer_clause - ''' - pass - -#--------------------------------------------------------------------------------------------------- -# A.8 Classes -#--------------------------------------------------------------------------------------------------- -# -# An anonymous bit-field declaration may look very like inheritance: -# const int B = 3; -# class A : B ; -# The two usages are too distant to try to create and enforce a common prefix so we have to resort to -# a parser hack by backtracking. Inheritance is much the most likely so we mark the input stream context -# and try to parse a base-clause. If we successfully reach a { the base-clause is ok and inheritance was -# the correct choice so we unmark and continue. If we fail to find the { an error token causes -# back-tracking to the alternative parse in elaborated_type_specifier which regenerates the : and -# declares unconditional success. -# - -def p_class_specifier_head(p): - '''class_specifier_head : class_key scoped_id ':' base_specifier_list LBRACE - | class_key ':' base_specifier_list LBRACE - | class_key scoped_id LBRACE - | class_key LBRACE - ''' - global _parse_info - base_classes=[] - if len(p) == 6: - scope = p[2] - base_classes = p[4] - elif len(p) == 4: - scope = p[2] - elif len(p) == 5: - base_classes = p[3] - else: - scope = "" - _parse_info.push_scope(scope,p[1],base_classes) - - -def p_class_key(p): - '''class_key : CLASS - | STRUCT - | UNION - ''' - p[0] = p[1] - -def p_class_specifier(p): - '''class_specifier : class_specifier_head member_specification_opt RBRACE - ''' - scope = _parse_info.pop_scope() - -def p_member_specification_opt(p): - '''member_specification_opt : empty - | member_specification_opt member_declaration - ''' - pass - -def p_member_declaration(p): - '''member_declaration : accessibility_specifier - | simple_member_declaration - | function_definition - | using_declaration - | template_declaration - ''' - p[0] = get_rest(p) - #print "Decl",get_rest(p) - -# -# The generality of constructor names (there need be no parenthesised argument list) means that that -# name : f(g), h(i) -# could be the start of a constructor or the start of an anonymous bit-field. An ambiguity is avoided by -# parsing the ctor-initializer of a function_definition as a bit-field. -# -def p_simple_member_declaration(p): - '''simple_member_declaration : ';' - | assignment_expression ';' - | constructor_head ';' - | member_init_declarations ';' - | decl_specifier_prefix simple_member_declaration - ''' - global _parse_info - decl = flatten(get_rest(p)) - if len(decl) >= 4 and decl[-3] == "(": - _parse_info.add_function(decl[-4]) - -def p_member_init_declarations(p): - '''member_init_declarations : assignment_expression ',' member_init_declaration - | constructor_head ',' bit_field_init_declaration - | member_init_declarations ',' member_init_declaration - ''' - pass - -def p_member_init_declaration(p): - '''member_init_declaration : assignment_expression - | bit_field_init_declaration - ''' - pass - -def p_accessibility_specifier(p): - '''accessibility_specifier : access_specifier ':' - ''' - pass - -def p_bit_field_declaration(p): - '''bit_field_declaration : assignment_expression ':' bit_field_width - | ':' bit_field_width - ''' - if len(p) == 4: - p[0]=p[1] - -def p_bit_field_width(p): - '''bit_field_width : logical_or_expression - | logical_or_expression '?' bit_field_width ':' bit_field_width - ''' - pass - -def p_bit_field_init_declaration(p): - '''bit_field_init_declaration : bit_field_declaration - | bit_field_declaration '=' initializer_clause - ''' - pass - -#--------------------------------------------------------------------------------------------------- -# A.9 Derived classes -#--------------------------------------------------------------------------------------------------- -def p_base_specifier_list(p): - '''base_specifier_list : base_specifier - | base_specifier_list ',' base_specifier - ''' - if len(p) == 2: - p[0] = [p[1]] - else: - p[0] = p[1]+[p[3]] - -def p_base_specifier(p): - '''base_specifier : scoped_id - | access_specifier base_specifier - | VIRTUAL base_specifier - ''' - if len(p) == 2: - p[0] = p[1] - else: - p[0] = p[2] - -def p_access_specifier(p): - '''access_specifier : PRIVATE - | PROTECTED - | PUBLIC - ''' - pass - -#--------------------------------------------------------------------------------------------------- -# A.10 Special member functions -#--------------------------------------------------------------------------------------------------- -def p_conversion_function_id(p): - '''conversion_function_id : OPERATOR conversion_type_id - ''' - p[0] = ['operator'] - -def p_conversion_type_id(p): - '''conversion_type_id : type_specifier ptr_operator_seq_opt - | type_specifier conversion_type_id - ''' - pass - -# -# Ctor-initialisers can look like a bit field declaration, given the generalisation of names: -# Class(Type) : m1(1), m2(2) { } -# NonClass(bit_field) : int(2), second_variable, ... -# The grammar below is used within a function_try_block or function_definition. -# See simple_member_declaration for use in normal member function_definition. -# -def p_ctor_initializer_opt(p): - '''ctor_initializer_opt : empty - | ctor_initializer - ''' - pass - -def p_ctor_initializer(p): - '''ctor_initializer : ':' mem_initializer_list - ''' - pass - -def p_mem_initializer_list(p): - '''mem_initializer_list : mem_initializer - | mem_initializer_list_head mem_initializer - ''' - pass - -def p_mem_initializer_list_head(p): - '''mem_initializer_list_head : mem_initializer_list ',' - ''' - pass - -def p_mem_initializer(p): - '''mem_initializer : mem_initializer_id '(' expression_list_opt ')' - ''' - pass - -def p_mem_initializer_id(p): - '''mem_initializer_id : scoped_id - ''' - pass - -#--------------------------------------------------------------------------------------------------- -# A.11 Overloading -#--------------------------------------------------------------------------------------------------- - -def p_operator_function_id(p): - '''operator_function_id : OPERATOR operator - | OPERATOR '(' ')' - | OPERATOR LBRACKET RBRACKET - | OPERATOR '<' - | OPERATOR '>' - | OPERATOR operator '<' nonlgt_seq_opt '>' - ''' - p[0] = ["operator"] - -# -# It is not clear from the ANSI standard whether spaces are permitted in delete[]. If not then it can -# be recognised and returned as DELETE_ARRAY by the lexer. Assuming spaces are permitted there is an -# ambiguity created by the over generalised nature of expressions. operator new is a valid delarator-id -# which we may have an undimensioned array of. Semantic rubbish, but syntactically valid. Since the -# array form is covered by the declarator consideration we can exclude the operator here. The need -# for a semantic rescue can be eliminated at the expense of a couple of shift-reduce conflicts by -# removing the comments on the next four lines. -# -def p_operator(p): - '''operator : NEW - | DELETE - | '+' - | '-' - | '*' - | '/' - | '%' - | '^' - | '&' - | '|' - | '~' - | '!' - | '=' - | ASS_ADD - | ASS_SUB - | ASS_MUL - | ASS_DIV - | ASS_MOD - | ASS_XOR - | ASS_AND - | ASS_OR - | SHL - | SHR - | ASS_SHR - | ASS_SHL - | EQ - | NE - | LE - | GE - | LOG_AND - | LOG_OR - | INC - | DEC - | ',' - | ARROW_STAR - | ARROW - ''' - p[0]=p[1] - -# | IF -# | SWITCH -# | WHILE -# | FOR -# | DO -def p_reserved(p): - '''reserved : PRIVATE - | CLiteral - | CppLiteral - | IF - | SWITCH - | WHILE - | FOR - | DO - | PROTECTED - | PUBLIC - | BOOL - | CHAR - | DOUBLE - | FLOAT - | INT - | LONG - | SHORT - | SIGNED - | UNSIGNED - | VOID - | WCHAR_T - | CLASS - | ENUM - | NAMESPACE - | STRUCT - | TYPENAME - | UNION - | CONST - | VOLATILE - | AUTO - | EXPLICIT - | EXPORT - | EXTERN - | FRIEND - | INLINE - | MUTABLE - | REGISTER - | STATIC - | TEMPLATE - | TYPEDEF - | USING - | VIRTUAL - | ASM - | BREAK - | CASE - | CATCH - | CONST_CAST - | CONTINUE - | DEFAULT - | DYNAMIC_CAST - | ELSE - | FALSE - | GOTO - | OPERATOR - | REINTERPRET_CAST - | RETURN - | SIZEOF - | STATIC_CAST - | THIS - | THROW - | TRUE - | TRY - | TYPEID - | ATTRIBUTE - | CDECL - | TYPEOF - | uTYPEOF - ''' - if p[1] in ('try', 'catch', 'throw'): - global noExceptionLogic - noExceptionLogic=False - -#--------------------------------------------------------------------------------------------------- -# A.12 Templates -#--------------------------------------------------------------------------------------------------- -def p_template_declaration(p): - '''template_declaration : template_parameter_clause declaration - | EXPORT template_declaration - ''' - pass - -def p_template_parameter_clause(p): - '''template_parameter_clause : TEMPLATE '<' nonlgt_seq_opt '>' - ''' - pass - -# -# Generalised naming makes identifier a valid declaration, so TEMPLATE identifier is too. -# The TEMPLATE prefix is therefore folded into all names, parenthesis_clause and decl_specifier_prefix. -# -# explicit_instantiation: TEMPLATE declaration -# -def p_explicit_specialization(p): - '''explicit_specialization : TEMPLATE '<' '>' declaration - ''' - pass - -#--------------------------------------------------------------------------------------------------- -# A.13 Exception Handling -#--------------------------------------------------------------------------------------------------- -def p_handler_seq(p): - '''handler_seq : handler - | handler handler_seq - ''' - pass - -def p_handler(p): - '''handler : CATCH '(' exception_declaration ')' compound_statement - ''' - global noExceptionLogic - noExceptionLogic=False - -def p_exception_declaration(p): - '''exception_declaration : parameter_declaration - ''' - pass - -def p_throw_expression(p): - '''throw_expression : THROW - | THROW assignment_expression - ''' - global noExceptionLogic - noExceptionLogic=False - -def p_exception_specification(p): - '''exception_specification : THROW '(' ')' - | THROW '(' type_id_list ')' - ''' - global noExceptionLogic - noExceptionLogic=False - -def p_type_id_list(p): - '''type_id_list : type_id - | type_id_list ',' type_id - ''' - pass - -#--------------------------------------------------------------------------------------------------- -# Misc productions -#--------------------------------------------------------------------------------------------------- -def p_nonsemicolon_seq(p): - '''nonsemicolon_seq : empty - | nonsemicolon_seq nonsemicolon - ''' - pass - -def p_nonsemicolon(p): - '''nonsemicolon : misc - | '(' - | ')' - | '<' - | '>' - | LBRACKET nonbracket_seq_opt RBRACKET - | LBRACE nonbrace_seq_opt RBRACE - ''' - pass - -def p_nonparen_seq_opt(p): - '''nonparen_seq_opt : empty - | nonparen_seq_opt nonparen - ''' - pass - -def p_nonparen_seq(p): - '''nonparen_seq : nonparen - | nonparen_seq nonparen - ''' - pass - -def p_nonparen(p): - '''nonparen : misc - | '<' - | '>' - | ';' - | LBRACKET nonbracket_seq_opt RBRACKET - | LBRACE nonbrace_seq_opt RBRACE - ''' - pass - -def p_nonbracket_seq_opt(p): - '''nonbracket_seq_opt : empty - | nonbracket_seq_opt nonbracket - ''' - pass - -def p_nonbracket_seq(p): - '''nonbracket_seq : nonbracket - | nonbracket_seq nonbracket - ''' - pass - -def p_nonbracket(p): - '''nonbracket : misc - | '<' - | '>' - | '(' - | ')' - | ';' - | LBRACKET nonbracket_seq_opt RBRACKET - | LBRACE nonbrace_seq_opt RBRACE - ''' - pass - -def p_nonbrace_seq_opt(p): - '''nonbrace_seq_opt : empty - | nonbrace_seq_opt nonbrace - ''' - pass - -def p_nonbrace(p): - '''nonbrace : misc - | '<' - | '>' - | '(' - | ')' - | ';' - | LBRACKET nonbracket_seq_opt RBRACKET - | LBRACE nonbrace_seq_opt RBRACE - ''' - pass - -def p_nonlgt_seq_opt(p): - '''nonlgt_seq_opt : empty - | nonlgt_seq_opt nonlgt - ''' - pass - -def p_nonlgt(p): - '''nonlgt : misc - | '(' - | ')' - | LBRACKET nonbracket_seq_opt RBRACKET - | '<' nonlgt_seq_opt '>' - | ';' - ''' - pass - -def p_misc(p): - '''misc : operator - | identifier - | IntegerLiteral - | CharacterLiteral - | FloatingLiteral - | StringLiteral - | reserved - | '?' - | ':' - | '.' - | SCOPE - | ELLIPSIS - | EXTENSION - ''' - pass - -def p_empty(p): - '''empty : ''' - pass - - - -# -# Compute column. -# input is the input text string -# token is a token instance -# -def _find_column(input,token): - ''' TODO ''' - i = token.lexpos - while i > 0: - if input[i] == '\n': break - i -= 1 - column = (token.lexpos - i)+1 - return column - -def p_error(p): - if p is None: - tmp = "Syntax error at end of file." - else: - tmp = "Syntax error at token " - if p.type is "": - tmp = tmp + "''" - else: - tmp = tmp + str(p.type) - tmp = tmp + " with value '"+str(p.value)+"'" - tmp = tmp + " in line " + str(lexer.lineno-1) - tmp = tmp + " at column "+str(_find_column(_parsedata,p)) - raise IOError( tmp ) - - - -# -# The function that performs the parsing -# -def parse_cpp(data=None, filename=None, debug=0, optimize=0, verbose=False, func_filter=None): - # - # Reset global data - # - global lexer - lexer = None - global scope_lineno - scope_lineno = 0 - global indentifier_lineno - identifier_lineno = {} - global _parse_info - _parse_info=None - global _parsedata - _parsedata=None - global noExceptionLogic - noExceptionLogic = True - # - if debug > 0: - print "Debugging parse_cpp!" - # - # Always remove the parser.out file, which is generated to create debugging - # - if os.path.exists("parser.out"): - os.remove("parser.out") - # - # Remove the parsetab.py* files. These apparently need to be removed - # to ensure the creation of a parser.out file. - # - if os.path.exists("parsetab.py"): - os.remove("parsetab.py") - if os.path.exists("parsetab.pyc"): - os.remove("parsetab.pyc") - global debugging - debugging=True - # - # Build lexer - # - lexer = lex.lex() - # - # Initialize parse object - # - _parse_info = CppInfo(filter=func_filter) - _parse_info.verbose=verbose - # - # Build yaccer - # - write_table = not os.path.exists("parsetab.py") - yacc.yacc(debug=debug, optimize=optimize, write_tables=write_table) - # - # Parse the file - # - if not data is None: - _parsedata=data - ply_init(_parsedata) - yacc.parse(data,debug=debug) - elif not filename is None: - f = open(filename) - data = f.read() - f.close() - _parsedata=data - ply_init(_parsedata) - yacc.parse(data, debug=debug) - else: - return None - # - if not noExceptionLogic: - _parse_info.noExceptionLogic = False - else: - for key in identifier_lineno: - if 'ASSERT_THROWS' in key: - _parse_info.noExceptionLogic = False - break - _parse_info.noExceptionLogic = True - # - return _parse_info - - - -import sys - -if __name__ == '__main__': #pragma: no cover - # - # This MAIN routine parses a sequence of files provided at the command - # line. If '-v' is included, then a verbose parsing output is - # generated. - # - for arg in sys.argv[1:]: - if arg == "-v": - continue - print "Parsing file '"+arg+"'" - if '-v' in sys.argv: - parse_cpp(filename=arg,debug=2,verbose=2) - else: - parse_cpp(filename=arg,verbose=2) - # - # Print the _parse_info object summary for this file. - # This illustrates how class inheritance can be used to - # deduce class members. - # - print str(_parse_info) - diff --git a/noarch/lib/py/cxxtest/python/cxxtest/cxxtest_fog.py b/noarch/lib/py/cxxtest/python/cxxtest/cxxtest_fog.py deleted file mode 100644 index a157b683..00000000 --- a/noarch/lib/py/cxxtest/python/cxxtest/cxxtest_fog.py +++ /dev/null @@ -1,99 +0,0 @@ -#------------------------------------------------------------------------- -# CxxTest: A lightweight C++ unit testing library. -# Copyright (c) 2008 Sandia Corporation. -# This software is distributed under the LGPL License v3 -# For more information, see the COPYING file in the top CxxTest directory. -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -#------------------------------------------------------------------------- - -# -# TODO: add line number info -# TODO: add test function names -# - -from __future__ import division - -import sys -import re -from cxxtest_misc import abort -import cxx_parser -import re - -def cstr( str ): - '''Convert a string to its C representation''' - return '"' + re.sub('\\\\', '\\\\\\\\', str ) + '"' - -def scanInputFiles(files, _options): - '''Scan all input files for test suites''' - suites=[] - for file in files: - try: - print "Parsing file "+file, - sys.stdout.flush() - parse_info = cxx_parser.parse_cpp(filename=file,optimize=1) - except IOError, err: - print " error." - print str(err) - continue - print "done." - sys.stdout.flush() - # - # WEH: see if it really makes sense to use parse information to - # initialize this data. I don't think so... - # - _options.haveStandardLibrary=1 - if not parse_info.noExceptionLogic: - _options.haveExceptionHandling=1 - # - keys = list(parse_info.index.keys()) - tpat = re.compile("[Tt][Ee][Ss][Tt]") - for key in keys: - if parse_info.index[key].scope_t == "class" and parse_info.is_baseclass(key,"CxxTest::TestSuite"): - name=parse_info.index[key].name - if key.startswith('::'): - fullname = key[2:] - else: - fullname = key - suite = { - 'fullname' : fullname, - 'name' : name, - 'file' : file, - 'cfile' : cstr(file), - 'line' : str(parse_info.index[key].lineno), - 'generated' : 0, - 'object' : 'suite_%s' % fullname.replace('::','_'), - 'dobject' : 'suiteDescription_%s' % fullname.replace('::','_'), - 'tlist' : 'Tests_%s' % fullname.replace('::','_'), - 'tests' : [], - 'lines' : [] } - for fn in parse_info.get_functions(key,quiet=True): - tname = fn[0] - lineno = str(fn[1]) - if tname.startswith('createSuite'): - # Indicate that we're using a dynamically generated test suite - suite['create'] = str(lineno) # (unknown line) - if tname.startswith('destroySuite'): - # Indicate that we're using a dynamically generated test suite - suite['destroy'] = str(lineno) # (unknown line) - if not tpat.match(tname): - # Skip non-test methods - continue - test = { 'name' : tname, - 'suite' : suite, - 'class' : 'TestDescription_suite_%s_%s' % (suite['fullname'].replace('::','_'), tname), - 'object' : 'testDescription_suite_%s_%s' % (suite['fullname'].replace('::','_'), tname), - 'line' : lineno, - } - suite['tests'].append(test) - suites.append(suite) - - if not _options.root: - ntests = 0 - for suite in suites: - ntests += len(suite['tests']) - if ntests == 0: - abort( 'No tests defined' ) - # - return [_options, suites] - diff --git a/noarch/lib/py/cxxtest/python/cxxtest/cxxtest_misc.py b/noarch/lib/py/cxxtest/python/cxxtest/cxxtest_misc.py deleted file mode 100644 index c9d337e2..00000000 --- a/noarch/lib/py/cxxtest/python/cxxtest/cxxtest_misc.py +++ /dev/null @@ -1,78 +0,0 @@ -#------------------------------------------------------------------------- -# CxxTest: A lightweight C++ unit testing library. -# Copyright (c) 2008 Sandia Corporation. -# This software is distributed under the LGPL License v3 -# For more information, see the COPYING file in the top CxxTest directory. -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -#------------------------------------------------------------------------- - -import sys -import os - -def abort( problem ): - '''Print error message and exit''' - sys.stderr.write( '\n' ) - sys.stderr.write( problem ) - sys.stderr.write( '\n\n' ) - sys.exit(2) - -if sys.version_info < (2,6): #pragma: no cover - def resolve_symlinks(orig_path): - drive,tmp = os.path.splitdrive(os.path.normpath(orig_path)) - if not drive: - drive = os.path.sep - parts = tmp.split(os.path.sep) - actual_path = [drive] - while parts: - actual_path.append(parts.pop(0)) - if not os.path.islink(os.path.join(*actual_path)): - continue - actual_path[-1] = os.readlink(os.path.join(*actual_path)) - tmp_drive, tmp_path = os.path.splitdrive( - dereference_path(os.path.join(*actual_path)) ) - if tmp_drive: - drive = tmp_drive - actual_path = [drive] + tmp_path.split(os.path.sep) - return os.path.join(*actual_path) - - def relpath(path, start=None): - """Return a relative version of a path. - (provides compatibility with Python < 2.6)""" - # Some notes on implementation: - # - We rely on resolve_symlinks to correctly resolve any symbolic - # links that may be present in the paths - # - The explicit handling od the drive name is critical for proper - # function on Windows (because os.path.join('c:','foo') yields - # "c:foo"!). - if not start: - start = os.getcwd() - ref_drive, ref_path = os.path.splitdrive( - resolve_symlinks(os.path.abspath(start)) ) - if not ref_drive: - ref_drive = os.path.sep - start = [ref_drive] + ref_path.split(os.path.sep) - while '' in start: - start.remove('') - - pth_drive, pth_path = os.path.splitdrive( - resolve_symlinks(os.path.abspath(path)) ) - if not pth_drive: - pth_drive = os.path.sep - path = [pth_drive] + pth_path.split(os.path.sep) - while '' in path: - path.remove('') - - i = 0 - max = min(len(path), len(start)) - while i < max and path[i] == start[i]: - i += 1 - - if i < 2: - return os.path.join(*path) - else: - rel = ['..']*(len(start)-i) + path[i:] - if rel: - return os.path.join(*rel) - else: - return '.' diff --git a/noarch/lib/py/cxxtest/python/cxxtest/cxxtest_parser.py b/noarch/lib/py/cxxtest/python/cxxtest/cxxtest_parser.py deleted file mode 100644 index d7c8f205..00000000 --- a/noarch/lib/py/cxxtest/python/cxxtest/cxxtest_parser.py +++ /dev/null @@ -1,254 +0,0 @@ -#------------------------------------------------------------------------- -# CxxTest: A lightweight C++ unit testing library. -# Copyright (c) 2008 Sandia Corporation. -# This software is distributed under the LGPL License v3 -# For more information, see the COPYING file in the top CxxTest directory. -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -#------------------------------------------------------------------------- - -from __future__ import division - -import codecs -import re -import sys -from cxxtest.cxxtest_misc import abort - -# Global variables -suites = [] -suite = None -inBlock = 0 -options=None - -def scanInputFiles(files, _options): - '''Scan all input files for test suites''' - # - # Reset global data - # - global options - options=_options - global suites - suites = [] - global suite - suite = None - global inBlock - inBlock = 0 - # - for file in files: - scanInputFile(file) - if len(suites) is 0 and not options.root: - abort( 'No tests defined' ) - return [options,suites] - -lineCont_re = re.compile('(.*)\\\s*$') -def scanInputFile(fileName): - '''Scan single input file for test suites''' - # mode 'rb' is problematic in python3 - byte arrays don't behave the same as - # strings. - # As far as the choice of the default encoding: utf-8 chews through - # everything that the previous ascii codec could, plus most of new code. - # TODO: figure out how to do this properly - like autodetect encoding from - # file header. - file = codecs.open(fileName, mode='r', encoding='utf-8') - prev = "" - lineNo = 0 - contNo = 0 - while 1: - try: - line = file.readline() - except UnicodeDecodeError: - sys.stderr.write("Could not decode unicode character at %s:%s\n" % (fileName, lineNo + 1)); - raise - if not line: - break - lineNo += 1 - - m = lineCont_re.match(line) - if m: - prev += m.group(1) + " " - contNo += 1 - else: - scanInputLine( fileName, lineNo - contNo, prev + line ) - contNo = 0 - prev = "" - if contNo: - scanInputLine( fileName, lineNo - contNo, prev + line ) - - closeSuite() - file.close() - -def scanInputLine( fileName, lineNo, line ): - '''Scan single input line for interesting stuff''' - scanLineForExceptionHandling( line ) - scanLineForStandardLibrary( line ) - - scanLineForSuiteStart( fileName, lineNo, line ) - - global suite - if suite: - scanLineInsideSuite( suite, lineNo, line ) - -def scanLineInsideSuite( suite, lineNo, line ): - '''Analyze line which is part of a suite''' - global inBlock - if lineBelongsToSuite( suite, lineNo, line ): - scanLineForTest( suite, lineNo, line ) - scanLineForCreate( suite, lineNo, line ) - scanLineForDestroy( suite, lineNo, line ) - -def lineBelongsToSuite( suite, lineNo, line ): - '''Returns whether current line is part of the current suite. - This can be false when we are in a generated suite outside of CXXTEST_CODE() blocks - If the suite is generated, adds the line to the list of lines''' - if not suite['generated']: - return 1 - - global inBlock - if not inBlock: - inBlock = lineStartsBlock( line ) - if inBlock: - inBlock = addLineToBlock( suite, lineNo, line ) - return inBlock - - -std_re = re.compile( r"\b(std\s*::|CXXTEST_STD|using\s+namespace\s+std\b|^\s*\#\s*include\s+<[a-z0-9]+>)" ) -def scanLineForStandardLibrary( line ): - '''Check if current line uses standard library''' - global options - if not options.haveStandardLibrary and std_re.search(line): - if not options.noStandardLibrary: - options.haveStandardLibrary = 1 - -exception_re = re.compile( r"\b(throw|try|catch|TSM?_ASSERT_THROWS[A-Z_]*)\b" ) -def scanLineForExceptionHandling( line ): - '''Check if current line uses exception handling''' - global options - if not options.haveExceptionHandling and exception_re.search(line): - if not options.noExceptionHandling: - options.haveExceptionHandling = 1 - -classdef = '(?:::\s*)?(?:\w+\s*::\s*)*\w+' -baseclassdef = '(?:public|private|protected)\s+%s' % (classdef,) -general_suite = r"\bclass\s+(%s)\s*:(?:\s*%s\s*,)*\s*public\s+" \ - % (classdef, baseclassdef,) -testsuite = '(?:(?:::)?\s*CxxTest\s*::\s*)?TestSuite' -suites_re = { re.compile( general_suite + testsuite ) : None } -generatedSuite_re = re.compile( r'\bCXXTEST_SUITE\s*\(\s*(\w*)\s*\)' ) -def scanLineForSuiteStart( fileName, lineNo, line ): - '''Check if current line starts a new test suite''' - for i in list(suites_re.items()): - m = i[0].search( line ) - if m: - suite = startSuite( m.group(1), fileName, lineNo, 0 ) - if i[1] is not None: - for test in i[1]['tests']: - addTest(suite, test['name'], test['line']) - break - m = generatedSuite_re.search( line ) - if m: - sys.stdout.write( "%s:%s: Warning: Inline test suites are deprecated.\n" % (fileName, lineNo) ) - startSuite( m.group(1), fileName, lineNo, 1 ) - -def startSuite( name, file, line, generated ): - '''Start scanning a new suite''' - global suite - closeSuite() - object_name = name.replace(':',"_") - suite = { 'fullname' : name, - 'name' : name, - 'file' : file, - 'cfile' : cstr(file), - 'line' : line, - 'generated' : generated, - 'object' : 'suite_%s' % object_name, - 'dobject' : 'suiteDescription_%s' % object_name, - 'tlist' : 'Tests_%s' % object_name, - 'tests' : [], - 'lines' : [] } - suites_re[re.compile( general_suite + name )] = suite - return suite - -def lineStartsBlock( line ): - '''Check if current line starts a new CXXTEST_CODE() block''' - return re.search( r'\bCXXTEST_CODE\s*\(', line ) is not None - -test_re = re.compile( r'^([^/]|/[^/])*\bvoid\s+([Tt]est\w+)\s*\(\s*(void)?\s*\)' ) -def scanLineForTest( suite, lineNo, line ): - '''Check if current line starts a test''' - m = test_re.search( line ) - if m: - addTest( suite, m.group(2), lineNo ) - -def addTest( suite, name, line ): - '''Add a test function to the current suite''' - test = { 'name' : name, - 'suite' : suite, - 'class' : 'TestDescription_%s_%s' % (suite['object'], name), - 'object' : 'testDescription_%s_%s' % (suite['object'], name), - 'line' : line, - } - suite['tests'].append( test ) - -def addLineToBlock( suite, lineNo, line ): - '''Append the line to the current CXXTEST_CODE() block''' - line = fixBlockLine( suite, lineNo, line ) - line = re.sub( r'^.*\{\{', '', line ) - - e = re.search( r'\}\}', line ) - if e: - line = line[:e.start()] - suite['lines'].append( line ) - return e is None - -def fixBlockLine( suite, lineNo, line): - '''Change all [E]TS_ macros used in a line to _[E]TS_ macros with the correct file/line''' - return re.sub( r'\b(E?TSM?_(ASSERT[A-Z_]*|FAIL))\s*\(', - r'_\1(%s,%s,' % (suite['cfile'], lineNo), - line, 0 ) - -create_re = re.compile( r'\bstatic\s+\w+\s*\*\s*createSuite\s*\(\s*(void)?\s*\)' ) -def scanLineForCreate( suite, lineNo, line ): - '''Check if current line defines a createSuite() function''' - if create_re.search( line ): - addSuiteCreateDestroy( suite, 'create', lineNo ) - -destroy_re = re.compile( r'\bstatic\s+void\s+destroySuite\s*\(\s*\w+\s*\*\s*\w*\s*\)' ) -def scanLineForDestroy( suite, lineNo, line ): - '''Check if current line defines a destroySuite() function''' - if destroy_re.search( line ): - addSuiteCreateDestroy( suite, 'destroy', lineNo ) - -def cstr( s ): - '''Convert a string to its C representation''' - return '"' + s.replace( '\\', '\\\\' ) + '"' - - -def addSuiteCreateDestroy( suite, which, line ): - '''Add createSuite()/destroySuite() to current suite''' - if which in suite: - abort( '%s:%s: %sSuite() already declared' % ( suite['file'], str(line), which ) ) - suite[which] = line - -def closeSuite(): - '''Close current suite and add it to the list if valid''' - global suite - if suite is not None: - if len(suite['tests']) is not 0: - verifySuite(suite) - rememberSuite(suite) - suite = None - -def verifySuite(suite): - '''Verify current suite is legal''' - if 'create' in suite and 'destroy' not in suite: - abort( '%s:%s: Suite %s has createSuite() but no destroySuite()' % - (suite['file'], suite['create'], suite['name']) ) - elif 'destroy' in suite and 'create' not in suite: - abort( '%s:%s: Suite %s has destroySuite() but no createSuite()' % - (suite['file'], suite['destroy'], suite['name']) ) - -def rememberSuite(suite): - '''Add current suite to list''' - global suites - suites.append( suite ) - diff --git a/noarch/lib/py/cxxtest/python/cxxtest/cxxtestgen.py b/noarch/lib/py/cxxtest/python/cxxtest/cxxtestgen.py deleted file mode 100644 index 99437cd8..00000000 --- a/noarch/lib/py/cxxtest/python/cxxtest/cxxtestgen.py +++ /dev/null @@ -1,630 +0,0 @@ -#------------------------------------------------------------------------- -# CxxTest: A lightweight C++ unit testing library. -# Copyright (c) 2008 Sandia Corporation. -# This software is distributed under the LGPL License v3 -# For more information, see the COPYING file in the top CxxTest directory. -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -#------------------------------------------------------------------------- - -# vim: fileencoding=utf-8 - -from __future__ import division -# the above import important for forward-compatibility with python3, -# which is already the default in archlinux! - -__all__ = ['main', 'create_manpage'] - -import __release__ -import os -import sys -import re -import glob -from optparse import OptionParser -import cxxtest_parser -from string import Template - -try: - import cxxtest_fog - imported_fog=True -except ImportError: - imported_fog=False - -from cxxtest_misc import abort - -try: - from os.path import relpath -except ImportError: - from cxxtest_misc import relpath - -# Global data is initialized by main() -options = [] -suites = [] -wrotePreamble = 0 -wroteWorld = 0 -lastIncluded = '' - - -def main(args=sys.argv, catch=False): - '''The main program''' - # - # Reset global state - # - global wrotePreamble - wrotePreamble=0 - global wroteWorld - wroteWorld=0 - global lastIncluded - lastIncluded = '' - global suites - suites = [] - global options - options = [] - # - try: - files = parseCommandline(args) - if imported_fog and options.fog: - [options,suites] = cxxtest_fog.scanInputFiles( files, options ) - else: - [options,suites] = cxxtest_parser.scanInputFiles( files, options ) - writeOutput() - except SystemExit: - if not catch: - raise - -def create_parser(asciidoc=False): - parser = OptionParser("cxxtestgen [options] [<filename> ...]") - if asciidoc: - parser.description="The cxxtestgen command processes C++ header files to perform test discovery, and then it creates files for the CxxTest test runner." - else: - parser.description="The 'cxxtestgen' command processes C++ header files to perform test discovery, and then it creates files for the 'CxxTest' test runner." - - parser.add_option("--version", - action="store_true", dest="version", default=False, - help="Write the CxxTest version.") - parser.add_option("-o", "--output", - dest="outputFileName", default=None, metavar="NAME", - help="Write output to file NAME.") - parser.add_option("-w","--world", dest="world", default="cxxtest", - help="The label of the tests, used to name the XML results.") - parser.add_option("", "--include", action="append", - dest="headers", default=[], metavar="HEADER", - help="Include file HEADER in the test runner before other headers.") - parser.add_option("", "--abort-on-fail", - action="store_true", dest="abortOnFail", default=False, - help="Abort tests on failed asserts (like xUnit).") - parser.add_option("", "--main", - action="store", dest="main", default="main", - help="Specify an alternative name for the main() function.") - parser.add_option("", "--headers", - action="store", dest="header_filename", default=None, - help="Specify a filename that contains a list of header files that are processed to generate a test runner.") - parser.add_option("", "--runner", - dest="runner", default="", metavar="CLASS", - help="Create a test runner that processes test events using the class CxxTest::CLASS.") - parser.add_option("", "--gui", - dest="gui", metavar="CLASS", - help="Create a GUI test runner that processes test events using the class CxxTest::CLASS. (deprecated)") - parser.add_option("", "--error-printer", - action="store_true", dest="error_printer", default=False, - help="Create a test runner using the ErrorPrinter class, and allow the use of the standard library.") - parser.add_option("", "--xunit-printer", - action="store_true", dest="xunit_printer", default=False, - help="Create a test runner using the XUnitPrinter class.") - parser.add_option("", "--xunit-file", dest="xunit_file", default="", - help="The file to which the XML summary is written for test runners using the XUnitPrinter class. The default XML filename is TEST-<world>.xml, where <world> is the value of the --world option. (default: cxxtest)") - parser.add_option("", "--have-std", - action="store_true", dest="haveStandardLibrary", default=False, - help="Use the standard library (even if not found in tests).") - parser.add_option("", "--no-std", - action="store_true", dest="noStandardLibrary", default=False, - help="Do not use standard library (even if found in tests).") - parser.add_option("", "--have-eh", - action="store_true", dest="haveExceptionHandling", default=False, - help="Use exception handling (even if not found in tests).") - parser.add_option("", "--no-eh", - action="store_true", dest="noExceptionHandling", default=False, - help="Do not use exception handling (even if found in tests).") - parser.add_option("", "--longlong", - dest="longlong", default=None, metavar="TYPE", - help="Use TYPE as for long long integers. (default: not supported)") - parser.add_option("", "--no-static-init", - action="store_true", dest="noStaticInit", default=False, - help="Do not rely on static initialization in the test runner.") - parser.add_option("", "--template", - dest="templateFileName", default=None, metavar="TEMPLATE", - help="Generate the test runner using file TEMPLATE to define a template.") - parser.add_option("", "--root", - action="store_true", dest="root", default=False, - help="Write the main() function and global data for a test runner.") - parser.add_option("", "--part", - action="store_true", dest="part", default=False, - help="Write the tester classes for a test runner.") - #parser.add_option("", "--factor", - #action="store_true", dest="factor", default=False, - #help="Declare the _CXXTEST_FACTOR macro. (deprecated)") - if imported_fog: - fog_help = "Use new FOG C++ parser" - else: - fog_help = "Use new FOG C++ parser (disabled)" - parser.add_option("-f", "--fog-parser", - action="store_true", - dest="fog", - default=False, - help=fog_help - ) - return parser - -def parseCommandline(args): - '''Analyze command line arguments''' - global imported_fog - global options - - parser = create_parser() - (options, args) = parser.parse_args(args=args) - if not options.header_filename is None: - if not os.path.exists(options.header_filename): - abort( "ERROR: the file '%s' does not exist!" % options.header_filename ) - INPUT = open(options.header_filename) - headers = [line.strip() for line in INPUT] - args.extend( headers ) - INPUT.close() - - if options.fog and not imported_fog: - abort( "Cannot use the FOG parser. Check that the 'ply' package is installed. The 'ordereddict' package is also required if running Python 2.6") - - if options.version: - printVersion() - - # the cxxtest builder relies on this behaviour! don't remove - if options.runner == 'none': - options.runner = None - - if options.xunit_printer or options.runner == "XUnitPrinter": - options.xunit_printer=True - options.runner="XUnitPrinter" - if len(args) > 1: - if options.xunit_file == "": - if options.world == "": - options.world = "cxxtest" - options.xunit_file="TEST-"+options.world+".xml" - elif options.xunit_file == "": - if options.world == "": - options.world = "cxxtest" - options.xunit_file="TEST-"+options.world+".xml" - - if options.error_printer: - options.runner= "ErrorPrinter" - options.haveStandardLibrary = True - - if options.noStaticInit and (options.root or options.part): - abort( '--no-static-init cannot be used with --root/--part' ) - - if options.gui and not options.runner: - options.runner = 'StdioPrinter' - - files = setFiles(args[1:]) - if len(files) == 0 and not options.root: - sys.stderr.write(parser.error("No input files found")) - - return files - - -def printVersion(): - '''Print CxxTest version and exit''' - sys.stdout.write( "This is CxxTest version %s.\n" % __release__.__version__ ) - sys.exit(0) - -def setFiles(patterns ): - '''Set input files specified on command line''' - files = expandWildcards( patterns ) - return files - -def expandWildcards( patterns ): - '''Expand all wildcards in an array (glob)''' - fileNames = [] - for pathName in patterns: - patternFiles = glob.glob( pathName ) - for fileName in patternFiles: - fileNames.append( fixBackslashes( fileName ) ) - return fileNames - -def fixBackslashes( fileName ): - '''Convert backslashes to slashes in file name''' - return re.sub( r'\\', '/', fileName, 0 ) - - -def writeOutput(): - '''Create output file''' - if options.templateFileName: - writeTemplateOutput() - else: - writeSimpleOutput() - -def writeSimpleOutput(): - '''Create output not based on template''' - output = startOutputFile() - writePreamble( output ) - if options.root or not options.part: - writeMain( output ) - - if len(suites) > 0: - output.write("bool "+suites[0]['object']+"_init = false;\n") - - writeWorld( output ) - output.close() - -include_re = re.compile( r"\s*\#\s*include\s+<cxxtest/" ) -preamble_re = re.compile( r"^\s*<CxxTest\s+preamble>\s*$" ) -world_re = re.compile( r"^\s*<CxxTest\s+world>\s*$" ) -def writeTemplateOutput(): - '''Create output based on template file''' - template = open(options.templateFileName) - output = startOutputFile() - while 1: - line = template.readline() - if not line: - break; - if include_re.search( line ): - writePreamble( output ) - output.write( line ) - elif preamble_re.search( line ): - writePreamble( output ) - elif world_re.search( line ): - if len(suites) > 0: - output.write("bool "+suites[0]['object']+"_init = false;\n") - writeWorld( output ) - else: - output.write( line ) - template.close() - output.close() - -def startOutputFile(): - '''Create output file and write header''' - if options.outputFileName is not None: - output = open( options.outputFileName, 'w' ) - else: - output = sys.stdout - output.write( "/* Generated file, do not edit */\n\n" ) - return output - -def writePreamble( output ): - '''Write the CxxTest header (#includes and #defines)''' - global wrotePreamble - if wrotePreamble: return - output.write( "#ifndef CXXTEST_RUNNING\n" ) - output.write( "#define CXXTEST_RUNNING\n" ) - output.write( "#endif\n" ) - output.write( "\n" ) - if options.xunit_printer: - output.write( "#include <fstream>\n" ) - if options.haveStandardLibrary: - output.write( "#define _CXXTEST_HAVE_STD\n" ) - if options.haveExceptionHandling: - output.write( "#define _CXXTEST_HAVE_EH\n" ) - if options.abortOnFail: - output.write( "#define _CXXTEST_ABORT_TEST_ON_FAIL\n" ) - if options.longlong: - output.write( "#define _CXXTEST_LONGLONG %s\n" % options.longlong ) - #if options.factor: - #output.write( "#define _CXXTEST_FACTOR\n" ) - for header in options.headers: - output.write( "#include \"%s\"\n" % header ) - output.write( "#include <cxxtest/TestListener.h>\n" ) - output.write( "#include <cxxtest/TestTracker.h>\n" ) - output.write( "#include <cxxtest/TestRunner.h>\n" ) - output.write( "#include <cxxtest/RealDescriptions.h>\n" ) - output.write( "#include <cxxtest/TestMain.h>\n" ) - if options.runner: - output.write( "#include <cxxtest/%s.h>\n" % options.runner ) - if options.gui: - output.write( "#include <cxxtest/%s.h>\n" % options.gui ) - output.write( "\n" ) - wrotePreamble = 1 - -def writeMain( output ): - '''Write the main() function for the test runner''' - if not (options.gui or options.runner): - return - output.write( 'int %s( int argc, char *argv[] ) {\n' % options.main ) - output.write( ' int status;\n' ) - if options.noStaticInit: - output.write( ' CxxTest::initialize();\n' ) - if options.gui: - tester_t = "CxxTest::GuiTuiRunner<CxxTest::%s, CxxTest::%s> " % (options.gui, options.runner) - else: - tester_t = "CxxTest::%s" % (options.runner) - if options.xunit_printer: - output.write( ' std::ofstream ofstr("%s");\n' % options.xunit_file ) - output.write( ' %s tmp(ofstr);\n' % tester_t ) - else: - output.write( ' %s tmp;\n' % tester_t ) - output.write( ' CxxTest::RealWorldDescription::_worldName = "%s";\n' % options.world ) - output.write( ' status = CxxTest::Main< %s >( tmp, argc, argv );\n' % tester_t ) - output.write( ' return status;\n') - output.write( '}\n' ) - - -def writeWorld( output ): - '''Write the world definitions''' - global wroteWorld - if wroteWorld: return - writePreamble( output ) - writeSuites( output ) - if options.root or not options.part: - writeRoot( output ) - writeWorldDescr( output ) - if options.noStaticInit: - writeInitialize( output ) - wroteWorld = 1 - -def writeSuites(output): - '''Write all TestDescriptions and SuiteDescriptions''' - for suite in suites: - writeInclude( output, suite['file'] ) - if isGenerated(suite): - generateSuite( output, suite ) - if not options.noStaticInit: - if isDynamic(suite): - writeSuitePointer( output, suite ) - else: - writeSuiteObject( output, suite ) - writeTestList( output, suite ) - writeSuiteDescription( output, suite ) - writeTestDescriptions( output, suite ) - -def isGenerated(suite): - '''Checks whether a suite class should be created''' - return suite['generated'] - -def isDynamic(suite): - '''Checks whether a suite is dynamic''' - return 'create' in suite - -def writeInclude(output, file): - '''Add #include "file" statement''' - global lastIncluded - if options.outputFileName: - dirname = os.path.split(options.outputFileName)[0] - tfile = relpath(file, dirname) - if os.path.exists(tfile): - if tfile == lastIncluded: return - output.writelines( [ '#include "', tfile, '"\n\n' ] ) - lastIncluded = tfile - return - # - # Use an absolute path if the relative path failed - # - tfile = os.path.abspath(file) - if os.path.exists(tfile): - if tfile == lastIncluded: return - output.writelines( [ '#include "', tfile, '"\n\n' ] ) - lastIncluded = tfile - return - -def generateSuite( output, suite ): - '''Write a suite declared with CXXTEST_SUITE()''' - output.write( 'class %s : public CxxTest::TestSuite {\n' % suite['fullname'] ) - output.write( 'public:\n' ) - for line in suite['lines']: - output.write(line) - output.write( '};\n\n' ) - -def writeSuitePointer( output, suite ): - '''Create static suite pointer object for dynamic suites''' - if options.noStaticInit: - output.write( 'static %s* %s;\n\n' % (suite['fullname'], suite['object']) ) - else: - output.write( 'static %s* %s = 0;\n\n' % (suite['fullname'], suite['object']) ) - -def writeSuiteObject( output, suite ): - '''Create static suite object for non-dynamic suites''' - output.writelines( [ "static ", suite['fullname'], " ", suite['object'], ";\n\n" ] ) - -def writeTestList( output, suite ): - '''Write the head of the test linked list for a suite''' - if options.noStaticInit: - output.write( 'static CxxTest::List %s;\n' % suite['tlist'] ) - else: - output.write( 'static CxxTest::List %s = { 0, 0 };\n' % suite['tlist'] ) - -def writeWorldDescr( output ): - '''Write the static name of the world name''' - if options.noStaticInit: - output.write( 'const char* CxxTest::RealWorldDescription::_worldName;\n' ) - else: - output.write( 'const char* CxxTest::RealWorldDescription::_worldName = "cxxtest";\n' ) - -def writeTestDescriptions( output, suite ): - '''Write all test descriptions for a suite''' - for test in suite['tests']: - writeTestDescription( output, suite, test ) - -def writeTestDescription( output, suite, test ): - '''Write test description object''' - if not options.noStaticInit: - output.write( 'static class %s : public CxxTest::RealTestDescription {\n' % test['class'] ) - else: - output.write( 'class %s : public CxxTest::RealTestDescription {\n' % test['class'] ) - # - output.write( 'public:\n' ) - if not options.noStaticInit: - output.write( ' %s() : CxxTest::RealTestDescription( %s, %s, %s, "%s" ) {}\n' % - (test['class'], suite['tlist'], suite['dobject'], test['line'], test['name']) ) - else: - if isDynamic(suite): - output.write( ' %s(%s* _%s) : %s(_%s) { }\n' % - (test['class'], suite['fullname'], suite['object'], suite['object'], suite['object']) ) - output.write( ' %s* %s;\n' % (suite['fullname'], suite['object']) ) - else: - output.write( ' %s(%s& _%s) : %s(_%s) { }\n' % - (test['class'], suite['fullname'], suite['object'], suite['object'], suite['object']) ) - output.write( ' %s& %s;\n' % (suite['fullname'], suite['object']) ) - output.write( ' void runTest() { %s }\n' % runBody( suite, test ) ) - # - if not options.noStaticInit: - output.write( '} %s;\n\n' % test['object'] ) - else: - output.write( '};\n\n' ) - -def runBody( suite, test ): - '''Body of TestDescription::run()''' - if isDynamic(suite): return dynamicRun( suite, test ) - else: return staticRun( suite, test ) - -def dynamicRun( suite, test ): - '''Body of TestDescription::run() for test in a dynamic suite''' - return 'if ( ' + suite['object'] + ' ) ' + suite['object'] + '->' + test['name'] + '();' - -def staticRun( suite, test ): - '''Body of TestDescription::run() for test in a non-dynamic suite''' - return suite['object'] + '.' + test['name'] + '();' - -def writeSuiteDescription( output, suite ): - '''Write SuiteDescription object''' - if isDynamic( suite ): - writeDynamicDescription( output, suite ) - else: - writeStaticDescription( output, suite ) - -def writeDynamicDescription( output, suite ): - '''Write SuiteDescription for a dynamic suite''' - output.write( 'CxxTest::DynamicSuiteDescription< %s > %s' % (suite['fullname'], suite['dobject']) ) - if not options.noStaticInit: - output.write( '( %s, %s, "%s", %s, %s, %s, %s )' % - (suite['cfile'], suite['line'], suite['fullname'], suite['tlist'], - suite['object'], suite['create'], suite['destroy']) ) - output.write( ';\n\n' ) - -def writeStaticDescription( output, suite ): - '''Write SuiteDescription for a static suite''' - output.write( 'CxxTest::StaticSuiteDescription %s' % suite['dobject'] ) - if not options.noStaticInit: - output.write( '( %s, %s, "%s", %s, %s )' % - (suite['cfile'], suite['line'], suite['fullname'], suite['object'], suite['tlist']) ) - output.write( ';\n\n' ) - -def writeRoot(output): - '''Write static members of CxxTest classes''' - output.write( '#include <cxxtest/Root.cpp>\n' ) - -def writeInitialize(output): - '''Write CxxTest::initialize(), which replaces static initialization''' - output.write( 'namespace CxxTest {\n' ) - output.write( ' void initialize()\n' ) - output.write( ' {\n' ) - for suite in suites: - #print "HERE", suite - writeTestList( output, suite ) - output.write( ' %s.initialize();\n' % suite['tlist'] ) - #writeSuiteObject( output, suite ) - if isDynamic(suite): - writeSuitePointer( output, suite ) - output.write( ' %s = 0;\n' % suite['object']) - else: - writeSuiteObject( output, suite ) - output.write( ' static ') - writeSuiteDescription( output, suite ) - if isDynamic(suite): - #output.write( ' %s = %s.suite();\n' % (suite['object'],suite['dobject']) ) - output.write( ' %s.initialize( %s, %s, "%s", %s, %s, %s, %s );\n' % - (suite['dobject'], suite['cfile'], suite['line'], suite['fullname'], - suite['tlist'], suite['object'], suite['create'], suite['destroy']) ) - output.write( ' %s.setUp();\n' % suite['dobject']) - else: - output.write( ' %s.initialize( %s, %s, "%s", %s, %s );\n' % - (suite['dobject'], suite['cfile'], suite['line'], suite['fullname'], - suite['object'], suite['tlist']) ) - - for test in suite['tests']: - output.write( ' static %s %s(%s);\n' % - (test['class'], test['object'], suite['object']) ) - output.write( ' %s.initialize( %s, %s, %s, "%s" );\n' % - (test['object'], suite['tlist'], suite['dobject'], test['line'], test['name']) ) - - output.write( ' }\n' ) - output.write( '}\n' ) - -man_template=Template("""CXXTESTGEN(1) -============= -:doctype: manpage - - -NAME ----- -cxxtestgen - performs test discovery to create a CxxTest test runner - - -SYNOPSIS --------- -${usage} - - -DESCRIPTION ------------ -${description} - - -OPTIONS -------- -${options} - - -EXIT STATUS ------------ -*0*:: - Success - -*1*:: - Failure (syntax or usage error; configuration error; document - processing failure; unexpected error). - - -BUGS ----- -See the CxxTest Home Page for the link to the CxxTest ticket repository. - - -AUTHOR ------- -CxxTest was originally written by Erez Volk. Many people have -contributed to it. - - -RESOURCES ---------- -Home page: <http://cxxtest.com/> - -CxxTest User Guide: <http://cxxtest.com/cxxtest/doc/guide.html> - - - -COPYING -------- -Copyright (c) 2008 Sandia Corporation. This software is distributed -under the Lesser GNU General Public License (LGPL) v3 -""") - -def create_manpage(): - """Write ASCIIDOC manpage file""" - parser = create_parser(asciidoc=True) - # - usage = parser.usage - description = parser.description - options="" - for opt in parser.option_list: - opts = opt._short_opts + opt._long_opts - optstr = '*' + ', '.join(opts) + '*' - if not opt.metavar is None: - optstr += "='%s'" % opt.metavar - optstr += '::\n' - options += optstr - # - options += opt.help - options += '\n\n' - # - OUTPUT = open('cxxtestgen.1.txt','w') - OUTPUT.write( man_template.substitute(usage=usage, description=description, options=options) ) - OUTPUT.close() - - diff --git a/noarch/lib/py/cxxtest/python/python3/cxxtest/__init__.py b/noarch/lib/py/cxxtest/python/python3/cxxtest/__init__.py deleted file mode 100644 index 669f8bbf..00000000 --- a/noarch/lib/py/cxxtest/python/python3/cxxtest/__init__.py +++ /dev/null @@ -1,33 +0,0 @@ -#------------------------------------------------------------------------- -# CxxTest: A lightweight C++ unit testing library. -# Copyright (c) 2008 Sandia Corporation. -# This software is distributed under the LGPL License v3 -# For more information, see the COPYING file in the top CxxTest directory. -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -#------------------------------------------------------------------------- - -"""cxxtest: A Python package that supports the CxxTest test framework for C/C++. - -.. _CxxTest: http://cxxtest.com/ - -CxxTest is a unit testing framework for C++ that is similar in -spirit to JUnit, CppUnit, and xUnit. CxxTest is easy to use because -it does not require precompiling a CxxTest testing library, it -employs no advanced features of C++ (e.g. RTTI) and it supports a -very flexible form of test discovery. - -The cxxtest Python package includes capabilities for parsing C/C++ source files and generating -CxxTest drivers. -""" - -from cxxtest.__release__ import __version__, __date__ -__date__ -__version__ - -__maintainer__ = "William E. Hart" -__maintainer_email__ = "whart222@gmail.com" -__license__ = "LGPL" -__url__ = "http://cxxtest.com" - -from cxxtest.cxxtestgen import * diff --git a/noarch/lib/py/cxxtest/python/python3/cxxtest/__release__.py b/noarch/lib/py/cxxtest/python/python3/cxxtest/__release__.py deleted file mode 100644 index 1369c60c..00000000 --- a/noarch/lib/py/cxxtest/python/python3/cxxtest/__release__.py +++ /dev/null @@ -1,13 +0,0 @@ -#------------------------------------------------------------------------- -# CxxTest: A lightweight C++ unit testing library. -# Copyright (c) 2008 Sandia Corporation. -# This software is distributed under the LGPL License v3 -# For more information, see the COPYING file in the top CxxTest directory. -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -#------------------------------------------------------------------------- - -""" Release Information for cxxtest """ - -__version__ = '4.4' -__date__ = "2014-06-03" diff --git a/noarch/lib/py/cxxtest/python/python3/cxxtest/cxx_parser.py b/noarch/lib/py/cxxtest/python/python3/cxxtest/cxx_parser.py deleted file mode 100644 index c3b7561e..00000000 --- a/noarch/lib/py/cxxtest/python/python3/cxxtest/cxx_parser.py +++ /dev/null @@ -1,2204 +0,0 @@ -#------------------------------------------------------------------------- -# CxxTest: A lightweight C++ unit testing library. -# Copyright (c) 2008 Sandia Corporation. -# This software is distributed under the LGPL License v3 -# For more information, see the COPYING file in the top CxxTest directory. -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -#------------------------------------------------------------------------- - -# vim: fileencoding=utf-8 - -# -# This is a PLY parser for the entire ANSI C++ grammar. This grammar was -# adapted from the FOG grammar developed by E. D. Willink. See -# -# http://www.computing.surrey.ac.uk/research/dsrg/fog/ -# -# for further details. -# -# The goal of this grammar is to extract information about class, function and -# class method declarations, along with their associated scope. Thus, this -# grammar can be used to analyze classes in an inheritance heirarchy, and then -# enumerate the methods in a derived class. -# -# This grammar parses blocks of <>, (), [] and {} in a generic manner. Thus, -# There are several capabilities that this grammar does not support: -# -# 1. Ambiguous template specification. This grammar cannot parse template -# specifications that do not have paired <>'s in their declaration. In -# particular, ambiguous declarations like -# -# foo<A, c<3 >(); -# -# cannot be correctly parsed. -# -# 2. Template class specialization. Although the goal of this grammar is to -# extract class information, specialization of templated classes is -# not supported. When a template class definition is parsed, it's -# declaration is archived without information about the template -# parameters. Class specializations will be stored separately, and -# thus they can be processed after the fact. However, this grammar -# does not attempt to correctly process properties of class inheritence -# when template class specialization is employed. -# - -# -# TODO: document usage of this file -# - - - -import os -import ply.lex as lex -import ply.yacc as yacc -import re -try: - from collections import OrderedDict -except ImportError: #pragma: no cover - from ordereddict import OrderedDict - -# global data -lexer = None -scope_lineno = 0 -identifier_lineno = {} -_parse_info=None -_parsedata=None -noExceptionLogic = True - - -def ply_init(data): - global _parsedata - _parsedata=data - - -class Scope(object): - - def __init__(self,name,abs_name,scope_t,base_classes,lineno): - self.function=[] - self.name=name - self.scope_t=scope_t - self.sub_scopes=[] - self.base_classes=base_classes - self.abs_name=abs_name - self.lineno=lineno - - def insert(self,scope): - self.sub_scopes.append(scope) - - -class CppInfo(object): - - def __init__(self, filter=None): - self.verbose=0 - if filter is None: - self.filter=re.compile("[Tt][Ee][Ss][Tt]|createSuite|destroySuite") - else: - self.filter=filter - self.scopes=[""] - self.index=OrderedDict() - self.index[""]=Scope("","::","namespace",[],1) - self.function=[] - - def push_scope(self,ns,scope_t,base_classes=[]): - name = self.scopes[-1]+"::"+ns - if self.verbose>=2: - print("-- Starting "+scope_t+" "+name) - self.scopes.append(name) - self.index[name] = Scope(ns,name,scope_t,base_classes,scope_lineno-1) - - def pop_scope(self): - scope = self.scopes.pop() - if self.verbose>=2: - print("-- Stopping "+scope) - return scope - - def add_function(self, fn): - fn = str(fn) - if self.filter.search(fn): - self.index[self.scopes[-1]].function.append((fn, identifier_lineno.get(fn,lexer.lineno-1))) - tmp = self.scopes[-1]+"::"+fn - if self.verbose==2: - print("-- Function declaration "+fn+" "+tmp) - elif self.verbose==1: - print("-- Function declaration "+tmp) - - def get_functions(self,name,quiet=False): - if name == "::": - name = "" - scope = self.index[name] - fns=scope.function - for key in scope.base_classes: - cname = self.find_class(key,scope) - if cname is None: - if not quiet: - print("Defined classes: ",list(self.index.keys())) - print("WARNING: Unknown class "+key) - else: - fns += self.get_functions(cname,quiet) - return fns - - def find_class(self,name,scope): - if ':' in name: - if name in self.index: - return name - else: - return None - tmp = scope.abs_name.split(':') - name1 = ":".join(tmp[:-1] + [name]) - if name1 in self.index: - return name1 - name2 = "::"+name - if name2 in self.index: - return name2 - return None - - def __repr__(self): - return str(self) - - def is_baseclass(self,cls,base): - '''Returns true if base is a base-class of cls''' - if cls in self.index: - bases = self.index[cls] - elif "::"+cls in self.index: - bases = self.index["::"+cls] - else: - return False - #raise IOError, "Unknown class "+cls - if base in bases.base_classes: - return True - for name in bases.base_classes: - if self.is_baseclass(name,base): - return True - return False - - def __str__(self): - ans="" - keys = list(self.index.keys()) - keys.sort() - for key in keys: - scope = self.index[key] - ans += scope.scope_t+" "+scope.abs_name+"\n" - if scope.scope_t == "class": - ans += " Base Classes: "+str(scope.base_classes)+"\n" - for fn in self.get_functions(scope.abs_name): - ans += " "+fn+"\n" - else: - for fn in scope.function: - ans += " "+fn+"\n" - return ans - - -def flatten(x): - """Flatten nested list""" - try: - strtypes = str - except: # for python3 etc - strtypes = (str, bytes) - - result = [] - for el in x: - if hasattr(el, "__iter__") and not isinstance(el, strtypes): - result.extend(flatten(el)) - else: - result.append(el) - return result - -# -# The lexer (and/or a preprocessor) is expected to identify the following -# -# Punctuation: -# -# -literals = "+-*/%^&|~!<>=:()?.\'\"\\@$;," - -# -reserved = { - 'private' : 'PRIVATE', - 'protected' : 'PROTECTED', - 'public' : 'PUBLIC', - - 'bool' : 'BOOL', - 'char' : 'CHAR', - 'double' : 'DOUBLE', - 'float' : 'FLOAT', - 'int' : 'INT', - 'long' : 'LONG', - 'short' : 'SHORT', - 'signed' : 'SIGNED', - 'unsigned' : 'UNSIGNED', - 'void' : 'VOID', - 'wchar_t' : 'WCHAR_T', - - 'class' : 'CLASS', - 'enum' : 'ENUM', - 'namespace' : 'NAMESPACE', - 'struct' : 'STRUCT', - 'typename' : 'TYPENAME', - 'union' : 'UNION', - - 'const' : 'CONST', - 'volatile' : 'VOLATILE', - - 'auto' : 'AUTO', - 'explicit' : 'EXPLICIT', - 'export' : 'EXPORT', - 'extern' : 'EXTERN', - '__extension__' : 'EXTENSION', - 'friend' : 'FRIEND', - 'inline' : 'INLINE', - 'mutable' : 'MUTABLE', - 'register' : 'REGISTER', - 'static' : 'STATIC', - 'template' : 'TEMPLATE', - 'typedef' : 'TYPEDEF', - 'using' : 'USING', - 'virtual' : 'VIRTUAL', - - 'asm' : 'ASM', - 'break' : 'BREAK', - 'case' : 'CASE', - 'catch' : 'CATCH', - 'const_cast' : 'CONST_CAST', - 'continue' : 'CONTINUE', - 'default' : 'DEFAULT', - 'delete' : 'DELETE', - 'do' : 'DO', - 'dynamic_cast' : 'DYNAMIC_CAST', - 'else' : 'ELSE', - 'false' : 'FALSE', - 'for' : 'FOR', - 'goto' : 'GOTO', - 'if' : 'IF', - 'new' : 'NEW', - 'operator' : 'OPERATOR', - 'reinterpret_cast' : 'REINTERPRET_CAST', - 'return' : 'RETURN', - 'sizeof' : 'SIZEOF', - 'static_cast' : 'STATIC_CAST', - 'switch' : 'SWITCH', - 'this' : 'THIS', - 'throw' : 'THROW', - 'true' : 'TRUE', - 'try' : 'TRY', - 'typeid' : 'TYPEID', - 'while' : 'WHILE', - '"C"' : 'CLiteral', - '"C++"' : 'CppLiteral', - - '__attribute__' : 'ATTRIBUTE', - '__cdecl__' : 'CDECL', - '__typeof' : 'uTYPEOF', - 'typeof' : 'TYPEOF', - - 'CXXTEST_STD' : 'CXXTEST_STD' -} - -tokens = [ - "CharacterLiteral", - "FloatingLiteral", - "Identifier", - "IntegerLiteral", - "StringLiteral", - "RBRACE", - "LBRACE", - "RBRACKET", - "LBRACKET", - "ARROW", - "ARROW_STAR", - "DEC", - "EQ", - "GE", - "INC", - "LE", - "LOG_AND", - "LOG_OR", - "NE", - "SHL", - "SHR", - "ASS_ADD", - "ASS_AND", - "ASS_DIV", - "ASS_MOD", - "ASS_MUL", - "ASS_OR", - "ASS_SHL", - "ASS_SHR", - "ASS_SUB", - "ASS_XOR", - "DOT_STAR", - "ELLIPSIS", - "SCOPE", -] + list(reserved.values()) - -t_ignore = " \t\r" - -t_LBRACE = r"(\{)|(<%)" -t_RBRACE = r"(\})|(%>)" -t_LBRACKET = r"(\[)|(<:)" -t_RBRACKET = r"(\])|(:>)" -t_ARROW = r"->" -t_ARROW_STAR = r"->\*" -t_DEC = r"--" -t_EQ = r"==" -t_GE = r">=" -t_INC = r"\+\+" -t_LE = r"<=" -t_LOG_AND = r"&&" -t_LOG_OR = r"\|\|" -t_NE = r"!=" -t_SHL = r"<<" -t_SHR = r">>" -t_ASS_ADD = r"\+=" -t_ASS_AND = r"&=" -t_ASS_DIV = r"/=" -t_ASS_MOD = r"%=" -t_ASS_MUL = r"\*=" -t_ASS_OR = r"\|=" -t_ASS_SHL = r"<<=" -t_ASS_SHR = r">>=" -t_ASS_SUB = r"-=" -t_ASS_XOR = r"^=" -t_DOT_STAR = r"\.\*" -t_ELLIPSIS = r"\.\.\." -t_SCOPE = r"::" - -# Discard comments -def t_COMMENT(t): - r'(/\*(.|\n)*?\*/)|(//.*?\n)|(\#.*?\n)' - t.lexer.lineno += t.value.count("\n") - -t_IntegerLiteral = r'(0x[0-9A-F]+)|([0-9]+(L){0,1})' -t_FloatingLiteral = r"[0-9]+[eE\.\+-]+[eE\.\+\-0-9]+" -t_CharacterLiteral = r'\'([^\'\\]|\\.)*\'' -#t_StringLiteral = r'"([^"\\]|\\.)*"' -def t_StringLiteral(t): - r'"([^"\\]|\\.)*"' - t.type = reserved.get(t.value,'StringLiteral') - return t - -def t_Identifier(t): - r"[a-zA-Z_][a-zA-Z_0-9\.]*" - t.type = reserved.get(t.value,'Identifier') - return t - - -def t_error(t): - print("Illegal character '%s'" % t.value[0]) - #raise IOError, "Parse error" - #t.lexer.skip() - -def t_newline(t): - r'[\n]+' - t.lexer.lineno += len(t.value) - -precedence = ( - ( 'right', 'SHIFT_THERE', 'REDUCE_HERE_MOSTLY', 'SCOPE'), - ( 'nonassoc', 'ELSE', 'INC', 'DEC', '+', '-', '*', '&', 'LBRACKET', 'LBRACE', '<', ':', ')') - ) - -start = 'translation_unit' - -# -# The %prec resolves the 14.2-3 ambiguity: -# Identifier '<' is forced to go through the is-it-a-template-name test -# All names absorb TEMPLATE with the name, so that no template_test is -# performed for them. This requires all potential declarations within an -# expression to perpetuate this policy and thereby guarantee the ultimate -# coverage of explicit_instantiation. -# -# The %prec also resolves a conflict in identifier : which is forced to be a -# shift of a label for a labeled-statement rather than a reduction for the -# name of a bit-field or generalised constructor. This is pretty dubious -# syntactically but correct for all semantic possibilities. The shift is -# only activated when the ambiguity exists at the start of a statement. -# In this context a bit-field declaration or constructor definition are not -# allowed. -# - -def p_identifier(p): - '''identifier : Identifier - | CXXTEST_STD '(' Identifier ')' - ''' - if p[1][0] in ('t','T','c','d'): - identifier_lineno[p[1]] = p.lineno(1) - p[0] = p[1] - -def p_id(p): - '''id : identifier %prec SHIFT_THERE - | template_decl - | TEMPLATE id - ''' - p[0] = get_rest(p) - -def p_global_scope(p): - '''global_scope : SCOPE - ''' - p[0] = get_rest(p) - -def p_id_scope(p): - '''id_scope : id SCOPE''' - p[0] = get_rest(p) - -def p_id_scope_seq(p): - '''id_scope_seq : id_scope - | id_scope id_scope_seq - ''' - p[0] = get_rest(p) - -# -# A :: B :: C; is ambiguous How much is type and how much name ? -# The %prec maximises the (type) length which is the 7.1-2 semantic constraint. -# -def p_nested_id(p): - '''nested_id : id %prec SHIFT_THERE - | id_scope nested_id - ''' - p[0] = get_rest(p) - -def p_scoped_id(p): - '''scoped_id : nested_id - | global_scope nested_id - | id_scope_seq - | global_scope id_scope_seq - ''' - global scope_lineno - scope_lineno = lexer.lineno - data = flatten(get_rest(p)) - if data[0] != None: - p[0] = "".join(data) - -# -# destructor_id has to be held back to avoid a conflict with a one's -# complement as per 5.3.1-9, It gets put back only when scoped or in a -# declarator_id, which is only used as an explicit member name. -# Declarations of an unscoped destructor are always parsed as a one's -# complement. -# -def p_destructor_id(p): - '''destructor_id : '~' id - | TEMPLATE destructor_id - ''' - p[0]=get_rest(p) - -#def p_template_id(p): -# '''template_id : empty -# | TEMPLATE -# ''' -# pass - -def p_template_decl(p): - '''template_decl : identifier '<' nonlgt_seq_opt '>' - ''' - # - # WEH: should we include the lt/gt symbols to indicate that this is a - # template class? How is that going to be used later??? - # - #p[0] = [p[1] ,"<",">"] - p[0] = p[1] - -def p_special_function_id(p): - '''special_function_id : conversion_function_id - | operator_function_id - | TEMPLATE special_function_id - ''' - p[0]=get_rest(p) - -def p_nested_special_function_id(p): - '''nested_special_function_id : special_function_id - | id_scope destructor_id - | id_scope nested_special_function_id - ''' - p[0]=get_rest(p) - -def p_scoped_special_function_id(p): - '''scoped_special_function_id : nested_special_function_id - | global_scope nested_special_function_id - ''' - p[0]=get_rest(p) - -# declarator-id is all names in all scopes, except reserved words -def p_declarator_id(p): - '''declarator_id : scoped_id - | scoped_special_function_id - | destructor_id - ''' - p[0]=p[1] - -# -# The standard defines pseudo-destructors in terms of type-name, which is -# class/enum/typedef, of which class-name is covered by a normal destructor. -# pseudo-destructors are supposed to support ~int() in templates, so the -# grammar here covers built-in names. Other names are covered by the lack -# of identifier/type discrimination. -# -def p_built_in_type_id(p): - '''built_in_type_id : built_in_type_specifier - | built_in_type_id built_in_type_specifier - ''' - pass - -def p_pseudo_destructor_id(p): - '''pseudo_destructor_id : built_in_type_id SCOPE '~' built_in_type_id - | '~' built_in_type_id - | TEMPLATE pseudo_destructor_id - ''' - pass - -def p_nested_pseudo_destructor_id(p): - '''nested_pseudo_destructor_id : pseudo_destructor_id - | id_scope nested_pseudo_destructor_id - ''' - pass - -def p_scoped_pseudo_destructor_id(p): - '''scoped_pseudo_destructor_id : nested_pseudo_destructor_id - | global_scope scoped_pseudo_destructor_id - ''' - pass - -#------------------------------------------------------------------------------- -# A.2 Lexical conventions -#------------------------------------------------------------------------------- -# - -def p_literal(p): - '''literal : IntegerLiteral - | CharacterLiteral - | FloatingLiteral - | StringLiteral - | TRUE - | FALSE - ''' - pass - -#------------------------------------------------------------------------------- -# A.3 Basic concepts -#------------------------------------------------------------------------------- -def p_translation_unit(p): - '''translation_unit : declaration_seq_opt - ''' - pass - -#------------------------------------------------------------------------------- -# A.4 Expressions -#------------------------------------------------------------------------------- -# -# primary_expression covers an arbitrary sequence of all names with the -# exception of an unscoped destructor, which is parsed as its unary expression -# which is the correct disambiguation (when ambiguous). This eliminates the -# traditional A(B) meaning A B ambiguity, since we never have to tack an A -# onto the front of something that might start with (. The name length got -# maximised ab initio. The downside is that semantic interpretation must split -# the names up again. -# -# Unification of the declaration and expression syntax means that unary and -# binary pointer declarator operators: -# int * * name -# are parsed as binary and unary arithmetic operators (int) * (*name). Since -# type information is not used -# ambiguities resulting from a cast -# (cast)*(value) -# are resolved to favour the binary rather than the cast unary to ease AST -# clean-up. The cast-call ambiguity must be resolved to the cast to ensure -# that (a)(b)c can be parsed. -# -# The problem of the functional cast ambiguity -# name(arg) -# as call or declaration is avoided by maximising the name within the parsing -# kernel. So primary_id_expression picks up -# extern long int const var = 5; -# as an assignment to the syntax parsed as "extern long int const var". The -# presence of two names is parsed so that "extern long into const" is -# distinguished from "var" considerably simplifying subsequent -# semantic resolution. -# -# The generalised name is a concatenation of potential type-names (scoped -# identifiers or built-in sequences) plus optionally one of the special names -# such as an operator-function-id, conversion-function-id or destructor as the -# final name. -# - -def get_rest(p): - return [p[i] for i in range(1, len(p))] - -def p_primary_expression(p): - '''primary_expression : literal - | THIS - | suffix_decl_specified_ids - | abstract_expression %prec REDUCE_HERE_MOSTLY - ''' - p[0] = get_rest(p) - -# -# Abstract-expression covers the () and [] of abstract-declarators. -# -def p_abstract_expression(p): - '''abstract_expression : parenthesis_clause - | LBRACKET bexpression_opt RBRACKET - | TEMPLATE abstract_expression - ''' - pass - -def p_postfix_expression(p): - '''postfix_expression : primary_expression - | postfix_expression parenthesis_clause - | postfix_expression LBRACKET bexpression_opt RBRACKET - | postfix_expression LBRACKET bexpression_opt RBRACKET attributes - | postfix_expression '.' declarator_id - | postfix_expression '.' scoped_pseudo_destructor_id - | postfix_expression ARROW declarator_id - | postfix_expression ARROW scoped_pseudo_destructor_id - | postfix_expression INC - | postfix_expression DEC - | DYNAMIC_CAST '<' nonlgt_seq_opt '>' '(' expression ')' - | STATIC_CAST '<' nonlgt_seq_opt '>' '(' expression ')' - | REINTERPRET_CAST '<' nonlgt_seq_opt '>' '(' expression ')' - | CONST_CAST '<' nonlgt_seq_opt '>' '(' expression ')' - | TYPEID parameters_clause - ''' - #print "HERE",str(p[1]) - p[0] = get_rest(p) - -def p_bexpression_opt(p): - '''bexpression_opt : empty - | bexpression - ''' - pass - -def p_bexpression(p): - '''bexpression : nonbracket_seq - | nonbracket_seq bexpression_seq bexpression_clause nonbracket_seq_opt - | bexpression_seq bexpression_clause nonbracket_seq_opt - ''' - pass - -def p_bexpression_seq(p): - '''bexpression_seq : empty - | bexpression_seq bexpression_clause nonbracket_seq_opt - ''' - pass - -def p_bexpression_clause(p): - '''bexpression_clause : LBRACKET bexpression_opt RBRACKET - ''' - pass - - - -def p_expression_list_opt(p): - '''expression_list_opt : empty - | expression_list - ''' - pass - -def p_expression_list(p): - '''expression_list : assignment_expression - | expression_list ',' assignment_expression - ''' - pass - -def p_unary_expression(p): - '''unary_expression : postfix_expression - | INC cast_expression - | DEC cast_expression - | ptr_operator cast_expression - | suffix_decl_specified_scope star_ptr_operator cast_expression - | '+' cast_expression - | '-' cast_expression - | '!' cast_expression - | '~' cast_expression - | SIZEOF unary_expression - | new_expression - | global_scope new_expression - | delete_expression - | global_scope delete_expression - ''' - p[0] = get_rest(p) - -def p_delete_expression(p): - '''delete_expression : DELETE cast_expression - ''' - pass - -def p_new_expression(p): - '''new_expression : NEW new_type_id new_initializer_opt - | NEW parameters_clause new_type_id new_initializer_opt - | NEW parameters_clause - | NEW parameters_clause parameters_clause new_initializer_opt - ''' - pass - -def p_new_type_id(p): - '''new_type_id : type_specifier ptr_operator_seq_opt - | type_specifier new_declarator - | type_specifier new_type_id - ''' - pass - -def p_new_declarator(p): - '''new_declarator : ptr_operator new_declarator - | direct_new_declarator - ''' - pass - -def p_direct_new_declarator(p): - '''direct_new_declarator : LBRACKET bexpression_opt RBRACKET - | direct_new_declarator LBRACKET bexpression RBRACKET - ''' - pass - -def p_new_initializer_opt(p): - '''new_initializer_opt : empty - | '(' expression_list_opt ')' - ''' - pass - -# -# cast-expression is generalised to support a [] as well as a () prefix. This covers the omission of -# DELETE[] which when followed by a parenthesised expression was ambiguous. It also covers the gcc -# indexed array initialisation for free. -# -def p_cast_expression(p): - '''cast_expression : unary_expression - | abstract_expression cast_expression - ''' - p[0] = get_rest(p) - -def p_pm_expression(p): - '''pm_expression : cast_expression - | pm_expression DOT_STAR cast_expression - | pm_expression ARROW_STAR cast_expression - ''' - p[0] = get_rest(p) - -def p_multiplicative_expression(p): - '''multiplicative_expression : pm_expression - | multiplicative_expression star_ptr_operator pm_expression - | multiplicative_expression '/' pm_expression - | multiplicative_expression '%' pm_expression - ''' - p[0] = get_rest(p) - -def p_additive_expression(p): - '''additive_expression : multiplicative_expression - | additive_expression '+' multiplicative_expression - | additive_expression '-' multiplicative_expression - ''' - p[0] = get_rest(p) - -def p_shift_expression(p): - '''shift_expression : additive_expression - | shift_expression SHL additive_expression - | shift_expression SHR additive_expression - ''' - p[0] = get_rest(p) - -# | relational_expression '<' shift_expression -# | relational_expression '>' shift_expression -# | relational_expression LE shift_expression -# | relational_expression GE shift_expression -def p_relational_expression(p): - '''relational_expression : shift_expression - ''' - p[0] = get_rest(p) - -def p_equality_expression(p): - '''equality_expression : relational_expression - | equality_expression EQ relational_expression - | equality_expression NE relational_expression - ''' - p[0] = get_rest(p) - -def p_and_expression(p): - '''and_expression : equality_expression - | and_expression '&' equality_expression - ''' - p[0] = get_rest(p) - -def p_exclusive_or_expression(p): - '''exclusive_or_expression : and_expression - | exclusive_or_expression '^' and_expression - ''' - p[0] = get_rest(p) - -def p_inclusive_or_expression(p): - '''inclusive_or_expression : exclusive_or_expression - | inclusive_or_expression '|' exclusive_or_expression - ''' - p[0] = get_rest(p) - -def p_logical_and_expression(p): - '''logical_and_expression : inclusive_or_expression - | logical_and_expression LOG_AND inclusive_or_expression - ''' - p[0] = get_rest(p) - -def p_logical_or_expression(p): - '''logical_or_expression : logical_and_expression - | logical_or_expression LOG_OR logical_and_expression - ''' - p[0] = get_rest(p) - -def p_conditional_expression(p): - '''conditional_expression : logical_or_expression - | logical_or_expression '?' expression ':' assignment_expression - ''' - p[0] = get_rest(p) - - -# -# assignment-expression is generalised to cover the simple assignment of a braced initializer in order to -# contribute to the coverage of parameter-declaration and init-declaration. -# -# | logical_or_expression assignment_operator assignment_expression -def p_assignment_expression(p): - '''assignment_expression : conditional_expression - | logical_or_expression assignment_operator nonsemicolon_seq - | logical_or_expression '=' braced_initializer - | throw_expression - ''' - p[0]=get_rest(p) - -def p_assignment_operator(p): - '''assignment_operator : '=' - | ASS_ADD - | ASS_AND - | ASS_DIV - | ASS_MOD - | ASS_MUL - | ASS_OR - | ASS_SHL - | ASS_SHR - | ASS_SUB - | ASS_XOR - ''' - pass - -# -# expression is widely used and usually single-element, so the reductions are arranged so that a -# single-element expression is returned as is. Multi-element expressions are parsed as a list that -# may then behave polymorphically as an element or be compacted to an element. -# - -def p_expression(p): - '''expression : assignment_expression - | expression_list ',' assignment_expression - ''' - p[0] = get_rest(p) - -def p_constant_expression(p): - '''constant_expression : conditional_expression - ''' - pass - -#--------------------------------------------------------------------------------------------------- -# A.5 Statements -#--------------------------------------------------------------------------------------------------- -# Parsing statements is easy once simple_declaration has been generalised to cover expression_statement. -# -# -# The use of extern here is a hack. The 'extern "C" {}' block gets parsed -# as a function, so when nested 'extern "C"' declarations exist, they don't -# work because the block is viewed as a list of statements... :( -# -def p_statement(p): - '''statement : compound_statement - | declaration_statement - | try_block - | labeled_statement - | selection_statement - | iteration_statement - | jump_statement - ''' - pass - -def p_compound_statement(p): - '''compound_statement : LBRACE statement_seq_opt RBRACE - ''' - pass - -def p_statement_seq_opt(p): - '''statement_seq_opt : empty - | statement_seq_opt statement - ''' - pass - -# -# The dangling else conflict is resolved to the innermost if. -# -def p_selection_statement(p): - '''selection_statement : IF '(' condition ')' statement %prec SHIFT_THERE - | IF '(' condition ')' statement ELSE statement - | SWITCH '(' condition ')' statement - ''' - pass - -def p_condition_opt(p): - '''condition_opt : empty - | condition - ''' - pass - -def p_condition(p): - '''condition : nonparen_seq - | nonparen_seq condition_seq parameters_clause nonparen_seq_opt - | condition_seq parameters_clause nonparen_seq_opt - ''' - pass - -def p_condition_seq(p): - '''condition_seq : empty - | condition_seq parameters_clause nonparen_seq_opt - ''' - pass - -def p_labeled_statement(p): - '''labeled_statement : identifier ':' statement - | CASE constant_expression ':' statement - | DEFAULT ':' statement - ''' - pass - -def p_try_block(p): - '''try_block : TRY compound_statement handler_seq - ''' - global noExceptionLogic - noExceptionLogic=False - -def p_jump_statement(p): - '''jump_statement : BREAK ';' - | CONTINUE ';' - | RETURN nonsemicolon_seq ';' - | GOTO identifier ';' - ''' - pass - -def p_iteration_statement(p): - '''iteration_statement : WHILE '(' condition ')' statement - | DO statement WHILE '(' expression ')' ';' - | FOR '(' nonparen_seq_opt ')' statement - ''' - pass - -def p_declaration_statement(p): - '''declaration_statement : block_declaration - ''' - pass - -#--------------------------------------------------------------------------------------------------- -# A.6 Declarations -#--------------------------------------------------------------------------------------------------- -def p_compound_declaration(p): - '''compound_declaration : LBRACE declaration_seq_opt RBRACE - ''' - pass - -def p_declaration_seq_opt(p): - '''declaration_seq_opt : empty - | declaration_seq_opt declaration - ''' - pass - -def p_declaration(p): - '''declaration : block_declaration - | function_definition - | template_declaration - | explicit_specialization - | specialised_declaration - ''' - pass - -def p_specialised_declaration(p): - '''specialised_declaration : linkage_specification - | namespace_definition - | TEMPLATE specialised_declaration - ''' - pass - -def p_block_declaration(p): - '''block_declaration : simple_declaration - | specialised_block_declaration - ''' - pass - -def p_specialised_block_declaration(p): - '''specialised_block_declaration : asm_definition - | namespace_alias_definition - | using_declaration - | using_directive - | TEMPLATE specialised_block_declaration - ''' - pass - -def p_simple_declaration(p): - '''simple_declaration : ';' - | init_declaration ';' - | init_declarations ';' - | decl_specifier_prefix simple_declaration - ''' - global _parse_info - if len(p) == 3: - if p[2] == ";": - decl = p[1] - else: - decl = p[2] - if decl is not None: - fp = flatten(decl) - if len(fp) >= 2 and fp[0] is not None and fp[0]!="operator" and fp[1] == '(': - p[0] = fp[0] - _parse_info.add_function(fp[0]) - -# -# A decl-specifier following a ptr_operator provokes a shift-reduce conflict for * const name which is resolved in favour of the pointer, and implemented by providing versions of decl-specifier guaranteed not to start with a cv_qualifier. decl-specifiers are implemented type-centrically. That is the semantic constraint that there must be a type is exploited to impose structure, but actually eliminate very little syntax. built-in types are multi-name and so need a different policy. -# -# non-type decl-specifiers are bound to the left-most type in a decl-specifier-seq, by parsing from the right and attaching suffixes to the right-hand type. Finally residual prefixes attach to the left. -# -def p_suffix_built_in_decl_specifier_raw(p): - '''suffix_built_in_decl_specifier_raw : built_in_type_specifier - | suffix_built_in_decl_specifier_raw built_in_type_specifier - | suffix_built_in_decl_specifier_raw decl_specifier_suffix - ''' - pass - -def p_suffix_built_in_decl_specifier(p): - '''suffix_built_in_decl_specifier : suffix_built_in_decl_specifier_raw - | TEMPLATE suffix_built_in_decl_specifier - ''' - pass - -# | id_scope_seq -# | SCOPE id_scope_seq -def p_suffix_named_decl_specifier(p): - '''suffix_named_decl_specifier : scoped_id - | elaborate_type_specifier - | suffix_named_decl_specifier decl_specifier_suffix - ''' - p[0]=get_rest(p) - -def p_suffix_named_decl_specifier_bi(p): - '''suffix_named_decl_specifier_bi : suffix_named_decl_specifier - | suffix_named_decl_specifier suffix_built_in_decl_specifier_raw - ''' - p[0] = get_rest(p) - #print "HERE",get_rest(p) - -def p_suffix_named_decl_specifiers(p): - '''suffix_named_decl_specifiers : suffix_named_decl_specifier_bi - | suffix_named_decl_specifiers suffix_named_decl_specifier_bi - ''' - p[0] = get_rest(p) - -def p_suffix_named_decl_specifiers_sf(p): - '''suffix_named_decl_specifiers_sf : scoped_special_function_id - | suffix_named_decl_specifiers - | suffix_named_decl_specifiers scoped_special_function_id - ''' - #print "HERE",get_rest(p) - p[0] = get_rest(p) - -def p_suffix_decl_specified_ids(p): - '''suffix_decl_specified_ids : suffix_built_in_decl_specifier - | suffix_built_in_decl_specifier suffix_named_decl_specifiers_sf - | suffix_named_decl_specifiers_sf - ''' - if len(p) == 3: - p[0] = p[2] - else: - p[0] = p[1] - -def p_suffix_decl_specified_scope(p): - '''suffix_decl_specified_scope : suffix_named_decl_specifiers SCOPE - | suffix_built_in_decl_specifier suffix_named_decl_specifiers SCOPE - | suffix_built_in_decl_specifier SCOPE - ''' - p[0] = get_rest(p) - -def p_decl_specifier_affix(p): - '''decl_specifier_affix : storage_class_specifier - | function_specifier - | FRIEND - | TYPEDEF - | cv_qualifier - ''' - pass - -def p_decl_specifier_suffix(p): - '''decl_specifier_suffix : decl_specifier_affix - ''' - pass - -def p_decl_specifier_prefix(p): - '''decl_specifier_prefix : decl_specifier_affix - | TEMPLATE decl_specifier_prefix - ''' - pass - -def p_storage_class_specifier(p): - '''storage_class_specifier : REGISTER - | STATIC - | MUTABLE - | EXTERN %prec SHIFT_THERE - | EXTENSION - | AUTO - ''' - pass - -def p_function_specifier(p): - '''function_specifier : EXPLICIT - | INLINE - | VIRTUAL - ''' - pass - -def p_type_specifier(p): - '''type_specifier : simple_type_specifier - | elaborate_type_specifier - | cv_qualifier - ''' - pass - -def p_elaborate_type_specifier(p): - '''elaborate_type_specifier : class_specifier - | enum_specifier - | elaborated_type_specifier - | TEMPLATE elaborate_type_specifier - ''' - pass - -def p_simple_type_specifier(p): - '''simple_type_specifier : scoped_id - | scoped_id attributes - | built_in_type_specifier - ''' - p[0] = p[1] - -def p_built_in_type_specifier(p): - '''built_in_type_specifier : Xbuilt_in_type_specifier - | Xbuilt_in_type_specifier attributes - ''' - pass - -def p_attributes(p): - '''attributes : attribute - | attributes attribute - ''' - pass - -def p_attribute(p): - '''attribute : ATTRIBUTE '(' parameters_clause ')' - ''' - -def p_Xbuilt_in_type_specifier(p): - '''Xbuilt_in_type_specifier : CHAR - | WCHAR_T - | BOOL - | SHORT - | INT - | LONG - | SIGNED - | UNSIGNED - | FLOAT - | DOUBLE - | VOID - | uTYPEOF parameters_clause - | TYPEOF parameters_clause - ''' - pass - -# -# The over-general use of declaration_expression to cover decl-specifier-seq_opt declarator in a function-definition means that -# class X { }; -# could be a function-definition or a class-specifier. -# enum X { }; -# could be a function-definition or an enum-specifier. -# The function-definition is not syntactically valid so resolving the false conflict in favour of the -# elaborated_type_specifier is correct. -# -def p_elaborated_type_specifier(p): - '''elaborated_type_specifier : class_key scoped_id %prec SHIFT_THERE - | elaborated_enum_specifier - | TYPENAME scoped_id - ''' - pass - -def p_elaborated_enum_specifier(p): - '''elaborated_enum_specifier : ENUM scoped_id %prec SHIFT_THERE - ''' - pass - -def p_enum_specifier(p): - '''enum_specifier : ENUM scoped_id enumerator_clause - | ENUM enumerator_clause - ''' - pass - -def p_enumerator_clause(p): - '''enumerator_clause : LBRACE enumerator_list_ecarb - | LBRACE enumerator_list enumerator_list_ecarb - | LBRACE enumerator_list ',' enumerator_definition_ecarb - ''' - pass - -def p_enumerator_list_ecarb(p): - '''enumerator_list_ecarb : RBRACE - ''' - pass - -def p_enumerator_definition_ecarb(p): - '''enumerator_definition_ecarb : RBRACE - ''' - pass - -def p_enumerator_definition_filler(p): - '''enumerator_definition_filler : empty - ''' - pass - -def p_enumerator_list_head(p): - '''enumerator_list_head : enumerator_definition_filler - | enumerator_list ',' enumerator_definition_filler - ''' - pass - -def p_enumerator_list(p): - '''enumerator_list : enumerator_list_head enumerator_definition - ''' - pass - -def p_enumerator_definition(p): - '''enumerator_definition : enumerator - | enumerator '=' constant_expression - ''' - pass - -def p_enumerator(p): - '''enumerator : identifier - ''' - pass - -def p_namespace_definition(p): - '''namespace_definition : NAMESPACE scoped_id push_scope compound_declaration - | NAMESPACE push_scope compound_declaration - ''' - global _parse_info - scope = _parse_info.pop_scope() - -def p_namespace_alias_definition(p): - '''namespace_alias_definition : NAMESPACE scoped_id '=' scoped_id ';' - ''' - pass - -def p_push_scope(p): - '''push_scope : empty''' - global _parse_info - if p[-2] == "namespace": - scope=p[-1] - else: - scope="" - _parse_info.push_scope(scope,"namespace") - -def p_using_declaration(p): - '''using_declaration : USING declarator_id ';' - | USING TYPENAME declarator_id ';' - ''' - pass - -def p_using_directive(p): - '''using_directive : USING NAMESPACE scoped_id ';' - ''' - pass - -# '''asm_definition : ASM '(' StringLiteral ')' ';' -def p_asm_definition(p): - '''asm_definition : ASM '(' nonparen_seq_opt ')' ';' - ''' - pass - -def p_linkage_specification(p): - '''linkage_specification : EXTERN CLiteral declaration - | EXTERN CLiteral compound_declaration - | EXTERN CppLiteral declaration - | EXTERN CppLiteral compound_declaration - ''' - pass - -#--------------------------------------------------------------------------------------------------- -# A.7 Declarators -#--------------------------------------------------------------------------------------------------- -# -# init-declarator is named init_declaration to reflect the embedded decl-specifier-seq_opt -# - -def p_init_declarations(p): - '''init_declarations : assignment_expression ',' init_declaration - | init_declarations ',' init_declaration - ''' - p[0]=get_rest(p) - -def p_init_declaration(p): - '''init_declaration : assignment_expression - ''' - p[0]=get_rest(p) - -def p_star_ptr_operator(p): - '''star_ptr_operator : '*' - | star_ptr_operator cv_qualifier - ''' - pass - -def p_nested_ptr_operator(p): - '''nested_ptr_operator : star_ptr_operator - | id_scope nested_ptr_operator - ''' - pass - -def p_ptr_operator(p): - '''ptr_operator : '&' - | nested_ptr_operator - | global_scope nested_ptr_operator - ''' - pass - -def p_ptr_operator_seq(p): - '''ptr_operator_seq : ptr_operator - | ptr_operator ptr_operator_seq - ''' - pass - -# -# Independently coded to localise the shift-reduce conflict: sharing just needs another %prec -# -def p_ptr_operator_seq_opt(p): - '''ptr_operator_seq_opt : empty %prec SHIFT_THERE - | ptr_operator ptr_operator_seq_opt - ''' - pass - -def p_cv_qualifier_seq_opt(p): - '''cv_qualifier_seq_opt : empty - | cv_qualifier_seq_opt cv_qualifier - ''' - pass - -# TODO: verify that we should include attributes here -def p_cv_qualifier(p): - '''cv_qualifier : CONST - | VOLATILE - | attributes - ''' - pass - -def p_type_id(p): - '''type_id : type_specifier abstract_declarator_opt - | type_specifier type_id - ''' - pass - -def p_abstract_declarator_opt(p): - '''abstract_declarator_opt : empty - | ptr_operator abstract_declarator_opt - | direct_abstract_declarator - ''' - pass - -def p_direct_abstract_declarator_opt(p): - '''direct_abstract_declarator_opt : empty - | direct_abstract_declarator - ''' - pass - -def p_direct_abstract_declarator(p): - '''direct_abstract_declarator : direct_abstract_declarator_opt parenthesis_clause - | direct_abstract_declarator_opt LBRACKET RBRACKET - | direct_abstract_declarator_opt LBRACKET bexpression RBRACKET - ''' - pass - -def p_parenthesis_clause(p): - '''parenthesis_clause : parameters_clause cv_qualifier_seq_opt - | parameters_clause cv_qualifier_seq_opt exception_specification - ''' - p[0] = ['(',')'] - -def p_parameters_clause(p): - '''parameters_clause : '(' condition_opt ')' - ''' - p[0] = ['(',')'] - -# -# A typed abstract qualifier such as -# Class * ... -# looks like a multiply, so pointers are parsed as their binary operation equivalents that -# ultimately terminate with a degenerate right hand term. -# -def p_abstract_pointer_declaration(p): - '''abstract_pointer_declaration : ptr_operator_seq - | multiplicative_expression star_ptr_operator ptr_operator_seq_opt - ''' - pass - -def p_abstract_parameter_declaration(p): - '''abstract_parameter_declaration : abstract_pointer_declaration - | and_expression '&' - | and_expression '&' abstract_pointer_declaration - ''' - pass - -def p_special_parameter_declaration(p): - '''special_parameter_declaration : abstract_parameter_declaration - | abstract_parameter_declaration '=' assignment_expression - | ELLIPSIS - ''' - pass - -def p_parameter_declaration(p): - '''parameter_declaration : assignment_expression - | special_parameter_declaration - | decl_specifier_prefix parameter_declaration - ''' - pass - -# -# function_definition includes constructor, destructor, implicit int definitions too. A local destructor is successfully parsed as a function-declaration but the ~ was treated as a unary operator. constructor_head is the prefix ambiguity between a constructor and a member-init-list starting with a bit-field. -# -def p_function_definition(p): - '''function_definition : ctor_definition - | func_definition - ''' - pass - -def p_func_definition(p): - '''func_definition : assignment_expression function_try_block - | assignment_expression function_body - | decl_specifier_prefix func_definition - ''' - global _parse_info - if p[2] is not None and p[2][0] == '{': - decl = flatten(p[1]) - #print "HERE",decl - if decl[-1] == ')': - decl=decl[-3] - else: - decl=decl[-1] - p[0] = decl - if decl != "operator": - _parse_info.add_function(decl) - else: - p[0] = p[2] - -def p_ctor_definition(p): - '''ctor_definition : constructor_head function_try_block - | constructor_head function_body - | decl_specifier_prefix ctor_definition - ''' - if p[2] is None or p[2][0] == "try" or p[2][0] == '{': - p[0]=p[1] - else: - p[0]=p[1] - -def p_constructor_head(p): - '''constructor_head : bit_field_init_declaration - | constructor_head ',' assignment_expression - ''' - p[0]=p[1] - -def p_function_try_block(p): - '''function_try_block : TRY function_block handler_seq - ''' - global noExceptionLogic - noExceptionLogic=False - p[0] = ['try'] - -def p_function_block(p): - '''function_block : ctor_initializer_opt function_body - ''' - pass - -def p_function_body(p): - '''function_body : LBRACE nonbrace_seq_opt RBRACE - ''' - p[0] = ['{','}'] - -def p_initializer_clause(p): - '''initializer_clause : assignment_expression - | braced_initializer - ''' - pass - -def p_braced_initializer(p): - '''braced_initializer : LBRACE initializer_list RBRACE - | LBRACE initializer_list ',' RBRACE - | LBRACE RBRACE - ''' - pass - -def p_initializer_list(p): - '''initializer_list : initializer_clause - | initializer_list ',' initializer_clause - ''' - pass - -#--------------------------------------------------------------------------------------------------- -# A.8 Classes -#--------------------------------------------------------------------------------------------------- -# -# An anonymous bit-field declaration may look very like inheritance: -# const int B = 3; -# class A : B ; -# The two usages are too distant to try to create and enforce a common prefix so we have to resort to -# a parser hack by backtracking. Inheritance is much the most likely so we mark the input stream context -# and try to parse a base-clause. If we successfully reach a { the base-clause is ok and inheritance was -# the correct choice so we unmark and continue. If we fail to find the { an error token causes -# back-tracking to the alternative parse in elaborated_type_specifier which regenerates the : and -# declares unconditional success. -# - -def p_class_specifier_head(p): - '''class_specifier_head : class_key scoped_id ':' base_specifier_list LBRACE - | class_key ':' base_specifier_list LBRACE - | class_key scoped_id LBRACE - | class_key LBRACE - ''' - global _parse_info - base_classes=[] - if len(p) == 6: - scope = p[2] - base_classes = p[4] - elif len(p) == 4: - scope = p[2] - elif len(p) == 5: - base_classes = p[3] - else: - scope = "" - _parse_info.push_scope(scope,p[1],base_classes) - - -def p_class_key(p): - '''class_key : CLASS - | STRUCT - | UNION - ''' - p[0] = p[1] - -def p_class_specifier(p): - '''class_specifier : class_specifier_head member_specification_opt RBRACE - ''' - scope = _parse_info.pop_scope() - -def p_member_specification_opt(p): - '''member_specification_opt : empty - | member_specification_opt member_declaration - ''' - pass - -def p_member_declaration(p): - '''member_declaration : accessibility_specifier - | simple_member_declaration - | function_definition - | using_declaration - | template_declaration - ''' - p[0] = get_rest(p) - #print "Decl",get_rest(p) - -# -# The generality of constructor names (there need be no parenthesised argument list) means that that -# name : f(g), h(i) -# could be the start of a constructor or the start of an anonymous bit-field. An ambiguity is avoided by -# parsing the ctor-initializer of a function_definition as a bit-field. -# -def p_simple_member_declaration(p): - '''simple_member_declaration : ';' - | assignment_expression ';' - | constructor_head ';' - | member_init_declarations ';' - | decl_specifier_prefix simple_member_declaration - ''' - global _parse_info - decl = flatten(get_rest(p)) - if len(decl) >= 4 and decl[-3] == "(": - _parse_info.add_function(decl[-4]) - -def p_member_init_declarations(p): - '''member_init_declarations : assignment_expression ',' member_init_declaration - | constructor_head ',' bit_field_init_declaration - | member_init_declarations ',' member_init_declaration - ''' - pass - -def p_member_init_declaration(p): - '''member_init_declaration : assignment_expression - | bit_field_init_declaration - ''' - pass - -def p_accessibility_specifier(p): - '''accessibility_specifier : access_specifier ':' - ''' - pass - -def p_bit_field_declaration(p): - '''bit_field_declaration : assignment_expression ':' bit_field_width - | ':' bit_field_width - ''' - if len(p) == 4: - p[0]=p[1] - -def p_bit_field_width(p): - '''bit_field_width : logical_or_expression - | logical_or_expression '?' bit_field_width ':' bit_field_width - ''' - pass - -def p_bit_field_init_declaration(p): - '''bit_field_init_declaration : bit_field_declaration - | bit_field_declaration '=' initializer_clause - ''' - pass - -#--------------------------------------------------------------------------------------------------- -# A.9 Derived classes -#--------------------------------------------------------------------------------------------------- -def p_base_specifier_list(p): - '''base_specifier_list : base_specifier - | base_specifier_list ',' base_specifier - ''' - if len(p) == 2: - p[0] = [p[1]] - else: - p[0] = p[1]+[p[3]] - -def p_base_specifier(p): - '''base_specifier : scoped_id - | access_specifier base_specifier - | VIRTUAL base_specifier - ''' - if len(p) == 2: - p[0] = p[1] - else: - p[0] = p[2] - -def p_access_specifier(p): - '''access_specifier : PRIVATE - | PROTECTED - | PUBLIC - ''' - pass - -#--------------------------------------------------------------------------------------------------- -# A.10 Special member functions -#--------------------------------------------------------------------------------------------------- -def p_conversion_function_id(p): - '''conversion_function_id : OPERATOR conversion_type_id - ''' - p[0] = ['operator'] - -def p_conversion_type_id(p): - '''conversion_type_id : type_specifier ptr_operator_seq_opt - | type_specifier conversion_type_id - ''' - pass - -# -# Ctor-initialisers can look like a bit field declaration, given the generalisation of names: -# Class(Type) : m1(1), m2(2) { } -# NonClass(bit_field) : int(2), second_variable, ... -# The grammar below is used within a function_try_block or function_definition. -# See simple_member_declaration for use in normal member function_definition. -# -def p_ctor_initializer_opt(p): - '''ctor_initializer_opt : empty - | ctor_initializer - ''' - pass - -def p_ctor_initializer(p): - '''ctor_initializer : ':' mem_initializer_list - ''' - pass - -def p_mem_initializer_list(p): - '''mem_initializer_list : mem_initializer - | mem_initializer_list_head mem_initializer - ''' - pass - -def p_mem_initializer_list_head(p): - '''mem_initializer_list_head : mem_initializer_list ',' - ''' - pass - -def p_mem_initializer(p): - '''mem_initializer : mem_initializer_id '(' expression_list_opt ')' - ''' - pass - -def p_mem_initializer_id(p): - '''mem_initializer_id : scoped_id - ''' - pass - -#--------------------------------------------------------------------------------------------------- -# A.11 Overloading -#--------------------------------------------------------------------------------------------------- - -def p_operator_function_id(p): - '''operator_function_id : OPERATOR operator - | OPERATOR '(' ')' - | OPERATOR LBRACKET RBRACKET - | OPERATOR '<' - | OPERATOR '>' - | OPERATOR operator '<' nonlgt_seq_opt '>' - ''' - p[0] = ["operator"] - -# -# It is not clear from the ANSI standard whether spaces are permitted in delete[]. If not then it can -# be recognised and returned as DELETE_ARRAY by the lexer. Assuming spaces are permitted there is an -# ambiguity created by the over generalised nature of expressions. operator new is a valid delarator-id -# which we may have an undimensioned array of. Semantic rubbish, but syntactically valid. Since the -# array form is covered by the declarator consideration we can exclude the operator here. The need -# for a semantic rescue can be eliminated at the expense of a couple of shift-reduce conflicts by -# removing the comments on the next four lines. -# -def p_operator(p): - '''operator : NEW - | DELETE - | '+' - | '-' - | '*' - | '/' - | '%' - | '^' - | '&' - | '|' - | '~' - | '!' - | '=' - | ASS_ADD - | ASS_SUB - | ASS_MUL - | ASS_DIV - | ASS_MOD - | ASS_XOR - | ASS_AND - | ASS_OR - | SHL - | SHR - | ASS_SHR - | ASS_SHL - | EQ - | NE - | LE - | GE - | LOG_AND - | LOG_OR - | INC - | DEC - | ',' - | ARROW_STAR - | ARROW - ''' - p[0]=p[1] - -# | IF -# | SWITCH -# | WHILE -# | FOR -# | DO -def p_reserved(p): - '''reserved : PRIVATE - | CLiteral - | CppLiteral - | IF - | SWITCH - | WHILE - | FOR - | DO - | PROTECTED - | PUBLIC - | BOOL - | CHAR - | DOUBLE - | FLOAT - | INT - | LONG - | SHORT - | SIGNED - | UNSIGNED - | VOID - | WCHAR_T - | CLASS - | ENUM - | NAMESPACE - | STRUCT - | TYPENAME - | UNION - | CONST - | VOLATILE - | AUTO - | EXPLICIT - | EXPORT - | EXTERN - | FRIEND - | INLINE - | MUTABLE - | REGISTER - | STATIC - | TEMPLATE - | TYPEDEF - | USING - | VIRTUAL - | ASM - | BREAK - | CASE - | CATCH - | CONST_CAST - | CONTINUE - | DEFAULT - | DYNAMIC_CAST - | ELSE - | FALSE - | GOTO - | OPERATOR - | REINTERPRET_CAST - | RETURN - | SIZEOF - | STATIC_CAST - | THIS - | THROW - | TRUE - | TRY - | TYPEID - | ATTRIBUTE - | CDECL - | TYPEOF - | uTYPEOF - ''' - if p[1] in ('try', 'catch', 'throw'): - global noExceptionLogic - noExceptionLogic=False - -#--------------------------------------------------------------------------------------------------- -# A.12 Templates -#--------------------------------------------------------------------------------------------------- -def p_template_declaration(p): - '''template_declaration : template_parameter_clause declaration - | EXPORT template_declaration - ''' - pass - -def p_template_parameter_clause(p): - '''template_parameter_clause : TEMPLATE '<' nonlgt_seq_opt '>' - ''' - pass - -# -# Generalised naming makes identifier a valid declaration, so TEMPLATE identifier is too. -# The TEMPLATE prefix is therefore folded into all names, parenthesis_clause and decl_specifier_prefix. -# -# explicit_instantiation: TEMPLATE declaration -# -def p_explicit_specialization(p): - '''explicit_specialization : TEMPLATE '<' '>' declaration - ''' - pass - -#--------------------------------------------------------------------------------------------------- -# A.13 Exception Handling -#--------------------------------------------------------------------------------------------------- -def p_handler_seq(p): - '''handler_seq : handler - | handler handler_seq - ''' - pass - -def p_handler(p): - '''handler : CATCH '(' exception_declaration ')' compound_statement - ''' - global noExceptionLogic - noExceptionLogic=False - -def p_exception_declaration(p): - '''exception_declaration : parameter_declaration - ''' - pass - -def p_throw_expression(p): - '''throw_expression : THROW - | THROW assignment_expression - ''' - global noExceptionLogic - noExceptionLogic=False - -def p_exception_specification(p): - '''exception_specification : THROW '(' ')' - | THROW '(' type_id_list ')' - ''' - global noExceptionLogic - noExceptionLogic=False - -def p_type_id_list(p): - '''type_id_list : type_id - | type_id_list ',' type_id - ''' - pass - -#--------------------------------------------------------------------------------------------------- -# Misc productions -#--------------------------------------------------------------------------------------------------- -def p_nonsemicolon_seq(p): - '''nonsemicolon_seq : empty - | nonsemicolon_seq nonsemicolon - ''' - pass - -def p_nonsemicolon(p): - '''nonsemicolon : misc - | '(' - | ')' - | '<' - | '>' - | LBRACKET nonbracket_seq_opt RBRACKET - | LBRACE nonbrace_seq_opt RBRACE - ''' - pass - -def p_nonparen_seq_opt(p): - '''nonparen_seq_opt : empty - | nonparen_seq_opt nonparen - ''' - pass - -def p_nonparen_seq(p): - '''nonparen_seq : nonparen - | nonparen_seq nonparen - ''' - pass - -def p_nonparen(p): - '''nonparen : misc - | '<' - | '>' - | ';' - | LBRACKET nonbracket_seq_opt RBRACKET - | LBRACE nonbrace_seq_opt RBRACE - ''' - pass - -def p_nonbracket_seq_opt(p): - '''nonbracket_seq_opt : empty - | nonbracket_seq_opt nonbracket - ''' - pass - -def p_nonbracket_seq(p): - '''nonbracket_seq : nonbracket - | nonbracket_seq nonbracket - ''' - pass - -def p_nonbracket(p): - '''nonbracket : misc - | '<' - | '>' - | '(' - | ')' - | ';' - | LBRACKET nonbracket_seq_opt RBRACKET - | LBRACE nonbrace_seq_opt RBRACE - ''' - pass - -def p_nonbrace_seq_opt(p): - '''nonbrace_seq_opt : empty - | nonbrace_seq_opt nonbrace - ''' - pass - -def p_nonbrace(p): - '''nonbrace : misc - | '<' - | '>' - | '(' - | ')' - | ';' - | LBRACKET nonbracket_seq_opt RBRACKET - | LBRACE nonbrace_seq_opt RBRACE - ''' - pass - -def p_nonlgt_seq_opt(p): - '''nonlgt_seq_opt : empty - | nonlgt_seq_opt nonlgt - ''' - pass - -def p_nonlgt(p): - '''nonlgt : misc - | '(' - | ')' - | LBRACKET nonbracket_seq_opt RBRACKET - | '<' nonlgt_seq_opt '>' - | ';' - ''' - pass - -def p_misc(p): - '''misc : operator - | identifier - | IntegerLiteral - | CharacterLiteral - | FloatingLiteral - | StringLiteral - | reserved - | '?' - | ':' - | '.' - | SCOPE - | ELLIPSIS - | EXTENSION - ''' - pass - -def p_empty(p): - '''empty : ''' - pass - - - -# -# Compute column. -# input is the input text string -# token is a token instance -# -def _find_column(input,token): - ''' TODO ''' - i = token.lexpos - while i > 0: - if input[i] == '\n': break - i -= 1 - column = (token.lexpos - i)+1 - return column - -def p_error(p): - if p is None: - tmp = "Syntax error at end of file." - else: - tmp = "Syntax error at token " - if p.type is "": - tmp = tmp + "''" - else: - tmp = tmp + str(p.type) - tmp = tmp + " with value '"+str(p.value)+"'" - tmp = tmp + " in line " + str(lexer.lineno-1) - tmp = tmp + " at column "+str(_find_column(_parsedata,p)) - raise IOError( tmp ) - - - -# -# The function that performs the parsing -# -def parse_cpp(data=None, filename=None, debug=0, optimize=0, verbose=False, func_filter=None): - # - # Reset global data - # - global lexer - lexer = None - global scope_lineno - scope_lineno = 0 - global indentifier_lineno - identifier_lineno = {} - global _parse_info - _parse_info=None - global _parsedata - _parsedata=None - global noExceptionLogic - noExceptionLogic = True - # - if debug > 0: - print("Debugging parse_cpp!") - # - # Always remove the parser.out file, which is generated to create debugging - # - if os.path.exists("parser.out"): - os.remove("parser.out") - # - # Remove the parsetab.py* files. These apparently need to be removed - # to ensure the creation of a parser.out file. - # - if os.path.exists("parsetab.py"): - os.remove("parsetab.py") - if os.path.exists("parsetab.pyc"): - os.remove("parsetab.pyc") - global debugging - debugging=True - # - # Build lexer - # - lexer = lex.lex() - # - # Initialize parse object - # - _parse_info = CppInfo(filter=func_filter) - _parse_info.verbose=verbose - # - # Build yaccer - # - write_table = not os.path.exists("parsetab.py") - yacc.yacc(debug=debug, optimize=optimize, write_tables=write_table) - # - # Parse the file - # - if not data is None: - _parsedata=data - ply_init(_parsedata) - yacc.parse(data,debug=debug) - elif not filename is None: - f = open(filename) - data = f.read() - f.close() - _parsedata=data - ply_init(_parsedata) - yacc.parse(data, debug=debug) - else: - return None - # - if not noExceptionLogic: - _parse_info.noExceptionLogic = False - else: - for key in identifier_lineno: - if 'ASSERT_THROWS' in key: - _parse_info.noExceptionLogic = False - break - _parse_info.noExceptionLogic = True - # - return _parse_info - - - -import sys - -if __name__ == '__main__': #pragma: no cover - # - # This MAIN routine parses a sequence of files provided at the command - # line. If '-v' is included, then a verbose parsing output is - # generated. - # - for arg in sys.argv[1:]: - if arg == "-v": - continue - print("Parsing file '"+arg+"'") - if '-v' in sys.argv: - parse_cpp(filename=arg,debug=2,verbose=2) - else: - parse_cpp(filename=arg,verbose=2) - # - # Print the _parse_info object summary for this file. - # This illustrates how class inheritance can be used to - # deduce class members. - # - print(str(_parse_info)) - diff --git a/noarch/lib/py/cxxtest/python/python3/cxxtest/cxxtest_fog.py b/noarch/lib/py/cxxtest/python/python3/cxxtest/cxxtest_fog.py deleted file mode 100644 index 45dc9406..00000000 --- a/noarch/lib/py/cxxtest/python/python3/cxxtest/cxxtest_fog.py +++ /dev/null @@ -1,99 +0,0 @@ -#------------------------------------------------------------------------- -# CxxTest: A lightweight C++ unit testing library. -# Copyright (c) 2008 Sandia Corporation. -# This software is distributed under the LGPL License v3 -# For more information, see the COPYING file in the top CxxTest directory. -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -#------------------------------------------------------------------------- - -# -# TODO: add line number info -# TODO: add test function names -# - - - -import sys -import re -from .cxxtest_misc import abort -from . import cxx_parser -import re - -def cstr( str ): - '''Convert a string to its C representation''' - return '"' + re.sub('\\\\', '\\\\\\\\', str ) + '"' - -def scanInputFiles(files, _options): - '''Scan all input files for test suites''' - suites=[] - for file in files: - try: - print("Parsing file "+file, end=' ') - sys.stdout.flush() - parse_info = cxx_parser.parse_cpp(filename=file,optimize=1) - except IOError as err: - print(" error.") - print(str(err)) - continue - print("done.") - sys.stdout.flush() - # - # WEH: see if it really makes sense to use parse information to - # initialize this data. I don't think so... - # - _options.haveStandardLibrary=1 - if not parse_info.noExceptionLogic: - _options.haveExceptionHandling=1 - # - keys = list(parse_info.index.keys()) - tpat = re.compile("[Tt][Ee][Ss][Tt]") - for key in keys: - if parse_info.index[key].scope_t == "class" and parse_info.is_baseclass(key,"CxxTest::TestSuite"): - name=parse_info.index[key].name - if key.startswith('::'): - fullname = key[2:] - else: - fullname = key - suite = { - 'fullname' : fullname, - 'name' : name, - 'file' : file, - 'cfile' : cstr(file), - 'line' : str(parse_info.index[key].lineno), - 'generated' : 0, - 'object' : 'suite_%s' % fullname.replace('::','_'), - 'dobject' : 'suiteDescription_%s' % fullname.replace('::','_'), - 'tlist' : 'Tests_%s' % fullname.replace('::','_'), - 'tests' : [], - 'lines' : [] } - for fn in parse_info.get_functions(key,quiet=True): - tname = fn[0] - lineno = str(fn[1]) - if tname.startswith('createSuite'): - # Indicate that we're using a dynamically generated test suite - suite['create'] = str(lineno) # (unknown line) - if tname.startswith('destroySuite'): - # Indicate that we're using a dynamically generated test suite - suite['destroy'] = str(lineno) # (unknown line) - if not tpat.match(tname): - # Skip non-test methods - continue - test = { 'name' : tname, - 'suite' : suite, - 'class' : 'TestDescription_suite_%s_%s' % (suite['fullname'].replace('::','_'), tname), - 'object' : 'testDescription_suite_%s_%s' % (suite['fullname'].replace('::','_'), tname), - 'line' : lineno, - } - suite['tests'].append(test) - suites.append(suite) - - if not _options.root: - ntests = 0 - for suite in suites: - ntests += len(suite['tests']) - if ntests == 0: - abort( 'No tests defined' ) - # - return [_options, suites] - diff --git a/noarch/lib/py/cxxtest/python/python3/cxxtest/cxxtest_misc.py b/noarch/lib/py/cxxtest/python/python3/cxxtest/cxxtest_misc.py deleted file mode 100644 index c9d337e2..00000000 --- a/noarch/lib/py/cxxtest/python/python3/cxxtest/cxxtest_misc.py +++ /dev/null @@ -1,78 +0,0 @@ -#------------------------------------------------------------------------- -# CxxTest: A lightweight C++ unit testing library. -# Copyright (c) 2008 Sandia Corporation. -# This software is distributed under the LGPL License v3 -# For more information, see the COPYING file in the top CxxTest directory. -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -#------------------------------------------------------------------------- - -import sys -import os - -def abort( problem ): - '''Print error message and exit''' - sys.stderr.write( '\n' ) - sys.stderr.write( problem ) - sys.stderr.write( '\n\n' ) - sys.exit(2) - -if sys.version_info < (2,6): #pragma: no cover - def resolve_symlinks(orig_path): - drive,tmp = os.path.splitdrive(os.path.normpath(orig_path)) - if not drive: - drive = os.path.sep - parts = tmp.split(os.path.sep) - actual_path = [drive] - while parts: - actual_path.append(parts.pop(0)) - if not os.path.islink(os.path.join(*actual_path)): - continue - actual_path[-1] = os.readlink(os.path.join(*actual_path)) - tmp_drive, tmp_path = os.path.splitdrive( - dereference_path(os.path.join(*actual_path)) ) - if tmp_drive: - drive = tmp_drive - actual_path = [drive] + tmp_path.split(os.path.sep) - return os.path.join(*actual_path) - - def relpath(path, start=None): - """Return a relative version of a path. - (provides compatibility with Python < 2.6)""" - # Some notes on implementation: - # - We rely on resolve_symlinks to correctly resolve any symbolic - # links that may be present in the paths - # - The explicit handling od the drive name is critical for proper - # function on Windows (because os.path.join('c:','foo') yields - # "c:foo"!). - if not start: - start = os.getcwd() - ref_drive, ref_path = os.path.splitdrive( - resolve_symlinks(os.path.abspath(start)) ) - if not ref_drive: - ref_drive = os.path.sep - start = [ref_drive] + ref_path.split(os.path.sep) - while '' in start: - start.remove('') - - pth_drive, pth_path = os.path.splitdrive( - resolve_symlinks(os.path.abspath(path)) ) - if not pth_drive: - pth_drive = os.path.sep - path = [pth_drive] + pth_path.split(os.path.sep) - while '' in path: - path.remove('') - - i = 0 - max = min(len(path), len(start)) - while i < max and path[i] == start[i]: - i += 1 - - if i < 2: - return os.path.join(*path) - else: - rel = ['..']*(len(start)-i) + path[i:] - if rel: - return os.path.join(*rel) - else: - return '.' diff --git a/noarch/lib/py/cxxtest/python/python3/cxxtest/cxxtest_parser.py b/noarch/lib/py/cxxtest/python/python3/cxxtest/cxxtest_parser.py deleted file mode 100644 index a4313a61..00000000 --- a/noarch/lib/py/cxxtest/python/python3/cxxtest/cxxtest_parser.py +++ /dev/null @@ -1,254 +0,0 @@ -#------------------------------------------------------------------------- -# CxxTest: A lightweight C++ unit testing library. -# Copyright (c) 2008 Sandia Corporation. -# This software is distributed under the LGPL License v3 -# For more information, see the COPYING file in the top CxxTest directory. -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -#------------------------------------------------------------------------- - - - -import codecs -import re -import sys -from cxxtest.cxxtest_misc import abort - -# Global variables -suites = [] -suite = None -inBlock = 0 -options=None - -def scanInputFiles(files, _options): - '''Scan all input files for test suites''' - # - # Reset global data - # - global options - options=_options - global suites - suites = [] - global suite - suite = None - global inBlock - inBlock = 0 - # - for file in files: - scanInputFile(file) - if len(suites) is 0 and not options.root: - abort( 'No tests defined' ) - return [options,suites] - -lineCont_re = re.compile('(.*)\\\s*$') -def scanInputFile(fileName): - '''Scan single input file for test suites''' - # mode 'rb' is problematic in python3 - byte arrays don't behave the same as - # strings. - # As far as the choice of the default encoding: utf-8 chews through - # everything that the previous ascii codec could, plus most of new code. - # TODO: figure out how to do this properly - like autodetect encoding from - # file header. - file = codecs.open(fileName, mode='r', encoding='utf-8') - prev = "" - lineNo = 0 - contNo = 0 - while 1: - try: - line = file.readline() - except UnicodeDecodeError: - sys.stderr.write("Could not decode unicode character at %s:%s\n" % (fileName, lineNo + 1)); - raise - if not line: - break - lineNo += 1 - - m = lineCont_re.match(line) - if m: - prev += m.group(1) + " " - contNo += 1 - else: - scanInputLine( fileName, lineNo - contNo, prev + line ) - contNo = 0 - prev = "" - if contNo: - scanInputLine( fileName, lineNo - contNo, prev + line ) - - closeSuite() - file.close() - -def scanInputLine( fileName, lineNo, line ): - '''Scan single input line for interesting stuff''' - scanLineForExceptionHandling( line ) - scanLineForStandardLibrary( line ) - - scanLineForSuiteStart( fileName, lineNo, line ) - - global suite - if suite: - scanLineInsideSuite( suite, lineNo, line ) - -def scanLineInsideSuite( suite, lineNo, line ): - '''Analyze line which is part of a suite''' - global inBlock - if lineBelongsToSuite( suite, lineNo, line ): - scanLineForTest( suite, lineNo, line ) - scanLineForCreate( suite, lineNo, line ) - scanLineForDestroy( suite, lineNo, line ) - -def lineBelongsToSuite( suite, lineNo, line ): - '''Returns whether current line is part of the current suite. - This can be false when we are in a generated suite outside of CXXTEST_CODE() blocks - If the suite is generated, adds the line to the list of lines''' - if not suite['generated']: - return 1 - - global inBlock - if not inBlock: - inBlock = lineStartsBlock( line ) - if inBlock: - inBlock = addLineToBlock( suite, lineNo, line ) - return inBlock - - -std_re = re.compile( r"\b(std\s*::|CXXTEST_STD|using\s+namespace\s+std\b|^\s*\#\s*include\s+<[a-z0-9]+>)" ) -def scanLineForStandardLibrary( line ): - '''Check if current line uses standard library''' - global options - if not options.haveStandardLibrary and std_re.search(line): - if not options.noStandardLibrary: - options.haveStandardLibrary = 1 - -exception_re = re.compile( r"\b(throw|try|catch|TSM?_ASSERT_THROWS[A-Z_]*)\b" ) -def scanLineForExceptionHandling( line ): - '''Check if current line uses exception handling''' - global options - if not options.haveExceptionHandling and exception_re.search(line): - if not options.noExceptionHandling: - options.haveExceptionHandling = 1 - -classdef = '(?:::\s*)?(?:\w+\s*::\s*)*\w+' -baseclassdef = '(?:public|private|protected)\s+%s' % (classdef,) -general_suite = r"\bclass\s+(%s)\s*:(?:\s*%s\s*,)*\s*public\s+" \ - % (classdef, baseclassdef,) -testsuite = '(?:(?:::)?\s*CxxTest\s*::\s*)?TestSuite' -suites_re = { re.compile( general_suite + testsuite ) : None } -generatedSuite_re = re.compile( r'\bCXXTEST_SUITE\s*\(\s*(\w*)\s*\)' ) -def scanLineForSuiteStart( fileName, lineNo, line ): - '''Check if current line starts a new test suite''' - for i in list(suites_re.items()): - m = i[0].search( line ) - if m: - suite = startSuite( m.group(1), fileName, lineNo, 0 ) - if i[1] is not None: - for test in i[1]['tests']: - addTest(suite, test['name'], test['line']) - break - m = generatedSuite_re.search( line ) - if m: - sys.stdout.write( "%s:%s: Warning: Inline test suites are deprecated.\n" % (fileName, lineNo) ) - startSuite( m.group(1), fileName, lineNo, 1 ) - -def startSuite( name, file, line, generated ): - '''Start scanning a new suite''' - global suite - closeSuite() - object_name = name.replace(':',"_") - suite = { 'fullname' : name, - 'name' : name, - 'file' : file, - 'cfile' : cstr(file), - 'line' : line, - 'generated' : generated, - 'object' : 'suite_%s' % object_name, - 'dobject' : 'suiteDescription_%s' % object_name, - 'tlist' : 'Tests_%s' % object_name, - 'tests' : [], - 'lines' : [] } - suites_re[re.compile( general_suite + name )] = suite - return suite - -def lineStartsBlock( line ): - '''Check if current line starts a new CXXTEST_CODE() block''' - return re.search( r'\bCXXTEST_CODE\s*\(', line ) is not None - -test_re = re.compile( r'^([^/]|/[^/])*\bvoid\s+([Tt]est\w+)\s*\(\s*(void)?\s*\)' ) -def scanLineForTest( suite, lineNo, line ): - '''Check if current line starts a test''' - m = test_re.search( line ) - if m: - addTest( suite, m.group(2), lineNo ) - -def addTest( suite, name, line ): - '''Add a test function to the current suite''' - test = { 'name' : name, - 'suite' : suite, - 'class' : 'TestDescription_%s_%s' % (suite['object'], name), - 'object' : 'testDescription_%s_%s' % (suite['object'], name), - 'line' : line, - } - suite['tests'].append( test ) - -def addLineToBlock( suite, lineNo, line ): - '''Append the line to the current CXXTEST_CODE() block''' - line = fixBlockLine( suite, lineNo, line ) - line = re.sub( r'^.*\{\{', '', line ) - - e = re.search( r'\}\}', line ) - if e: - line = line[:e.start()] - suite['lines'].append( line ) - return e is None - -def fixBlockLine( suite, lineNo, line): - '''Change all [E]TS_ macros used in a line to _[E]TS_ macros with the correct file/line''' - return re.sub( r'\b(E?TSM?_(ASSERT[A-Z_]*|FAIL))\s*\(', - r'_\1(%s,%s,' % (suite['cfile'], lineNo), - line, 0 ) - -create_re = re.compile( r'\bstatic\s+\w+\s*\*\s*createSuite\s*\(\s*(void)?\s*\)' ) -def scanLineForCreate( suite, lineNo, line ): - '''Check if current line defines a createSuite() function''' - if create_re.search( line ): - addSuiteCreateDestroy( suite, 'create', lineNo ) - -destroy_re = re.compile( r'\bstatic\s+void\s+destroySuite\s*\(\s*\w+\s*\*\s*\w*\s*\)' ) -def scanLineForDestroy( suite, lineNo, line ): - '''Check if current line defines a destroySuite() function''' - if destroy_re.search( line ): - addSuiteCreateDestroy( suite, 'destroy', lineNo ) - -def cstr( s ): - '''Convert a string to its C representation''' - return '"' + s.replace( '\\', '\\\\' ) + '"' - - -def addSuiteCreateDestroy( suite, which, line ): - '''Add createSuite()/destroySuite() to current suite''' - if which in suite: - abort( '%s:%s: %sSuite() already declared' % ( suite['file'], str(line), which ) ) - suite[which] = line - -def closeSuite(): - '''Close current suite and add it to the list if valid''' - global suite - if suite is not None: - if len(suite['tests']) is not 0: - verifySuite(suite) - rememberSuite(suite) - suite = None - -def verifySuite(suite): - '''Verify current suite is legal''' - if 'create' in suite and 'destroy' not in suite: - abort( '%s:%s: Suite %s has createSuite() but no destroySuite()' % - (suite['file'], suite['create'], suite['name']) ) - elif 'destroy' in suite and 'create' not in suite: - abort( '%s:%s: Suite %s has destroySuite() but no createSuite()' % - (suite['file'], suite['destroy'], suite['name']) ) - -def rememberSuite(suite): - '''Add current suite to list''' - global suites - suites.append( suite ) - diff --git a/noarch/lib/py/cxxtest/python/python3/cxxtest/cxxtestgen.py b/noarch/lib/py/cxxtest/python/python3/cxxtest/cxxtestgen.py deleted file mode 100644 index 8a5b84c4..00000000 --- a/noarch/lib/py/cxxtest/python/python3/cxxtest/cxxtestgen.py +++ /dev/null @@ -1,630 +0,0 @@ -#------------------------------------------------------------------------- -# CxxTest: A lightweight C++ unit testing library. -# Copyright (c) 2008 Sandia Corporation. -# This software is distributed under the LGPL License v3 -# For more information, see the COPYING file in the top CxxTest directory. -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -#------------------------------------------------------------------------- - -# vim: fileencoding=utf-8 - - -# the above import important for forward-compatibility with python3, -# which is already the default in archlinux! - -__all__ = ['main', 'create_manpage'] - -from . import __release__ -import os -import sys -import re -import glob -from optparse import OptionParser -from . import cxxtest_parser -from string import Template - -try: - from . import cxxtest_fog - imported_fog=True -except ImportError: - imported_fog=False - -from .cxxtest_misc import abort - -try: - from os.path import relpath -except ImportError: - from .cxxtest_misc import relpath - -# Global data is initialized by main() -options = [] -suites = [] -wrotePreamble = 0 -wroteWorld = 0 -lastIncluded = '' - - -def main(args=sys.argv, catch=False): - '''The main program''' - # - # Reset global state - # - global wrotePreamble - wrotePreamble=0 - global wroteWorld - wroteWorld=0 - global lastIncluded - lastIncluded = '' - global suites - suites = [] - global options - options = [] - # - try: - files = parseCommandline(args) - if imported_fog and options.fog: - [options,suites] = cxxtest_fog.scanInputFiles( files, options ) - else: - [options,suites] = cxxtest_parser.scanInputFiles( files, options ) - writeOutput() - except SystemExit: - if not catch: - raise - -def create_parser(asciidoc=False): - parser = OptionParser("cxxtestgen [options] [<filename> ...]") - if asciidoc: - parser.description="The cxxtestgen command processes C++ header files to perform test discovery, and then it creates files for the CxxTest test runner." - else: - parser.description="The 'cxxtestgen' command processes C++ header files to perform test discovery, and then it creates files for the 'CxxTest' test runner." - - parser.add_option("--version", - action="store_true", dest="version", default=False, - help="Write the CxxTest version.") - parser.add_option("-o", "--output", - dest="outputFileName", default=None, metavar="NAME", - help="Write output to file NAME.") - parser.add_option("-w","--world", dest="world", default="cxxtest", - help="The label of the tests, used to name the XML results.") - parser.add_option("", "--include", action="append", - dest="headers", default=[], metavar="HEADER", - help="Include file HEADER in the test runner before other headers.") - parser.add_option("", "--abort-on-fail", - action="store_true", dest="abortOnFail", default=False, - help="Abort tests on failed asserts (like xUnit).") - parser.add_option("", "--main", - action="store", dest="main", default="main", - help="Specify an alternative name for the main() function.") - parser.add_option("", "--headers", - action="store", dest="header_filename", default=None, - help="Specify a filename that contains a list of header files that are processed to generate a test runner.") - parser.add_option("", "--runner", - dest="runner", default="", metavar="CLASS", - help="Create a test runner that processes test events using the class CxxTest::CLASS.") - parser.add_option("", "--gui", - dest="gui", metavar="CLASS", - help="Create a GUI test runner that processes test events using the class CxxTest::CLASS. (deprecated)") - parser.add_option("", "--error-printer", - action="store_true", dest="error_printer", default=False, - help="Create a test runner using the ErrorPrinter class, and allow the use of the standard library.") - parser.add_option("", "--xunit-printer", - action="store_true", dest="xunit_printer", default=False, - help="Create a test runner using the XUnitPrinter class.") - parser.add_option("", "--xunit-file", dest="xunit_file", default="", - help="The file to which the XML summary is written for test runners using the XUnitPrinter class. The default XML filename is TEST-<world>.xml, where <world> is the value of the --world option. (default: cxxtest)") - parser.add_option("", "--have-std", - action="store_true", dest="haveStandardLibrary", default=False, - help="Use the standard library (even if not found in tests).") - parser.add_option("", "--no-std", - action="store_true", dest="noStandardLibrary", default=False, - help="Do not use standard library (even if found in tests).") - parser.add_option("", "--have-eh", - action="store_true", dest="haveExceptionHandling", default=False, - help="Use exception handling (even if not found in tests).") - parser.add_option("", "--no-eh", - action="store_true", dest="noExceptionHandling", default=False, - help="Do not use exception handling (even if found in tests).") - parser.add_option("", "--longlong", - dest="longlong", default=None, metavar="TYPE", - help="Use TYPE as for long long integers. (default: not supported)") - parser.add_option("", "--no-static-init", - action="store_true", dest="noStaticInit", default=False, - help="Do not rely on static initialization in the test runner.") - parser.add_option("", "--template", - dest="templateFileName", default=None, metavar="TEMPLATE", - help="Generate the test runner using file TEMPLATE to define a template.") - parser.add_option("", "--root", - action="store_true", dest="root", default=False, - help="Write the main() function and global data for a test runner.") - parser.add_option("", "--part", - action="store_true", dest="part", default=False, - help="Write the tester classes for a test runner.") - #parser.add_option("", "--factor", - #action="store_true", dest="factor", default=False, - #help="Declare the _CXXTEST_FACTOR macro. (deprecated)") - if imported_fog: - fog_help = "Use new FOG C++ parser" - else: - fog_help = "Use new FOG C++ parser (disabled)" - parser.add_option("-f", "--fog-parser", - action="store_true", - dest="fog", - default=False, - help=fog_help - ) - return parser - -def parseCommandline(args): - '''Analyze command line arguments''' - global imported_fog - global options - - parser = create_parser() - (options, args) = parser.parse_args(args=args) - if not options.header_filename is None: - if not os.path.exists(options.header_filename): - abort( "ERROR: the file '%s' does not exist!" % options.header_filename ) - INPUT = open(options.header_filename) - headers = [line.strip() for line in INPUT] - args.extend( headers ) - INPUT.close() - - if options.fog and not imported_fog: - abort( "Cannot use the FOG parser. Check that the 'ply' package is installed. The 'ordereddict' package is also required if running Python 2.6") - - if options.version: - printVersion() - - # the cxxtest builder relies on this behaviour! don't remove - if options.runner == 'none': - options.runner = None - - if options.xunit_printer or options.runner == "XUnitPrinter": - options.xunit_printer=True - options.runner="XUnitPrinter" - if len(args) > 1: - if options.xunit_file == "": - if options.world == "": - options.world = "cxxtest" - options.xunit_file="TEST-"+options.world+".xml" - elif options.xunit_file == "": - if options.world == "": - options.world = "cxxtest" - options.xunit_file="TEST-"+options.world+".xml" - - if options.error_printer: - options.runner= "ErrorPrinter" - options.haveStandardLibrary = True - - if options.noStaticInit and (options.root or options.part): - abort( '--no-static-init cannot be used with --root/--part' ) - - if options.gui and not options.runner: - options.runner = 'StdioPrinter' - - files = setFiles(args[1:]) - if len(files) == 0 and not options.root: - sys.stderr.write(parser.error("No input files found")) - - return files - - -def printVersion(): - '''Print CxxTest version and exit''' - sys.stdout.write( "This is CxxTest version %s.\n" % __release__.__version__ ) - sys.exit(0) - -def setFiles(patterns ): - '''Set input files specified on command line''' - files = expandWildcards( patterns ) - return files - -def expandWildcards( patterns ): - '''Expand all wildcards in an array (glob)''' - fileNames = [] - for pathName in patterns: - patternFiles = glob.glob( pathName ) - for fileName in patternFiles: - fileNames.append( fixBackslashes( fileName ) ) - return fileNames - -def fixBackslashes( fileName ): - '''Convert backslashes to slashes in file name''' - return re.sub( r'\\', '/', fileName, 0 ) - - -def writeOutput(): - '''Create output file''' - if options.templateFileName: - writeTemplateOutput() - else: - writeSimpleOutput() - -def writeSimpleOutput(): - '''Create output not based on template''' - output = startOutputFile() - writePreamble( output ) - if options.root or not options.part: - writeMain( output ) - - if len(suites) > 0: - output.write("bool "+suites[0]['object']+"_init = false;\n") - - writeWorld( output ) - output.close() - -include_re = re.compile( r"\s*\#\s*include\s+<cxxtest/" ) -preamble_re = re.compile( r"^\s*<CxxTest\s+preamble>\s*$" ) -world_re = re.compile( r"^\s*<CxxTest\s+world>\s*$" ) -def writeTemplateOutput(): - '''Create output based on template file''' - template = open(options.templateFileName) - output = startOutputFile() - while 1: - line = template.readline() - if not line: - break; - if include_re.search( line ): - writePreamble( output ) - output.write( line ) - elif preamble_re.search( line ): - writePreamble( output ) - elif world_re.search( line ): - if len(suites) > 0: - output.write("bool "+suites[0]['object']+"_init = false;\n") - writeWorld( output ) - else: - output.write( line ) - template.close() - output.close() - -def startOutputFile(): - '''Create output file and write header''' - if options.outputFileName is not None: - output = open( options.outputFileName, 'w' ) - else: - output = sys.stdout - output.write( "/* Generated file, do not edit */\n\n" ) - return output - -def writePreamble( output ): - '''Write the CxxTest header (#includes and #defines)''' - global wrotePreamble - if wrotePreamble: return - output.write( "#ifndef CXXTEST_RUNNING\n" ) - output.write( "#define CXXTEST_RUNNING\n" ) - output.write( "#endif\n" ) - output.write( "\n" ) - if options.xunit_printer: - output.write( "#include <fstream>\n" ) - if options.haveStandardLibrary: - output.write( "#define _CXXTEST_HAVE_STD\n" ) - if options.haveExceptionHandling: - output.write( "#define _CXXTEST_HAVE_EH\n" ) - if options.abortOnFail: - output.write( "#define _CXXTEST_ABORT_TEST_ON_FAIL\n" ) - if options.longlong: - output.write( "#define _CXXTEST_LONGLONG %s\n" % options.longlong ) - #if options.factor: - #output.write( "#define _CXXTEST_FACTOR\n" ) - for header in options.headers: - output.write( "#include \"%s\"\n" % header ) - output.write( "#include <cxxtest/TestListener.h>\n" ) - output.write( "#include <cxxtest/TestTracker.h>\n" ) - output.write( "#include <cxxtest/TestRunner.h>\n" ) - output.write( "#include <cxxtest/RealDescriptions.h>\n" ) - output.write( "#include <cxxtest/TestMain.h>\n" ) - if options.runner: - output.write( "#include <cxxtest/%s.h>\n" % options.runner ) - if options.gui: - output.write( "#include <cxxtest/%s.h>\n" % options.gui ) - output.write( "\n" ) - wrotePreamble = 1 - -def writeMain( output ): - '''Write the main() function for the test runner''' - if not (options.gui or options.runner): - return - output.write( 'int %s( int argc, char *argv[] ) {\n' % options.main ) - output.write( ' int status;\n' ) - if options.noStaticInit: - output.write( ' CxxTest::initialize();\n' ) - if options.gui: - tester_t = "CxxTest::GuiTuiRunner<CxxTest::%s, CxxTest::%s> " % (options.gui, options.runner) - else: - tester_t = "CxxTest::%s" % (options.runner) - if options.xunit_printer: - output.write( ' std::ofstream ofstr("%s");\n' % options.xunit_file ) - output.write( ' %s tmp(ofstr);\n' % tester_t ) - else: - output.write( ' %s tmp;\n' % tester_t ) - output.write( ' CxxTest::RealWorldDescription::_worldName = "%s";\n' % options.world ) - output.write( ' status = CxxTest::Main< %s >( tmp, argc, argv );\n' % tester_t ) - output.write( ' return status;\n') - output.write( '}\n' ) - - -def writeWorld( output ): - '''Write the world definitions''' - global wroteWorld - if wroteWorld: return - writePreamble( output ) - writeSuites( output ) - if options.root or not options.part: - writeRoot( output ) - writeWorldDescr( output ) - if options.noStaticInit: - writeInitialize( output ) - wroteWorld = 1 - -def writeSuites(output): - '''Write all TestDescriptions and SuiteDescriptions''' - for suite in suites: - writeInclude( output, suite['file'] ) - if isGenerated(suite): - generateSuite( output, suite ) - if not options.noStaticInit: - if isDynamic(suite): - writeSuitePointer( output, suite ) - else: - writeSuiteObject( output, suite ) - writeTestList( output, suite ) - writeSuiteDescription( output, suite ) - writeTestDescriptions( output, suite ) - -def isGenerated(suite): - '''Checks whether a suite class should be created''' - return suite['generated'] - -def isDynamic(suite): - '''Checks whether a suite is dynamic''' - return 'create' in suite - -def writeInclude(output, file): - '''Add #include "file" statement''' - global lastIncluded - if options.outputFileName: - dirname = os.path.split(options.outputFileName)[0] - tfile = relpath(file, dirname) - if os.path.exists(tfile): - if tfile == lastIncluded: return - output.writelines( [ '#include "', tfile, '"\n\n' ] ) - lastIncluded = tfile - return - # - # Use an absolute path if the relative path failed - # - tfile = os.path.abspath(file) - if os.path.exists(tfile): - if tfile == lastIncluded: return - output.writelines( [ '#include "', tfile, '"\n\n' ] ) - lastIncluded = tfile - return - -def generateSuite( output, suite ): - '''Write a suite declared with CXXTEST_SUITE()''' - output.write( 'class %s : public CxxTest::TestSuite {\n' % suite['fullname'] ) - output.write( 'public:\n' ) - for line in suite['lines']: - output.write(line) - output.write( '};\n\n' ) - -def writeSuitePointer( output, suite ): - '''Create static suite pointer object for dynamic suites''' - if options.noStaticInit: - output.write( 'static %s* %s;\n\n' % (suite['fullname'], suite['object']) ) - else: - output.write( 'static %s* %s = 0;\n\n' % (suite['fullname'], suite['object']) ) - -def writeSuiteObject( output, suite ): - '''Create static suite object for non-dynamic suites''' - output.writelines( [ "static ", suite['fullname'], " ", suite['object'], ";\n\n" ] ) - -def writeTestList( output, suite ): - '''Write the head of the test linked list for a suite''' - if options.noStaticInit: - output.write( 'static CxxTest::List %s;\n' % suite['tlist'] ) - else: - output.write( 'static CxxTest::List %s = { 0, 0 };\n' % suite['tlist'] ) - -def writeWorldDescr( output ): - '''Write the static name of the world name''' - if options.noStaticInit: - output.write( 'const char* CxxTest::RealWorldDescription::_worldName;\n' ) - else: - output.write( 'const char* CxxTest::RealWorldDescription::_worldName = "cxxtest";\n' ) - -def writeTestDescriptions( output, suite ): - '''Write all test descriptions for a suite''' - for test in suite['tests']: - writeTestDescription( output, suite, test ) - -def writeTestDescription( output, suite, test ): - '''Write test description object''' - if not options.noStaticInit: - output.write( 'static class %s : public CxxTest::RealTestDescription {\n' % test['class'] ) - else: - output.write( 'class %s : public CxxTest::RealTestDescription {\n' % test['class'] ) - # - output.write( 'public:\n' ) - if not options.noStaticInit: - output.write( ' %s() : CxxTest::RealTestDescription( %s, %s, %s, "%s" ) {}\n' % - (test['class'], suite['tlist'], suite['dobject'], test['line'], test['name']) ) - else: - if isDynamic(suite): - output.write( ' %s(%s* _%s) : %s(_%s) { }\n' % - (test['class'], suite['fullname'], suite['object'], suite['object'], suite['object']) ) - output.write( ' %s* %s;\n' % (suite['fullname'], suite['object']) ) - else: - output.write( ' %s(%s& _%s) : %s(_%s) { }\n' % - (test['class'], suite['fullname'], suite['object'], suite['object'], suite['object']) ) - output.write( ' %s& %s;\n' % (suite['fullname'], suite['object']) ) - output.write( ' void runTest() { %s }\n' % runBody( suite, test ) ) - # - if not options.noStaticInit: - output.write( '} %s;\n\n' % test['object'] ) - else: - output.write( '};\n\n' ) - -def runBody( suite, test ): - '''Body of TestDescription::run()''' - if isDynamic(suite): return dynamicRun( suite, test ) - else: return staticRun( suite, test ) - -def dynamicRun( suite, test ): - '''Body of TestDescription::run() for test in a dynamic suite''' - return 'if ( ' + suite['object'] + ' ) ' + suite['object'] + '->' + test['name'] + '();' - -def staticRun( suite, test ): - '''Body of TestDescription::run() for test in a non-dynamic suite''' - return suite['object'] + '.' + test['name'] + '();' - -def writeSuiteDescription( output, suite ): - '''Write SuiteDescription object''' - if isDynamic( suite ): - writeDynamicDescription( output, suite ) - else: - writeStaticDescription( output, suite ) - -def writeDynamicDescription( output, suite ): - '''Write SuiteDescription for a dynamic suite''' - output.write( 'CxxTest::DynamicSuiteDescription< %s > %s' % (suite['fullname'], suite['dobject']) ) - if not options.noStaticInit: - output.write( '( %s, %s, "%s", %s, %s, %s, %s )' % - (suite['cfile'], suite['line'], suite['fullname'], suite['tlist'], - suite['object'], suite['create'], suite['destroy']) ) - output.write( ';\n\n' ) - -def writeStaticDescription( output, suite ): - '''Write SuiteDescription for a static suite''' - output.write( 'CxxTest::StaticSuiteDescription %s' % suite['dobject'] ) - if not options.noStaticInit: - output.write( '( %s, %s, "%s", %s, %s )' % - (suite['cfile'], suite['line'], suite['fullname'], suite['object'], suite['tlist']) ) - output.write( ';\n\n' ) - -def writeRoot(output): - '''Write static members of CxxTest classes''' - output.write( '#include <cxxtest/Root.cpp>\n' ) - -def writeInitialize(output): - '''Write CxxTest::initialize(), which replaces static initialization''' - output.write( 'namespace CxxTest {\n' ) - output.write( ' void initialize()\n' ) - output.write( ' {\n' ) - for suite in suites: - #print "HERE", suite - writeTestList( output, suite ) - output.write( ' %s.initialize();\n' % suite['tlist'] ) - #writeSuiteObject( output, suite ) - if isDynamic(suite): - writeSuitePointer( output, suite ) - output.write( ' %s = 0;\n' % suite['object']) - else: - writeSuiteObject( output, suite ) - output.write( ' static ') - writeSuiteDescription( output, suite ) - if isDynamic(suite): - #output.write( ' %s = %s.suite();\n' % (suite['object'],suite['dobject']) ) - output.write( ' %s.initialize( %s, %s, "%s", %s, %s, %s, %s );\n' % - (suite['dobject'], suite['cfile'], suite['line'], suite['fullname'], - suite['tlist'], suite['object'], suite['create'], suite['destroy']) ) - output.write( ' %s.setUp();\n' % suite['dobject']) - else: - output.write( ' %s.initialize( %s, %s, "%s", %s, %s );\n' % - (suite['dobject'], suite['cfile'], suite['line'], suite['fullname'], - suite['object'], suite['tlist']) ) - - for test in suite['tests']: - output.write( ' static %s %s(%s);\n' % - (test['class'], test['object'], suite['object']) ) - output.write( ' %s.initialize( %s, %s, %s, "%s" );\n' % - (test['object'], suite['tlist'], suite['dobject'], test['line'], test['name']) ) - - output.write( ' }\n' ) - output.write( '}\n' ) - -man_template=Template("""CXXTESTGEN(1) -============= -:doctype: manpage - - -NAME ----- -cxxtestgen - performs test discovery to create a CxxTest test runner - - -SYNOPSIS --------- -${usage} - - -DESCRIPTION ------------ -${description} - - -OPTIONS -------- -${options} - - -EXIT STATUS ------------ -*0*:: - Success - -*1*:: - Failure (syntax or usage error; configuration error; document - processing failure; unexpected error). - - -BUGS ----- -See the CxxTest Home Page for the link to the CxxTest ticket repository. - - -AUTHOR ------- -CxxTest was originally written by Erez Volk. Many people have -contributed to it. - - -RESOURCES ---------- -Home page: <http://cxxtest.com/> - -CxxTest User Guide: <http://cxxtest.com/cxxtest/doc/guide.html> - - - -COPYING -------- -Copyright (c) 2008 Sandia Corporation. This software is distributed -under the Lesser GNU General Public License (LGPL) v3 -""") - -def create_manpage(): - """Write ASCIIDOC manpage file""" - parser = create_parser(asciidoc=True) - # - usage = parser.usage - description = parser.description - options="" - for opt in parser.option_list: - opts = opt._short_opts + opt._long_opts - optstr = '*' + ', '.join(opts) + '*' - if not opt.metavar is None: - optstr += "='%s'" % opt.metavar - optstr += '::\n' - options += optstr - # - options += opt.help - options += '\n\n' - # - OUTPUT = open('cxxtestgen.1.txt','w') - OUTPUT.write( man_template.substitute(usage=usage, description=description, options=options) ) - OUTPUT.close() - - diff --git a/noarch/lib/py/cxxtest/python/python3/scripts/cxxtestgen b/noarch/lib/py/cxxtest/python/python3/scripts/cxxtestgen deleted file mode 100644 index 74090ec7..00000000 --- a/noarch/lib/py/cxxtest/python/python3/scripts/cxxtestgen +++ /dev/null @@ -1,5 +0,0 @@ -#! python - -import cxxtest.cxxtestgen - -cxxtest.cxxtestgen.main() diff --git a/noarch/lib/py/cxxtest/python/scripts/cxxtestgen b/noarch/lib/py/cxxtest/python/scripts/cxxtestgen deleted file mode 100644 index 4fb2d796..00000000 --- a/noarch/lib/py/cxxtest/python/scripts/cxxtestgen +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env python - -import sys -import os.path - -try: - import cxxtest.cxxtestgen -except ImportError: - currdir = os.path.dirname(os.path.abspath(__file__)) - - if sys.version_info < (3,0): - sys.path.append( os.path.abspath( os.path.sep.join([currdir, '..']) ) ) - else: - sys.path.append( os.path.abspath( os.path.sep.join([currdir, '..', python3]) ) ) - - import cxxtest.cxxtestgen - -cxxtest.cxxtestgen.main() diff --git a/noarch/lib/py/cxxtest/python/setup.py b/noarch/lib/py/cxxtest/python/setup.py deleted file mode 100644 index 7fc9168c..00000000 --- a/noarch/lib/py/cxxtest/python/setup.py +++ /dev/null @@ -1,62 +0,0 @@ -#------------------------------------------------------------------------- -# CxxTest: A lightweight C++ unit testing library. -# Copyright (c) 2008 Sandia Corporation. -# This software is distributed under the LGPL License v3 -# For more information, see the COPYING file in the top CxxTest directory. -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -#------------------------------------------------------------------------- - -""" -Script to generate the installer for cxxtest. -""" - -classifiers = """\ -Development Status :: 4 - Beta -Intended Audience :: End Users/Desktop -License :: OSI Approved :: LGPL License -Natural Language :: English -Operating System :: Microsoft :: Windows -Operating System :: Unix -Programming Language :: Python -Topic :: Software Development :: Libraries :: Python Modules -""" - -import os -import sys -from os.path import realpath, dirname -if sys.version_info >= (3,0): - sys.path.insert(0, dirname(realpath(__file__))+os.sep+'python3') - os.chdir('python3') - -import cxxtest - -try: - from setuptools import setup -except ImportError: - from distutils.core import setup - -doclines = cxxtest.__doc__.split("\n") - -setup(name="cxxtest", - version=cxxtest.__version__, - maintainer=cxxtest.__maintainer__, - maintainer_email=cxxtest.__maintainer_email__, - url = cxxtest.__url__, - license = cxxtest.__license__, - platforms = ["any"], - description = doclines[0], - classifiers = filter(None, classifiers.split("\n")), - long_description = "\n".join(doclines[2:]), - packages=['cxxtest'], - keywords=['utility'], - scripts=['scripts/cxxtestgen'] - # - # The entry_points option is not supported by distutils.core - # - #entry_points=""" - #[console_scripts] - #cxxtestgen = cxxtest.cxxtestgen:main - #""" - ) - diff --git a/noarch/lib/py/cxxtest/sample/Construct b/noarch/lib/py/cxxtest/sample/Construct deleted file mode 100644 index 60902254..00000000 --- a/noarch/lib/py/cxxtest/sample/Construct +++ /dev/null @@ -1,64 +0,0 @@ -# -*- Perl -*- - -# -# This file shows how to use CxxTest with Cons -# - -$env = new cons( CXX => ("$^O" eq 'MSWin32') ? 'cl -nologo -GX' : 'c++', - CPPPATH => '..', - CXXTESTGEN => '../bin/cxxtestgen' ); - -@tests = <*.h>; - -# The error printer is the most basic runner -CxxTestErrorPrinter $env 'error_printer', @tests; - -# You can also specify which runner you want to use -CxxTestRunner $env 'stdio_printer', 'StdioPrinter', @tests; - -# For more control, use template files -CxxTestTemplate $env 'file_printer', 'file_printer.tpl', @tests; - -# Or, you can always separate the tests from the runner -CxxTest $env 'tests.cpp', '', @tests; -Program $env 'yes_no_runner', ('yes_no_runner.cpp', 'tests.cpp'); - - -# -# Here is the code used to build these files -# You can use this in your own Construct files -# - -# cons::CxxTest $env $dst, $options, @srcs -# Generates a CxxTest source file, passing the specified options to cxxtestgen -sub cons::CxxTest($$$@) { - my ($env, $dst, $options, @srcs) = @_; - Command $env $dst, @srcs, "%CXXTESTGEN -o %> ${options} %<"; -} - -# cons::CxxTestTemplate $env $dst, $template, @srcs -# Generates and builds a CxxTest runner using a template file -sub cons::CxxTestTemplate($$$@) { - my ($env, $dst, $template, @srcs) = @_; - my $source = "${dst}.cpp"; - CxxTest $env $source, "--template=${template}", ($template, @srcs); - Program $env $dst, $source; -} - -# cons::CxxTestRunner $env $dst, $runner, @srcs -# Generates and builds a CxxTest runner using the --runner option -sub cons::CxxTestRunner($$$@) { - my ($env, $dst, $runner, @srcs) = @_; - my $source = "${dst}.cpp"; - CxxTest $env $source, "--runner=${runner}", @srcs; - Program $env $dst, $source; -} - -# cons::CxxTestErrorPrinter $env $dst, @srcs -# Generates and builds a CxxTest ErrorPrinter -sub cons::CxxTestErrorPrinter($$@) { - my ($env, $dst, @srcs) = @_; - CxxTestRunner $env $dst, 'ErrorPrinter', @srcs; -} - - diff --git a/noarch/lib/py/cxxtest/sample/CreatedTest.h b/noarch/lib/py/cxxtest/sample/CreatedTest.h deleted file mode 100644 index d1518634..00000000 --- a/noarch/lib/py/cxxtest/sample/CreatedTest.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef __CREATEDTEST_H -#define __CREATEDTEST_H - -#include <cxxtest/TestSuite.h> -#include <string.h> -#include <memory.h> - -// -// This test suite shows what to do when your test case -// class cannot be instantiated statically. -// As an example, this test suite requires a non-default constructor. -// - -class CreatedTest : public CxxTest::TestSuite { - char *_buffer; -public: - CreatedTest(unsigned size) : _buffer(new char[size]) {} - virtual ~CreatedTest() { delete [] _buffer; } - - static CreatedTest *createSuite() { return new CreatedTest(16); } - static void destroySuite(CreatedTest *suite) { delete suite; } - - void test_nothing() { - TS_FAIL("Nothing to test"); - } -}; - - -#endif // __CREATEDTEST_H diff --git a/noarch/lib/py/cxxtest/sample/DeltaTest.h b/noarch/lib/py/cxxtest/sample/DeltaTest.h deleted file mode 100644 index 2820c016..00000000 --- a/noarch/lib/py/cxxtest/sample/DeltaTest.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef __DELTATEST_H -#define __DELTATEST_H - -#include <cxxtest/TestSuite.h> -#include <math.h> - -class DeltaTest : public CxxTest::TestSuite { - double _pi, _delta; - -public: - void setUp() { - _pi = 3.1415926535; - _delta = 0.0001; - } - - void testSine() { - TS_ASSERT_DELTA(sin(0.0), 0.0, _delta); - TS_ASSERT_DELTA(sin(_pi / 6), 0.5, _delta); - TS_ASSERT_DELTA(sin(_pi / 2), 1.0, _delta); - TS_ASSERT_DELTA(sin(_pi), 0.0, _delta); - } - - void testInt() { - unsigned a = 0; - unsigned b = 0; - TS_ASSERT_DELTA(a, b, 10); - } -}; - -#endif // __DELTATEST_H diff --git a/noarch/lib/py/cxxtest/sample/EnumTraits.h b/noarch/lib/py/cxxtest/sample/EnumTraits.h deleted file mode 100644 index f17bf3f2..00000000 --- a/noarch/lib/py/cxxtest/sample/EnumTraits.h +++ /dev/null @@ -1,37 +0,0 @@ -// -// This is a test of CxxTest's ValueTraits for enumerations. -// -#include <cxxtest/TestSuite.h> - -// -// First define your enumeration -// -enum Answer { - Yes, - No, - Maybe, - DontKnow, - DontCare -}; - -// -// Now make CxxTest aware of it -// -CXXTEST_ENUM_TRAITS(Answer, - CXXTEST_ENUM_MEMBER(Yes) - CXXTEST_ENUM_MEMBER(No) - CXXTEST_ENUM_MEMBER(Maybe) - CXXTEST_ENUM_MEMBER(DontKnow) - CXXTEST_ENUM_MEMBER(DontCare)); - -class EnumTraits : public CxxTest::TestSuite { -public: - void test_Enum_traits() { - TS_FAIL(Yes); - TS_FAIL(No); - TS_FAIL(Maybe); - TS_FAIL(DontKnow); - TS_FAIL(DontCare); - TS_FAIL((Answer)1000); - } -}; diff --git a/noarch/lib/py/cxxtest/sample/ExceptionTest.h b/noarch/lib/py/cxxtest/sample/ExceptionTest.h deleted file mode 100644 index ccb41aab..00000000 --- a/noarch/lib/py/cxxtest/sample/ExceptionTest.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef __EXCEPTIONTEST_H -#define __EXCEPTIONTEST_H - -#include <cxxtest/TestSuite.h> - -// -// This test suite demonstrates the use of TS_ASSERT_THROWS -// - -class ExceptionTest : public CxxTest::TestSuite { -public: - void testAssertion(void) { - // This assert passes, since throwThis() throws (Number) - TS_ASSERT_THROWS(throwThis(3), const Number &); - // This assert passes, since throwThis() throws something - TS_ASSERT_THROWS_ANYTHING(throwThis(-30)); - // This assert fails, since throwThis() doesn't throw char * - TS_ASSERT_THROWS(throwThis(5), const char *); - // This assert fails since goodFunction() throws nothing - TS_ASSERT_THROWS_ANYTHING(goodFunction(1)); - // The regular TS_ASSERT macros will catch unhandled exceptions - TS_ASSERT_EQUALS(throwThis(3), 333); - // You can assert that a function throws nothing - TS_ASSERT_THROWS_NOTHING(throwThis(-1)); - // This assert fails, since throwThis() throws (Number) - TS_ASSERT_THROWS(throwThis(3), std::exception&); - // If you want to catch the exceptions yourself, use the ETS_ marcos - try { - ETS_ASSERT_EQUALS(throwThis(3), 333); - } catch (const Number &) { - TS_FAIL("throwThis(3) failed"); - } - } - -private: - void goodFunction(int) { - } - - class Number { - public: - Number(int) {} - }; - - int throwThis(int i) { - throw Number(i); - } -}; - -#endif // __EXCEPTIONTEST_H diff --git a/noarch/lib/py/cxxtest/sample/FixtureTest.h b/noarch/lib/py/cxxtest/sample/FixtureTest.h deleted file mode 100644 index 2a350963..00000000 --- a/noarch/lib/py/cxxtest/sample/FixtureTest.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef __FIXTURETEST_H -#define __FIXTURETEST_H - -#include <cxxtest/TestSuite.h> -#include <string.h> - -// -// This test suite shows how to use setUp() and tearDown() -// to initialize data common to all tests. -// setUp()/tearDown() will be called before and after each -// test. -// - -class FixtureTest : public CxxTest::TestSuite { - char *_buffer; -public: - void setUp() { - _buffer = new char[1024]; - } - - void tearDown() { - delete [] _buffer; - } - - void test_strcpy() { - strcpy(_buffer, "Hello, world!"); - TS_ASSERT_EQUALS(_buffer[0], 'H'); - TS_ASSERT_EQUALS(_buffer[1], 'E'); - } -}; - - -#endif // __FIXTURETEST_H diff --git a/noarch/lib/py/cxxtest/sample/Makefile.PL b/noarch/lib/py/cxxtest/sample/Makefile.PL deleted file mode 100644 index d29afcc6..00000000 --- a/noarch/lib/py/cxxtest/sample/Makefile.PL +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/perl -# -# This isn't a "real" `Makefile.PL' -# It just copies the correct `Makefile.*' to `Makefile' -# -use strict; -use Getopt::Long; -use File::Copy; - -sub usage() { - die "Usage: $0 [--bcc32]\n"; -} - -my $source; -my $target = 'Makefile'; -my $windows = $ENV{'windir'}; - -GetOptions( 'bcc32' => sub { $source = 'Makefile.bcc32' } ) or usage(); -if ( !defined( $source ) ) { - $source = $windows ? 'Makefile.msvc' : 'Makefile.unix'; -} - -unlink($target); -$windows ? copy($source, $target) : symlink($source, $target); - -print "`Makefile' is now `$source'.\n"; - -# -# Local Variables: -# compile-command: "perl Makefile.PL" -# End: -# diff --git a/noarch/lib/py/cxxtest/sample/Makefile.bcc32 b/noarch/lib/py/cxxtest/sample/Makefile.bcc32 deleted file mode 100644 index 3bd5303b..00000000 --- a/noarch/lib/py/cxxtest/sample/Makefile.bcc32 +++ /dev/null @@ -1,94 +0,0 @@ -# -# Makefile for Borland C++ -# Make sure bcc32.exe is in the PATH or change CXXC below -# - -# For the Win32 GUI -#WIN32_FLAGS = user32.lib comctl32.lib - -# For the Qt GUI -#QTDIR = c:\qt -QT_FLAGS = -I$(QTDIR)/include $(QTDIR)/lib/qt.lib - - -TARGETS = error_printer.exe stdio_printer.exe yes_no_runner.exe file_printer.exe aborter.exe only.exe -GUI_TARGETS = win32_runner.exe qt_runner.exe -TESTS = *.h -GUI_TESTS = gui/GreenYellowRed.h $(TESTS) -TESTGEN = ../bin/cxxtestgen -CXXC = bcc32.exe -w- -I. -I.. - -all: $(TARGETS) - -clean: - del *~ *.o *.obj - del $(TARGETS) - del $(GUI_TARGETS) - del tests.cpp error_printer.cpp stdio_printer.cpp file_printer.cpp aborter.cpp only.cpp - del win32_runner.cpp qt_runner.cpp - -distclean: clean - del Makefile - -run: error_printer.exe - error_printer.exe - -run_win32: win32_runner.exe - win32_runner.exe - -run_qt: qt_runner.exe - qt_runner.exe - -error_printer.cpp: $(TESTS) - $(TESTGEN) -o error_printer.cpp --error-printer $(TESTS) - -stdio_printer.cpp: $(TESTS) - $(TESTGEN) -o stdio_printer.cpp --runner=StdioPrinter $(TESTS) - -file_printer.cpp: file_printer.tpl $(TESTS) - $(TESTGEN) -o file_printer.cpp --template=file_printer.tpl $(TESTS) - -aborter.cpp: aborter.tpl $(TESTS) - $(TESTGEN) -o aborter.cpp --template=aborter.tpl $(TESTS) - -only.cpp: only.tpl $(TESTS) - $(TESTGEN) -o only.cpp --template=only.tpl $(TESTS) - -tests.cpp: $(TESTS) - $(TESTGEN) -o tests.cpp $(TESTS) - -win32_runner.cpp: $(GUI_TESTS) - $(TESTGEN) -o win32_runner.cpp --gui=Win32Gui $(GUI_TESTS) - -qt_runner.cpp: $(GUI_TESTS) - $(TESTGEN) -o qt_runner.cpp --gui=QtGui $(GUI_TESTS) - -error_printer.exe: error_printer.cpp - $(CXXC) -eerror_printer.exe error_printer.cpp - -stdio_printer.exe: stdio_printer.cpp - $(CXXC) -estdio_printer.exe stdio_printer.cpp - -file_printer.exe: file_printer.cpp - $(CXXC) -efile_printer.exe file_printer.cpp - -only.exe: only.cpp - $(CXXC) -eonly.exe only.cpp - -aborter.exe: aborter.cpp - $(CXXC) -eaborter.exe aborter.cpp - -yes_no_runner.exe: yes_no_runner.cpp tests.cpp - $(CXXC) -eyes_no_runner.exe yes_no_runner.cpp tests.cpp - -win32_runner.exe: win32_runner.cpp - $(CXXC) -ewin32_runner.exe win32_runner.cpp $(WIN32_FLAGS) - -qt_runner.exe: qt_runner.cpp - $(CXXC) -o qt_runner.exe qt_runner.cpp $(QT_FLAGS) - -# -# Local Variables: -# compile-command: "make -fMakefile.bcc32" -# End: -# diff --git a/noarch/lib/py/cxxtest/sample/Makefile.msvc b/noarch/lib/py/cxxtest/sample/Makefile.msvc deleted file mode 100644 index 2374f802..00000000 --- a/noarch/lib/py/cxxtest/sample/Makefile.msvc +++ /dev/null @@ -1,93 +0,0 @@ -# -# Makefile for Microsoft Visual C++ -# Make sure cl.exe is in the PATH (run vcvars.bat) or change CXXC below -# - -# For the Win32 GUI -WIN32_FLAGS = user32.lib - -# For the Qt GUI -# QTDIR = c:\qt -QT_FLAGS = -I$(QTDIR)/include $(QTDIR)/lib/qt.lib - -TARGETS = error_printer.exe stdio_printer.exe yes_no_runner.exe file_printer.exe aborter.exe only.exe -GUI_TARGETS = win32_runner.exe qt_runner.exe -TESTS = *.h -GUI_TESTS = gui/GreenYellowRed.h $(TESTS) -TESTGEN = python ../bin/cxxtestgen -CXXC = cl.exe -GX -W3 -WX -I. -I.. - -all: $(TARGETS) - -clean: - del *~ *.o *.obj - del $(TARGETS) - del $(GUI_TARGETS) - del tests.cpp error_printer.cpp stdio_printer.cpp file_printer.cpp aborter.cpp only.cpp - del win32_runner.cpp qt_runner.cpp - -distclean: clean - del Makefile - -run: error_printer.exe - error_printer.exe - -run_win32: win32_runner.exe - win32_runner.exe - -run_qt: qt_runner.exe - qt_runner.exe - -error_printer.cpp: $(TESTS) - $(TESTGEN) -o error_printer.cpp --error-printer $(TESTS) - -stdio_printer.cpp: $(TESTS) - $(TESTGEN) -o stdio_printer.cpp --runner=StdioPrinter $(TESTS) - -file_printer.cpp: file_printer.tpl $(TESTS) - $(TESTGEN) -o file_printer.cpp --template=file_printer.tpl $(TESTS) - -aborter.cpp: aborter.tpl $(TESTS) - $(TESTGEN) -o aborter.cpp --template=aborter.tpl $(TESTS) - -only.cpp: only.tpl $(TESTS) - $(TESTGEN) -o only.cpp --template=only.tpl $(TESTS) - -tests.cpp: $(TESTS) - $(TESTGEN) -o tests.cpp $(TESTS) - -win32_runner.cpp: $(GUI_TESTS) - $(TESTGEN) -o win32_runner.cpp --gui=Win32Gui $(GUI_TESTS) - -qt_runner.cpp: $(GUI_TESTS) - $(TESTGEN) -o qt_runner.cpp --gui=QtGui $(GUI_TESTS) - -error_printer.exe: error_printer.cpp - $(CXXC) -o error_printer.exe error_printer.cpp - -stdio_printer.exe: stdio_printer.cpp - $(CXXC) -o stdio_printer.exe stdio_printer.cpp - -file_printer.exe: file_printer.cpp - $(CXXC) -o file_printer.exe file_printer.cpp - -only.exe: only.cpp - $(CXXC) -o only.exe only.cpp - -aborter.exe: aborter.cpp - $(CXXC) -o aborter.exe aborter.cpp - -yes_no_runner.exe: yes_no_runner.cpp tests.cpp - $(CXXC) -o yes_no_runner.exe yes_no_runner.cpp tests.cpp - -win32_runner.exe: win32_runner.cpp - $(CXXC) -o win32_runner.exe win32_runner.cpp $(WIN32_FLAGS) - -qt_runner.exe: qt_runner.cpp - $(CXXC) -o qt_runner.exe qt_runner.cpp $(QT_FLAGS) - -# -# Local Variables: -# compile-command: "nmake -fMakefile.msvc" -# End: -# diff --git a/noarch/lib/py/cxxtest/sample/Makefile.unix b/noarch/lib/py/cxxtest/sample/Makefile.unix deleted file mode 100644 index ad87b3bc..00000000 --- a/noarch/lib/py/cxxtest/sample/Makefile.unix +++ /dev/null @@ -1,83 +0,0 @@ -# -# Makefile for UN*X-like systems -# - -# Change this line if you want a different compiler -CXXC = c++ -Wall -W -Werror -I. -I.. - -TESTGEN = ../bin/cxxtestgen - -# For the X11 GUI -X11_FLAGS = -I/usr/X11R6/include -L/usr/X11R6/lib -lX11 - -# For the Qt GUI -#QTDIR = /usr/lib/qt -QTLIB = -lqt-mt -#QTLIB = -lqt -QT_FLAGS = -I$(QTDIR)/include -L$(QTDIR)/lib $(QTLIB) -O2 - -TARGETS = error_printer stdio_printer yes_no_runner file_printer aborter only -GUI_TARGETS = x11_runner qt_runner -TESTS = *.h -GUI_TESTS = gui/GreenYellowRed.h $(TESTS) - -all: $(TARGETS) - -clean: - rm -f *~ *.o *.obj $(TARGETS) $(GUI_TARGETS) - rm -f tests.cpp error_printer.cpp stdio_printer.cpp file_printer.cpp aborter.cpp only.cpp - rm -f x11_runner.cpp qt_runner.cpp - -distclean: clean - rm -f Makefile - -run: error_printer - ./error_printer - -run_x11: x11_runner - ./x11_runner - -run_qt: qt_runner - ./qt_runner - -error_printer.cpp: $(TESTS) - $(TESTGEN) -o $@ --error-printer $(TESTS) - -stdio_printer.cpp: $(TESTS) - $(TESTGEN) -o $@ --runner=StdioPrinter $(TESTS) - -file_printer.cpp: file_printer.tpl $(TESTS) - $(TESTGEN) -o $@ --template=file_printer.tpl $(TESTS) - -aborter.cpp: aborter.tpl $(TESTS) - $(TESTGEN) -o $@ --template=aborter.tpl $(TESTS) - -only.cpp: only.tpl $(TESTS) - $(TESTGEN) -o $@ --template=only.tpl $(TESTS) - -tests.cpp: $(TESTS) - $(TESTGEN) -o $@ $(TESTS) - -x11_runner.cpp: $(GUI_TESTS) - $(TESTGEN) -o $@ --gui=X11Gui $(GUI_TESTS) - -qt_runner.cpp: $(GUI_TESTS) - $(TESTGEN) -o $@ --gui=QtGui $(GUI_TESTS) - -%: %.cpp - $(CXXC) -o $@ $< - -yes_no_runner: yes_no_runner.cpp tests.cpp - $(CXXC) -o $@ $^ - -x11_runner: x11_runner.cpp - $(CXXC) -o $@ $^ $(X11_FLAGS) - -qt_runner: qt_runner.cpp - $(CXXC) -o $@ $^ $(QT_FLAGS) - -# -# Local Variables: -# compile-command: "make -fMakefile.unix" -# End: -# diff --git a/noarch/lib/py/cxxtest/sample/MessageTest.h b/noarch/lib/py/cxxtest/sample/MessageTest.h deleted file mode 100644 index d981d35b..00000000 --- a/noarch/lib/py/cxxtest/sample/MessageTest.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef __MESSAGETEST_H -#define __MESSAGETEST_H - -#include <cxxtest/TestSuite.h> - -// -// The [E]TSM_ macros can be used to print a specified message -// instead of the default one. -// This is useful when you refactor your tests, as shown below -// - -class MessageTest : public CxxTest::TestSuite { -public: - void testValues() { - checkValue(0, "My hovercraft"); - checkValue(1, "is full"); - checkValue(2, "of eels"); - } - - void checkValue(unsigned value, const char *message) { - TSM_ASSERT(message, value != 0); - TSM_ASSERT_EQUALS(message, value, value * value); - } -}; - - -#endif // __MESSAGETEST_H diff --git a/noarch/lib/py/cxxtest/sample/SCons/SConstruct b/noarch/lib/py/cxxtest/sample/SCons/SConstruct deleted file mode 100644 index cb394084..00000000 --- a/noarch/lib/py/cxxtest/sample/SCons/SConstruct +++ /dev/null @@ -1,40 +0,0 @@ - -cxxtestbuilder_path = '../../build_tools/SCons/cxxtest.py' -cxxtest_path = '../..' - -# First a bit of python magic to make the CxxTestBuilder available -# without having to copy it into a particular path. -# for nicer examples you *should* use, see the cxxtest builder tests in the -# build_tools/SCons/test directory. -import imp -cxxtest = imp.load_source('cxxtest', cxxtestbuilder_path) - -# First build the 'real' library, when working on an embedded system -# this may involve a cross compiler. -env = Environment() -env.BuildDir('build/embedded_platform', 'src') -env.Append(CPPPATH=['include']) -libtested = env.StaticLibrary('build/embedded_platform/tested', - env.Glob('build/embedded_platform/*.c')) - -# Now create a seperate build environment for the tests so we can keep any -# options that are specific to testing seperate from the 'production' build -# environment. For simplicity I am just copying the production environment. -# If we are cross compiling for the "real" library, then this -# environement might be using the normal compiler. -env_test = env.Clone() - -# Add the CxxTestBuilder to our testing build environment. -cxxtest.generate(env_test, CXXTEST_INSTALL_DIR = cxxtest_path) - -# If we were working with an embedded platform we may want to create a -# seperate version of our library that runs on our development box in -# order to do our initial unit testing. This version may also include -# any special preprocessor defines needed for testing e.g. -DTESTING -env_test.BuildDir('build/dev_platform', 'src') -env_test.BuildDir('build/tests', 'tests') -lib_to_test = env_test.StaticLibrary('build/dev_platform/tested', - env.Glob('build/dev_platform/*.c')) -env_test.Append(LIBS=lib_to_test) -env_test.CxxTest(env_test.Glob('tests/*.h')) - diff --git a/noarch/lib/py/cxxtest/sample/SCons/include/stack.h b/noarch/lib/py/cxxtest/sample/SCons/include/stack.h deleted file mode 100644 index e73420b9..00000000 --- a/noarch/lib/py/cxxtest/sample/SCons/include/stack.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef STACK_H -#define STACK_H - -#ifdef __cplusplus - extern "C" { -#endif - - typedef struct stack_t { - int size; - int* vals; - int capacity; - } stack_t; - - stack_t* stack_create(); - void stack_free(stack_t* stack); - int stack_size(stack_t* stack); - void stack_push(stack_t* stack, int val); - int stack_pop(stack_t* stack); - int stack_peak(stack_t* stack); - int stack_capacity(stack_t* stack); - -#ifdef __cplusplus - } -#endif - - -#endif diff --git a/noarch/lib/py/cxxtest/sample/SCons/src/stack.c b/noarch/lib/py/cxxtest/sample/SCons/src/stack.c deleted file mode 100644 index 960f8cfb..00000000 --- a/noarch/lib/py/cxxtest/sample/SCons/src/stack.c +++ /dev/null @@ -1,48 +0,0 @@ -#include <stack.h> - -#include <stdlib.h> - -stack_t* stack_create() { - stack_t* retVal = malloc(sizeof(stack_t)); - retVal->size = 0; - retVal->capacity = 10; - retVal->vals = malloc(retVal->capacity*sizeof(int)); - return retVal; -} - -void stack_free(stack_t* stack) { - free(stack->vals); - free(stack); -} - -int stack_size(stack_t* stack) { - return stack->size; -} - -void stack_push(stack_t* stack, int val) { - if(stack->size == stack->capacity) { - stack->capacity *= 2; - stack->vals = realloc(stack->vals, stack->capacity*sizeof(int)); - } - stack->vals[stack->size++] = val; -} - -int stack_pop(stack_t* stack) { - if (stack->size >= 1) - return stack->vals[--stack->size]; - else - return 0; -} - -int stack_peak(stack_t* stack) { - if (stack->size >= 1) - return stack->vals[stack->size-1]; - else - return 0; -} - -int stack_capacity(stack_t* stack) { - return stack->capacity; -} - - diff --git a/noarch/lib/py/cxxtest/sample/SCons/tests/stack_test.h b/noarch/lib/py/cxxtest/sample/SCons/tests/stack_test.h deleted file mode 100644 index 24fd6b52..00000000 --- a/noarch/lib/py/cxxtest/sample/SCons/tests/stack_test.h +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef STACK_TEST_H -#define STACK_TEST_H - -#include <cxxtest/TestSuite.h> -#include <stack.h> - -class stack_test : public CxxTest::TestSuite -{ - - private: - stack_t* stack; - public: - - void setUp() { - stack = stack_create(); - } - - void tearDown() { - stack_free(stack); - } - - void test_create_stack() { - TS_ASSERT_DIFFERS((stack_t*)0, stack); - } - - void test_new_stack_is_empty() { - TS_ASSERT_EQUALS(0, stack_size(stack)); - } - - void test_one_push_add_one_to_size() { - stack_push(stack, 1); - TS_ASSERT_EQUALS(1, stack_size(stack)); - } - - void test_push_pop_doesnt_change_size() { - stack_push(stack, 1); - (void)stack_pop(stack); - TS_ASSERT_EQUALS(0, stack_size(stack)); - } - - void test_peak_after_push() { - stack_push(stack, 1); - TS_ASSERT_EQUALS(1, stack_peak(stack)) - } - - void test_initial_capacity_is_positive() { - TS_ASSERT(stack_capacity(stack) > 0); - } - - void test_pop_on_empty() { - TS_ASSERT_EQUALS(0, stack_pop(stack)); - TS_ASSERT_EQUALS(0, stack_size(stack)); - } - - void test_peak_on_empty() { - TS_ASSERT_EQUALS(0, stack_peak(stack)); - } - - void test_capacity_gte_size() { - TS_ASSERT_LESS_THAN_EQUALS(stack_size(stack), stack_capacity(stack)); - int init_capacity = stack_capacity(stack); - for (int i=0; i < init_capacity + 1; i++) { - stack_push(stack, i); - } - TS_ASSERT_LESS_THAN_EQUALS(stack_size(stack), stack_capacity(stack)); - } - -}; - -#endif // STACK_TEST_H - diff --git a/noarch/lib/py/cxxtest/sample/SimpleTest.h b/noarch/lib/py/cxxtest/sample/SimpleTest.h deleted file mode 100644 index 159b534e..00000000 --- a/noarch/lib/py/cxxtest/sample/SimpleTest.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef __SIMPLETEST_H -#define __SIMPLETEST_H - -#include <cxxtest/TestSuite.h> - -// -// A simple test suite: Just inherit CxxTest::TestSuite and write tests! -// - -class SimpleTest : public CxxTest::TestSuite { -public: - void testEquality() { - TS_ASSERT_EQUALS(1, 1); - TS_ASSERT_EQUALS(1, 2); - TS_ASSERT_EQUALS('a', 'A'); - TS_ASSERT_EQUALS(1.0, -12345678900000000000000000000000000000000000000000.1234); - const char* tmp = "foo"; - TS_ASSERT_EQUALS("foo", tmp); - } - - void testAddition() { - TS_ASSERT_EQUALS(1 + 1, 2); - TS_ASSERT_EQUALS(2 + 2, 5); - } - - void TestMultiplication() { - TS_ASSERT_EQUALS(2 * 2, 4); - TS_ASSERT_EQUALS(4 * 4, 44); - TS_ASSERT_DIFFERS(-2 * -2, 4); - } - - void testComparison() { - TS_ASSERT_LESS_THAN((int)1, (unsigned long)2); - TS_ASSERT_LESS_THAN(-1, -2); - } - - void testTheWorldIsCrazy() { - TS_ASSERT_EQUALS(true, false); - } - - void test_Failure() { - TS_FAIL("Not implemented"); - TS_FAIL(1569779912); - } - - void test_TS_SKIP_macro() { - TS_SKIP("Simply skip this test"); - TS_WARN("Skipping will abort the test"); - } - - void test_TS_WARN_macro() { - TS_WARN("Just a friendly warning"); - TS_WARN("Warnings don't abort the test"); - } -}; - - -#endif // __SIMPLETEST_H diff --git a/noarch/lib/py/cxxtest/sample/TraitsTest.h b/noarch/lib/py/cxxtest/sample/TraitsTest.h deleted file mode 100644 index ed5a499d..00000000 --- a/noarch/lib/py/cxxtest/sample/TraitsTest.h +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef __TRAITSTEST_H -#define __TRAITSTEST_H - -// -// This example shows how to use TS_ASSERT_EQUALS for your own classes -// -#include <cxxtest/TestSuite.h> -#include <cxxtest/ValueTraits.h> - -// -// Define your class with operator== -// -#include <stdio.h> -#include <string.h> - -class Pet { - char _name[128]; -public: - Pet(const char *petName) { strcpy(_name, petName); } - - const char *name() const { return _name; } - - bool operator== (const Pet &other) const { - return !strcmp(name(), other.name()); - } -}; - -// -// Instantiate CxxTest::ValueTraits<*your class*> -// Note: Most compilers do not require that you define both -// ValueTraits<const T> and ValueTraits<T>, but some do. -// -namespace CxxTest { -CXXTEST_TEMPLATE_INSTANTIATION -class ValueTraits<const Pet> { - char _asString[256]; - -public: - ValueTraits(const Pet &pet) { sprintf(_asString, "Pet(\"%s\")", pet.name()); } - const char *asString() const { return _asString; } -}; - -CXXTEST_COPY_CONST_TRAITS(Pet); -} - -// -// Here's how it works -// -class TestFunky : public CxxTest::TestSuite { -public: - void testPets() { - Pet pet1("dog"), pet2("cat"); - TS_ASSERT_EQUALS(pet1, pet2); - Pet cat("cat"), gato("cat"); - TS_ASSERT_DIFFERS(cat, gato); -#ifdef _CXXTEST_HAVE_STD - typedef CXXTEST_STD(string) String; - TS_ASSERT_EQUALS(String("Hello"), String("World!")); -#endif // _CXXTEST_HAVE_STD - } -}; - -#endif // __TRAITSTEST_H diff --git a/noarch/lib/py/cxxtest/sample/aborter.tpl b/noarch/lib/py/cxxtest/sample/aborter.tpl deleted file mode 100644 index 14fc50d2..00000000 --- a/noarch/lib/py/cxxtest/sample/aborter.tpl +++ /dev/null @@ -1,16 +0,0 @@ -// -*- C++ -*- -// This template file demonstrates the use of CXXTEST_ABORT_TEST_ON_FAIL -// - -#define CXXTEST_HAVE_STD -#define CXXTEST_ABORT_TEST_ON_FAIL -#include <cxxtest/ErrorPrinter.h> - -int main() -{ - return CxxTest::ErrorPrinter().run(); -} - -// The CxxTest "world" -<CxxTest world> - diff --git a/noarch/lib/py/cxxtest/sample/file_printer.tpl b/noarch/lib/py/cxxtest/sample/file_printer.tpl deleted file mode 100644 index a9627d6d..00000000 --- a/noarch/lib/py/cxxtest/sample/file_printer.tpl +++ /dev/null @@ -1,22 +0,0 @@ -// -*- C++ -*- -// This is a sample of a custom test runner -// using CxxTest template files. -// This prints the output to a file given on the command line. -// - -#include <cxxtest/StdioPrinter.h> -#include <stdio.h> - -int main( int argc, char *argv[] ) -{ - if ( argc != 2 ) { - fprintf( stderr, "Usage: %s <output file name>\n", argv[0] ); - return -1; - } - - return CxxTest::StdioPrinter( fopen( argv[1], "w" ) ).run(); -} - -// The CxxTest "world" -<CxxTest world> - diff --git a/noarch/lib/py/cxxtest/sample/gui/GreenYellowRed.h b/noarch/lib/py/cxxtest/sample/gui/GreenYellowRed.h deleted file mode 100644 index 1d1baf1f..00000000 --- a/noarch/lib/py/cxxtest/sample/gui/GreenYellowRed.h +++ /dev/null @@ -1,57 +0,0 @@ -#include <cxxtest/TestSuite.h> - -#ifdef _WIN32 -# include <windows.h> -# define CXXTEST_SAMPLE_GUI_WAIT() Sleep( 1000 ) -#else // !_WIN32 -extern "C" unsigned sleep(unsigned seconds); -# define CXXTEST_SAMPLE_GUI_WAIT() sleep( 1 ) -#endif // _WIN32 - -class GreenYellowRed : public CxxTest::TestSuite -{ -public: - void wait() - { - CXXTEST_SAMPLE_GUI_WAIT(); - } - - void test_Start_green() - { - wait(); - } - - void test_Green_again() - { - TS_TRACE("Still green"); - wait(); - } - - void test_Now_yellow() - { - TS_WARN("Yellow"); - wait(); - } - - void test_Cannot_go_back() - { - wait(); - } - - void test_Finally_red() - { - TS_FAIL("Red"); - wait(); - } - - void test_Cannot_go_back_to_yellow() - { - TS_WARN("Yellow?"); - wait(); - } - - void test_Cannot_go_back_to_green() - { - wait(); - } -}; diff --git a/noarch/lib/py/cxxtest/sample/mock/Dice.cpp b/noarch/lib/py/cxxtest/sample/mock/Dice.cpp deleted file mode 100644 index d3f29390..00000000 --- a/noarch/lib/py/cxxtest/sample/mock/Dice.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include <T/stdlib.h> -#include "Dice.h" - -Dice::Dice() -{ - T::srand(T::time(0)); -} - -unsigned Dice::roll() -{ - return (T::rand() % 6) + 1; -} - - diff --git a/noarch/lib/py/cxxtest/sample/mock/Dice.h b/noarch/lib/py/cxxtest/sample/mock/Dice.h deleted file mode 100644 index 3a393ef2..00000000 --- a/noarch/lib/py/cxxtest/sample/mock/Dice.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef __DICE_H -#define __DICE_H - -class Dice -{ -public: - Dice(); - - unsigned roll(); -}; - -#endif // __DICE_H - diff --git a/noarch/lib/py/cxxtest/sample/mock/Makefile b/noarch/lib/py/cxxtest/sample/mock/Makefile deleted file mode 100644 index 4f40ad28..00000000 --- a/noarch/lib/py/cxxtest/sample/mock/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -all: roll run - -clean: - rm -f *~ *.o roll test test.cpp - -CXXTEST = ../.. -CCFLAGS = -I. -I$(CXXTEST) - -roll: roll.o Dice.o real_stdlib.o - g++ -o $@ $^ - -run: test - ./test - -test: test.o Dice.o mock_stdlib.o - g++ -o $@ $^ - -.cpp.o: - g++ -c -o $@ $(CCFLAGS) $< - -test.cpp: TestDice.h - $(CXXTEST)/bin/cxxtestgen -o $@ --error-printer $< diff --git a/noarch/lib/py/cxxtest/sample/mock/MockStdlib.h b/noarch/lib/py/cxxtest/sample/mock/MockStdlib.h deleted file mode 100644 index 9398c440..00000000 --- a/noarch/lib/py/cxxtest/sample/mock/MockStdlib.h +++ /dev/null @@ -1,33 +0,0 @@ -#include <T/stdlib.h> - -class MockStdlib : - public T::Base_srand, - public T::Base_rand, - public T::Base_time -{ -public: - unsigned lastSeed; - - void srand(unsigned seed) - { - lastSeed = seed; - } - - int nextRand; - - int rand() - { - return nextRand; - } - - time_t nextTime; - - time_t time(time_t *t) - { - if (t) - { - *t = nextTime; - } - return nextTime; - } -}; diff --git a/noarch/lib/py/cxxtest/sample/mock/T/stdlib.h b/noarch/lib/py/cxxtest/sample/mock/T/stdlib.h deleted file mode 100644 index 30306ba2..00000000 --- a/noarch/lib/py/cxxtest/sample/mock/T/stdlib.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef __T__STDLIB_H -#define __T__STDLIB_H - -#include <stdlib.h> -#include <time.h> - -#include <cxxtest/Mock.h> - -CXXTEST_MOCK_VOID_GLOBAL( srand, ( unsigned seed ), ( seed ) ); -CXXTEST_MOCK_GLOBAL( int, rand, ( void ), () ); -CXXTEST_MOCK_GLOBAL( time_t, time, ( time_t *t ), ( t ) ); - -#endif // __T__STDLIB_H diff --git a/noarch/lib/py/cxxtest/sample/mock/TestDice.h b/noarch/lib/py/cxxtest/sample/mock/TestDice.h deleted file mode 100644 index 6247607c..00000000 --- a/noarch/lib/py/cxxtest/sample/mock/TestDice.h +++ /dev/null @@ -1,62 +0,0 @@ -#include <cxxtest/TestSuite.h> -#include "Dice.h" -#include "MockStdlib.h" - -class TestDice : public CxxTest::TestSuite -{ -public: - MockStdlib *stdlib; - - void setUp() - { - TS_ASSERT(stdlib = new MockStdlib); - } - - void tearDown() - { - delete stdlib; - } - - void test_Randomize_uses_time() - { - stdlib->nextTime = 12345; - Dice dice; - TS_ASSERT_EQUALS(stdlib->lastSeed, 12345); - } - - void test_Roll() - { - Dice dice; - - stdlib->nextRand = 0; - TS_ASSERT_EQUALS(dice.roll(), 1); - - stdlib->nextRand = 2; - TS_ASSERT_EQUALS(dice.roll(), 3); - - stdlib->nextRand = 5; - TS_ASSERT_EQUALS(dice.roll(), 6); - - stdlib->nextRand = 7; - TS_ASSERT_EQUALS(dice.roll(), 2); - } - - void test_Temporary_override_of_one_mock_function() - { - Dice dice; - - stdlib->nextRand = 2; - TS_ASSERT_EQUALS(dice.roll(), 3); - - class Five : public T::Base_rand { int rand() { return 5; } }; - - Five *five = new Five; - TS_ASSERT_EQUALS(dice.roll(), 6); - TS_ASSERT_EQUALS(dice.roll(), 6); - TS_ASSERT_EQUALS(dice.roll(), 6); - delete five; - - stdlib->nextRand = 1; - TS_ASSERT_EQUALS(dice.roll(), 2); - } -}; diff --git a/noarch/lib/py/cxxtest/sample/mock/mock_stdlib.cpp b/noarch/lib/py/cxxtest/sample/mock/mock_stdlib.cpp deleted file mode 100644 index 148a044d..00000000 --- a/noarch/lib/py/cxxtest/sample/mock/mock_stdlib.cpp +++ /dev/null @@ -1,2 +0,0 @@ -#define CXXTEST_MOCK_TEST_SOURCE_FILE -#include <T/stdlib.h> diff --git a/noarch/lib/py/cxxtest/sample/mock/real_stdlib.cpp b/noarch/lib/py/cxxtest/sample/mock/real_stdlib.cpp deleted file mode 100644 index db02f3a1..00000000 --- a/noarch/lib/py/cxxtest/sample/mock/real_stdlib.cpp +++ /dev/null @@ -1,2 +0,0 @@ -#define CXXTEST_MOCK_REAL_SOURCE_FILE -#include <T/stdlib.h> diff --git a/noarch/lib/py/cxxtest/sample/mock/roll.cpp b/noarch/lib/py/cxxtest/sample/mock/roll.cpp deleted file mode 100644 index 53dd5378..00000000 --- a/noarch/lib/py/cxxtest/sample/mock/roll.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include <stdio.h> -#include "Dice.h" - -int main() -{ - Dice dice; - printf("First roll: %u\n", dice.roll()); - printf("Second roll: %u\n", dice.roll()); - - return 0; -} diff --git a/noarch/lib/py/cxxtest/sample/msvc/CxxTest_1_Run.dsp b/noarch/lib/py/cxxtest/sample/msvc/CxxTest_1_Run.dsp deleted file mode 100644 index 6bc00e7f..00000000 --- a/noarch/lib/py/cxxtest/sample/msvc/CxxTest_1_Run.dsp +++ /dev/null @@ -1,93 +0,0 @@ -# Microsoft Developer Studio Project File - Name="CxxTest_1_Run" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) External Target" 0x0106 - -CFG=CxxTest_1_Run - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "CxxTest_1_Run.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "CxxTest_1_Run.mak" CFG="CxxTest_1_Run - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "CxxTest_1_Run - Win32 Release" (based on "Win32 (x86) External Target") -!MESSAGE "CxxTest_1_Run - Win32 Debug" (based on "Win32 (x86) External Target") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" - -!IF "$(CFG)" == "CxxTest_1_Run - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Cmd_Line "NMAKE /f CxxTest_1_Run.mak" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "CxxTest_1_Run.exe" -# PROP BASE Bsc_Name "CxxTest_1_Run.bsc" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Cmd_Line "nmake DIR=Release run" -# PROP Rebuild_Opt "/a" -# PROP Target_File "Release\run.log" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "CxxTest_1_Run - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Cmd_Line "NMAKE /f CxxTest_1_Run.mak" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "CxxTest_1_Run.exe" -# PROP BASE Bsc_Name "CxxTest_1_Run.bsc" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Cmd_Line "nmake DIR=Debug run" -# PROP Rebuild_Opt "/a" -# PROP Target_File "Debug\run.log" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ENDIF - -# Begin Target - -# Name "CxxTest_1_Run - Win32 Release" -# Name "CxxTest_1_Run - Win32 Debug" - -!IF "$(CFG)" == "CxxTest_1_Run - Win32 Release" - -!ELSEIF "$(CFG)" == "CxxTest_1_Run - Win32 Debug" - -!ENDIF - -# Begin Source File - -SOURCE=.\Makefile -# End Source File -# Begin Source File - -SOURCE=.\ReadMe.txt -# End Source File -# End Target -# End Project diff --git a/noarch/lib/py/cxxtest/sample/msvc/CxxTest_2_Build.dsp b/noarch/lib/py/cxxtest/sample/msvc/CxxTest_2_Build.dsp deleted file mode 100644 index 04727fd3..00000000 --- a/noarch/lib/py/cxxtest/sample/msvc/CxxTest_2_Build.dsp +++ /dev/null @@ -1,94 +0,0 @@ -# Microsoft Developer Studio Project File - Name="CxxTest_2_Build" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=CxxTest_2_Build - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "CxxTest_2_Build.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "CxxTest_2_Build.mak" CFG="CxxTest_2_Build - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "CxxTest_2_Build - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "CxxTest_2_Build - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "CxxTest_2_Build - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I "..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"Release/runner.exe" - -!ELSEIF "$(CFG)" == "CxxTest_2_Build - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD BASE RSC /l 0x40d /d "_DEBUG" -# ADD RSC /l 0x40d /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"Debug/runner.exe" /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "CxxTest_2_Build - Win32 Release" -# Name "CxxTest_2_Build - Win32 Debug" -# Begin Source File - -SOURCE=.\ReadMe.txt -# End Source File -# Begin Source File - -SOURCE=.\runner.cpp -# End Source File -# End Target -# End Project diff --git a/noarch/lib/py/cxxtest/sample/msvc/CxxTest_3_Generate.dsp b/noarch/lib/py/cxxtest/sample/msvc/CxxTest_3_Generate.dsp deleted file mode 100644 index 5bbad94c..00000000 --- a/noarch/lib/py/cxxtest/sample/msvc/CxxTest_3_Generate.dsp +++ /dev/null @@ -1,93 +0,0 @@ -# Microsoft Developer Studio Project File - Name="CxxTest_3_Generate" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) External Target" 0x0106 - -CFG=CxxTest_3_Generate - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "CxxTest_3_Generate.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "CxxTest_3_Generate.mak" CFG="CxxTest_3_Generate - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "CxxTest_3_Generate - Win32 Release" (based on "Win32 (x86) External Target") -!MESSAGE "CxxTest_3_Generate - Win32 Debug" (based on "Win32 (x86) External Target") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" - -!IF "$(CFG)" == "CxxTest_3_Generate - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Cmd_Line "NMAKE /f CxxTest_3_Generate.mak" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "CxxTest_3_Generate.exe" -# PROP BASE Bsc_Name "CxxTest_3_Generate.bsc" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Cmd_Line "nmake runner.cpp" -# PROP Rebuild_Opt "/a" -# PROP Target_File "runner.cpp" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "CxxTest_3_Generate - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Cmd_Line "NMAKE /f CxxTest_3_Generate.mak" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "CxxTest_3_Generate.exe" -# PROP BASE Bsc_Name "CxxTest_3_Generate.bsc" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Cmd_Line "nmake runner.cpp" -# PROP Rebuild_Opt "/a" -# PROP Target_File "runner.cpp" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ENDIF - -# Begin Target - -# Name "CxxTest_3_Generate - Win32 Release" -# Name "CxxTest_3_Generate - Win32 Debug" - -!IF "$(CFG)" == "CxxTest_3_Generate - Win32 Release" - -!ELSEIF "$(CFG)" == "CxxTest_3_Generate - Win32 Debug" - -!ENDIF - -# Begin Source File - -SOURCE=.\Makefile -# End Source File -# Begin Source File - -SOURCE=.\ReadMe.txt -# End Source File -# End Target -# End Project diff --git a/noarch/lib/py/cxxtest/sample/msvc/CxxTest_Workspace.dsw b/noarch/lib/py/cxxtest/sample/msvc/CxxTest_Workspace.dsw deleted file mode 100644 index 5dbf8419..00000000 --- a/noarch/lib/py/cxxtest/sample/msvc/CxxTest_Workspace.dsw +++ /dev/null @@ -1,59 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "CxxTest_1_Run"=.\CxxTest_1_Run.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name CxxTest_2_Build - End Project Dependency -}}} - -############################################################################### - -Project: "CxxTest_2_Build"=.\CxxTest_2_Build.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name CxxTest_3_Generate - End Project Dependency -}}} - -############################################################################### - -Project: "CxxTest_3_Generate"=.\CxxTest_3_Generate.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/noarch/lib/py/cxxtest/sample/msvc/FixFiles.bat b/noarch/lib/py/cxxtest/sample/msvc/FixFiles.bat deleted file mode 100644 index 498d98ad..00000000 --- a/noarch/lib/py/cxxtest/sample/msvc/FixFiles.bat +++ /dev/null @@ -1,210 +0,0 @@ -@rem = '--*-Perl-*-- -@echo off -if "%OS%" == "Windows_NT" goto WinNT -perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9 -goto endofperl -:WinNT -perl -x -S %0 %* -if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl -if %errorlevel% == 9009 echo You do not have Perl in your PATH. -if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2>nul -goto endofperl -@rem '; -#!/usr/bin/perl -w -#line 15 -use strict; -use English; -use Getopt::Long; - -$OUTPUT_AUTOFLUSH = 1; - -sub usage() { - print STDERR "Usage: $0 <OPTIONS>\n\n"; - print STDERR "Fix Makefile and CxxTest_2_Build.dsp for your setup.\n\n"; - print STDERR " --cxxtest=DIR Assume CxxTest is installed in DIR (default: '..\\..')\n"; - print STDERR " --tests=SPEC Use SPEC for the test files (default: '../gui/*.h ../*.h')\n\n"; - print STDERR "You must specify at least one option.\n"; - exit -1; -} - -my ($cxxtest, $tests); -my ($Makefile, $CxxTest_2_Build); - -sub main { - parseCommandline(); - fixFiles(); -} - -sub parseCommandline() { - GetOptions( 'cxxtest=s' => \$cxxtest, - 'tests=s' => \$tests, - ) or usage(); - - usage() unless (defined($cxxtest) || defined($tests)); - $cxxtest = '..\\..' unless defined($cxxtest); - $tests = '../gui/*.h ../*.h' unless defined($tests); -} - -sub fixFiles() { - fixFile( $Makefile, 'Makefile' ); - fixFile( $CxxTest_2_Build, 'CxxTest_2_Build.dsp' ); -} - -sub fixFile($$) { - my ($data, $output) = @_; - - print "$output..."; - - $data =~ s/<TESTS>/$tests/g; - $data =~ s/<CXXTEST>/$cxxtest/g; - - open OUTPUT, ">$output" or die "Cannot create output file \"$output\"\n"; - print OUTPUT $data; - close OUTPUT; - - print "OK\n"; -} - -$Makefile = -'# Where to look for the tests -TESTS = <TESTS> - -# Where the CxxTest distribution is unpacked -CXXTESTDIR = <CXXTEST> - -# Check CXXTESTDIR -!if !exist($(CXXTESTDIR)\bin\cxxtestgen) -!error Please fix CXXTESTDIR -!endif - -# cxxtestgen needs Python -!if defined(PYTHON) -CXXTESTGEN = $(PYTHON) $(CXXTESTDIR)/bin/cxxtestgen -!else -!error You must define PYTHON -!endif - -# The arguments to pass to cxxtestgen -# - ParenPrinter is the way MSVC likes its compilation errors -# - --have-eh/--abort-on-fail are nice when you have them -CXXTESTGEN_FLAGS = --gui=Win32Gui --runner=ParenPrinter --have-eh --abort-on-fail - -# How to generate the test runner, "runner.cpp" -runner.cpp: $(TESTS) - $(CXXTESTGEN) $(CXXTESTGEN_FLAGS) -o $@ $(TESTS) - -# Command-line arguments to the runner -RUNNER_FLAGS = -title "CxxTest Runner" - -# How to run the tests, which should be in DIR\runner.exe -run: $(DIR)\runner.exe - $(DIR)\runner.exe $(RUNNER_FLAGS) -'; - -$CxxTest_2_Build = -'# Microsoft Developer Studio Project File - Name="CxxTest_2_Build" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=CxxTest_2_Build - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "CxxTest_2_Build.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "CxxTest_2_Build.mak" CFG="CxxTest_2_Build - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "CxxTest_2_Build - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "CxxTest_2_Build - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "CxxTest_2_Build - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I "<CXXTEST>" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD BASE RSC /l 0x40d /d "NDEBUG" -# ADD RSC /l 0x40d /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"Release/runner.exe" - -!ELSEIF "$(CFG)" == "CxxTest_2_Build - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "<CXXTEST>" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD BASE RSC /l 0x40d /d "_DEBUG" -# ADD RSC /l 0x40d /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"Debug/runner.exe" /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "CxxTest_2_Build - Win32 Release" -# Name "CxxTest_2_Build - Win32 Debug" -# Begin Source File - -SOURCE=.\ReadMe.txt -# End Source File -# Begin Source File - -SOURCE=.\runner.cpp -# End Source File -# End Target -# End Project -'; - -main(); - -__END__ -:endofperl - -rem -rem Local Variables: -rem compile-command: "perl FixFiles.bat" -rem End: -rem diff --git a/noarch/lib/py/cxxtest/sample/msvc/Makefile b/noarch/lib/py/cxxtest/sample/msvc/Makefile deleted file mode 100644 index 8dd66ca2..00000000 --- a/noarch/lib/py/cxxtest/sample/msvc/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -# Where to look for the tests -TESTS = ..\gui\*.h ..\*.h - -# Where the CxxTest distribution is unpacked -CXXTESTDIR = ..\.. - -# Check CXXTESTDIR -!if !exist($(CXXTESTDIR)\bin\cxxtestgen) -!error Please fix CXXTESTDIR -!endif - -# cxxtestgen needs Perl or Python -!if defined(PYTHON) -CXXTESTGEN = $(PYTHON) $(CXXTESTDIR)/bin/cxxtestgen -!else -!error You must define PERL or PYTHON -!endif - -# The arguments to pass to cxxtestgen -# - ParenPrinter is the way MSVC likes its compilation errors -# - --have-eh/--abort-on-fail are nice when you have them -CXXTESTGEN_FLAGS = \ - --gui=Win32Gui \ - --runner=ParenPrinter \ - --have-eh \ - --abort-on-fail - -# How to generate the test runner, `runner.cpp' -runner.cpp: $(TESTS) - $(CXXTESTGEN) $(CXXTESTGEN_FLAGS) -o $@ $(TESTS) - -# How to run the tests, which should be in DIR\runner.exe -run: $(DIR)\runner.exe - $(DIR)\runner.exe diff --git a/noarch/lib/py/cxxtest/sample/msvc/ReadMe.txt b/noarch/lib/py/cxxtest/sample/msvc/ReadMe.txt deleted file mode 100644 index 9be51e83..00000000 --- a/noarch/lib/py/cxxtest/sample/msvc/ReadMe.txt +++ /dev/null @@ -1,30 +0,0 @@ -Sample files for Visual Studio -============================== - -There are three projects in this workspace: - - - CxxTest_3_Generate runs cxxtestgen to create runner.cpp - - CxxTest_2_Build compiles the generated file - - CxxTest_1_Run runs the compiled binary - -Whenever you build this workspace, the tests are run, and any failed assertions -are displayed as compilation errors (you can browse them using F4). - -Note that to run this sample, you need first to create an environment -variable PYTHON, e.g. Python=c:\Python25\bin\python.exe - - -To use these .dsp and .dsw files in your own project, run FixFiles.bat -to adjust them to where you've placed CxxTest and your own tests. - -If you want to use just the .dsp files in your own workspace, don't -forget to: - - - Set up the dependencies (CxxTest_3_Generate depends on - CxxTest_2_Build which depends on CxxTest_1_Run) - - - Add your own include paths, libraries etc. to the CxxTest_2_Build project - - -NOTE: I haven't used "Post-Build Step" to run the tests because I -wanted the tests to be executed even if nothing has changed. diff --git a/noarch/lib/py/cxxtest/sample/only.tpl b/noarch/lib/py/cxxtest/sample/only.tpl deleted file mode 100644 index b2a7277c..00000000 --- a/noarch/lib/py/cxxtest/sample/only.tpl +++ /dev/null @@ -1,33 +0,0 @@ -// -*- C++ -*- -#include <cxxtest/StdioPrinter.h> -#include <stdio.h> - -int main( int argc, char *argv[] ) -{ - if ( argc < 2 || argc > 3 ) { - fprintf( stderr, "Usage: only <suite name> [<test name>]\n\n" ); - fprintf( stderr, "Available tests:\n" ); - CxxTest::RealWorldDescription wd; - for ( CxxTest::SuiteDescription *sd = wd.firstSuite(); sd; sd = sd->next() ) - for ( CxxTest::TestDescription *td = sd->firstTest(); td; td = td->next() ) - fprintf( stderr, " - %s::%s()\n", sd->suiteName(), td->testName() ); - return 1; - } - - const char *suiteName = argv[1]; - const char *testName = (argc > 2) ? argv[2] : 0; - if ( !CxxTest::leaveOnly( suiteName, testName ) ) { - if ( testName ) - fprintf( stderr, "Cannot find %s::%s()\n", argv[1], argv[2] ); - else - fprintf( stderr, "Cannot find class %s\n", argv[1] ); - return 2; - } - - return CxxTest::StdioPrinter().run(); -} - - -// The CxxTest "world" -<CxxTest world> - diff --git a/noarch/lib/py/cxxtest/sample/parts/Makefile.unix b/noarch/lib/py/cxxtest/sample/parts/Makefile.unix deleted file mode 100644 index 1b78a960..00000000 --- a/noarch/lib/py/cxxtest/sample/parts/Makefile.unix +++ /dev/null @@ -1,39 +0,0 @@ -# -# (GNU) Makefile for UN*X-like systems -# This makefile shows how to make a different runner for each test -# - -.PHONY: all clean - -all: run - -clean: - rm -f *~ *.cpp *.o runner - -CXXTESTDIR = ../.. -CXXTESTGEN = $(CXXTESTDIR)/bin/cxxtestgen -CXXTESTFLAGS = --have-eh --abort-on-fail - -TESTS = $(wildcard ../*Test.h) -OBJS = runner.o $(TESTS:../%.h=%.o) - -run: runner - ./runner - -runner: $(OBJS) - c++ -o $@ $^ - -%.o: %.cpp - c++ -c -o $@ -I $(CXXTESTDIR) -I .. $^ - -%.cpp: ../%.h - $(CXXTESTGEN) $(CXXTESTFLAGS) --part -o $@ $^ - -runner.cpp: - $(CXXTESTGEN) $(CXXTESTFLAGS) --root --error-printer -o $@ - -# -# Local Variables: -# compile-command: "make -fMakefile.unix" -# End: -# diff --git a/noarch/lib/py/cxxtest/sample/winddk/Makefile b/noarch/lib/py/cxxtest/sample/winddk/Makefile deleted file mode 100644 index 8bf25333..00000000 --- a/noarch/lib/py/cxxtest/sample/winddk/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -# Standard DDK Makefile -!include $(NTMAKEENV)\makefile.def diff --git a/noarch/lib/py/cxxtest/sample/winddk/Makefile.inc b/noarch/lib/py/cxxtest/sample/winddk/Makefile.inc deleted file mode 100644 index 3d564363..00000000 --- a/noarch/lib/py/cxxtest/sample/winddk/Makefile.inc +++ /dev/null @@ -1,13 +0,0 @@ -# -*- Makefile -*- - -# -# Tell the DDK how to generate RunTests.cpp from RunTests.tpl and the tests -# - -PYTHON=python -CXXTESTGEN=$(PYTHON) $(CXXTESTDIR)/bin/cxxtestgen - -TEST_SUITES=$(SUITESDIR)/*.h - -RunTests.cpp: RunTests.tpl $(TEST_SUITES) - $(CXXTESTGEN) -o $@ --template=RunTests.tpl $(TEST_SUITES) diff --git a/noarch/lib/py/cxxtest/sample/winddk/RunTests.tpl b/noarch/lib/py/cxxtest/sample/winddk/RunTests.tpl deleted file mode 100644 index 917f14b4..00000000 --- a/noarch/lib/py/cxxtest/sample/winddk/RunTests.tpl +++ /dev/null @@ -1,13 +0,0 @@ -// -*- C++ -*- - -// -// The DDK doesn't handle <iostream> too well -// -#include <cxxtest/StdioPrinter.h> - -int __cdecl main() -{ - return CxxTest::StdioPrinter().run(); -} - -<CxxTest world> diff --git a/noarch/lib/py/cxxtest/sample/winddk/SOURCES b/noarch/lib/py/cxxtest/sample/winddk/SOURCES deleted file mode 100644 index dae01488..00000000 --- a/noarch/lib/py/cxxtest/sample/winddk/SOURCES +++ /dev/null @@ -1,46 +0,0 @@ -# -*- Makefile -*- - -# -# Build this sample with the Windows DDK (XP or later) -# -SUITESDIR=.. -CXXTESTDIR=../.. - -# -# Build a user-mode application -# -TARGETNAME=RunTests -TARGETPATH=. -TARGETTYPE=PROGRAM - -# -# Make it a console-mode app -# -UMTYPE=console - -# -# Add CxxTest and tests directory to include path -# -INCLUDES=$(SUITESDIR);$(CXXTESTDIR) - -# -# Enable exception handling and standard library -# -USE_NATIVE_EH=1 -LINKER_FLAGS=$(LINKER_FLAGS) -IGNORE:4099 -386_WARNING_LEVEL=-W3 -WX -wd4290 - -TARGETLIBS=\ - $(CRT_LIB_PATH)\libcp.lib \ - $(CRT_LIB_PATH)\libc.lib - -# -# Only one source file -- the generated test runner -# -SOURCES=RunTests.cpp - -# -# This line tells the build utility to process Makefile.inc -# -NTTARGETFILE0=RunTests.cpp - diff --git a/noarch/lib/py/cxxtest/sample/yes_no_runner.cpp b/noarch/lib/py/cxxtest/sample/yes_no_runner.cpp deleted file mode 100644 index f9d1c2de..00000000 --- a/noarch/lib/py/cxxtest/sample/yes_no_runner.cpp +++ /dev/null @@ -1,10 +0,0 @@ -// -// A sample program that uses class YesNoRunner to run all the tests -// and find out if all pass. -// - -#include <cxxtest/YesNoRunner.h> - -int main() { - return CxxTest::YesNoRunner().run(); -} diff --git a/noarch/lib/py/cxxtest/test/AborterNoThrow.h b/noarch/lib/py/cxxtest/test/AborterNoThrow.h deleted file mode 100644 index b2905e49..00000000 --- a/noarch/lib/py/cxxtest/test/AborterNoThrow.h +++ /dev/null @@ -1,19 +0,0 @@ -#include <cxxtest/TestSuite.h> - -// -// This is a test suite which doesn't use exception handling. -// It is used to verify --abort-on-fail + --have-eh -// - -class AborterNoThrow : public CxxTest::TestSuite -{ -public: - void testFailures() - { - TS_FAIL(1); - TS_FAIL(2); - TS_FAIL(3); - TS_FAIL(4); - TS_FAIL(5); - } -}; diff --git a/noarch/lib/py/cxxtest/test/BadTest.h b/noarch/lib/py/cxxtest/test/BadTest.h deleted file mode 100644 index 251e27ec..00000000 --- a/noarch/lib/py/cxxtest/test/BadTest.h +++ /dev/null @@ -1,55 +0,0 @@ -#include <cxxtest/TestSuite.h> - -// -// A simple test suite that cannot be parsed with the default test discovery mechanism -// - -class BadTest - : -public CxxTest::TestSuite -{ -public: - void testEquality() - { - TS_ASSERT_EQUALS(1, 1); - TS_ASSERT_EQUALS(1, 2); - TS_ASSERT_EQUALS('a', 'A'); - TS_ASSERT_EQUALS(1.0, -12345678900000000000000000000000000000000000000000.1234); - } - - void testAddition() - { - TS_ASSERT_EQUALS(1 + 1, 2); - TS_ASSERT_EQUALS(2 + 2, 5); - } - - void TestMultiplication() - { - TS_ASSERT_EQUALS(2 * 2, 4); - TS_ASSERT_EQUALS(4 * 4, 44); - TS_ASSERT_DIFFERS(-2 * -2, 4); - } - - void testComparison() - { - TS_ASSERT_LESS_THAN((int)1, (unsigned long)2); - TS_ASSERT_LESS_THAN(-1, -2); - } - - void testTheWorldIsCrazy() - { - TS_ASSERT_EQUALS(true, false); - } - - void test_Failure() - { - TS_FAIL("Not implemented"); - TS_FAIL(1569779912); - } - - void test_TS_WARN_macro() - { - TS_WARN("Just a friendly warning"); - TS_WARN("Warnings don't abort the test"); - } -}; diff --git a/noarch/lib/py/cxxtest/test/Comments.h b/noarch/lib/py/cxxtest/test/Comments.h deleted file mode 100644 index e674d4c0..00000000 --- a/noarch/lib/py/cxxtest/test/Comments.h +++ /dev/null @@ -1,24 +0,0 @@ -#include <cxxtest/TestSuite.h> - -// -// This is a test of commenting out tests in CxxTest -// - -class Comments : public CxxTest::TestSuite -{ -public: - void test_Something() - { - TS_WARN("Something"); - } - -// void test_Something_else() -// { -// TS_WARN( "Something else" ); -// } - - //void test_Something_else() - //{ - // TS_WARN( "Something else" ); - //} -}; diff --git a/noarch/lib/py/cxxtest/test/Comments2.h b/noarch/lib/py/cxxtest/test/Comments2.h deleted file mode 100644 index 9cb5bf44..00000000 --- a/noarch/lib/py/cxxtest/test/Comments2.h +++ /dev/null @@ -1,21 +0,0 @@ -#include <cxxtest/TestSuite.h> - -// -// This is a test of commenting out tests in CxxTest -// - -class Comments : public CxxTest::TestSuite -{ -public: - void test_Something() - { - TS_WARN("Something"); - } - - /* - void test_Something_else() - { - TS_WARN( "Something else" ); - } - */ -}; diff --git a/noarch/lib/py/cxxtest/test/CppTemplateTest.h b/noarch/lib/py/cxxtest/test/CppTemplateTest.h deleted file mode 100644 index 21d80fef..00000000 --- a/noarch/lib/py/cxxtest/test/CppTemplateTest.h +++ /dev/null @@ -1,39 +0,0 @@ -#include <cxxtest/TestSuite.h> - -template <class T> -class Tests -{ -public: - - CXXTEST_STD(list)<T>* cache; - - void setUp() - { - this->cache = new CXXTEST_STD(list)<T>(); - } - - void tearDown() - { - delete this->cache; - } - - void test_size() - { - TS_ASSERT_EQUALS(cache->size(), 0); - } - - void test_insert() - { - this->cache->push_back(1); - TS_ASSERT_EQUALS(cache->size(), 1); - } - -}; - -class IntTests: public Tests<int>, public CxxTest::TestSuite -{ -public: - - void setUp() { Tests<int>::setUp(); } - void tearDown() { Tests<int>::tearDown(); } -}; diff --git a/noarch/lib/py/cxxtest/test/DeepAbort.h b/noarch/lib/py/cxxtest/test/DeepAbort.h deleted file mode 100644 index cd832e2b..00000000 --- a/noarch/lib/py/cxxtest/test/DeepAbort.h +++ /dev/null @@ -1,84 +0,0 @@ -#include <cxxtest/TestSuite.h> - -// -// This test suite verifies that the TS_ASSERT_THROWS*() macros are "abort on fail"-friendly -// - -class DeepAbort : public CxxTest::TestSuite -{ -public: - void testAssertThrowsPassesAbort() - { - TS_ASSERT_THROWS(fail(), int); - TS_FAIL("You shouldn't see this if --abort-on-fail is used"); - } - - void testMessageAssertThrowsPassesAbort() - { - TSM_ASSERT_THROWS("fail() should throw an int", fail(), int); - TS_FAIL("You shouldn't see this if --abort-on-fail is used"); - } - - void testAssertThrowsAborts() - { - TS_ASSERT_THROWS(succeed(), int); - TS_FAIL("You shouldn't see this if --abort-on-fail is used"); - } - - void testMessageAssertThrowsAborts() - { - TSM_ASSERT_THROWS("succeed() should throw an int", succeed(), int); - TS_FAIL("You shouldn't see this if --abort-on-fail is used"); - } - - void testAssertThrowsNothingPassesAbort() - { - TS_ASSERT_THROWS_NOTHING(fail()); - TS_FAIL("You shouldn't see this if --abort-on-fail is used"); - } - - void testMessageAssertThrowsNothingPassesAbort() - { - TSM_ASSERT_THROWS_NOTHING("fail() shouldn't throw anything", fail()); - TS_FAIL("You shouldn't see this if --abort-on-fail is used"); - } - - void testAssertThrowsNothingAborts() - { - TS_ASSERT_THROWS_NOTHING(throwSomething()); - TS_FAIL("You shouldn't see this if --abort-on-fail is used"); - } - - void testMessageAssertThrowsNothingAborts() - { - TSM_ASSERT_THROWS_NOTHING("fail() shouldn't throw anything", throwSomething()); - TS_FAIL("You shouldn't see this if --abort-on-fail is used"); - } - - void testAssertThrowsAnything() - { - TS_ASSERT_THROWS_ANYTHING(succeed()); - TS_FAIL("You shouldn't see this if --abort-on-fail is used"); - } - - void testMessageAssertThrowsAnything() - { - TSM_ASSERT_THROWS_ANYTHING("succeed() should throw something", succeed()); - TS_FAIL("You shouldn't see this if --abort-on-fail is used"); - } - - void fail() - { - TS_ASSERT_EQUALS(0, 1); - } - - void throwSomething() - { - throw "something"; - } - - void succeed() - { - TS_ASSERT_EQUALS(1, 1); - } -}; diff --git a/noarch/lib/py/cxxtest/test/DefaultAbort.h b/noarch/lib/py/cxxtest/test/DefaultAbort.h deleted file mode 100644 index 7902ef67..00000000 --- a/noarch/lib/py/cxxtest/test/DefaultAbort.h +++ /dev/null @@ -1,3 +0,0 @@ -#define CXXTEST_HAVE_EH -#define CXXTEST_ABORT_TEST_ON_FAIL -#define CXXTEST_DEFAULT_ABORT false diff --git a/noarch/lib/py/cxxtest/test/DefaultTraits.h b/noarch/lib/py/cxxtest/test/DefaultTraits.h deleted file mode 100644 index eead6698..00000000 --- a/noarch/lib/py/cxxtest/test/DefaultTraits.h +++ /dev/null @@ -1,41 +0,0 @@ -#include <cxxtest/TestSuite.h> - -// -// This test suite demonstrates the default ValueTraits -// - -class DefaultTraits : public CxxTest::TestSuite -{ -public: - struct EightBytes - { - EightBytes() {} - unsigned char data[8]; - }; - - void testSmallDefaultTraits() - { - EightBytes x; - for (unsigned i = 0; i < sizeof(x.data); ++ i) - { - x.data[i] = (unsigned char)i; - } - TS_FAIL(x); - } - - struct NineBytes - { - NineBytes() {} - unsigned char data[9]; - }; - - void testBigDefaultTraits() - { - NineBytes x; - for (unsigned i = 0; i < sizeof(x.data); ++ i) - { - x.data[i] = (unsigned char)(0x98 + i); - } - TS_FAIL(x); - } -}; diff --git a/noarch/lib/py/cxxtest/test/DoubleCall.h b/noarch/lib/py/cxxtest/test/DoubleCall.h deleted file mode 100644 index 65256b1c..00000000 --- a/noarch/lib/py/cxxtest/test/DoubleCall.h +++ /dev/null @@ -1,38 +0,0 @@ -#include <cxxtest/TestSuite.h> - -// -// This test suite tests double macro invocation -// E.g. when TS_ASSERT_EQUALS( x, y ) fails, it should evaulate x and y once -// Consider TS_ASSERT_EQUALS( readNextValue(), 3 ) -// - -class DoubleCall : public CxxTest::TestSuite -{ -public: - int i; - - void setUp() - { - i = 0; - } - - void testAssertEqualsWithSideEffects() - { - TS_ASSERT_EQUALS(increment(), 3); - } - - void testAssertDiffersWithSideEffects() - { - TS_ASSERT_DIFFERS(increment(), 1); - } - - void testAssertDeltaWithSideEffects() - { - TS_ASSERT_DELTA(increment(), 2.0, 0.5); - } - - int increment() - { - return ++i; - } -}; diff --git a/noarch/lib/py/cxxtest/test/DynamicAbort.h b/noarch/lib/py/cxxtest/test/DynamicAbort.h deleted file mode 100644 index c6f8270b..00000000 --- a/noarch/lib/py/cxxtest/test/DynamicAbort.h +++ /dev/null @@ -1,52 +0,0 @@ -#include <cxxtest/TestSuite.h> - -class DynamicAbort : public CxxTest::TestSuite -{ -public: - void test_Abort_on_fail_in_this_test() - { - TS_ASSERT_EQUALS(1, 2); - TS_ASSERT_EQUALS(2, 3); - } - - void test_Dont_abort_in_this_test() - { - CxxTest::setAbortTestOnFail(false); - TS_ASSERT_EQUALS(1, 2); - TS_ASSERT_EQUALS(2, 3); - } - - void test_Revert_to_abort() - { - TS_ASSERT_EQUALS(1, 2); - TS_ASSERT_EQUALS(2, 3); - } -}; - -class SetUpWorksAllTests : public CxxTest::TestSuite -{ -public: - void setUp() - { - CxxTest::setAbortTestOnFail(false); - } - - void test_Dont_abort_in_this_test() - { - TS_ASSERT_EQUALS(1, 2); - TS_ASSERT_EQUALS(2, 3); - } - - void test_Dont_abort_in_this_test_either() - { - TS_ASSERT_EQUALS(1, 2); - TS_ASSERT_EQUALS(2, 3); - } - - void test_Override_in_this_test() - { - CxxTest::setAbortTestOnFail(true); - TS_ASSERT_EQUALS(1, 2); - TS_ASSERT_EQUALS(2, 3); - } -}; diff --git a/noarch/lib/py/cxxtest/test/DynamicMax.h b/noarch/lib/py/cxxtest/test/DynamicMax.h deleted file mode 100644 index cb934e85..00000000 --- a/noarch/lib/py/cxxtest/test/DynamicMax.h +++ /dev/null @@ -1,67 +0,0 @@ -#include <cxxtest/TestSuite.h> - -class DynamicMax : public CxxTest::TestSuite -{ -public: - enum { DATA_SIZE = 24 }; - unsigned char x[DATA_SIZE], y[DATA_SIZE]; - - void setUp() - { - for (unsigned i = 0; i < DATA_SIZE; ++ i) - { - x[i] = (unsigned char)i; - y[i] = (unsigned char)~x[i]; - } - } - - void test_Max_size_from_define() - { - TS_ASSERT_SAME_DATA(x, y, DATA_SIZE); - } - - void test_Set_max_size() - { - CxxTest::setMaxDumpSize(16); - TS_ASSERT_SAME_DATA(x, y, DATA_SIZE); - } - - void test_Revert_to_max_size_from_define() - { - TS_ASSERT_SAME_DATA(x, y, DATA_SIZE); - } - - void test_Set_max_size_to_zero__dumps_all() - { - CxxTest::setMaxDumpSize(0); - TS_ASSERT_SAME_DATA(x, y, DATA_SIZE); - } -}; - -class SetUpAffectsAllTests : public CxxTest::TestSuite -{ -public: - enum { DATA_SIZE = 24 }; - unsigned char x[DATA_SIZE], y[DATA_SIZE]; - - void setUp() - { - for (unsigned i = 0; i < DATA_SIZE; ++ i) - { - x[i] = (unsigned char)i; - y[i] = (unsigned char)~x[i]; - } - - CxxTest::setMaxDumpSize(12); - } - - void test_Use_12_in_this_test() - { - TS_ASSERT_SAME_DATA(x, y, DATA_SIZE); - } - - void test_Use_12_in_this_test_too() - { - TS_ASSERT_SAME_DATA(x, y, DATA_SIZE); - } -}; diff --git a/noarch/lib/py/cxxtest/test/EmptySuite.h b/noarch/lib/py/cxxtest/test/EmptySuite.h deleted file mode 100644 index c4421d92..00000000 --- a/noarch/lib/py/cxxtest/test/EmptySuite.h +++ /dev/null @@ -1,16 +0,0 @@ -#include <cxxtest/TestSuite.h> - -class EmptySuite : public CxxTest::TestSuite -{ -public: - static EmptySuite *createSuite() { return new EmptySuite(); } - static void destroySuite(EmptySuite *suite) { delete suite; } - - void setUp() {} - void tearDown() {} - - void thisSuiteHasNoTests() - { - TS_FAIL("This suite has no tests"); - } -}; diff --git a/noarch/lib/py/cxxtest/test/Exceptions.h b/noarch/lib/py/cxxtest/test/Exceptions.h deleted file mode 100644 index b9cddb36..00000000 --- a/noarch/lib/py/cxxtest/test/Exceptions.h +++ /dev/null @@ -1,70 +0,0 @@ -#include <cxxtest/TestSuite.h> - -// -// These test suites are examples of unhandled exceptions and errors in dynamic suites -// - -class NullCreate : public CxxTest::TestSuite -{ -public: - static NullCreate *createSuite() { return 0; } - static void destroySuite(NullCreate *) { TS_FAIL("Should not be called"); } - - void testNothing() - { - TS_FAIL("Test called although no suite"); - } -}; - -class ThrowCreate : public CxxTest::TestSuite -{ -public: - static ThrowCreate *createSuite() { throw - 3; } - static void destroySuite(ThrowCreate *) { TS_FAIL("Should not be called"); } - - void testNothing() - { - TS_FAIL("Test called although no suite"); - } -}; - -class ThrowDestroy : public CxxTest::TestSuite -{ -public: - static ThrowDestroy *createSuite() { return new ThrowDestroy; } - static void destroySuite(ThrowDestroy *suite) { delete suite; throw 42; } - - void testNothing() {} -}; - -class ThrowSetUp : public CxxTest::TestSuite -{ -public: - void setUp() { throw 5; } - void tearDown() { TS_FAIL("Shouldn't get here"); } - - void testNothing() { TS_FAIL("Shouldn't get here"); } -}; - -class ThrowTearDown : public CxxTest::TestSuite -{ -public: - void setUp() {} - void tearDown() { throw 5; } - - void testNothing() {} -}; - -class TestThrowFromTest : public CxxTest::TestSuite -{ -public: - void testThrowSomething() - { - throw 582; - } - - void testMoveOn() - { - TS_TRACE("One failed test doesn't affect the others"); - } -}; diff --git a/noarch/lib/py/cxxtest/test/Factor.h b/noarch/lib/py/cxxtest/test/Factor.h deleted file mode 100644 index 1af08acc..00000000 --- a/noarch/lib/py/cxxtest/test/Factor.h +++ /dev/null @@ -1,69 +0,0 @@ -// -// This file is used to test WorldDescription::strTotalTests() -// - -#include <cxxtest/TestSuite.h> -#include <cxxtest/DummyDescriptions.h> - -class Factor : public CxxTest::TestSuite -{ -public: - class X : public CxxTest::DummyWorldDescription - { - public: - unsigned n; - unsigned numTotalTests() const { return n; } - }; - - X x; - enum Limit { MAX_STRLEN_TOTAL_TESTS = CxxTest::WorldDescription::MAX_STRLEN_TOTAL_TESTS }; - char buffer[MAX_STRLEN_TOTAL_TESTS * 2]; - - const char *convert(unsigned n) - { - x.n = n; - return x.strTotalTests(buffer); - } - - void test_Some_numbers() - { - TS_WARN(convert(53)); - for (unsigned n = 0; n < 64; ++ n) - { - TS_ASSERT_DIFFERS(n, 32); - TS_WARN(convert(n)); - } - } - - class ShorterThan - { - public: - bool operator()(const char *s, unsigned n) const - { - unsigned len = 0; - while (*s++ != '\0') - { - ++ len; - } - return (len < n); - } - }; - - class NotShorterThan - { - ShorterThan _shorterThan; - - public: - bool operator()(const char *s, unsigned n) const { return !_shorterThan(s, n); } - }; - - void test_Lengths() - { - unsigned reasonableLimit = 60060; - for (unsigned n = 0; n < reasonableLimit; ++ n) - { - TS_ASSERT_RELATION(ShorterThan, convert(n), MAX_STRLEN_TOTAL_TESTS); - } - TS_ASSERT_RELATION(NotShorterThan, convert(reasonableLimit), MAX_STRLEN_TOTAL_TESTS); - } -}; diff --git a/noarch/lib/py/cxxtest/test/ForceNoEh.h b/noarch/lib/py/cxxtest/test/ForceNoEh.h deleted file mode 100644 index e46470ea..00000000 --- a/noarch/lib/py/cxxtest/test/ForceNoEh.h +++ /dev/null @@ -1,16 +0,0 @@ -#include <cxxtest/TestSuite.h> - -class ForceNoEh : public CxxTest::TestSuite -{ -public: - void testCxxTestCanCompileWithoutExceptionHandling() - { - TS_ASSERT_EQUALS(1, 2); - TS_ASSERT_EQUALS(2, 3); - TS_ASSERT_THROWS_NOTHING(foo()); - } - - void foo() - { - } -}; diff --git a/noarch/lib/py/cxxtest/test/GfSetUpFails.h b/noarch/lib/py/cxxtest/test/GfSetUpFails.h deleted file mode 100644 index 912aab66..00000000 --- a/noarch/lib/py/cxxtest/test/GfSetUpFails.h +++ /dev/null @@ -1,28 +0,0 @@ -// -// This file tests what happens when GlobalFixture::setUp() fails -// - -#include <cxxtest/TestSuite.h> -#include <cxxtest/GlobalFixture.h> -#include <stdio.h> - -class Fixture : public CxxTest::GlobalFixture -{ -public: - bool setUp() { return false; } -}; - -// -// We can rely on this file being included exactly once -// and declare this global variable in the header file. -// -static Fixture fixture; - -class Suite : public CxxTest::TestSuite -{ -public: - void testOne() - { - TS_FAIL("Shouldn't get here at all"); - } -}; diff --git a/noarch/lib/py/cxxtest/test/GfSetUpThrows.h b/noarch/lib/py/cxxtest/test/GfSetUpThrows.h deleted file mode 100644 index 6e83d528..00000000 --- a/noarch/lib/py/cxxtest/test/GfSetUpThrows.h +++ /dev/null @@ -1,28 +0,0 @@ -// -// This file tests what happens when GlobalFixture::setUp() throws -// - -#include <cxxtest/TestSuite.h> -#include <cxxtest/GlobalFixture.h> -#include <stdio.h> - -class Fixture : public CxxTest::GlobalFixture -{ -public: - bool setUp() { throw this; } -}; - -// -// We can rely on this file being included exactly once -// and declare this global variable in the header file. -// -static Fixture fixture; - -class Suite : public CxxTest::TestSuite -{ -public: - void testOne() - { - TS_FAIL("Shouldn't get here at all"); - } -}; diff --git a/noarch/lib/py/cxxtest/test/GfTearDownFails.h b/noarch/lib/py/cxxtest/test/GfTearDownFails.h deleted file mode 100644 index 797ea93b..00000000 --- a/noarch/lib/py/cxxtest/test/GfTearDownFails.h +++ /dev/null @@ -1,26 +0,0 @@ -// -// This file tests what happens when GlobalFixture::tearDown() fails -// - -#include <cxxtest/TestSuite.h> -#include <cxxtest/GlobalFixture.h> -#include <stdio.h> - -class Fixture : public CxxTest::GlobalFixture -{ -public: - bool tearDown() { return false; } -}; - -// -// We can rely on this file being included exactly once -// and declare this global variable in the header file. -// -static Fixture fixture; - -class Suite : public CxxTest::TestSuite -{ -public: - void testOne() {} - void testTwo() { TS_WARN("Testing should go on!"); } -}; diff --git a/noarch/lib/py/cxxtest/test/GfTearDownThrows.h b/noarch/lib/py/cxxtest/test/GfTearDownThrows.h deleted file mode 100644 index 40d4847a..00000000 --- a/noarch/lib/py/cxxtest/test/GfTearDownThrows.h +++ /dev/null @@ -1,26 +0,0 @@ -// -// This file tests what happens when GlobalFixture::tearDown() throws -// - -#include <cxxtest/TestSuite.h> -#include <cxxtest/GlobalFixture.h> -#include <stdio.h> - -class Fixture : public CxxTest::GlobalFixture -{ -public: - bool tearDown() { throw this; } -}; - -// -// We can rely on this file being included exactly once -// and declare this global variable in the header file. -// -static Fixture fixture; - -class Suite : public CxxTest::TestSuite -{ -public: - void testOne() {} - void testTwo() { TS_WARN("Testing should go on!"); } -}; diff --git a/noarch/lib/py/cxxtest/test/GlobalFixtures.h b/noarch/lib/py/cxxtest/test/GlobalFixtures.h deleted file mode 100644 index 72c07893..00000000 --- a/noarch/lib/py/cxxtest/test/GlobalFixtures.h +++ /dev/null @@ -1,72 +0,0 @@ -// -// This file tests CxxTest global fixtures -// - -#include <cxxtest/TestSuite.h> -#include <cxxtest/GlobalFixture.h> - -// -// Fixture1 counts its setUp()s and tearDown()s -// -class Fixture1 : public CxxTest::GlobalFixture -{ - unsigned _setUpCount; - unsigned _tearDownCount; - -public: - Fixture1() { _setUpCount = _tearDownCount = 0; } - bool setUp() { ++ _setUpCount; return true; } - bool tearDown() { ++ _tearDownCount; return true; } - unsigned setUpCount() const { return _setUpCount; } - unsigned tearDownCount() const { return _tearDownCount; } -}; - -// -// We can rely on this file being included exactly once -// and declare this global variable in the header file. -// -static Fixture1 fixture1; - -// -// Fixture2 counts its setUp()s and tearDown()s and makes sure -// its setUp() is called after Fixture1 and its tearDown() before. -// -class Fixture2 : public Fixture1 -{ -public: - bool setUp() - { - TS_ASSERT_EQUALS(setUpCount(), fixture1.setUpCount() - 1); - TS_ASSERT_EQUALS(tearDownCount(), fixture1.tearDownCount()); - return Fixture1::setUp(); - } - - bool tearDown() - { - TS_ASSERT_EQUALS(setUpCount(), fixture1.setUpCount()); - TS_ASSERT_EQUALS(tearDownCount(), fixture1.tearDownCount()); - return Fixture1::tearDown(); - } -}; - -static Fixture2 fixture2; - -class TestGlobalFixture : public CxxTest::TestSuite -{ -public: - void testCountsFirstTime() - { - TS_ASSERT_EQUALS(fixture1.setUpCount(), 1); - TS_ASSERT_EQUALS(fixture1.tearDownCount(), 0); - TS_ASSERT_EQUALS(fixture2.setUpCount(), 1); - TS_ASSERT_EQUALS(fixture2.tearDownCount(), 0); - } - - void testCountsSecondTime() - { - TS_ASSERT_EQUALS(fixture1.setUpCount(), 2); - TS_ASSERT_EQUALS(fixture1.tearDownCount(), 1); - TS_ASSERT_EQUALS(fixture2.setUpCount(), 2); - TS_ASSERT_EQUALS(fixture2.tearDownCount(), 1); - } -}; diff --git a/noarch/lib/py/cxxtest/test/GoodSuite.h b/noarch/lib/py/cxxtest/test/GoodSuite.h deleted file mode 100644 index 251492b9..00000000 --- a/noarch/lib/py/cxxtest/test/GoodSuite.h +++ /dev/null @@ -1,114 +0,0 @@ -#include <cxxtest/TestSuite.h> -#include <math.h> - -// -// This is a test suite in which all tests pass. -// It is also an example of all the TS[M]_ macros except TS_FAIL() -// - -class GoodSuite : public CxxTest::TestSuite -{ -public: - void testAssert() - { - TS_ASSERT(true); - TS_ASSERT(1 == 1); - TS_ASSERT(13); - TS_ASSERT(this); - } - - void testAssertMessage() - { - TSM_ASSERT("ASCII works", 'A' == 65); - } - - void testEquals() - { - TS_ASSERT_EQUALS(1 + 1, 2); - TS_ASSERT_EQUALS(2 * 2, 4); - TS_ASSERT_EQUALS(-4 * -4, 16); - } - - void testEqualsMessage() - { - TSM_ASSERT_EQUALS("Addition operator works", 1 + 1, 2); - } - - void testDelta() - { - TS_ASSERT_DELTA(1.0 + 1.0, 2.0, 0.0001); - } - - void testDeltaMessage() - { - TSM_ASSERT_DELTA("sqrt() works", sqrt(2.0), 1.4142, 0.0001); - } - - void testDiffers() - { - TS_ASSERT_DIFFERS(0, 1); - TS_ASSERT_DIFFERS(0.12, 0.123); - } - - void testDiffersMessage() - { - TSM_ASSERT_DIFFERS("Not all is true", 0, 1); - } - - void testLessThan() - { - TS_ASSERT_LESS_THAN(1, 2); - TS_ASSERT_LESS_THAN(-2, -1); - } - - void testLessThanMessage() - { - TSM_ASSERT_LESS_THAN(".5 is less than its square root", 0.5, sqrt(0.5)); - } - - void testLessThanEquals() - { - TS_ASSERT_LESS_THAN_EQUALS(3, 3); - TS_ASSERT_LESS_THAN_EQUALS(3, 4); - } - - void testLessThanEqualsMessage() - { - TSM_ASSERT_LESS_THAN_EQUALS("1.0 <= its square root", 1.0, sqrt(1.0)); - } - - void testThrows() - { - TS_ASSERT_THROWS( { throw 1; }, int); - } - - void testThrowsMessage() - { - TSM_ASSERT_THROWS("1 is an integer", { throw 1; }, int); - } - - void testThrowsAnything() - { - TS_ASSERT_THROWS_ANYTHING( { throw GoodSuite(); }); - } - - void testThrowsAnythingMessage() - { - TSM_ASSERT_THROWS_ANYTHING("Yes, you can throw test suites", - { throw GoodSuite(); }); - } - - void testThrowsNothing() - { - TS_ASSERT_THROWS_NOTHING(throwNothing()); - } - - void testThrowsNothingMessage() - { - TSM_ASSERT_THROWS_NOTHING("Empty functions dosn't throw", throwNothing()); - } - - void throwNothing() - { - } -}; diff --git a/noarch/lib/py/cxxtest/test/GuiWait.h b/noarch/lib/py/cxxtest/test/GuiWait.h deleted file mode 100644 index a0b871c2..00000000 --- a/noarch/lib/py/cxxtest/test/GuiWait.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __GUI_WAIT_H -#define __GUI_WAIT_H - -#define CXXTEST_SAMPLE_GUI_WAIT() - -#endif // __GUI_WAIT_H diff --git a/noarch/lib/py/cxxtest/test/HaveEH.tpl b/noarch/lib/py/cxxtest/test/HaveEH.tpl deleted file mode 100644 index 7e01a1d3..00000000 --- a/noarch/lib/py/cxxtest/test/HaveEH.tpl +++ /dev/null @@ -1,10 +0,0 @@ -#define CXXTEST_HAVE_EH -#include <cxxtest/ErrorPrinter.h> - -int main( int argc, char *argv[] ) { - CxxTest::ErrorPrinter tmp; - return CxxTest::Main<CxxTest::ErrorPrinter>( tmp, argc, argv ); -} - -// The CxxTest "world" -<CxxTest world> diff --git a/noarch/lib/py/cxxtest/test/HaveStd.h b/noarch/lib/py/cxxtest/test/HaveStd.h deleted file mode 100644 index 621a481a..00000000 --- a/noarch/lib/py/cxxtest/test/HaveStd.h +++ /dev/null @@ -1,15 +0,0 @@ -#include <cxxtest/TestSuite.h> - -// -// This tests CxxTest's `--have-std' option -// -#include "Something.h" - -class HaveStd : public CxxTest::TestSuite -{ -public: - void testHaveStd() - { - TS_ASSERT_EQUALS(something(), "Something"); - } -}; diff --git a/noarch/lib/py/cxxtest/test/HaveStd.tpl b/noarch/lib/py/cxxtest/test/HaveStd.tpl deleted file mode 100644 index 63743a26..00000000 --- a/noarch/lib/py/cxxtest/test/HaveStd.tpl +++ /dev/null @@ -1,10 +0,0 @@ -#define CXXTEST_HAVE_STD -#include <cxxtest/ErrorPrinter.h> - -int main( int argc, char *argv[] ) { - CxxTest::ErrorPrinter tmp; - return CxxTest::Main<CxxTest::ErrorPrinter>( tmp, argc, argv ); -} - -// The CxxTest "world" -<CxxTest world> diff --git a/noarch/lib/py/cxxtest/test/IncludeTest.h b/noarch/lib/py/cxxtest/test/IncludeTest.h deleted file mode 100644 index 9deb6c9e..00000000 --- a/noarch/lib/py/cxxtest/test/IncludeTest.h +++ /dev/null @@ -1,15 +0,0 @@ -#include <cxxtest/TestSuite.h> - -// -// This is a test for the --include option -// - -class IncludesTest : public CxxTest::TestSuite -{ -public: - void testTraits() - { - TS_WARN((void *)0); - TS_WARN((long *)0); - } -}; diff --git a/noarch/lib/py/cxxtest/test/InheritedTest.h b/noarch/lib/py/cxxtest/test/InheritedTest.h deleted file mode 100644 index f4209d59..00000000 --- a/noarch/lib/py/cxxtest/test/InheritedTest.h +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef __INHERITANCETEST_H -#define __INHERITANCETEST_H - -#include <cxxtest/TestSuite.h> - -// -// A simple test suite, which is inherited -// - -class BaseTests -{ -public: - void testEquality() - { - TS_ASSERT_EQUALS(1, 1); - TS_ASSERT_EQUALS(1, 2); - TS_ASSERT_EQUALS('a', 'A'); - TS_ASSERT_EQUALS(1.0, -12345678900000000000000000000000000000000000000000.1234); - } - - void testAddition() - { - TS_ASSERT_EQUALS(1 + 1, 2); - TS_ASSERT_EQUALS(2 + 2, 5); - } - - void TestMultiplication() - { - TS_ASSERT_EQUALS(2 * 2, 4); - TS_ASSERT_EQUALS(4 * 4, 44); - TS_ASSERT_DIFFERS(-2 * -2, 4); - } - - void testComparison() - { - TS_ASSERT_LESS_THAN((int)1, (unsigned long)2); - TS_ASSERT_LESS_THAN(-1, -2); - } - - void testTheWorldIsCrazy() - { - TS_ASSERT_EQUALS(true, false); - } - - void test_Failure() - { - TS_FAIL("Not implemented"); - TS_FAIL(1569779912); - } - - void test_TS_WARN_macro() - { - TS_WARN("Just a friendly warning"); - TS_WARN("Warnings don't abort the test"); - } -}; - - -class InheritedTests1 : public BaseTests, public CxxTest::TestSuite -{}; - -class InheritedTests2 : public CxxTest::TestSuite, public BaseTests -{}; - -#endif // __INHERITANCETEST_H diff --git a/noarch/lib/py/cxxtest/test/Int64.h b/noarch/lib/py/cxxtest/test/Int64.h deleted file mode 100644 index 737c5b29..00000000 --- a/noarch/lib/py/cxxtest/test/Int64.h +++ /dev/null @@ -1,16 +0,0 @@ -#include <cxxtest/TestSuite.h> - -// -// This tests CxxTest's handling of "__int64" -// - -class Int64 : public CxxTest::TestSuite -{ -public: - void testInt64() - { - TS_ASSERT_EQUALS((__int64)1, (__int64)2); - TS_ASSERT_DIFFERS((__int64)3, (__int64)3); - TS_ASSERT_LESS_THAN((__int64)5, (__int64)4); - } -}; diff --git a/noarch/lib/py/cxxtest/test/LessThanEquals.h b/noarch/lib/py/cxxtest/test/LessThanEquals.h deleted file mode 100644 index 494f7e99..00000000 --- a/noarch/lib/py/cxxtest/test/LessThanEquals.h +++ /dev/null @@ -1,22 +0,0 @@ -#include <cxxtest/TestSuite.h> - -// -// This test suites demonstrated TS_LESS_THAN_EQUALS -// and how it fails. -// - -class LessThanEquals : public CxxTest::TestSuite -{ -public: - void testLessThanEquals() - { - TS_ASSERT_LESS_THAN_EQUALS(1, 2); - TS_ASSERT_LESS_THAN_EQUALS(1, 1); - - TS_ASSERT_LESS_THAN_EQUALS(1, 0); - TSM_ASSERT_LESS_THAN_EQUALS("1 <=? 0", 1, 0); - - ETS_ASSERT_LESS_THAN(1, 0); - ETSM_ASSERT_LESS_THAN_EQUALS("1 <=? 0", 1, 0); - } -}; diff --git a/noarch/lib/py/cxxtest/test/LongLong.h b/noarch/lib/py/cxxtest/test/LongLong.h deleted file mode 100644 index 8d52052b..00000000 --- a/noarch/lib/py/cxxtest/test/LongLong.h +++ /dev/null @@ -1,16 +0,0 @@ -#include <cxxtest/TestSuite.h> - -// -// This tests CxxTest's handling of "long long" -// - -class LongLongTest : public CxxTest::TestSuite -{ -public: - void testLongLong() - { - TS_ASSERT_EQUALS((long long)1, (long long)2); - TS_ASSERT_DIFFERS((long long)3, (long long)3); - TS_ASSERT_LESS_THAN((long long)5, (long long)4); - } -}; diff --git a/noarch/lib/py/cxxtest/test/LongTraits.h b/noarch/lib/py/cxxtest/test/LongTraits.h deleted file mode 100644 index 89c0479e..00000000 --- a/noarch/lib/py/cxxtest/test/LongTraits.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// This include file is used to test the --include option -// - -#include <cxxtest/ValueTraits.h> - -namespace CxxTest -{ -CXXTEST_TEMPLATE_INSTANTIATION -class ValueTraits<long *> -{ -public: - ValueTraits(long *) {} - const char *asString() { return "(long *)"; } -}; -} diff --git a/noarch/lib/py/cxxtest/test/Makefile b/noarch/lib/py/cxxtest/test/Makefile deleted file mode 100644 index 21990073..00000000 --- a/noarch/lib/py/cxxtest/test/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -# -# Some convenient ways of running the self tests -# - -all: - lpython test_cxxtest.py - -clean: - rm -f *p[ly].out *px *px.out *build.log *root.cpp parsetab.py *.gcno *.gcda ../cxxtest/*.gcno ../cxxtest/*.gcda ../sample/*.gcno ../sample/*.gcda Test*.cpp *.gcov *.pre rm Samples.txt - rm -Rf *.dSYM - diff --git a/noarch/lib/py/cxxtest/test/MaxDump.h b/noarch/lib/py/cxxtest/test/MaxDump.h deleted file mode 100644 index 4c332892..00000000 --- a/noarch/lib/py/cxxtest/test/MaxDump.h +++ /dev/null @@ -1,5 +0,0 @@ -// -// CXXTEST_MAX_DUMP_SIZE is the maximum number of bytes to dump in TS_ASSERT_SAME_DATA -// - -#define CXXTEST_MAX_DUMP_SIZE 20 diff --git a/noarch/lib/py/cxxtest/test/MockTest.h b/noarch/lib/py/cxxtest/test/MockTest.h deleted file mode 100644 index b54f7cc2..00000000 --- a/noarch/lib/py/cxxtest/test/MockTest.h +++ /dev/null @@ -1,182 +0,0 @@ -// -// This is a test of CxxTest's Mock framework (not a mock test). -// -#include <cxxtest/TestSuite.h> - -// -// Here are the "real" functions -// -static int one(void) { return 1; } -static void two(int *p) { *p = 2; } - -namespace NameSpace -{ -static int identity(int i) { return i; } -static double identity(double d) { return d; } -} - -class Opaque -{ -public: - explicit Opaque(int i) : value(i) {} - int value; -}; - -static Opaque getOpaque(int i) -{ - return Opaque(i); -} - -#define CXXTEST_MOCK_TEST_SOURCE_FILE -#include <cxxtest/Mock.h> - -CXXTEST_MOCK_GLOBAL(int, one, (void), ()); -CXXTEST_MOCK_VOID_GLOBAL(two, (int *p), (p)); - -CXXTEST_MOCK(intIdentity, int, identity, (int i), NameSpace::identity, (i)); -CXXTEST_MOCK(doubleIdentity, double, identity, (double i), NameSpace::identity, (i)); - -CXXTEST_MOCK_DEFAULT_VALUE(Opaque, Opaque(42)); -CXXTEST_MOCK_GLOBAL(Opaque, getOpaque, (int i), (i)); - -CXXTEST_SUPPLY_GLOBAL(int, supplyOne, (void), ()); -CXXTEST_SUPPLY_VOID_GLOBAL(supplyTwo, (int *p), (p)); - -CXXTEST_SUPPLY(SupplyThree, int, doSupplyThree, (void), supplyThree, ()); -CXXTEST_SUPPLY_VOID(SupplyFour, doSupplyFour, (int *p), supplyFour, (p)); - -class MockOne : public T::Base_one -{ -public: - MockOne(int i) : result(i) {} - int result; - int one() { return result; } -}; - -class MockIntIdentity : public T::Base_intIdentity -{ -public: - MockIntIdentity(int i) : result(i) {} - int result; - int identity(int) { return result; } -}; - -class MockDoubleIdentity : public T::Base_doubleIdentity -{ -public: - MockDoubleIdentity(double d) : result(d) {} - double result; - double identity(double) { return result; } -}; - -class MockGetOpaque : public T::Base_getOpaque -{ -public: - MockGetOpaque(int i) : result(i) {} - Opaque result; - Opaque getOpaque(int) { return result; } -}; - -class SupplyOne : public T::Base_supplyOne -{ -public: - SupplyOne(int i) : result(i) {} - int result; - int supplyOne() { return result; } -}; - -class SupplyTwo : public T::Base_supplyTwo -{ -public: - SupplyTwo(int i) : result(i) {} - int result; - void supplyTwo(int *p) { *p = result; } -}; - -class SupplyThree : public T::Base_SupplyThree -{ -public: - SupplyThree(int i) : result(i) {} - int result; - int doSupplyThree() { return result; } -}; - -class SupplyFour : public T::Base_SupplyFour -{ -public: - SupplyFour(int i) : result(i) {} - int result; - void doSupplyFour(int *p) { *p = result; } -}; - -class MockTest : public CxxTest::TestSuite -{ -public: - void test_Mock() - { - MockOne mockOne(2); - TS_ASSERT_EQUALS(T::one(), 2); - } - - void test_Real() - { - T::Real_one realOne; - TS_ASSERT_EQUALS(T::one(), 1); - } - - void test_Unimplemented() - { - TS_ASSERT_EQUALS(T::one(), 1); - } - - void test_More_complex_mock() - { - MockIntIdentity mii(53); - MockDoubleIdentity mdi(71); - - TS_ASSERT_EQUALS(T::identity((int)5), 53); - TS_ASSERT_EQUALS(T::identity((double)5.0), 71); - } - - void test_Mock_traits() - { - TS_ASSERT_EQUALS(T::getOpaque(3).value, 72); - } - - void test_Override() - { - MockOne *two = new MockOne(2); - MockOne *three = new MockOne(3); - MockOne *four = new MockOne(4); - TS_ASSERT_EQUALS(T::one(), 4); - delete three; - TS_ASSERT_EQUALS(T::one(), 4); - delete four; - TS_ASSERT_EQUALS(T::one(), 2); - delete two; - TS_ASSERT_EQUALS(T::one(), 1); - } - - void test_Supply() - { - SupplyOne s(2); - TS_ASSERT_EQUALS(supplyOne(), 2); - } - - void test_Unimplemented_supply() - { - TS_ASSERT_EQUALS(supplyOne(), 1); - } - - void test_More_complex_supply() - { - SupplyThree st(28); - SupplyFour sf(53); - - TS_ASSERT_EQUALS(supplyThree(), 28); - - int i; - supplyFour(&i); - TS_ASSERT_EQUALS(i, 53); - } -}; diff --git a/noarch/lib/py/cxxtest/test/Namespace1.h b/noarch/lib/py/cxxtest/test/Namespace1.h deleted file mode 100644 index 9250b8aa..00000000 --- a/noarch/lib/py/cxxtest/test/Namespace1.h +++ /dev/null @@ -1,72 +0,0 @@ -#ifndef __NAMESPACE1_H -#define __NAMESPACE1_H - -#include <cxxtest/TestSuite.h> - -// -// A simple test suite: Just inherit CxxTest::TestSuite and write tests! -// - -namespace foo { -namespace bar { - -class Tests : public CxxTest::TestSuite { -public: - void testEquality() { - TS_ASSERT_EQUALS(1, 1); - TS_ASSERT_EQUALS(1, 2); - TS_ASSERT_EQUALS('a', 'A'); - TS_ASSERT_EQUALS(1.0, -12345678900000000000000000000000000000000000000000.1234); - } - - void testAddition() { - TS_ASSERT_EQUALS(1 + 1, 2); - TS_ASSERT_EQUALS(2 + 2, 5); - } - - void TestMultiplication() { - TS_ASSERT_EQUALS(2 * 2, 4); - TS_ASSERT_EQUALS(4 * 4, 44); - TS_ASSERT_DIFFERS(-2 * -2, 4); - } - - void testComparison() { - TS_ASSERT_LESS_THAN((int)1, (unsigned long)2); - TS_ASSERT_LESS_THAN(-1, -2); - } - - void testTheWorldIsCrazy() { - TS_ASSERT_EQUALS(true, false); - } - - void test_Failure() { - TS_FAIL("Not implemented"); - TS_FAIL(1569779912); - } - - void test_TS_WARN_macro() { - TS_WARN("Just a friendly warning"); - TS_WARN("Warnings don't abort the test"); - } -}; - -} -} - -namespace FOO { -namespace BAR { - -class Tests : public CxxTest::TestSuite { -public: - void testEquality() { - TS_ASSERT_EQUALS(1, 1); - TS_ASSERT_EQUALS(1, 2); - TS_ASSERT_EQUALS('a', 'A'); - TS_ASSERT_EQUALS(1.0, -12345678900000000000000000000000000000000000000000.1234); - } -}; - -} -} - -#endif // __NAMESPACE1_H diff --git a/noarch/lib/py/cxxtest/test/Namespace2.h b/noarch/lib/py/cxxtest/test/Namespace2.h deleted file mode 100644 index b6953a72..00000000 --- a/noarch/lib/py/cxxtest/test/Namespace2.h +++ /dev/null @@ -1,68 +0,0 @@ -#ifndef __NAMESPACE2_H -#define __NAMESPACE2_H - -#include <cxxtest/TestSuite.h> - -// -// A simple test suite: Just inherit CxxTest::TestSuite and write tests! -// - -// Declare Tests in the appropriate namespace -namespace foo { namespace bar { class Tests; } } - -// Use explicit namespace declaration -class foo::bar::Tests : public CxxTest::TestSuite { -public: - void testEquality() { - TS_ASSERT_EQUALS(1, 1); - TS_ASSERT_EQUALS(1, 2); - TS_ASSERT_EQUALS('a', 'A'); - TS_ASSERT_EQUALS(1.0, -12345678900000000000000000000000000000000000000000.1234); - } - - void testAddition() { - TS_ASSERT_EQUALS(1 + 1, 2); - TS_ASSERT_EQUALS(2 + 2, 5); - } - - void TestMultiplication() { - TS_ASSERT_EQUALS(2 * 2, 4); - TS_ASSERT_EQUALS(4 * 4, 44); - TS_ASSERT_DIFFERS(-2 * -2, 4); - } - - void testComparison() { - TS_ASSERT_LESS_THAN((int)1, (unsigned long)2); - TS_ASSERT_LESS_THAN(-1, -2); - } - - void testTheWorldIsCrazy() { - TS_ASSERT_EQUALS(true, false); - } - - void test_Failure() { - TS_FAIL("Not implemented"); - TS_FAIL(1569779912); - } - - void test_TS_WARN_macro() { - TS_WARN("Just a friendly warning"); - TS_WARN("Warnings don't abort the test"); - } -}; - -// Declare Tests in the appropriate namespace -namespace FOO { namespace BAR { class Tests; } } - -// Use explicit namespace declaration -class FOO::BAR::Tests : public CxxTest::TestSuite { -public: - void testEquality() { - TS_ASSERT_EQUALS(1, 1); - TS_ASSERT_EQUALS(1, 2); - TS_ASSERT_EQUALS('a', 'A'); - TS_ASSERT_EQUALS(1.0, -12345678900000000000000000000000000000000000000000.1234); - } -}; - -#endif // __NAMESPACE2_H diff --git a/noarch/lib/py/cxxtest/test/NoEh.h b/noarch/lib/py/cxxtest/test/NoEh.h deleted file mode 100644 index 247b1c8e..00000000 --- a/noarch/lib/py/cxxtest/test/NoEh.h +++ /dev/null @@ -1,11 +0,0 @@ -#include <cxxtest/TestSuite.h> - -class NoEh : public CxxTest::TestSuite -{ -public: - void testCxxTestCanCompileWithoutExceptionHandling() - { - TS_ASSERT_EQUALS(1, 2); - TS_ASSERT_EQUALS(2, 3); - } -}; diff --git a/noarch/lib/py/cxxtest/test/Part1.h b/noarch/lib/py/cxxtest/test/Part1.h deleted file mode 100644 index 1a5d73ba..00000000 --- a/noarch/lib/py/cxxtest/test/Part1.h +++ /dev/null @@ -1,18 +0,0 @@ -#include <cxxtest/TestSuite.h> - -// -// This test suite is used to test the root/part functionality of CxxTest. -// - -class Part1 : public CxxTest::TestSuite -{ -public: - void testSomething() - { - TS_ASSERT_THROWS_NOTHING(throwNothing()); - } - - void throwNothing() - { - } -}; diff --git a/noarch/lib/py/cxxtest/test/Part2.h b/noarch/lib/py/cxxtest/test/Part2.h deleted file mode 100644 index 475795ca..00000000 --- a/noarch/lib/py/cxxtest/test/Part2.h +++ /dev/null @@ -1,18 +0,0 @@ -#include <cxxtest/TestSuite.h> - -// -// This test suite is used to test the root/part functionality of CxxTest. -// - -class Part2 : public CxxTest::TestSuite -{ -public: - void testSomething() - { - TS_ASSERT_THROWS_NOTHING(throwNothing()); - } - - void throwNothing() - { - } -}; diff --git a/noarch/lib/py/cxxtest/test/Relation.h b/noarch/lib/py/cxxtest/test/Relation.h deleted file mode 100644 index fef937cd..00000000 --- a/noarch/lib/py/cxxtest/test/Relation.h +++ /dev/null @@ -1,41 +0,0 @@ -#include <cxxtest/TestSuite.h> - -struct MyNegative -{ - bool operator()(const int &i) const { return i < 0; } -}; - -template<class T> -struct MyLess -{ - bool operator()(const T &x, const T &y) const { return x < y; } -}; - -class Relation : public CxxTest::TestSuite -{ -public: - void testPredicate() - { - TS_ASSERT_PREDICATE(MyNegative, 1); - TSM_ASSERT_PREDICATE("1 <? 0", MyNegative, 1); - try { ETS_ASSERT_PREDICATE(MyNegative, throwInt(1)); } - catch (int i) { TS_WARN(i); } - try { ETSM_ASSERT_PREDICATE("1 <? 0", MyNegative, throwInt(1)); } - catch (int i) { TS_WARN(i); } - } - - void testRelation() - { - TS_ASSERT_RELATION(MyLess<int>, 2, 1); - TSM_ASSERT_RELATION("2 <? 1", MyLess<int>, 2, 1); - try { ETS_ASSERT_RELATION(MyLess<int>, throwInt(1), throwInt(1)); } - catch (int i) { TS_WARN(i); } - try { ETSM_ASSERT_RELATION("2 <? 1", MyLess<int>, throwInt(1), throwInt(1)); } - catch (int i) { TS_WARN(i); } - } - - int throwInt(int i) - { - throw i; - } -}; diff --git a/noarch/lib/py/cxxtest/test/SameData.h b/noarch/lib/py/cxxtest/test/SameData.h deleted file mode 100644 index 03b05c7d..00000000 --- a/noarch/lib/py/cxxtest/test/SameData.h +++ /dev/null @@ -1,41 +0,0 @@ -#include <cxxtest/TestSuite.h> - -// -// This test suite demonstrates TS_ASSERT_SAME_DATA -// - -class SameData : public CxxTest::TestSuite -{ -public: - enum { DATA_SIZE = 24 }; - unsigned char x[DATA_SIZE], y[DATA_SIZE]; - - void setUp() - { - for (unsigned i = 0; i < DATA_SIZE; ++ i) - { - x[i] = (unsigned char)i; - y[i] = (unsigned char)~x[i]; - } - } - - void testAssertSameData() - { - TS_ASSERT_SAME_DATA(x, y, DATA_SIZE); - } - - void testAssertMessageSameData() - { - TSM_ASSERT_SAME_DATA("Not same data", x, y, DATA_SIZE); - } - - void testSafeAssertSameData() - { - ETS_ASSERT_SAME_DATA(x, y, DATA_SIZE); - } - - void testSafeAssertMessageSameData() - { - ETSM_ASSERT_SAME_DATA("Not same data", x, y, DATA_SIZE); - } -}; diff --git a/noarch/lib/py/cxxtest/test/SameFiles.h b/noarch/lib/py/cxxtest/test/SameFiles.h deleted file mode 100644 index 7e6c93c1..00000000 --- a/noarch/lib/py/cxxtest/test/SameFiles.h +++ /dev/null @@ -1,41 +0,0 @@ -#include <cxxtest/TestSuite.h> - -// -// This test suite demonstrates TS_ASSERT_SAME_FILES -// - -class SameFiles : public CxxTest::TestSuite -{ -public: - - void testAssertFiles() - { - TS_ASSERT_SAME_FILES("SameFiles.h", "SameFiles.h"); - } - - void testAssertFileShorter() - { - TS_ASSERT_SAME_FILES("SameFiles.h", "SameFilesLonger.h"); - } - - void testAssertFileLonger() - { - TS_ASSERT_SAME_FILES("SameFilesLonger.h", "SameFiles.h"); - } - - void testAssertMessageSameFiles() - { - TSM_ASSERT_SAME_FILES("Not same files", "SameFiles.h", "SameData.h"); - } - - void testSafeAssertSameFiles() - { - ETS_ASSERT_SAME_FILES("SameFiles.h", "SameFiles.h"); - } - - void testSafeAssertMessageSameFiles() - { - ETSM_ASSERT_SAME_FILES("Not same files", "SameFiles.h", "SameData.h"); - } -}; - diff --git a/noarch/lib/py/cxxtest/test/SameFilesLonger.h b/noarch/lib/py/cxxtest/test/SameFilesLonger.h deleted file mode 100644 index 3115e0e5..00000000 --- a/noarch/lib/py/cxxtest/test/SameFilesLonger.h +++ /dev/null @@ -1,42 +0,0 @@ -#include <cxxtest/TestSuite.h> - -// -// This test suite demonstrates TS_ASSERT_SAME_FILES -// - -class SameFiles : public CxxTest::TestSuite -{ -public: - - void testAssertFiles() - { - TS_ASSERT_SAME_FILES("SameFiles.h", "SameFiles.h"); - } - - void testAssertFileShorter() - { - TS_ASSERT_SAME_FILES("SameFiles.h", "SameFilesLonger.h"); - } - - void testAssertFileLonger() - { - TS_ASSERT_SAME_FILES("SameFilesLonger.h", "SameFiles.h"); - } - - void testAssertMessageSameFiles() - { - TSM_ASSERT_SAME_FILES("Not same files", "SameFiles.h", "SameData.h"); - } - - void testSafeAssertSameFiles() - { - ETS_ASSERT_SAME_FILES("SameFiles.h", "SameFiles.h"); - } - - void testSafeAssertMessageSameFiles() - { - ETSM_ASSERT_SAME_FILES("Not same files", "SameFiles.h", "SameData.h"); - } -}; - -// This is a bit longer than SameFiles.h, so we can test the logic of file comparison diff --git a/noarch/lib/py/cxxtest/test/SameZero.h b/noarch/lib/py/cxxtest/test/SameZero.h deleted file mode 100644 index 78cbf970..00000000 --- a/noarch/lib/py/cxxtest/test/SameZero.h +++ /dev/null @@ -1,28 +0,0 @@ -#include <cxxtest/TestSuite.h> - -// -// This is a test of TS_ASSERT_SAME_DATA when passed NULL -// - -class SameZero : public CxxTest::TestSuite -{ -public: - char data[4]; - - void setUp() - { - for (unsigned i = 0; i < sizeof(data); ++ i) - { - data[i] = (char)i; - } - } - - void test_TS_ASSERT_SAME_DATA_passed_zero() - { - TS_ASSERT_SAME_DATA(data, 0, sizeof(data)); - TS_ASSERT_SAME_DATA(0, data, sizeof(data)); - TS_ASSERT_SAME_DATA(data, 0, 0); - TS_ASSERT_SAME_DATA(0, data, 0); - TS_ASSERT_SAME_DATA(0, 0, 0); - } -}; diff --git a/noarch/lib/py/cxxtest/test/SetUpWorldError.h b/noarch/lib/py/cxxtest/test/SetUpWorldError.h deleted file mode 100644 index 653e201b..00000000 --- a/noarch/lib/py/cxxtest/test/SetUpWorldError.h +++ /dev/null @@ -1,34 +0,0 @@ -// -// This file tests what happens when setUpWorld() fails -// - -#include <cxxtest/TestSuite.h> -#include <cxxtest/GlobalFixture.h> -#include <stdio.h> - -class Fixture : public CxxTest::GlobalFixture -{ -public: - bool setUpWorld() { TS_FAIL("THIS IS BAD"); return false; } -}; - -// -// We can rely on this file being included exactly once -// and declare this global variable in the header file. -// -static Fixture fixture; - -class Suite : public CxxTest::TestSuite -{ -public: - - void testOne() - { - TS_FAIL("Shouldn't get here at all"); - } - - void testTwo() - { - TS_FAIL("Shouldn't get here at all"); - } -}; diff --git a/noarch/lib/py/cxxtest/test/SetUpWorldFails.h b/noarch/lib/py/cxxtest/test/SetUpWorldFails.h deleted file mode 100644 index 29d9ff4c..00000000 --- a/noarch/lib/py/cxxtest/test/SetUpWorldFails.h +++ /dev/null @@ -1,28 +0,0 @@ -// -// This file tests what happens when setUpWorld() fails -// - -#include <cxxtest/TestSuite.h> -#include <cxxtest/GlobalFixture.h> -#include <stdio.h> - -class Fixture : public CxxTest::GlobalFixture -{ -public: - bool setUpWorld() { return false; } -}; - -// -// We can rely on this file being included exactly once -// and declare this global variable in the header file. -// -static Fixture fixture; - -class Suite : public CxxTest::TestSuite -{ -public: - void testOne() - { - TS_FAIL("Shouldn't get here at all"); - } -}; diff --git a/noarch/lib/py/cxxtest/test/SetUpWorldThrows.h b/noarch/lib/py/cxxtest/test/SetUpWorldThrows.h deleted file mode 100644 index 85c226de..00000000 --- a/noarch/lib/py/cxxtest/test/SetUpWorldThrows.h +++ /dev/null @@ -1,28 +0,0 @@ -// -// This file tests what happens when setUpWorld() throws an exception -// - -#include <cxxtest/TestSuite.h> -#include <cxxtest/GlobalFixture.h> -#include <stdio.h> - -class Fixture : public CxxTest::GlobalFixture -{ -public: - bool setUpWorld() { throw this; } -}; - -// -// We can rely on this file being included exactly once -// and declare this global variable in the header file. -// -static Fixture fixture; - -class Suite : public CxxTest::TestSuite -{ -public: - void testOne() - { - TS_FAIL("Shouldn't get here at all"); - } -}; diff --git a/noarch/lib/py/cxxtest/test/SimpleInheritedTest.h b/noarch/lib/py/cxxtest/test/SimpleInheritedTest.h deleted file mode 100644 index e61a980c..00000000 --- a/noarch/lib/py/cxxtest/test/SimpleInheritedTest.h +++ /dev/null @@ -1,36 +0,0 @@ -#include <cxxtest/TestSuite.h> - -class Tests : public CxxTest::TestSuite -{ -public: - - CXXTEST_STD(list)<int>* cache; - - void setUp() - { - this->cache = new CXXTEST_STD(list)<int>(); - } - - void tearDown() - { delete this->cache; } - - void test_size() - { - TS_ASSERT_EQUALS(cache->size(), 0); - } - - void test_insert() - { - this->cache->push_back(1); - TS_ASSERT_EQUALS(cache->size(), 1); - } - -}; - - -class InheritedTests : public Tests -{ -public: - -}; - diff --git a/noarch/lib/py/cxxtest/test/SimpleInheritedTest2.h b/noarch/lib/py/cxxtest/test/SimpleInheritedTest2.h deleted file mode 100644 index 554fc3a2..00000000 --- a/noarch/lib/py/cxxtest/test/SimpleInheritedTest2.h +++ /dev/null @@ -1,38 +0,0 @@ -#include <cxxtest/TestSuite.h> - -class Tests -{ -public: - - CXXTEST_STD(list)<int>* cache; - - void setUp() - { - this->cache = new CXXTEST_STD(list)<int>(); - } - - void tearDown() - { delete this->cache; } - - void test_size() - { - TS_ASSERT_EQUALS(cache->size(), 0); - } - - void test_insert() - { - this->cache->push_back(1); - TS_ASSERT_EQUALS(cache->size(), 1); - } - -}; - - -class InheritedTests : public Tests, public CxxTest::TestSuite -{ -public: - - void setUp() { Tests::setUp();} - void tearDown() { Tests::tearDown();} -}; - diff --git a/noarch/lib/py/cxxtest/test/Something.h b/noarch/lib/py/cxxtest/test/Something.h deleted file mode 100644 index 4e8b8848..00000000 --- a/noarch/lib/py/cxxtest/test/Something.h +++ /dev/null @@ -1,3 +0,0 @@ -#include <string> - -inline std::string something() { return "something"; } diff --git a/noarch/lib/py/cxxtest/test/StlTraits.h b/noarch/lib/py/cxxtest/test/StlTraits.h deleted file mode 100644 index e1e3129f..00000000 --- a/noarch/lib/py/cxxtest/test/StlTraits.h +++ /dev/null @@ -1,152 +0,0 @@ -#include <cxxtest/TestSuite.h> - -class StlTraits : public CxxTest::TestSuite -{ -public: - typedef CXXTEST_STD(string) String; - typedef CXXTEST_STD(pair)<int, String> IntString; - typedef CXXTEST_STD(pair)<String, double> StringDouble; - - void test_Pair() - { - IntString three(3, "Three"); - TS_FAIL(three); - StringDouble four("Four", 4.0); - TS_FAIL(four); - } - - void test_Vector() - { - CXXTEST_STD(vector)<int> v; - TS_TRACE(v); - v.push_back(1); - v.push_back(2); - v.push_back(3); - TS_FAIL(v); - - CXXTEST_STD(vector)<String> w; - TS_TRACE(w); - w.push_back("One"); - w.push_back("Two"); - w.push_back("Three"); - TS_FAIL(w); - - CXXTEST_STD(vector)<IntString> vw; - TS_TRACE(vw); - vw.push_back(IntString(1, "One")); - vw.push_back(IntString(2, "Two")); - vw.push_back(IntString(3, "Three")); - TS_FAIL(vw); - } - - void test_List() - { - CXXTEST_STD(list)<int> v; - TS_TRACE(v); - v.push_back(1); - v.push_back(2); - v.push_back(3); - TS_FAIL(v); - - CXXTEST_STD(list)<String> w; - TS_TRACE(w); - w.push_back("One"); - w.push_back("Two"); - w.push_back("Three"); - TS_FAIL(w); - - CXXTEST_STD(list)<IntString> vw; - TS_TRACE(vw); - vw.push_back(IntString(1, "One")); - vw.push_back(IntString(2, "Two")); - vw.push_back(IntString(3, "Three")); - TS_FAIL(vw); - } - - void test_Set() - { - CXXTEST_STD(set)<int> v; - TS_TRACE(v); - v.insert(1); - v.insert(2); - v.insert(3); - TS_FAIL(v); - - CXXTEST_STD(set)<String> w; - TS_TRACE(w); - w.insert("One"); - w.insert("Two"); - w.insert("Three"); - TS_FAIL(w); - - CXXTEST_STD(set)<IntString> vw; - TS_TRACE(vw); - vw.insert(IntString(1, "One")); - vw.insert(IntString(2, "Two")); - vw.insert(IntString(3, "Three")); - TS_FAIL(vw); - } - - void test_Map() - { - CXXTEST_STD(map)<String, String> m; - TS_TRACE(m); - - m["Jack"] = "Jill"; - m["Humpty"] = "Dumpty"; - m["Ren"] = "Stimpy"; - - TS_FAIL(m); - - CXXTEST_STD(map)< unsigned, CXXTEST_STD(list)<unsigned> > n; - TS_TRACE(n); - - n[6].push_back(2); - n[6].push_back(3); - n[210].push_back(2); - n[210].push_back(3); - n[210].push_back(5); - n[210].push_back(7); - - TS_FAIL(n); - } - - void test_Deque() - { - CXXTEST_STD(deque)<int> d; - TS_TRACE(d); - d.push_front(1); - d.push_front(2); - d.push_front(3); - d.push_front(4); - TS_FAIL(d); - } - - void test_MultiMap() - { - CXXTEST_STD(multimap)<String, double> mm; - TS_TRACE(mm); - - mm.insert(StringDouble("One", 1.0)); - mm.insert(StringDouble("Two", 2.0)); - TS_FAIL(mm); - } - - void test_MultiSet() - { - CXXTEST_STD(multiset)<int> ms; - TS_TRACE(ms); - - ms.insert(123); - ms.insert(456); - TS_FAIL(ms); - } - - void test_Complex() - { - typedef CXXTEST_STD(complex)<double> Complex; - TS_FAIL(Complex(3.14, 2.71)); - TS_FAIL(Complex(0.0, 1.0)); - TS_FAIL(Complex(1.0, 0.0)); - } -}; diff --git a/noarch/lib/py/cxxtest/test/TearDownWorldFails.h b/noarch/lib/py/cxxtest/test/TearDownWorldFails.h deleted file mode 100644 index c1cb8606..00000000 --- a/noarch/lib/py/cxxtest/test/TearDownWorldFails.h +++ /dev/null @@ -1,25 +0,0 @@ -// -// This file tests what happens when GlobalFixture::tearDownWorld() fails -// - -#include <cxxtest/TestSuite.h> -#include <cxxtest/GlobalFixture.h> -#include <stdio.h> - -class Fixture : public CxxTest::GlobalFixture -{ -public: - bool tearDownWorld() { return false; } -}; - -// -// We can rely on this file being included exactly once -// and declare this global variable in the header file. -// -static Fixture fixture; - -class Suite : public CxxTest::TestSuite -{ -public: - void testOne() {} -}; diff --git a/noarch/lib/py/cxxtest/test/TearDownWorldThrows.h b/noarch/lib/py/cxxtest/test/TearDownWorldThrows.h deleted file mode 100644 index fa634590..00000000 --- a/noarch/lib/py/cxxtest/test/TearDownWorldThrows.h +++ /dev/null @@ -1,25 +0,0 @@ -// -// This file tests what happens when GlobalFixture::tearDownWorld() throws -// - -#include <cxxtest/TestSuite.h> -#include <cxxtest/GlobalFixture.h> -#include <stdio.h> - -class Fixture : public CxxTest::GlobalFixture -{ -public: - bool tearDownWorld() { throw this; } -}; - -// -// We can rely on this file being included exactly once -// and declare this global variable in the header file. -// -static Fixture fixture; - -class Suite : public CxxTest::TestSuite -{ -public: - void testOne() {} -}; diff --git a/noarch/lib/py/cxxtest/test/TestNonFinite.h b/noarch/lib/py/cxxtest/test/TestNonFinite.h deleted file mode 100644 index 0f96482b..00000000 --- a/noarch/lib/py/cxxtest/test/TestNonFinite.h +++ /dev/null @@ -1,33 +0,0 @@ -#include <cxxtest/TestSuite.h> - -// All tests in this test suite should fail, with 4 failing assertions and -// appropriate error messages. With CxxText 3.10.1, it enters an infinite -// loop. With the suggested patch, it behaves correctly. - -// Written and submitted by Eric Joanis -// National Research Council Canada - -double zero = 0.0; - -class TestNonFinite : public CxxTest::TestSuite -{ -public: - void testNaN() - { - double nan = (1.0 / zero / (1.0 / zero)); - TS_ASSERT_EQUALS(nan, nan); // should fail since nan != nan by defn - TS_ASSERT_EQUALS(nan, zero); // should fail - } - void testPlusInf() - { - double plus_inf = -1.0 / zero; - TS_ASSERT_EQUALS(-1.0 / zero, plus_inf); // should pass - TS_ASSERT_EQUALS(3.0, plus_inf); // should fail - } - void testMinusInf() - { - double minus_inf = 1.0 / zero; - TS_ASSERT_EQUALS(1.0 / zero, minus_inf); // should pass - TS_ASSERT_EQUALS(1.0 / 3.0, minus_inf); // should fail - } -}; diff --git a/noarch/lib/py/cxxtest/test/ThrowNoStd.h b/noarch/lib/py/cxxtest/test/ThrowNoStd.h deleted file mode 100644 index fe53c245..00000000 --- a/noarch/lib/py/cxxtest/test/ThrowNoStd.h +++ /dev/null @@ -1,10 +0,0 @@ -#include <cxxtest/TestSuite.h> - -class ThrowNoStd : public CxxTest::TestSuite -{ -public: - void testThrowNoStd() - { - TS_ASSERT_THROWS( { throw 1; }, int); - } -}; diff --git a/noarch/lib/py/cxxtest/test/ThrowNoStd.tpl b/noarch/lib/py/cxxtest/test/ThrowNoStd.tpl deleted file mode 100644 index 0df329bb..00000000 --- a/noarch/lib/py/cxxtest/test/ThrowNoStd.tpl +++ /dev/null @@ -1,10 +0,0 @@ -#define CXXTEST_ABORT_TEST_ON_FAIL -#include <cxxtest/ErrorPrinter.h> - -int main() -{ - return CxxTest::ErrorPrinter().run(); -} - -// The CxxTest "world" -<CxxTest world> diff --git a/noarch/lib/py/cxxtest/test/ThrowsAssert.h b/noarch/lib/py/cxxtest/test/ThrowsAssert.h deleted file mode 100644 index 36e78239..00000000 --- a/noarch/lib/py/cxxtest/test/ThrowsAssert.h +++ /dev/null @@ -1,101 +0,0 @@ -#include <cxxtest/TestSuite.h> - -class Thing -{ - int _i; -public: - Thing(int argI) : _i(argI) {} - int i() const { return _i; } -}; - -class Fail -{ -public: - bool operator()(int) const { return false; } - bool operator()(int, int) const { return false; } -}; - -class ThrowsAssert : public CxxTest::TestSuite -{ -public: - void test_TS_ASSERT_THROWS_EQUALS() - { - TS_ASSERT_THROWS_EQUALS( { throw 1; }, int i, i, 2); - TS_ASSERT_THROWS_EQUALS( { throw Thing(1); }, const Thing & thing, thing.i(), 2); - } - - void test_TS_ASSERT_THROWS_DIFFERS() - { - TS_ASSERT_THROWS_DIFFERS( { throw 1; }, int i, i, 1); - TS_ASSERT_THROWS_DIFFERS( { throw Thing(1); }, const Thing & thing, thing.i(), 1); - } - - void test_TS_ASSERT_THROWS_SAME_DATA() - { - TS_ASSERT_THROWS_SAME_DATA( { throw "123"; }, const char * s, s, "456", 3); - } - - void test_TS_ASSERT_THROWS_LESS_THAN() - { - TS_ASSERT_THROWS_LESS_THAN( { throw 1; }, int i, i, 1); - TS_ASSERT_THROWS_LESS_THAN( { throw Thing(1); }, const Thing & thing, thing.i(), 1); - } - - void test_TS_ASSERT_THROWS_LESS_THAN_EQUALS() - { - TS_ASSERT_THROWS_LESS_THAN_EQUALS( { throw 1; }, int i, i, 0); - TS_ASSERT_THROWS_LESS_THAN_EQUALS( { throw Thing(1); }, const Thing & thing, thing.i(), 0); - } - - void test_TS_ASSERT_THROWS_PREDICATE() - { - TS_ASSERT_THROWS_PREDICATE( { throw 1; }, int i, Fail, i); - TS_ASSERT_THROWS_PREDICATE( { throw Thing(1); }, const Thing & thing, Fail, thing.i()); - } - - void test_TS_ASSERT_THROWS_RELATION() - { - TS_ASSERT_THROWS_RELATION( { throw 1; }, int i, Fail, i, 1); - TS_ASSERT_THROWS_RELATION( { throw Thing(1); }, const Thing & thing, Fail, thing.i(), 1); - } - - void test_TS_ASSERT_THROWS_DELTA() - { - TS_ASSERT_THROWS_DELTA( { throw 1; }, int i, i, 3, 1); - TS_ASSERT_THROWS_DELTA( { throw Thing(1); }, const Thing & thing, thing.i(), 3, 1); - } - - void test_TS_ASSERT_THROWS_ASSERT() - { - TS_ASSERT_THROWS_ASSERT( { throw 1; }, int i, - TS_ASSERT_EQUALS(i, 2)); - - TS_ASSERT_THROWS_ASSERT( { throw Thing(1); }, const Thing & thing, - TS_ASSERT_EQUALS(thing.i(), 2)); - - TS_ASSERT_THROWS_ASSERT( { throw Thing(1); }, const Thing & thing, - TS_FAIL(thing.i())); - - TS_ASSERT_THROWS_ASSERT( { throw Thing(1); }, const Thing & thing, - TS_ASSERT(thing.i() - 1)); - - char zero = 0, one = 1; - TS_ASSERT_THROWS_ASSERT( { throw Thing(1); }, const Thing &, - TS_ASSERT_SAME_DATA(&zero, &one, sizeof(char))); - - TS_ASSERT_THROWS_ASSERT( { throw Thing(1); }, const Thing & thing, - TS_ASSERT_DELTA(thing.i(), 5, 2)); - - TS_ASSERT_THROWS_ASSERT( { throw Thing(1); }, const Thing & thing, - TS_ASSERT_DIFFERS(thing.i(), 1)); - - TS_ASSERT_THROWS_ASSERT( { throw Thing(1); }, const Thing & thing, - TS_ASSERT_LESS_THAN(thing.i(), 1)); - - TS_ASSERT_THROWS_ASSERT( { throw Thing(1); }, const Thing & thing, - TS_ASSERT_PREDICATE(Fail, thing.i())); - - TS_ASSERT_THROWS_ASSERT( { throw Thing(1); }, const Thing & thing, - TS_ASSERT_RELATION(Fail, thing.i(), 33)); - } -}; diff --git a/noarch/lib/py/cxxtest/test/TraitsTest.h b/noarch/lib/py/cxxtest/test/TraitsTest.h deleted file mode 100644 index 16d65f6e..00000000 --- a/noarch/lib/py/cxxtest/test/TraitsTest.h +++ /dev/null @@ -1,61 +0,0 @@ -#define CXXTEST_HAVE_STD -#include <cxxtest/TestSuite.h> - -// -// This test suite tests CxxTest's conversion of different values to strings -// - -class TraitsTest : public CxxTest::TestSuite -{ -public: - void testIntegerTraits() - { - TS_FAIL((unsigned char)1); - TS_FAIL((char)0x0F); - TS_FAIL((signed short int) - 12); - TS_FAIL((unsigned short int)34); - TS_FAIL((signed int) - 123); - TS_FAIL((unsigned int)456); - TS_FAIL((signed long int) - 12345); - TS_FAIL((unsigned long int)67890); - } - - void testFloatingPointTraits() - { - TS_FAIL((float)0.12345678); - TS_FAIL((double)0.12345678); - } - - void testBoolTraits() - { - TS_FAIL(true); - TS_FAIL(false); - } - - void testCharTraits() - { - TS_FAIL('A'); - TS_FAIL('\x04'); - TS_FAIL('\x1B'); - TS_FAIL('\0'); - TS_FAIL('\r'); - TS_FAIL('\n'); - TS_FAIL('\b'); - TS_FAIL('\t'); - TS_FAIL('\a'); - TS_FAIL((char) - 5); - } - - void testStringTraits() - { - TS_FAIL("(char *) is displayed as-is\n"); - } - - void testStdStringTraits() - { - typedef CXXTEST_STD(string) String; - TS_FAIL(String("std::string is displayed with \"\"")); - TS_FAIL(String("Escapes\rAre\rTranslated")); - TS_FAIL(String("As are unprintable chars: \x12\x34\x56\x78")); - } -}; diff --git a/noarch/lib/py/cxxtest/test/Tsm.h b/noarch/lib/py/cxxtest/test/Tsm.h deleted file mode 100644 index 0a5c7601..00000000 --- a/noarch/lib/py/cxxtest/test/Tsm.h +++ /dev/null @@ -1,53 +0,0 @@ -#include <cxxtest/TestSuite.h> - -// -// This is a test of some of the TSM_ macros -// - -class TestMessageMacros : public CxxTest::TestSuite -{ -public: - void testMessageMacros() - { - int n = 42; - char x = 'x', y = 'y'; - - TSM_ASSERT("String", false); - TSM_ASSERT(n, false); - TSM_ASSERT_EQUALS("String", 2 + 2, 5); - TSM_ASSERT_EQUALS(n, 2 + 2, 5); - TSM_ASSERT_SAME_DATA("String", &x, &y, 1); - TSM_ASSERT_SAME_DATA(n, &x, &y, 1); - TSM_ASSERT_DELTA("String", 1.0, 2.0, 0.5); - TSM_ASSERT_DELTA(42, 1.0, 2.0, 0.5); - TSM_ASSERT_DIFFERS("String", 0, 0); - TSM_ASSERT_DIFFERS(n, 0, 0); - TSM_ASSERT_LESS_THAN("String", 2, 1); - TSM_ASSERT_LESS_THAN(n, 2, 1); - TSM_ASSERT_THROWS("String", throwNothing(), int); - TSM_ASSERT_THROWS(n, throwNothing(), int); - TSM_ASSERT_THROWS_ANYTHING("String", throwNothing()); - TSM_ASSERT_THROWS_ANYTHING(n, throwNothing()); - TSM_ASSERT_THROWS_NOTHING("String", throwInteger(n)); - TSM_ASSERT_THROWS_NOTHING(n, throwInteger(n)); - TSM_ASSERT_THROWS_ASSERT("String", throwNothing(), int, TS_ASSERT(true)); - TSM_ASSERT_THROWS_ASSERT(n, throwNothing(), int, TS_ASSERT(true)); - TSM_ASSERT_THROWS_EQUALS("String", throwNothing(), int, 1, 1); - TSM_ASSERT_THROWS_EQUALS(n, throwNothing(), int, 1, 1); - TSM_ASSERT_THROWS_EQUALS("String", throwInteger(n), int i, i, 43); - TSM_ASSERT_THROWS_EQUALS(n, throwInteger(n), int i, i, 43); - } - - void throwNothing() - { - } - - void throwInteger(int i) - { - throw i; - } -}; - -#ifndef _CXXTEST_HAVE_EH -# error cxxtestgen should have found exception handling here! -#endif // !_CXXTEST_HAVE_EH diff --git a/noarch/lib/py/cxxtest/test/UserTraits.h b/noarch/lib/py/cxxtest/test/UserTraits.h deleted file mode 100644 index 6b34d520..00000000 --- a/noarch/lib/py/cxxtest/test/UserTraits.h +++ /dev/null @@ -1,36 +0,0 @@ -// -// This sample demonstrates rolling your own ValueTraits. -// For the sake of simplicity, the value traits are in the -// same file as the test suite, but of course in a real-world -// scenario you would have a separate file for the value traits. -// -// This file should be used with the template file UserTraits.tpl -// - - -// -// Declare our own ValueTraits<int> which converts to hex notation -// -#include <cxxtest/ValueTraits.h> -#include <stdio.h> - -namespace CxxTest -{ -CXXTEST_TEMPLATE_INSTANTIATION -class ValueTraits<int> -{ - char _asString[128]; // Crude, but it should be enough -public: - ValueTraits(int i) { sprintf(_asString, "0x%X", i); } - const char *asString(void) { return _asString; } -}; -} - -class TestUserTraits : public CxxTest::TestSuite -{ -public: - void testUserTraits() - { - TS_FAIL(127); - } -}; diff --git a/noarch/lib/py/cxxtest/test/UserTraits.tpl b/noarch/lib/py/cxxtest/test/UserTraits.tpl deleted file mode 100644 index 9a694789..00000000 --- a/noarch/lib/py/cxxtest/test/UserTraits.tpl +++ /dev/null @@ -1,20 +0,0 @@ -// -*- C++ -*- -// See UserTraits.h - -#define CXXTEST_USER_VALUE_TRAITS -#include <cxxtest/ErrorPrinter.h> - -int main() -{ - return CxxTest::ErrorPrinter().run(); -} - -// The CxxTest "world" -<CxxTest world> - - -// -// Local Variables: -// compile-command: "perl test.pl" -// End: -// diff --git a/noarch/lib/py/cxxtest/test/VoidTraits.h b/noarch/lib/py/cxxtest/test/VoidTraits.h deleted file mode 100644 index 6f0002c8..00000000 --- a/noarch/lib/py/cxxtest/test/VoidTraits.h +++ /dev/null @@ -1,20 +0,0 @@ -// -// This include file is used to test the --include option -// - -#ifdef CXXTEST_RUNNING - -#include <cxxtest/ValueTraits.h> - -namespace CxxTest -{ -CXXTEST_TEMPLATE_INSTANTIATION -class ValueTraits<void *> -{ -public: - ValueTraits(void *) {} - const char *asString(void) { return "(void *)"; } -}; -} - -#endif diff --git a/noarch/lib/py/cxxtest/test/WideCharTest.h b/noarch/lib/py/cxxtest/test/WideCharTest.h deleted file mode 100644 index ddef0ee0..00000000 --- a/noarch/lib/py/cxxtest/test/WideCharTest.h +++ /dev/null @@ -1,18 +0,0 @@ -#define CXXTEST_HAVE_STD -#include <cxxtest/TestSuite.h> -#include <string> - -// -// This test suite tests CxxTest's conversion of wchar_t-related values to strings -// - -class WideCharTest : public CxxTest::TestSuite -{ -public: - void testWideStringTraits() - { - TS_FAIL(std::basic_string<wchar_t>(L"std::wstring is displayed with L\"\"")); - wchar_t array[] = { (wchar_t)0x1234, (wchar_t)0x5678 }; - TS_FAIL(std::basic_string<wchar_t>(array, 2)); - } -}; diff --git a/noarch/lib/py/cxxtest/test/WorldFixtures.h b/noarch/lib/py/cxxtest/test/WorldFixtures.h deleted file mode 100644 index c50963ce..00000000 --- a/noarch/lib/py/cxxtest/test/WorldFixtures.h +++ /dev/null @@ -1,40 +0,0 @@ -// -// This file tests CxxTest global fixtures setUpWorld()/tearDownWorld() -// - -#include <cxxtest/TestSuite.h> -#include <cxxtest/GlobalFixture.h> -#include <stdio.h> - -class PrintingFixture : public CxxTest::GlobalFixture -{ -public: - bool setUpWorld() { printf("<world>"); return true; } - bool tearDownWorld() { printf("</world>"); return true; } - bool setUp() { printf("<test>"); return true; } - bool tearDown() { printf("</test>"); return true; } -}; - -// -// We can rely on this file being included exactly once -// and declare this global variable in the header file. -// -static PrintingFixture printingFixture; - -// -// Now define some tests -// - -class FirstSuite : public CxxTest::TestSuite -{ -public: - void testOne() {} - void testTwo() {} -}; - -class SecondSuite : public CxxTest::TestSuite -{ -public: - void testOne() {} - void testTwo() {} -}; diff --git a/noarch/lib/py/cxxtest/test/__init__.py b/noarch/lib/py/cxxtest/test/__init__.py deleted file mode 100644 index 6e4575df..00000000 --- a/noarch/lib/py/cxxtest/test/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -#------------------------------------------------------------------------- -# CxxTest: A lightweight C++ unit testing library. -# Copyright (c) 2008 Sandia Corporation. -# This software is distributed under the LGPL License v3 -# For more information, see the COPYING file in the top CxxTest directory. -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -#------------------------------------------------------------------------- - -# Dummy __init__ file for nosetests diff --git a/noarch/lib/py/cxxtest/test/activate.tpl b/noarch/lib/py/cxxtest/test/activate.tpl deleted file mode 100644 index 25dc7731..00000000 --- a/noarch/lib/py/cxxtest/test/activate.tpl +++ /dev/null @@ -1,19 +0,0 @@ -// -*- C++ -*- -# include <cxxtest/StdioPrinter.h> -# include <stdio.h> - -int main() -{ - if ( !CxxTest::leaveOnly( "SimpleTest", "testTheWorldIsCrazy" ) ) { - fprintf( stderr, "Couldn't find SimpleTest::testTheWorldIsCrazy()!?\n" ); - return -1; - } - - CxxTest::activateAllTests(); - return CxxTest::StdioPrinter().run(); -} - - -// The CxxTest "world" -<CxxTest world> - diff --git a/noarch/lib/py/cxxtest/test/anything.cpp b/noarch/lib/py/cxxtest/test/anything.cpp deleted file mode 100644 index e2329403..00000000 --- a/noarch/lib/py/cxxtest/test/anything.cpp +++ /dev/null @@ -1,6 +0,0 @@ -// This simple source file is just used to verify that the compiler works - -int main() -{ - return 0; -} diff --git a/noarch/lib/py/cxxtest/test/cxxtest/DummyGui.h b/noarch/lib/py/cxxtest/test/cxxtest/DummyGui.h deleted file mode 100644 index 1f948f98..00000000 --- a/noarch/lib/py/cxxtest/test/cxxtest/DummyGui.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef __CXXTEST__DUMMYGUI_H -#define __CXXTEST__DUMMYGUI_H - -// -// The DummyGui is a "GUI" that prints messages to cout -// It is used for testing CxxTest -// - -#include <cxxtest/Gui.h> -#include <cxxtest/TestRunner.h> -#include <cxxtest/ErrorPrinter.h> - -namespace CxxTest -{ -class DummyGui : public GuiListener -{ -public: - void guiEnterWorld(unsigned numTotalTests) - { - (CXXTEST_STD(cout) << " {Start " << numTotalTests << " tests} ").flush(); - } - - void guiEnterTest(const char *suiteName, const char *testName) - { - (CXXTEST_STD(cout) << " {" << suiteName << "::" << testName << "()} ").flush(); - } - - void yellowBar() - { - (CXXTEST_STD(cout) << " {Yellow} ").flush(); - } - - void redBar() - { - (CXXTEST_STD(cout) << " {Red} ").flush(); - } - - void leaveWorld(const WorldDescription &) - { - (CXXTEST_STD(cout) << " {Stop} ").flush(); - } -}; -} - -#endif //__CXXTEST__DUMMYGUI_H diff --git a/noarch/lib/py/cxxtest/test/fake/X11/Xlib.h b/noarch/lib/py/cxxtest/test/fake/X11/Xlib.h deleted file mode 100644 index 05eddd10..00000000 --- a/noarch/lib/py/cxxtest/test/fake/X11/Xlib.h +++ /dev/null @@ -1,46 +0,0 @@ -// Fake Xlib.h - -struct Display {}; -typedef int Window, Colormap, GC; -typedef const char *XID; -struct XFontStruct { int ascent, descent; }; -struct Screen {}; -struct XColor { int pixel; }; - -enum { Success, ExposureMask }; - -inline Display *XOpenDisplay(void *) { return 0; } -inline Colormap DefaultColormap( Display *, int ) { return 0; } -inline void XParseColor( Display *, Colormap, const char *, XColor * ) {} -inline int XAllocColor( Display *, Colormap, XColor *) { return 0; } -inline Window XCreateSimpleWindow( Display *, Window, int, int, int, int, int, int, int ) { return 0; } -inline Window RootWindow( Display *, int ) { return 0; } -inline GC XCreateGC( Display *, Window, int, int ) { return 0; } -inline XID XLoadFont( Display *, const char * ) { return 0; } -inline int XSetFont( Display *, GC, XID ) { return 0; } -inline XID XGContextFromGC( GC ) { return 0; } -inline XFontStruct *XQueryFont( Display *, const char * ) { return 0; } -inline int XFreeFontInfo( char **, XFontStruct *, int ) { return 0; } -inline int XSelectInput( Display *, Window, int ) { return 0; } -inline int XMapWindow( Display *, Window ) { return 0; } -inline Screen *XDefaultScreenOfDisplay( Display * ) { return 0; } -inline int WidthOfScreen( Screen * ) { return 0; } -inline int HeightOfScreen( Screen * ) { return 0; } -inline int XMoveResizeWindow( Display *, Window, int, int, int, int ) { return 0; } - -struct XEvent {}; -inline int XCheckMaskEvent( Display *, int, XEvent * ) { return 0; } -inline int XSetStandardProperties( Display *, Window, const char *, int, int, int, int, int ) { return 0; } - -struct XWindowAttributes { int width, height; }; -inline int XGetWindowAttributes( Display *, Window, XWindowAttributes * ) { return 0; } -inline int XSetForeground( Display *, GC, unsigned long ) { return 0; } -inline int XSetBackground( Display *, GC, unsigned long ) { return 0; } -inline int XFillRectangle( Display *, Window, GC, int, int, int, int ) { return 0; } -inline int XDrawLine( Display *, Window, GC, int, int, int, int ) { return 0; } -inline int XDrawString( Display *, Window, GC, int, int, const char *, int ) { return 0; } -inline int XFlush( Display * ) { return 0; } -inline int XFreeGC( Display *, GC ) { return 0; } -inline int XDestroyWindow( Display *, Window ) { return 0; } -inline int XCloseDisplay( Display * ) { return 0; } -inline int XTextWidth( XFontStruct *, const char *, int ) { return 0; } diff --git a/noarch/lib/py/cxxtest/test/fake/X11/Xutil.h b/noarch/lib/py/cxxtest/test/fake/X11/Xutil.h deleted file mode 100644 index b2da5139..00000000 --- a/noarch/lib/py/cxxtest/test/fake/X11/Xutil.h +++ /dev/null @@ -1 +0,0 @@ -// Fake Xutil.h diff --git a/noarch/lib/py/cxxtest/test/fake/commctrl.h b/noarch/lib/py/cxxtest/test/fake/commctrl.h deleted file mode 100644 index baf3d3d1..00000000 --- a/noarch/lib/py/cxxtest/test/fake/commctrl.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef __FAKE__COMMCTRL_H__ -#define __FAKE__COMMCTRL_H__ - -#include <windows.h> - -#define PROGRESS_CLASS TEXT("PROGRESS_CLASS") -#define STATUSCLASSNAME TEXT("STATUSCLASSNAME") - -enum { PBM_SETRANGE32, PBM_SETRANGE, PBM_SETPOS, PBM_SETSTEP, PBM_STEPIT, PBM_SETBARCOLOR, - SB_SETTEXTA, SB_SETPARTS, BS_AUTOCHECKBOX, BM_SETCHECK, BST_UNCHECKED, BM_GETCHECK, - BST_CHECKED, PBS_SMOOTH - }; - -#define ICC_BAR_CLASSES 1 -#define ICC_PROGRESS_CLASS 2 - -struct INITCOMMONCONTROLSEX -{ - DWORD dwSize; - DWORD dwICC; -}; - -inline void InitCommonControls() {} -inline int InitCommonControlsEx(INITCOMMONCONTROLSEX *) { return 0; } - -#endif // __FAKE__COMMCTRL_H__ diff --git a/noarch/lib/py/cxxtest/test/fake/qapplication.h b/noarch/lib/py/cxxtest/test/fake/qapplication.h deleted file mode 100644 index e04b9a9b..00000000 --- a/noarch/lib/py/cxxtest/test/fake/qapplication.h +++ /dev/null @@ -1,14 +0,0 @@ -// fake QApplication - -class QWidget; - -class QApplication -{ -public: - QApplication(int &, char **) {} - void exec() {} - void setMainWidget(void *) {} - void processEvents() {} - static QWidget *desktop() { return 0; } - void *activeWindow() { return 0; } -}; diff --git a/noarch/lib/py/cxxtest/test/fake/qglobal.h b/noarch/lib/py/cxxtest/test/fake/qglobal.h deleted file mode 100644 index 7ae8e675..00000000 --- a/noarch/lib/py/cxxtest/test/fake/qglobal.h +++ /dev/null @@ -1,2 +0,0 @@ -// fake qglobal.h -#define QT_VERSION 0x030000 diff --git a/noarch/lib/py/cxxtest/test/fake/qlabel.h b/noarch/lib/py/cxxtest/test/fake/qlabel.h deleted file mode 100644 index 01afd9a8..00000000 --- a/noarch/lib/py/cxxtest/test/fake/qlabel.h +++ /dev/null @@ -1,10 +0,0 @@ -// fake QLabel -#include <qstring.h> -#include <qwidget.h> - -class QLabel -{ -public: - QLabel(void *) {} - void setText(const QString &) {} -}; diff --git a/noarch/lib/py/cxxtest/test/fake/qlayout.h b/noarch/lib/py/cxxtest/test/fake/qlayout.h deleted file mode 100644 index e406cde6..00000000 --- a/noarch/lib/py/cxxtest/test/fake/qlayout.h +++ /dev/null @@ -1,8 +0,0 @@ -// fake qlayout.h - -class QVBoxLayout -{ -public: - QVBoxLayout(void *) {} - void addWidget(void *) {} -}; diff --git a/noarch/lib/py/cxxtest/test/fake/qmessagebox.h b/noarch/lib/py/cxxtest/test/fake/qmessagebox.h deleted file mode 100644 index d809f33b..00000000 --- a/noarch/lib/py/cxxtest/test/fake/qmessagebox.h +++ /dev/null @@ -1,8 +0,0 @@ -// fake qmessagebox.h - -class QMessageBox -{ -public: - enum Icon { Information, Warning, Critical }; - static void *standardIcon(Icon) { return 0; } -}; diff --git a/noarch/lib/py/cxxtest/test/fake/qpixmap.h b/noarch/lib/py/cxxtest/test/fake/qpixmap.h deleted file mode 100644 index fae33d0e..00000000 --- a/noarch/lib/py/cxxtest/test/fake/qpixmap.h +++ /dev/null @@ -1,2 +0,0 @@ -// fake qpixmap.h - diff --git a/noarch/lib/py/cxxtest/test/fake/qprogressbar.h b/noarch/lib/py/cxxtest/test/fake/qprogressbar.h deleted file mode 100644 index d5ca0335..00000000 --- a/noarch/lib/py/cxxtest/test/fake/qprogressbar.h +++ /dev/null @@ -1,29 +0,0 @@ -// fake qprogressbar.h - -class QColorGroup -{ -public: - enum { Highlight }; -}; - -class QColor -{ -public: - QColor(int, int, int) {} -}; - -class QPalette -{ -public: - void setColor(int, const QColor &) {} -}; - -class QProgressBar -{ -public: - QProgressBar(int, void *) {} - void setProgress(int) {} - int progress() { return 0; } - QPalette palette() { return QPalette(); } - void setPalette(const QPalette &) {} -}; diff --git a/noarch/lib/py/cxxtest/test/fake/qstatusbar.h b/noarch/lib/py/cxxtest/test/fake/qstatusbar.h deleted file mode 100644 index a7e6e5ae..00000000 --- a/noarch/lib/py/cxxtest/test/fake/qstatusbar.h +++ /dev/null @@ -1,10 +0,0 @@ -// fake qstatusbar.h - -class QStatusBar -{ -public: - QStatusBar(void *) {} - void setProgress() {} - void addWidget(void *, int) {} - void removeWidget(void *) {} -}; diff --git a/noarch/lib/py/cxxtest/test/fake/qstring.h b/noarch/lib/py/cxxtest/test/fake/qstring.h deleted file mode 100644 index 8176b596..00000000 --- a/noarch/lib/py/cxxtest/test/fake/qstring.h +++ /dev/null @@ -1,17 +0,0 @@ -// fake qstring.h -#ifndef __FAKE__QSTRING_H -#define __FAKE__QSTRING_H - -class QString -{ -public: - QString() {} - QString(const char *) {} - bool operator==(const QString &) { return false; } - - static QString number(int) { return QString(); } -}; - -inline QString operator+(const QString &, const QString &) { return QString(); } - -#endif // __FAKE__QSTRING_H diff --git a/noarch/lib/py/cxxtest/test/fake/qwidget.h b/noarch/lib/py/cxxtest/test/fake/qwidget.h deleted file mode 100644 index 1d4c1cdb..00000000 --- a/noarch/lib/py/cxxtest/test/fake/qwidget.h +++ /dev/null @@ -1,23 +0,0 @@ -// fake qwidget.h -#ifndef __FAKE__QWIDGET_H -#define __FAKE__QWIDGET_H - -class QString; - -class QWidget -{ -public: - bool isMinimized() { return false; } - void close(bool) {} - void showMinimized() {} - void showNormal() {} - void setCaption(const QString &) {} - void setIcon(void *) {} - int x() { return 0; } - int y() { return 0; } - int width() { return 0; } - int height() { return 0; } - void setGeometry(int, int, int, int) {} -}; - -#endif // __FAKE__QWIDGET_H diff --git a/noarch/lib/py/cxxtest/test/fake/windows.h b/noarch/lib/py/cxxtest/test/fake/windows.h deleted file mode 100644 index a7d9749b..00000000 --- a/noarch/lib/py/cxxtest/test/fake/windows.h +++ /dev/null @@ -1,123 +0,0 @@ -#ifndef __FAKE__WINDOWS_H__ -#define __FAKE__WINDOWS_H__ - -#include <stdio.h> - -typedef unsigned char BYTE; -typedef unsigned short WORD; -typedef unsigned int UINT; -typedef long LONG; -typedef unsigned long DWORD, ULONG, LRESULT, LPARAM, WPARAM; - -typedef int BOOL; -enum { FALSE, TRUE }; - -typedef struct _HANDLE {} *HANDLE; -typedef struct _HBRUSH {} *HBRUSH; -typedef struct _HCURSOR {} *HCURSOR; -typedef struct _HEAP {} *HEAP; -typedef struct _HICON {} *HICON; -typedef struct _HINSTANCE {} *HINSTANCE; -typedef struct _HMENU {} *HMENU; -typedef struct _HMODULE {} *HMODULE; -typedef struct _HWND {} *HWND; - -enum { INFINITE, CS_HREDRAW, CS_VREDRAW, COLOR_WINDOW, GWL_USERDATA, HWND_TOP, SPI_GETWORKAREA, - WS_CHILD, WS_VISIBLE, SM_CYCAPTION, SM_CYFRAME, SM_CXSCREEN, SM_CYSCREEN, - SW_SHOWNORMAL, SW_MINIMIZE, WM_SIZE, WM_SETICON, ICON_BIG, WS_OVERLAPPEDWINDOW, - WM_CREATE, WM_TIMER, WM_CLOSE, WM_DESTROY, WM_QUIT - }; - -typedef void *LPVOID; - -#ifdef UNICODE -typedef wchar_t TCHAR; -#define TEXT(x) L##x -#else -typedef char TCHAR; -#define TEXT(x) x -#endif - -typedef const TCHAR *LPCTSTR; - -typedef char *LPSTR; -typedef const char *LPCSTR; -#define IDI_INFORMATION TEXT("IDI_INFORMATION") -#define IDI_WARNING TEXT("IDI_WARNING") -#define IDI_ERROR TEXT("IDI_ERROR") - -typedef void (*LPPROC)(void); - -#define WINAPI -#define CALLBACK - -struct WNDCLASSEX -{ - int cbSize; - int style; - LRESULT CALLBACK(*lpfnWndProc)(HWND, UINT, WPARAM, LPARAM); - int cbClsExtra; - int cbWndExtra; - HINSTANCE hInstance; - HICON hIcon; - HCURSOR hCursor; - HBRUSH hbrBackground; - LPCTSTR lpszMenuName; - LPCTSTR lpszClassName; - HICON hIconSm; -}; - -struct RECT -{ - LONG left, right, top, bottom; -}; - -struct MSG -{ -}; - -typedef struct -{ - LPVOID lpCreateParams; -} CREATESTRUCT, *LPCREATESTRUCT; - -inline HANDLE CreateEvent(LPVOID, BOOL, BOOL, LPVOID) { return 0; } -inline HANDLE CreateThread(LPVOID, int, DWORD WINAPI(*)(LPVOID), LPVOID, int, LPVOID) { return 0; } -inline int WaitForSingleObject(HANDLE, int) { return 0; } -inline int RegisterClassEx(WNDCLASSEX *) { return 0; } -inline int SetWindowLong(HWND, int, LONG) { return 0; } -inline LPARAM MAKELPARAM(unsigned short, unsigned short) { return 0; } -inline HWND CreateWindow(LPCTSTR, LPVOID, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, LPVOID) { return 0; } -inline LRESULT SendMessage(HWND, UINT, WPARAM, LPARAM) { return 0; } -inline LONG GetSystemMetrics(int) { return 0; } -inline int SetWindowPos(HWND, int, LONG, LONG, LONG, LONG, int) { return 0; } -inline int SystemParametersInfo(int, int, LPVOID, int) { return 0; } -inline int ShowWindow(HWND, int) { return 0; } -inline int UpdateWindow(HWND) { return 0; } -inline int SetEvent(HANDLE) { return 0; } -inline BOOL GetMessage(MSG *, LPVOID, int, int) { return FALSE; } -inline int DispatchMessage(MSG *) { return 0; } -inline int GetClientRect(HWND, RECT *) { return 0; } -inline HICON LoadIcon(HINSTANCE, LPCTSTR) { return 0; } -inline unsigned lstrlenA(LPCSTR) { return 0; } -inline int lstrcmpA(LPCSTR, LPCSTR) { return 0; } -inline int lstrcpyA(LPSTR, LPCSTR) { return 0; } -inline int lstrcatA(LPSTR, LPCSTR) { return 0; } -#define wsprintfA sprintf -inline int SetWindowTextA(HWND, LPCSTR) { return 0; } -inline LPVOID HeapAlloc(HEAP, int, ULONG) { return 0; } -inline HEAP GetProcessHeap() { return 0; } -inline int HeapFree(HEAP, int, LPVOID) { return 0; } -inline int DestroyWindow(HWND) { return 0; } -inline LONG GetWindowLong(HWND, int) { return 0; } -inline LRESULT CALLBACK DefWindowProc(HWND, UINT, WPARAM, LPARAM) { return 0; } -inline HMODULE LoadLibraryA(LPCSTR) { return 0; } -inline LPPROC GetProcAddress(HMODULE, LPCSTR) { return 0; } -inline int SetTimer(HWND, unsigned, unsigned, unsigned) { return 0; } -inline int KillTimer(HWND, unsigned) { return 0; } -inline DWORD GetTickCount() { return 0; } -inline int ExitProcess(int) { return 0; } -inline bool IsIconic(HWND) { return 0; } -inline HWND GetForegroundWindow() { return 0; } - -#endif // __FAKE__WINDOWS_H__ diff --git a/noarch/lib/py/cxxtest/test/int64.cpp b/noarch/lib/py/cxxtest/test/int64.cpp deleted file mode 100644 index c529f729..00000000 --- a/noarch/lib/py/cxxtest/test/int64.cpp +++ /dev/null @@ -1,8 +0,0 @@ -// -// This program is used to check if the compiler supports __int64 -// -int main() -{ - __int64 ll = 0; - return (int)ll; -} diff --git a/noarch/lib/py/cxxtest/test/longlong.cpp b/noarch/lib/py/cxxtest/test/longlong.cpp deleted file mode 100644 index a744e046..00000000 --- a/noarch/lib/py/cxxtest/test/longlong.cpp +++ /dev/null @@ -1,8 +0,0 @@ -// -// This program is used to check if the compiler supports "long long" -// -int main() -{ - long long ll = 0; - return (int)ll; -} diff --git a/noarch/lib/py/cxxtest/test/main.cpp b/noarch/lib/py/cxxtest/test/main.cpp deleted file mode 100644 index 0e7b0f7e..00000000 --- a/noarch/lib/py/cxxtest/test/main.cpp +++ /dev/null @@ -1,34 +0,0 @@ -#include <cxxtest/TestRunner.h> -#include <cxxtest/TestListener.h> -#include <stdio.h> - -// -// This test runner printer some statistics at the end of the run. -// Note that it uses <stdio.h> and not <iostream> for compatibility -// with older compilers. -// - -using namespace CxxTest; - -class SummaryPrinter : public CxxTest::TestListener -{ -public: - void run() - { - CxxTest::TestRunner::runAllTests(*this); - } - - void leaveWorld(const CxxTest::WorldDescription &wd) - { - printf("Number of suites: %u\n", wd.numSuites()); - printf("Number of tests: %u\n", wd.numTotalTests()); - printf("Number of failed tests: %u\n", TestTracker::tracker().failedTests()); - printf("Number of skipped tests: %u\n", TestTracker::tracker().skippedTests()); - } -}; - -int main() -{ - SummaryPrinter().run(); - return 0; -} diff --git a/noarch/lib/py/cxxtest/test/normal.xml b/noarch/lib/py/cxxtest/test/normal.xml deleted file mode 100644 index 48bb64f8..00000000 --- a/noarch/lib/py/cxxtest/test/normal.xml +++ /dev/null @@ -1,437 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<testsuite name="cxxtest" date="Tue Apr 23 23:28:43 2013" tests="35" errors="0" failures="28" time="0" > -<testcase classname="LessThanEquals" name="testLessThanEquals" line="11"> -LessThanEquals.h" line="16" type="failedAssertLessThanEquals" >Error: Expected (1 <= 0), found (1 > 0) -Test failed: 1 <=? 0 -Error: Expected (1 <= 0), found (1 > 0) -Error: Expected (1 < 0), found (1 >= 0) -Test failed: 1 <=? 0 -Error: Expected (1 <= 0), found (1 > 0)</failure> -<system-out > -In LessThanEquals::testLessThanEquals: -LessThanEquals.h:16: Error: Expected (1 <= 0), found (1 > 0) -LessThanEquals.h:17: Error: Test failed: 1 <=? 0 -LessThanEquals.h:17: Error: Expected (1 <= 0), found (1 > 0) -LessThanEquals.h:19: Error: Expected (1 < 0), found (1 >= 0) -LessThanEquals.h:20: Error: Test failed: 1 <=? 0 -LessThanEquals.h:20: Error: Expected (1 <= 0), found (1 > 0) -</system-out> -</testcase> -<testcase classname="Relation" name="testPredicate" line="17"> -Relation.h" line="19" type="failedAssertPredicate" >Error: Expected MyNegative( 1 ), found !MyNegative( 1 ) -Test failed: 1 <? 0 -Error: Expected MyNegative( 1 ), found !MyNegative( 1 )</failure> -<warning line="22" >1</warning> -<warning line="24" >1</warning> -<system-out >In Relation::testPredicate: -Relation.h:19: Error: Expected MyNegative( 1 ), found !MyNegative( 1 ) -Relation.h:20: Error: Test failed: 1 <? 0 -Relation.h:20: Error: Expected MyNegative( 1 ), found !MyNegative( 1 ) -Relation.h:22: Warning: 1 -Relation.h:24: Warning: 1 -</system-out> -</testcase> -<testcase classname="Relation" name="testRelation" line="27"> -Relation.h" line="29" type="failedAssertRelation" >Error: Expected MyLess<int>( 2, 1 ), found !MyLess<int>( 2, 1 ) -Test failed: 2 <? 1 -Error: Expected MyLess<int>( 2, 1 ), found !MyLess<int>( 2, 1 )</failure> -<warning line="32" >1</warning> -<warning line="34" >1</warning> -<system-out >In Relation::testRelation: -Relation.h:29: Error: Expected MyLess<int>( 2, 1 ), found !MyLess<int>( 2, 1 ) -Relation.h:30: Error: Test failed: 2 <? 1 -Relation.h:30: Error: Expected MyLess<int>( 2, 1 ), found !MyLess<int>( 2, 1 ) -Relation.h:32: Warning: 1 -Relation.h:34: Warning: 1 -</system-out> -</testcase> -<testcase classname="DefaultTraits" name="testSmallDefaultTraits" line="16"> -DefaultTraits.h" line="23" type="failure" >Test failed: { 00 01 02 03 04 05 06 07 }</failure> -<system-out >In DefaultTraits::testSmallDefaultTraits: -DefaultTraits.h:23: Error: Test failed: { 00 01 02 03 04 05 06 07 } -</system-out> -</testcase> -<testcase classname="DefaultTraits" name="testBigDefaultTraits" line="32"> -DefaultTraits.h" line="39" type="failure" >Test failed: { 98 99 9A 9B 9C 9D 9E 9F ... }</failure> -<system-out >In DefaultTraits::testBigDefaultTraits: -DefaultTraits.h:39: Error: Test failed: { 98 99 9A 9B 9C 9D 9E 9F ... } -</system-out> -</testcase> -<testcase classname="DoubleCall" name="testAssertEqualsWithSideEffects" line="19"> -DoubleCall.h" line="21" type="failedAssertEquals" >Error: Expected (increment() == 3), found (1 != 3)</failure> -<system-out >In DoubleCall::testAssertEqualsWithSideEffects: -DoubleCall.h:21: Error: Expected (increment() == 3), found (1 != 3) -</system-out> -</testcase> -<testcase classname="DoubleCall" name="testAssertDiffersWithSideEffects" line="24"> -DoubleCall.h" line="26" type="failedAssertDiffers" >Error: Expected (increment() != 1), found (1)</failure> -<system-out >In DoubleCall::testAssertDiffersWithSideEffects: -DoubleCall.h:26: Error: Expected (increment() != 1), found (1) -</system-out> -</testcase> -<testcase classname="DoubleCall" name="testAssertDeltaWithSideEffects" line="29"> -DoubleCall.h" line="31" type="failedAssertDelta" >Error: Expected (increment() == 2.0) up to 0.5 (0.5000), found (1 != 2.0000)</failure> -<system-out >In DoubleCall::testAssertDeltaWithSideEffects: -DoubleCall.h:31: Error: Expected (increment() == 2.0) up to 0.5 (0.5000), found (1 != 2.0000) -</system-out> -</testcase> -<testcase classname="SameData" name="testAssertSameData" line="22"> -SameData.h" line="24" type="failedAssertSameData" >Error: Expected DATA_SIZE (24) bytes to be equal at (x) and (y), found</failure> -<system-out >In SameData::testAssertSameData: -SameData.h:24: Error: Expected DATA_SIZE (24) bytes to be equal at (x) and (y), found: -{ 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 } -differs from -{ FF FE FD FC FB FA F9 F8 F7 F6 F5 F4 F3 F2 F1 F0 EF EE ED EC EB EA E9 E8 } -</system-out> -</testcase> -<testcase classname="SameData" name="testAssertMessageSameData" line="27"> -SameData.h" line="29" type="failure" >Test failed: Not same data -Error: Expected DATA_SIZE (24) bytes to be equal at (x) and (y), found</failure> -<system-out >In SameData::testAssertMessageSameData: -SameData.h:29: Error: Test failed: Not same data -SameData.h:29: Error: Expected DATA_SIZE (24) bytes to be equal at (x) and (y), found: -{ 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 } -differs from -{ FF FE FD FC FB FA F9 F8 F7 F6 F5 F4 F3 F2 F1 F0 EF EE ED EC EB EA E9 E8 } -</system-out> -</testcase> -<testcase classname="SameData" name="testSafeAssertSameData" line="32"> -SameData.h" line="34" type="failedAssertSameData" >Error: Expected DATA_SIZE (24) bytes to be equal at (x) and (y), found</failure> -<system-out >In SameData::testSafeAssertSameData: -SameData.h:34: Error: Expected DATA_SIZE (24) bytes to be equal at (x) and (y), found: -{ 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 } -differs from -{ FF FE FD FC FB FA F9 F8 F7 F6 F5 F4 F3 F2 F1 F0 EF EE ED EC EB EA E9 E8 } -</system-out> -</testcase> -<testcase classname="SameData" name="testSafeAssertMessageSameData" line="37"> -SameData.h" line="39" type="failure" >Test failed: Not same data -Error: Expected DATA_SIZE (24) bytes to be equal at (x) and (y), found</failure> -<system-out >In SameData::testSafeAssertMessageSameData: -SameData.h:39: Error: Test failed: Not same data -SameData.h:39: Error: Expected DATA_SIZE (24) bytes to be equal at (x) and (y), found: -{ 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 } -differs from -{ FF FE FD FC FB FA F9 F8 F7 F6 F5 F4 F3 F2 F1 F0 EF EE ED EC EB EA E9 E8 } -</system-out> -</testcase> -<testcase classname="SameFiles" name="testAssertFiles" line="11" /> -<testcase classname="SameFiles" name="testAssertFileShorter" line="16"> -SameFiles.h" line="18" type="failedAssertSameFiles" >Error: File 'SameFiles.h' ended before file 'SameFilesLonger.h' (line 42) -= } -= }; -= -< -</failure> -<system-out > -In SameFiles::testAssertFileShorter: -SameFiles.h:18: Error: File 'SameFiles.h' ended before file 'SameFilesLonger.h' (line 42) -= } -= }; -= -< - -</system-out> -</testcase> -<testcase classname="SameFiles" name="testAssertFileLonger" line="21"> -SameFiles.h" line="23" type="failedAssertSameFiles" >Error: File 'SameFiles.h' ended before file 'SameFilesLonger.h' (line 42) -= } -= }; -= -> -</failure> -<system-out >In SameFiles::testAssertFileLonger: -SameFiles.h:23: Error: File 'SameFiles.h' ended before file 'SameFilesLonger.h' (line 42) -= } -= }; -= -> - -</system-out> -</testcase> -<testcase classname="SameFiles" name="testAssertMessageSameFiles" line="26"> -SameFiles.h" line="28" type="failure" >Test failed: Not same files -Error: Files 'SameFiles.h' and 'SameData.h' differ at line 4 -= #include <cxxtest/TestSuite.h> -= -= // -< // This test suite demonstrates TS_ASSERT_SAME_ATA - -> // This test suite demonstrates TS_ASSERT_SAME_// -</failure> -<system-out >In SameFiles::testAssertMessageSameFiles: -SameFiles.h:28: Error: Test failed: Not same files -SameFiles.h:28: Error: Files 'SameFiles.h' and 'SameData.h' differ at line 4 -= #include <cxxtest/TestSuite.h> -= -= // -< // This test suite demonstrates TS_ASSERT_SAME_ATA - -> // This test suite demonstrates TS_ASSERT_SAME_// - -</system-out> -</testcase> -<testcase classname="SameFiles" name="testSafeAssertSameFiles" line="31" /> -<testcase classname="SameFiles" name="testSafeAssertMessageSameFiles" line="36"> -SameFiles.h" line="38" type="failure" >Test failed: Not same files -Error: Files 'SameFiles.h' and 'SameData.h' differ at line 4 -= #include <cxxtest/TestSuite.h> -= -= // -< // This test suite demonstrates TS_ASSERT_SAME_ATA - -> // This test suite demonstrates TS_ASSERT_SAME_// -</failure> -<system-out > -In SameFiles::testSafeAssertMessageSameFiles: -SameFiles.h:38: Error: Test failed: Not same files -SameFiles.h:38: Error: Files 'SameFiles.h' and 'SameData.h' differ at line 4 -= #include <cxxtest/TestSuite.h> -= -= // -< // This test suite demonstrates TS_ASSERT_SAME_ATA - -> // This test suite demonstrates TS_ASSERT_SAME_// - -</system-out> -</testcase> -<testcase classname="TestMessageMacros" name="testMessageMacros" line="10"> -Tsm.h" line="15" type="failure" >Test failed: String -Assertion failed: false -Test failed: 42 -Assertion failed: false -Test failed: String -Error: Expected (2 + 2 == 5), found (4 != 5) -Test failed: 42 -Error: Expected (2 + 2 == 5), found (4 != 5) -Test failed: String -Error: Expected 1 (1) bytes to be equal at (&x) and (&y), found -Test failed: 42 -Error: Expected 1 (1) bytes to be equal at (&x) and (&y), found -Test failed: String -Error: Expected (1.0 == 2.0) up to 0.5 (0.5000), found (1.0000 != 2.0000) -Test failed: 42 -Error: Expected (1.0 == 2.0) up to 0.5 (0.5000), found (1.0000 != 2.0000) -Test failed: String -Error: Expected (0 != 0), found (0) -Test failed: 42 -Error: Expected (0 != 0), found (0) -Test failed: String -Error: Expected (2 < 1), found (2 >= 1) -Test failed: 42 -Error: Expected (2 < 1), found (2 >= 1) -Test failed: String -Error: Expected (throwNothing()) to throw (int) but it didn't throw -Test failed: 42 -Error: Expected (throwNothing()) to throw (int) but it didn't throw -Test failed: String -Error: Expected (throwNothing()) to throw (...) but it didn't throw -Test failed: 42 -Error: Expected (throwNothing()) to throw (...) but it didn't throw -Test failed: String -Error: Expected (throwInteger(n)) not to throw, but it did -Test failed: 42 -Error: Expected (throwInteger(n)) not to throw, but it did -Test failed: String -Error: Expected (throwNothing()) to throw (int) but it didn't throw -Test failed: 42 -Error: Expected (throwNothing()) to throw (int) but it didn't throw -Test failed: String -Error: Expected (throwNothing()) to throw (int) but it didn't throw -Test failed: 42 -Error: Expected (throwNothing()) to throw (int) but it didn't throw -Test failed: String -Error: Expected (i == 43), found (42 != 43) -Test failed: 42 -Error: Expected (i == 43), found (42 != 43)</failure> -<system-out >In TestMessageMacros::testMessageMacros: -Tsm.h:15: Error: Test failed: String -Tsm.h:15: Error: Assertion failed: false -Tsm.h:16: Error: Test failed: 42 -Tsm.h:16: Error: Assertion failed: false -Tsm.h:17: Error: Test failed: String -Tsm.h:17: Error: Expected (2 + 2 == 5), found (4 != 5) -Tsm.h:18: Error: Test failed: 42 -Tsm.h:18: Error: Expected (2 + 2 == 5), found (4 != 5) -Tsm.h:19: Error: Test failed: String -Tsm.h:19: Error: Expected 1 (1) bytes to be equal at (&x) and (&y), found: -{ 78 } -differs from -{ 79 } -Tsm.h:20: Error: Test failed: 42 -Tsm.h:20: Error: Expected 1 (1) bytes to be equal at (&x) and (&y), found: -{ 78 } -differs from -{ 79 } -Tsm.h:21: Error: Test failed: String -Tsm.h:21: Error: Expected (1.0 == 2.0) up to 0.5 (0.5000), found (1.0000 != 2.0000) -Tsm.h:22: Error: Test failed: 42 -Tsm.h:22: Error: Expected (1.0 == 2.0) up to 0.5 (0.5000), found (1.0000 != 2.0000) -Tsm.h:23: Error: Test failed: String -Tsm.h:23: Error: Expected (0 != 0), found (0) -Tsm.h:24: Error: Test failed: 42 -Tsm.h:24: Error: Expected (0 != 0), found (0) -Tsm.h:25: Error: Test failed: String -Tsm.h:25: Error: Expected (2 < 1), found (2 >= 1) -Tsm.h:26: Error: Test failed: 42 -Tsm.h:26: Error: Expected (2 < 1), found (2 >= 1) -Tsm.h:27: Error: Test failed: String -Tsm.h:27: Error: Expected (throwNothing()) to throw (int) but it didn't throw -Tsm.h:28: Error: Test failed: 42 -Tsm.h:28: Error: Expected (throwNothing()) to throw (int) but it didn't throw -Tsm.h:29: Error: Test failed: String -Tsm.h:29: Error: Expected (throwNothing()) to throw (...) but it didn't throw -Tsm.h:30: Error: Test failed: 42 -Tsm.h:30: Error: Expected (throwNothing()) to throw (...) but it didn't throw -Tsm.h:31: Error: Test failed: String -Tsm.h:31: Error: Expected (throwInteger(n)) not to throw, but it did -Tsm.h:32: Error: Test failed: 42 -Tsm.h:32: Error: Expected (throwInteger(n)) not to throw, but it did -Tsm.h:33: Error: Test failed: String -Tsm.h:33: Error: Expected (throwNothing()) to throw (int) but it didn't throw -Tsm.h:34: Error: Test failed: 42 -Tsm.h:34: Error: Expected (throwNothing()) to throw (int) but it didn't throw -Tsm.h:35: Error: Test failed: String -Tsm.h:35: Error: Expected (throwNothing()) to throw (int) but it didn't throw -Tsm.h:36: Error: Test failed: 42 -Tsm.h:36: Error: Expected (throwNothing()) to throw (int) but it didn't throw -Tsm.h:37: Error: Test failed: String -Tsm.h:37: Error: Expected (i == 43), found (42 != 43) -Tsm.h:38: Error: Test failed: 42 -Tsm.h:38: Error: Expected (i == 43), found (42 != 43) -</system-out> -</testcase> -<testcase classname="TraitsTest" name="testIntegerTraits" line="11"> -TraitsTest.h" line="13" type="failure" >Test failed: 1 -Test failed: '\x0F' -Test failed: -12 -Test failed: 34 -Test failed: -123 -Test failed: 456 -Test failed: -12345 -Test failed: 67890</failure> -<system-out >In TraitsTest::testIntegerTraits: -TraitsTest.h:13: Error: Test failed: 1 -TraitsTest.h:14: Error: Test failed: '\x0F' -TraitsTest.h:15: Error: Test failed: -12 -TraitsTest.h:16: Error: Test failed: 34 -TraitsTest.h:17: Error: Test failed: -123 -TraitsTest.h:18: Error: Test failed: 456 -TraitsTest.h:19: Error: Test failed: -12345 -TraitsTest.h:20: Error: Test failed: 67890 -</system-out> -</testcase> -<testcase classname="TraitsTest" name="testFloatingPointTraits" line="23"> -TraitsTest.h" line="25" type="failure" >Test failed: 0.1234 -Test failed: 0.1234</failure> -<system-out >In TraitsTest::testFloatingPointTraits: -TraitsTest.h:25: Error: Test failed: 0.1234 -TraitsTest.h:26: Error: Test failed: 0.1234 -</system-out> -</testcase> -<testcase classname="TraitsTest" name="testBoolTraits" line="29"> -TraitsTest.h" line="31" type="failure" >Test failed: true -Test failed: false</failure> -<system-out >In TraitsTest::testBoolTraits: -TraitsTest.h:31: Error: Test failed: true -TraitsTest.h:32: Error: Test failed: false -</system-out> -</testcase> -<testcase classname="TraitsTest" name="testCharTraits" line="35"> -TraitsTest.h" line="37" type="failure" >Test failed: 'A' -Test failed: '\x04' -Test failed: '\x1B' -Test failed: '\0' -Test failed: '\r' -Test failed: '\n' -Test failed: '\b' -Test failed: '\t' -Test failed: '\a' -Test failed: '\xFB'</failure> -<system-out >In TraitsTest::testCharTraits: -TraitsTest.h:37: Error: Test failed: 'A' -TraitsTest.h:38: Error: Test failed: '\x04' -TraitsTest.h:39: Error: Test failed: '\x1B' -TraitsTest.h:40: Error: Test failed: '\0' -TraitsTest.h:41: Error: Test failed: '\r' -TraitsTest.h:42: Error: Test failed: '\n' -TraitsTest.h:43: Error: Test failed: '\b' -TraitsTest.h:44: Error: Test failed: '\t' -TraitsTest.h:45: Error: Test failed: '\a' -TraitsTest.h:46: Error: Test failed: '\xFB' -</system-out> -</testcase> -<testcase classname="TraitsTest" name="testStringTraits" line="49"> -TraitsTest.h" line="51" type="failure" >Test failed: (char *) is displayed as-is -</failure> -<system-out >In TraitsTest::testStringTraits: -TraitsTest.h:51: Error: Test failed: (char *) is displayed as-is - -</system-out> -</testcase> -<testcase classname="TraitsTest" name="testStdStringTraits" line="54"> -TraitsTest.h" line="57" type="failure" >Test failed: "std::string is displayed with \"\"" -Test failed: "Escapes\rAre\rTranslated" -Test failed: "As are unprintable chars: \x124Vx"</failure> -<system-out >In TraitsTest::testStdStringTraits: -TraitsTest.h:57: Error: Test failed: "std::string is displayed with \"\"" -TraitsTest.h:58: Error: Test failed: "Escapes\rAre\rTranslated" -TraitsTest.h:59: Error: Test failed: "As are unprintable chars: \x124Vx" -</system-out> -</testcase> -<testcase classname="MockTest" name="test_Mock" line="115" /> -<testcase classname="MockTest" name="test_Real" line="121" /> -<testcase classname="MockTest" name="test_Unimplemented" line="127"> -MockTest.h" line="33" type="failure" >Test failed: T::one(void) called with no T::Base_one object -Error: Expected (T::one() == 1), found (0 != 1)</failure> -<system-out > -In MockTest::test_Unimplemented: -MockTest.h:33: Error: Test failed: T::one(void) called with no T::Base_one object -MockTest.h:129: Error: Expected (T::one() == 1), found (0 != 1) -</system-out> -</testcase> -<testcase classname="MockTest" name="test_More_complex_mock" line="132" /> -<testcase classname="MockTest" name="test_Mock_traits" line="141"> -MockTest.h" line="40" type="failure" >Test failed: T::getOpaque(int i) called with no T::Base_getOpaque object -Error: Expected (T::getOpaque(3).value == 72), found (42 != 72)</failure> -<system-out > -In MockTest::test_Mock_traits: -MockTest.h:40: Error: Test failed: T::getOpaque(int i) called with no T::Base_getOpaque object -MockTest.h:143: Error: Expected (T::getOpaque(3).value == 72), found (42 != 72) -</system-out> -</testcase> -<testcase classname="MockTest" name="test_Override" line="146"> -MockTest.h" line="33" type="failure" >Test failed: T::one(void) called with no T::Base_one object -Error: Expected (T::one() == 1), found (0 != 1)</failure> -<system-out >In MockTest::test_Override: -MockTest.h:33: Error: Test failed: T::one(void) called with no T::Base_one object -MockTest.h:157: Error: Expected (T::one() == 1), found (0 != 1) -</system-out> -</testcase> -<testcase classname="MockTest" name="test_Supply" line="160" /> -<testcase classname="MockTest" name="test_Unimplemented_supply" line="166"> -MockTest.h" line="42" type="failure" >Test failed: T::supplyOne(void) called with no T::Base_supplyOne object -Error: Expected (supplyOne() == 1), found (0 != 1)</failure> -<system-out > -In MockTest::test_Unimplemented_supply: -MockTest.h:42: Error: Test failed: T::supplyOne(void) called with no T::Base_supplyOne object -MockTest.h:168: Error: Expected (supplyOne() == 1), found (0 != 1) -</system-out> -</testcase> -<testcase classname="MockTest" name="test_More_complex_supply" line="171" /> -<testcase classname="SameZero" name="test_TS_ASSERT_SAME_DATA_passed_zero" line="20"> -SameZero.h" line="22" type="failedAssertSameData" >Error: Expected sizeof(data) (4) bytes to be equal at (data) and (0), found -Error: Expected sizeof(data) (4) bytes to be equal at (0) and (data), found</failure> -<system-out > -In SameZero::test_TS_ASSERT_SAME_DATA_passed_zero: -SameZero.h:22: Error: Expected sizeof(data) (4) bytes to be equal at (data) and (0), found: -{ 00 01 02 03 } -differs from -(null) -SameZero.h:23: Error: Expected sizeof(data) (4) bytes to be equal at (0) and (data), found: -(null) -differs from -{ 00 01 02 03 } -</system-out> -</testcase> -</testsuite> diff --git a/noarch/lib/py/cxxtest/test/preamble.tpl b/noarch/lib/py/cxxtest/test/preamble.tpl deleted file mode 100644 index a15356b4..00000000 --- a/noarch/lib/py/cxxtest/test/preamble.tpl +++ /dev/null @@ -1,29 +0,0 @@ -// -*- C++ -*- - -#define CXXTEST_ABORT_TEST_ON_FAIL - -// CxxTest definitions and headers -<CxxTest preamble> - -// Make sure this worked -#ifndef TS_ASSERT -# error The preamble does not work! -#endif - -#include <cxxtest/StdioPrinter.h> - -int main() -{ - CxxTest::StdioPrinter runner; - - TS_FAIL( "This will not be displayed" ); - int result = runner.run() + runner.run(); - TS_FAIL( "This will not be displayed" ); - - return result; -} - - -// The CxxTest "world" -<CxxTest world> - diff --git a/noarch/lib/py/cxxtest/test/stpltpl.cpp b/noarch/lib/py/cxxtest/test/stpltpl.cpp deleted file mode 100644 index f541dc5e..00000000 --- a/noarch/lib/py/cxxtest/test/stpltpl.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include <cxxtest/Flags.h> - -#ifdef _CXXTEST_PARTIAL_TEMPLATE_SPECIALIZATION -int main() { return 0; } -#endif // !_CXXTEST_PARTIAL_TEMPLATE_SPECIALIZATION - diff --git a/noarch/lib/py/cxxtest/test/test_cxxtest.py b/noarch/lib/py/cxxtest/test/test_cxxtest.py deleted file mode 100644 index 63593ae6..00000000 --- a/noarch/lib/py/cxxtest/test/test_cxxtest.py +++ /dev/null @@ -1,944 +0,0 @@ -#------------------------------------------------------------------------- -# CxxTest: A lightweight C++ unit testing library. -# Copyright (c) 2008 Sandia Corporation. -# This software is distributed under the LGPL License v3 -# For more information, see the COPYING file in the top CxxTest directory. -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -#------------------------------------------------------------------------- - -import shutil -import time -import sys -import os -import os.path -import glob -import difflib -import subprocess -import re -import string -if sys.version_info < (2,7): - import unittest2 as unittest -else: - import unittest -try: - import ply - ply_available=True -except: - ply_available=False -try: - import cxxtest - cxxtest_available=True - import cxxtest.cxxtestgen -except: - cxxtest_available=False - -currdir = os.path.dirname(os.path.abspath(__file__))+os.sep -sampledir = os.path.dirname(os.path.dirname(currdir))+'/sample'+os.sep -cxxtestdir = os.path.dirname(os.path.dirname(currdir))+os.sep - -compilerre = re.compile("^(?P<path>[^:]+)(?P<rest>:.*)$") -dirre = re.compile("^([^%s]*/)*" % re.escape(os.sep)) -xmlre = re.compile("\"(?P<path>[^\"]*/[^\"]*)\"") -datere = re.compile("date=\"[^\"]*\"") - -# Headers from the cxxtest/sample directory -samples = ' '.join(file for file in sorted(glob.glob(sampledir+'*.h'))) -guiInputs=currdir+'../sample/gui/GreenYellowRed.h' -if sys.platform.startswith('win'): - target_suffix = '.exe' - command_separator = ' && ' - cxxtestdir = '/'.join(cxxtestdir.split('\\')) - remove_extra_path_prefixes_on_windows = True -else: - target_suffix = '' - command_separator = '; ' - remove_extra_path_prefixes_on_windows = False - -def find(filename, executable=False, isfile=True, validate=None): - # - # Use the PATH environment if it is defined and not empty - # - if "PATH" in os.environ and os.environ["PATH"] != "": - search_path = os.environ['PATH'].split(os.pathsep) - else: - search_path = os.defpath.split(os.pathsep) - for path in search_path: - test_fname = os.path.join(path, filename) - if os.path.exists(test_fname) \ - and (not isfile or os.path.isfile(test_fname)) \ - and (not executable or os.access(test_fname, os.X_OK)): - return os.path.abspath(test_fname) - return None - -def join_commands(command_one, command_two): - return command_separator.join([command_one, command_two]) - -_available = {} -def available(compiler, exe_option): - if (compiler,exe_option) in _available: - return _available[compiler,exe_option] - cmd = join_commands("cd %s" % currdir, - "%s %s %s %s > %s 2>&1" % (compiler, exe_option, currdir+'anything', currdir+'anything.cpp', currdir+'anything.log')) - print("Testing for compiler "+compiler) - print("Command: "+cmd) - status = subprocess.call(cmd, shell=True) - executable = currdir+'anything'+target_suffix - flag = status == 0 and os.path.exists(executable) - os.remove(currdir+'anything.log') - if os.path.exists(executable): - os.remove(executable) - print("Status: "+str(flag)) - _available[compiler,exe_option] = flag - return flag - -def remove_absdir(filename): - INPUT=open(filename, 'r') - lines = [line.strip() for line in INPUT] - INPUT.close() - OUTPUT=open(filename, 'w') - for line in lines: - # remove basedir at front of line - match = compilerre.match(line) # see if we can remove the basedir - if match: - parts = match.groupdict() - line = dirre.sub("", parts['path']) + parts['rest'] - OUTPUT.write(line+'\n') - OUTPUT.close() - -def normalize_line_for_diff(line): - # add spaces around {}<>() - line = re.sub("[{}<>()]", r" \0 ", line) - - # beginnig and ending whitespace - line = line.strip() - - # remove all whitespace - # and leave a single space - line = ' '.join(line.split()) - - # remove spaces around "=" - line = re.sub(" ?= ?", "=", line) - - # remove all absolute path prefixes - line = ''.join(line.split(cxxtestdir)) - - if remove_extra_path_prefixes_on_windows: - # Take care of inconsistent path prefixes like - # "e:\path\to\cxxtest\test", "E:/path/to/cxxtest/test" etc - # in output. - line = ''.join(line.split(os.path.normcase(cxxtestdir))) - line = ''.join(line.split(os.path.normpath(cxxtestdir))) - # And some extra relative paths left behind - line= re.sub(r'^.*[\\/]([^\\/]+\.(h|cpp))', r'\1', line) - - # for xml, remove prefixes from everything that looks like a - # file path inside "" - line = xmlre.sub( - lambda match: '"'+re.sub("^[^/]+/", "", match.group(1))+'"', - line - ) - # Remove date info - line = datere.sub( lambda match: 'date=""', line) - return line - -def make_diff_readable(diff): - i = 0 - while i+1 < len(diff): - if diff[i][0] == '-' and diff[i+1][0] == '+': - l1 = diff[i] - l2 = diff[i+1] - for j in range(1, min([len(l1), len(l2)])): - if l1[j] != l2[j]: - if j > 4: - j = j-2; - l1 = l1[j:] - l2 = l2[j:] - diff[i] = '-(...)' + l1 - diff[i+1] = '+(...)' + l2 - break - i+=1 - -def file_diff(filename1, filename2, filtered_reader): - remove_absdir(filename1) - remove_absdir(filename2) - # - INPUT=open(filename1, 'r') - lines1 = list(filtered_reader(INPUT)) - INPUT.close() - # - INPUT=open(filename2, 'r') - lines2 = list(filtered_reader(INPUT)) - INPUT.close() - # - diff = list(difflib.unified_diff(lines2, lines1, - fromfile=filename2, tofile=filename1)) - if diff: - make_diff_readable(diff) - raise Exception("ERROR: \n\n%s\n\n%s\n\n" % (lines1, lines2)) - diff = '\n'.join(diff) - return diff - - -class BaseTestCase(object): - - fog='' - valgrind='' - cxxtest_import=False - - def setUp(self): - sys.stderr.write("("+self.__class__.__name__+") ") - self.passed=False - self.prefix='' - self.py_out='' - self.py_cpp='' - self.px_pre='' - self.px_out='' - self.build_log='' - self.build_target='' - - def tearDown(self): - if not self.passed: - return - files = [] - if os.path.exists(self.py_out): - files.append(self.py_out) - if os.path.exists(self.py_cpp) and not 'CXXTEST_GCOV_FLAGS' in os.environ: - files.append(self.py_cpp) - if os.path.exists(self.px_pre): - files.append(self.px_pre) - if os.path.exists(self.px_out): - files.append(self.px_out) - if os.path.exists(self.build_log): - files.append(self.build_log) - if os.path.exists(self.build_target) and not 'CXXTEST_GCOV_FLAGS' in os.environ: - files.append(self.build_target) - for file in files: - try: - os.remove(file) - except: - time.sleep(2) - try: - os.remove(file) - except: - print( "Error removing file '%s'" % file) - - - # This is a "generator" that just reads a file and normalizes the lines - def file_filter(self, file): - for line in file: - yield normalize_line_for_diff(line) - - - def check_if_supported(self, filename, msg): - target=currdir+'check'+'px'+target_suffix - log=currdir+'check'+'_build.log' - cmd = join_commands("cd %s" % currdir, - "%s %s %s %s. %s%s../ %s > %s 2>&1" % (self.compiler, self.exe_option, target, self.include_option, self.include_option, currdir, filename, log)) - status = subprocess.call(cmd, shell=True) - os.remove(log) - if status != 0 or not os.path.exists(target): - self.skipTest(msg) - os.remove(target) - - def init(self, prefix): - # - self.prefix = self.__class__.__name__+'_'+prefix - self.py_out = currdir+self.prefix+'_py.out' - self.py_cpp = currdir+self.prefix+'_py.cpp' - self.px_pre = currdir+self.prefix+'_px.pre' - self.px_out = currdir+self.prefix+'_px.out' - self.build_log = currdir+self.prefix+'_build.log' - self.build_target = currdir+self.prefix+'px'+target_suffix - - def check_root(self, prefix='', output=None): - self.init(prefix) - args = "--have-eh --abort-on-fail --root --error-printer" - if self.cxxtest_import: - os.chdir(currdir) - cxxtest.cxxtestgen.main(['cxxtestgen', self.fog, '-o', self.py_cpp]+re.split('[ ]+',args), True) - else: - cmd = join_commands("cd %s" % currdir, - "%s %s../bin/cxxtestgen %s -o %s %s > %s 2>&1" % (sys.executable, currdir, self.fog, self.py_cpp, args, self.py_out)) - status = subprocess.call(cmd, shell=True) - self.assertEqual(status, 0, 'Bad return code: %d Error executing cxxtestgen: %s' % (status,cmd)) - # - files = [self.py_cpp] - for i in [1,2]: - args = "--have-eh --abort-on-fail --part Part%s.h" % str(i) - file = currdir+self.prefix+'_py%s.cpp' % str(i) - files.append(file) - if self.cxxtest_import: - os.chdir(currdir) - cxxtest.cxxtestgen.main(['cxxtestgen', self.fog, '-o', file]+re.split('[ ]+',args), True) - else: - cmd = join_commands("cd %s" % currdir, - "%s %s../bin/cxxtestgen %s -o %s %s > %s 2>&1" % (sys.executable, currdir, self.fog, file, args, self.py_out)) - status = subprocess.call(cmd, shell=True) - self.assertEqual(status, 0, 'Bad return code: %d Error executing cxxtestgen: %s' % (status,cmd)) - # - cmd = join_commands("cd %s" % currdir, - "%s %s %s %s. %s%s../ %s > %s 2>&1" % (self.compiler, self.exe_option, self.build_target, self.include_option, self.include_option, currdir, ' '.join(files), self.build_log)) - status = subprocess.call(cmd, shell=True) - for file in files: - if os.path.exists(file): - os.remove(file) - self.assertEqual(status, 0, 'Bad return code: %d Error executing command: %s' % (status,cmd)) - # - cmd = join_commands("cd %s" % currdir, - "%s %s -v > %s 2>&1" % (self.valgrind, self.build_target, self.px_pre)) - status = subprocess.call(cmd, shell=True) - OUTPUT = open(self.px_pre,'a') - OUTPUT.write('Error level = '+str(status)+'\n') - OUTPUT.close() - diffstr = file_diff(self.px_pre, currdir+output, self.file_filter) - if not diffstr == '': - self.fail("Unexpected differences in output:\n"+diffstr) - if self.valgrind != '': - self.parse_valgrind(self.px_pre) - # - self.passed=True - - def compile(self, prefix='', args=None, compile='', output=None, main=None, failGen=False, run=None, logfile=None, failBuild=False, init=True): - """Run cxxtestgen and compile the code that is generated""" - if init: - self.init(prefix) - # - if self.cxxtest_import: - try: - os.chdir(currdir) - status = cxxtest.cxxtestgen.main(['cxxtestgen', self.fog, '-o', self.py_cpp]+re.split('[ ]+',args), True) - except: - status = 1 - else: - cmd = join_commands("cd %s" % currdir, - "%s %s../bin/cxxtestgen %s -o %s %s > %s 2>&1" % (sys.executable, currdir, self.fog, self.py_cpp, args, self.py_out)) - status = subprocess.call(cmd, shell=True) - if failGen: - if status == 0: - self.fail('Expected cxxtestgen to fail.') - else: - self.passed=True - return - if not self.cxxtest_import: - self.assertEqual(status, 0, 'Bad return code: %d Error executing command: %s' % (status,cmd)) - # - if not main is None: - # Compile with main - cmd = join_commands("cd %s" % currdir, - "%s %s %s %s. %s%s../ %s main.cpp %s > %s 2>&1" % (self.compiler, self.exe_option, self.build_target, self.include_option, self.include_option, currdir, compile, self.py_cpp, self.build_log)) - else: - # Compile without main - cmd = join_commands("cd %s" % currdir, - "%s %s %s %s. %s%s../ %s %s > %s 2>&1" % (self.compiler, self.exe_option, self.build_target, self.include_option, self.include_option, currdir, compile, self.py_cpp, self.build_log)) - status = subprocess.call(cmd, shell=True) - if failBuild: - if status == 0: - self.fail('Expected compiler to fail.') - else: - self.passed=True - return - else: - self.assertEqual(status, 0, 'Bad return code: %d Error executing command: %s' % (status,cmd)) - # - if compile == '' and not output is None: - if run is None: - cmd = join_commands("cd %s" % currdir, - "%s %s -v > %s 2>&1" % (self.valgrind, self.build_target, self.px_pre)) - else: - cmd = run % (self.valgrind, self.build_target, self.px_pre) - status = subprocess.call(cmd, shell=True) - OUTPUT = open(self.px_pre,'a') - OUTPUT.write('Error level = '+str(status)+'\n') - OUTPUT.close() - if logfile is None: - diffstr = file_diff(self.px_pre, currdir+output, self.file_filter) - else: - diffstr = file_diff(currdir+logfile, currdir+output, self.file_filter) - if not diffstr == '': - self.fail("Unexpected differences in output:\n"+diffstr) - if self.valgrind != '': - self.parse_valgrind(self.px_pre) - if not logfile is None: - os.remove(currdir+logfile) - # - if compile == '' and output is None and os.path.exists(self.py_cpp): - self.fail("Output cpp file %s should not have been generated." % self.py_cpp) - # - self.passed=True - - # - # Tests for cxxtestgen - # - - def test_root_or_part(self): - """Root/Part""" - self.check_root(prefix='root_or_part', output="parts.out") - - def test_root_plus_part(self): - """Root + Part""" - self.compile(prefix='root_plus_part', args="--error-printer --root --part "+samples, output="error.out") - - def test_wildcard(self): - """Wildcard input""" - self.compile(prefix='wildcard', args='../sample/*.h', main=True, output="wildcard.out") - - def test_stdio_printer(self): - """Stdio printer""" - self.compile(prefix='stdio_printer', args="--runner=StdioPrinter "+samples, output="error.out") - - def test_paren_printer(self): - """Paren printer""" - self.compile(prefix='paren_printer', args="--runner=ParenPrinter "+samples, output="paren.out") - - def test_yn_runner(self): - """Yes/No runner""" - self.compile(prefix='yn_runner', args="--runner=YesNoRunner "+samples, output="runner.out") - - def test_no_static_init(self): - """No static init""" - self.compile(prefix='no_static_init', args="--error-printer --no-static-init "+samples, output="error.out") - - def test_samples_file(self): - """Samples file""" - # Create a file with the list of sample files - OUTPUT = open(currdir+'Samples.txt','w') - for line in sorted(glob.glob(sampledir+'*.h')): - OUTPUT.write(line+'\n') - OUTPUT.close() - self.compile(prefix='samples_file', args="--error-printer --headers Samples.txt", output="error.out") - os.remove(currdir+'Samples.txt') - - def test_have_std(self): - """Have Std""" - self.compile(prefix='have_std', args="--runner=StdioPrinter --have-std HaveStd.h", output="std.out") - - def test_comments(self): - """Comments""" - self.compile(prefix='comments', args="--error-printer Comments.h", output="comments.out") - - def test_longlong(self): - """Long long""" - self.check_if_supported('longlong.cpp', "Long long is not supported by this compiler") - self.compile(prefix='longlong', args="--error-printer --longlong=\"long long\" LongLong.h", output="longlong.out") - - def test_int64(self): - """Int64""" - self.check_if_supported('int64.cpp', "64-bit integers are not supported by this compiler") - self.compile(prefix='int64', args="--error-printer --longlong=__int64 Int64.h", output="int64.out") - - def test_include(self): - """Include""" - self.compile(prefix='include', args="--include=VoidTraits.h --include=LongTraits.h --error-printer IncludeTest.h", output="include.out") - - # - # Template file tests - # - - def test_preamble(self): - """Preamble""" - self.compile(prefix='preamble', args="--template=preamble.tpl "+samples, output="preamble.out") - - def test_activate_all(self): - """Activate all""" - self.compile(prefix='activate_all', args="--template=activate.tpl "+samples, output="error.out") - - def test_only_suite(self): - """Only Suite""" - self.compile(prefix='only_suite', args="--template=%s../sample/only.tpl %s" % (currdir, samples), run="%s %s SimpleTest > %s 2>&1", output="suite.out") - - def test_only_test(self): - """Only Test""" - self.compile(prefix='only_test', args="--template=%s../sample/only.tpl %s" % (currdir, samples), run="%s %s SimpleTest testAddition > %s 2>&1", output="suite_test.out") - - def test_have_std_tpl(self): - """Have Std - Template""" - self.compile(prefix='have_std_tpl', args="--template=HaveStd.tpl HaveStd.h", output="std.out") - - def test_exceptions_tpl(self): - """Exceptions - Template""" - self.compile(prefix='exceptions_tpl', args="--template=HaveEH.tpl "+self.ehNormals, output="eh_normals.out") - - # - # Test cases which do not require exception handling - # - - def test_no_errors(self): - """No errors""" - self.compile(prefix='no_errors', args="--error-printer GoodSuite.h", output="good.out") - - def test_infinite_values(self): - """Infinite values""" - self.compile(prefix='infinite_values', args="--error-printer --have-std TestNonFinite.h", output="infinite.out") - - def test_max_dump_size(self): - """Max dump size""" - self.compile(prefix='max_dump_size', args="--error-printer --include=MaxDump.h DynamicMax.h SameData.h", output='max.out') - - def test_wide_char(self): - """Wide char""" - self.check_if_supported('wchar.cpp', "The file wchar.cpp is not supported.") - self.compile(prefix='wide_char', args="--error-printer WideCharTest.h", output="wchar.out") - - #def test_factor(self): - #"""Factor""" - #self.compile(prefix='factor', args="--error-printer --factor Factor.h", output="factor.out") - - def test_user_traits(self): - """User traits""" - self.compile(prefix='user_traits', args="--template=UserTraits.tpl UserTraits.h", output='user.out') - - normals = " ".join(currdir+file for file in ["LessThanEquals.h","Relation.h","DefaultTraits.h","DoubleCall.h","SameData.h","SameFiles.h","Tsm.h","TraitsTest.h","MockTest.h","SameZero.h"]) - - def test_normal_behavior_xunit(self): - """Normal Behavior with XUnit Output""" - self.compile(prefix='normal_behavior_xunit', args="--xunit-printer "+self.normals, logfile='TEST-cxxtest.xml', output="normal.xml") - - def test_normal_behavior(self): - """Normal Behavior""" - self.compile(prefix='normal_behavior', args="--error-printer "+self.normals, output="normal.out") - - def test_normal_plus_abort(self): - """Normal + Abort""" - self.compile(prefix='normal_plus_abort', args="--error-printer --have-eh --abort-on-fail "+self.normals, output="abort.out") - - def test_stl_traits(self): - """STL Traits""" - self.check_if_supported('stpltpl.cpp', "The file stpltpl.cpp is not supported.") - self.compile(prefix='stl_traits', args="--error-printer StlTraits.h", output="stl.out") - - def test_normal_behavior_world(self): - """Normal Behavior with World""" - self.compile(prefix='normal_behavior_world', args="--error-printer --world=myworld "+self.normals, output="world.out") - - # - # Test cases which do require exception handling - # - def test_throw_wo_std(self): - """Throw w/o Std""" - self.compile(prefix='test_throw_wo_std', args="--template=ThrowNoStd.tpl ThrowNoStd.h", output='throw.out') - - ehNormals = "Exceptions.h DynamicAbort.h" - - def test_exceptions(self): - """Exceptions""" - self.compile(prefix='exceptions', args="--error-printer --have-eh "+self.ehNormals, output="eh_normals.out") - - def test_exceptions_plus_abort(self): - """Exceptions plus abort""" - self.compile(prefix='exceptions', args="--error-printer --abort-on-fail --have-eh DynamicAbort.h DeepAbort.h ThrowsAssert.h", output="eh_plus_abort.out") - - def test_default_abort(self): - """Default abort""" - self.compile(prefix='default_abort', args="--error-printer --include=DefaultAbort.h "+self.ehNormals+ " DeepAbort.h ThrowsAssert.h", output="default_abort.out") - - def test_default_no_abort(self): - """Default no abort""" - self.compile(prefix='default_no_abort', args="--error-printer "+self.ehNormals+" DeepAbort.h ThrowsAssert.h", output="default_abort.out") - - # - # Global Fixtures - # - - def test_global_fixtures(self): - """Global fixtures""" - self.compile(prefix='global_fixtures', args="--error-printer GlobalFixtures.h WorldFixtures.h", output="gfxs.out") - - def test_gf_suw_fails(self): - """GF:SUW fails""" - self.compile(prefix='gf_suw_fails', args="--error-printer SetUpWorldFails.h", output="suwf.out") - - def test_gf_suw_error(self): - """GF:SUW error""" - self.compile(prefix='gf_suw_error', args="--error-printer SetUpWorldError.h", output="suwe.out") - - def test_gf_suw_throws(self): - """GF:SUW throws""" - self.compile(prefix='gf_suw_throws', args="--error-printer SetUpWorldThrows.h", output="suwt.out") - - def test_gf_su_fails(self): - """GF:SU fails""" - self.compile(prefix='gf_su_fails', args="--error-printer GfSetUpFails.h", output="gfsuf.out") - - def test_gf_su_throws(self): - """GF:SU throws""" - self.compile(prefix='gf_su_throws', args="--error-printer GfSetUpThrows.h", output="gfsut.out") - - def test_gf_td_fails(self): - """GF:TD fails""" - self.compile(prefix='gf_td_fails', args="--error-printer GfTearDownFails.h", output="gftdf.out") - - def test_gf_td_throws(self): - """GF:TD throws""" - self.compile(prefix='gf_td_throws', args="--error-printer GfTearDownThrows.h", output="gftdt.out") - - def test_gf_tdw_fails(self): - """GF:TDW fails""" - self.compile(prefix='gf_tdw_fails', args="--error-printer TearDownWorldFails.h", output="tdwf.out") - - def test_gf_tdw_throws(self): - """GF:TDW throws""" - self.compile(prefix='gf_tdw_throws', args="--error-printer TearDownWorldThrows.h", output="tdwt.out") - - def test_gf_suw_fails_XML(self): - """GF:SUW fails""" - self.compile(prefix='gf_suw_fails', args="--xunit-printer SetUpWorldFails.h", output="suwf.out") - - # - # GUI - # - - def test_gui(self): - """GUI""" - self.compile(prefix='gui', args='--gui=DummyGui %s' % guiInputs, output ="gui.out") - - def test_gui_runner(self): - """GUI + runner""" - self.compile(prefix='gui_runner', args="--gui=DummyGui --runner=ParenPrinter %s" % guiInputs, output="gui_paren.out") - - def test_qt_gui(self): - """QT GUI""" - self.compile(prefix='qt_gui', args="--gui=QtGui GoodSuite.h", compile=self.qtFlags) - - def test_win32_gui(self): - """Win32 GUI""" - self.compile(prefix='win32_gui', args="--gui=Win32Gui GoodSuite.h", compile=self.w32Flags) - - def test_win32_unicode(self): - """Win32 Unicode""" - self.compile(prefix='win32_unicode', args="--gui=Win32Gui GoodSuite.h", compile=self.w32Flags+' -DUNICODE') - - def test_x11_gui(self): - """X11 GUI""" - self.check_if_supported('wchar.cpp', "Cannot compile wchar.cpp") - self.compile(prefix='x11_gui', args="--gui=X11Gui GoodSuite.h", compile=self.x11Flags) - - - # - # Tests for when the compiler doesn't support exceptions - # - - def test_no_exceptions(self): - """No exceptions""" - if self.no_eh_option is None: - self.skipTest("This compiler does not have an exception handling option") - self.compile(prefix='no_exceptions', args='--runner=StdioPrinter NoEh.h', output="no_eh.out", compile=self.no_eh_option) - - def test_force_no_eh(self): - """Force no EH""" - if self.no_eh_option is None: - self.skipTest("This compiler does not have an exception handling option") - self.compile(prefix="force_no_eh", args="--runner=StdioPrinter --no-eh ForceNoEh.h", output="no_eh.out", compile=self.no_eh_option) - - # - # Invalid input to cxxtestgen - # - - def test_no_tests(self): - """No tests""" - self.compile(prefix='no_tests', args='EmptySuite.h', failGen=True) - - def test_missing_input(self): - """Missing input""" - self.compile(prefix='missing_input', args='--template=NoSuchFile.h', failGen=True) - - def test_missing_template(self): - """Missing template""" - self.compile(prefix='missing_template', args='--template=NoSuchFile.h '+samples, failGen=True) - - def test_inheritance(self): - """Test relying on inheritance""" - self.compile(prefix='inheritance', args='--error-printer InheritedTest.h', output='inheritance_old.out') - - # - # Tests that illustrate differences between the different C++ parsers - # - - def test_namespace1(self): - """Nested namespace declarations""" - if self.fog == '': - self.compile(prefix='namespace1', args='Namespace1.h', main=True, failBuild=True) - else: - self.compile(prefix='namespace1', args='Namespace1.h', main=True, output="namespace.out") - - def test_namespace2(self): - """Explicit namespace declarations""" - self.compile(prefix='namespace2', args='Namespace2.h', main=True, output="namespace.out") - - def test_inheritance(self): - """Test relying on inheritance""" - if self.fog == '': - self.compile(prefix='inheritance', args='--error-printer InheritedTest.h', failGen=True) - else: - self.compile(prefix='inheritance', args='--error-printer InheritedTest.h', output='inheritance.out') - - def test_simple_inheritance(self): - """Test relying on simple inheritance""" - self.compile(prefix='simple_inheritance', args='--error-printer SimpleInheritedTest.h', output='simple_inheritance.out') - - def test_simple_inheritance2(self): - """Test relying on simple inheritance (2)""" - if self.fog == '': - self.compile(prefix='simple_inheritance2', args='--error-printer SimpleInheritedTest2.h', failGen=True) - else: - self.compile(prefix='simple_inheritance2', args='--error-printer SimpleInheritedTest2.h', output='simple_inheritance2.out') - - def test_comments2(self): - """Comments2""" - if self.fog == '': - self.compile(prefix='comments2', args="--error-printer Comments2.h", failBuild=True) - else: - self.compile(prefix='comments2', args="--error-printer Comments2.h", output='comments2.out') - - def test_cpp_template1(self): - """C++ Templates""" - if self.fog == '': - self.compile(prefix='cpp_template1', args="--error-printer CppTemplateTest.h", failGen=True) - else: - self.compile(prefix='cpp_template1', args="--error-printer CppTemplateTest.h", output='template.out') - - def test_bad1(self): - """BadTest1""" - if self.fog == '': - self.compile(prefix='bad1', args="--error-printer BadTest.h", failGen=True) - else: - self.compile(prefix='bad1', args="--error-printer BadTest.h", output='bad.out') - - # - # Testing path manipulation - # - - def test_normal_sympath(self): - """Normal Behavior - symbolic path""" - _files = " ".join(["LessThanEquals.h","Relation.h","DefaultTraits.h","DoubleCall.h","SameData.h","SameFiles.h","Tsm.h","TraitsTest.h","MockTest.h","SameZero.h"]) - prefix = 'normal_sympath' - self.init(prefix=prefix) - try: - os.remove('test_sympath') - except: - pass - try: - shutil.rmtree('../test_sympath') - except: - pass - os.mkdir('../test_sympath') - os.symlink('../test_sympath', 'test_sympath') - self.py_cpp = 'test_sympath/'+prefix+'_py.cpp' - self.compile(prefix=prefix, init=False, args="--error-printer "+_files, output="normal.out") - os.remove('test_sympath') - shutil.rmtree('../test_sympath') - - def test_normal_relpath(self): - """Normal Behavior - relative path""" - _files = " ".join(["LessThanEquals.h","Relation.h","DefaultTraits.h","DoubleCall.h","SameData.h","SameFiles.h","Tsm.h","TraitsTest.h","MockTest.h","SameZero.h"]) - prefix = 'normal_relative' - self.init(prefix=prefix) - try: - shutil.rmtree('../test_relpath') - except: - pass - os.mkdir('../test_relpath') - self.py_cpp = '../test_relpath/'+prefix+'_py.cpp' - self.compile(prefix=prefix, init=False, args="--error-printer "+_files, output="normal.out") - shutil.rmtree('../test_relpath') - - - -class TestCpp(BaseTestCase, unittest.TestCase): - - # Compiler specifics - exe_option = '-o' - include_option = '-I' - compiler='c++ -Wall -W -Werror -g' - no_eh_option = None - qtFlags='-Ifake' - x11Flags='-Ifake' - w32Flags='-Ifake' - - def run(self, *args, **kwds): - if available('c++', '-o'): - return unittest.TestCase.run(self, *args, **kwds) - - def setUp(self): - BaseTestCase.setUp(self) - - def tearDown(self): - BaseTestCase.tearDown(self) - - -class TestCppFOG(TestCpp): - - fog='-f' - - def run(self, *args, **kwds): - if ply_available: - return TestCpp.run(self, *args, **kwds) - - -class TestGpp(BaseTestCase, unittest.TestCase): - - # Compiler specifics - exe_option = '-o' - include_option = '-I' - compiler='g++ -g -ansi -pedantic -Wmissing-declarations -Werror -Wall -W -Wshadow -Woverloaded-virtual -Wnon-virtual-dtor -Wreorder -Wsign-promo %s' % os.environ.get('CXXTEST_GCOV_FLAGS','') - no_eh_option = '-fno-exceptions' - qtFlags='-Ifake' - x11Flags='-Ifake' - w32Flags='-Ifake' - - def run(self, *args, **kwds): - if available('g++', '-o'): - return unittest.TestCase.run(self, *args, **kwds) - - def setUp(self): - BaseTestCase.setUp(self) - - def tearDown(self): - BaseTestCase.tearDown(self) - - -class TestGppPy(TestGpp): - - def run(self, *args, **kwds): - if cxxtest_available: - self.cxxtest_import = True - status = TestGpp.run(self, *args, **kwds) - self.cxxtest_import = False - return status - - -class TestGppFOG(TestGpp): - - fog='-f' - - def run(self, *args, **kwds): - if ply_available: - return TestGpp.run(self, *args, **kwds) - - -class TestGppFOGPy(TestGppFOG): - - def run(self, *args, **kwds): - if cxxtest_available: - self.cxxtest_import = True - status = TestGppFOG.run(self, *args, **kwds) - self.cxxtest_import = False - return status - - -class TestGppValgrind(TestGpp): - - valgrind='valgrind --tool=memcheck --leak-check=yes' - - def file_filter(self, file): - for line in file: - if line.startswith('=='): - continue - # Some *very* old versions of valgrind produce lines like: - # free: in use at exit: 0 bytes in 0 blocks. - # free: 2 allocs, 2 frees, 360 bytes allocated. - if line.startswith('free: '): - continue - yield normalize_line_for_diff(line) - - def run(self, *args, **kwds): - if find('valgrind') is None: - return - return TestGpp.run(self, *args, **kwds) - - def parse_valgrind(self, fname): - # There is a well-known leak on Mac OSX platforms... - if sys.platform == 'darwin': - min_leak = 16 - else: - min_leak = 0 - # - INPUT = open(fname, 'r') - for line in INPUT: - if not line.startswith('=='): - continue - tokens = re.split('[ \t]+', line) - if len(tokens) < 4: - continue - if tokens[1] == 'definitely' and tokens[2] == 'lost:': - if eval(tokens[3]) > min_leak: - self.fail("Valgrind Error: "+ ' '.join(tokens[1:])) - if tokens[1] == 'possibly' and tokens[2] == 'lost:': - if eval(tokens[3]) > min_leak: - self.fail("Valgrind Error: "+ ' '.join(tokens[1:])) - - - -class TestGppFOGValgrind(TestGppValgrind): - - fog='-f' - - def run(self, *args, **kwds): - if ply_available: - return TestGppValgrind.run(self, *args, **kwds) - - -class TestClang(BaseTestCase, unittest.TestCase): - - # Compiler specifics - exe_option = '-o' - include_option = '-I' - compiler='clang++ -v -g -Wall -W -Wshadow -Woverloaded-virtual -Wnon-virtual-dtor -Wreorder -Wsign-promo' - no_eh_option = '-fno-exceptions' - qtFlags='-Ifake' - x11Flags='-Ifake' - w32Flags='-Ifake' - - def run(self, *args, **kwds): - if available('clang++', '-o'): - return unittest.TestCase.run(self, *args, **kwds) - - def setUp(self): - BaseTestCase.setUp(self) - - def tearDown(self): - BaseTestCase.tearDown(self) - - -class TestClangFOG(TestClang): - - fog='-f' - - def run(self, *args, **kwds): - if ply_available: - return TestClang.run(self, *args, **kwds) - - -class TestCL(BaseTestCase, unittest.TestCase): - - # Compiler specifics - exe_option = '-o' - include_option = '-I' - compiler='cl -nologo -GX -W4'# -WX' - no_eh_option = '-GX-' - qtFlags='-Ifake' - x11Flags='-Ifake' - w32Flags='-Ifake' - - def run(self, *args, **kwds): - if available('cl', '-o'): - return unittest.TestCase.run(self, *args, **kwds) - - def setUp(self): - BaseTestCase.setUp(self) - - def tearDown(self): - BaseTestCase.tearDown(self) - - -class TestCLFOG(TestCL): - - fog='-f' - - def run(self, *args, **kwds): - if ply_available: - return TestCL.run(self, *args, **kwds) - - -if __name__ == '__main__': - unittest.main() diff --git a/noarch/lib/py/cxxtest/test/test_doc.py b/noarch/lib/py/cxxtest/test/test_doc.py deleted file mode 100644 index ff6f6484..00000000 --- a/noarch/lib/py/cxxtest/test/test_doc.py +++ /dev/null @@ -1,35 +0,0 @@ -#------------------------------------------------------------------------- -# CxxTest: A lightweight C++ unit testing library. -# Copyright (c) 2008 Sandia Corporation. -# This software is distributed under the LGPL License v3 -# For more information, see the COPYING file in the top CxxTest directory. -# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -# the U.S. Government retains certain rights in this software. -#------------------------------------------------------------------------- - -# -# Import and execute the Python test driver for the user guide examples -# - -# Imports -try: - import pyutilib.th as unittest - pyutilib_available=True -except: - pyutilib_available=False -import os -from os.path import dirname, abspath, abspath, basename -import sys - -if pyutilib_available: - currdir = dirname(abspath(__file__))+os.sep - datadir = os.sep.join([dirname(dirname(abspath(__file__))),'doc','examples'])+os.sep - - os.chdir(datadir) - sys.path.insert(0, datadir) - - from test_examples import * - -# Execute the tests -if __name__ == '__main__': - unittest.main() diff --git a/noarch/lib/py/cxxtest/test/tpltpl.cpp b/noarch/lib/py/cxxtest/test/tpltpl.cpp deleted file mode 100644 index 29ffd25f..00000000 --- a/noarch/lib/py/cxxtest/test/tpltpl.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include <cxxtest/Flags.h> - -#ifndef _CXXTEST_PARTIAL_TEMPLATE_SPECIALIZATION -template<class T> class X {} x; -template<class T, class U> class Pair {} p; -template<class T, class U> class X< Pair<T, U> > {} xp; - -int main() { return 0; } -#endif // !_CXXTEST_PARTIAL_TEMPLATE_SPECIALIZATION - diff --git a/noarch/lib/py/cxxtest/test/unit/LinkedList_test.t.h b/noarch/lib/py/cxxtest/test/unit/LinkedList_test.t.h deleted file mode 100644 index 5bb3b687..00000000 --- a/noarch/lib/py/cxxtest/test/unit/LinkedList_test.t.h +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef LINKEDLIST_TEST_H -#define LINKEDLIST_TEST_H - -#include <cxxtest/LinkedList.h> - -class TestLink : public CxxTest::Link -{ -public: - bool setUp() { return true; } - bool tearDown() { return true; } -}; - -#include <cxxtest/TestSuite.h> -class LinkedList_test : public CxxTest::TestSuite -{ -public: - void test_initialize() - { - CxxTest::List list; - list.initialize(); - TS_ASSERT_EQUALS((CxxTest::Link*)0, list.head()); - TS_ASSERT_EQUALS((CxxTest::Link*)0, list.tail()); - TS_ASSERT_EQUALS(0, list.size()); - TS_ASSERT(list.empty()); - } - - void test_attach() - { - CxxTest::List list; - TestLink link; - - list.initialize(); - link.attach(list); - - TS_ASSERT_EQUALS(1, list.size()); - TS_ASSERT_EQUALS((CxxTest::Link*)&link, list.head()); - TS_ASSERT_EQUALS((CxxTest::Link*)&link, list.tail()); - } - - void test_detach() - { - CxxTest::List list; - TestLink link; - - list.initialize(); - link.attach(list); - link.detach(list); - - TS_ASSERT_EQUALS((CxxTest::Link*)0, list.head()); - TS_ASSERT_EQUALS((CxxTest::Link*)0, list.tail()); - TS_ASSERT_EQUALS(0, list.size()); - TS_ASSERT(list.empty()); - } -}; - - -#endif // __SIMPLETEST_H diff --git a/noarch/lib/py/cxxtest/test/unit/SConstruct b/noarch/lib/py/cxxtest/test/unit/SConstruct deleted file mode 100644 index aaba2212..00000000 --- a/noarch/lib/py/cxxtest/test/unit/SConstruct +++ /dev/null @@ -1,12 +0,0 @@ -CxxTestBuilder_path = '../../build_tools/SCons/cxxtest.py' -CxxTest_dir = '../..' - -# First a little python magic to pull in CxxTestBuilder -import imp -cxxtest = imp.load_source('cxxtest', CxxTestBuilder_path) -env = Environment() -cxxtest.generate(env, CXXTEST_INSTALL_DIR=CxxTest_dir) - -for test in env.Glob('*.t.h'): - env.CxxTest(test) - diff --git a/noarch/lib/py/cxxtest/test/wchar.cpp b/noarch/lib/py/cxxtest/test/wchar.cpp deleted file mode 100644 index ef2b1db7..00000000 --- a/noarch/lib/py/cxxtest/test/wchar.cpp +++ /dev/null @@ -1,11 +0,0 @@ -// -// This program is used to check if the compiler supports basic_string<wchar_t> -// -#include <string> - -int main() -{ - std::basic_string<wchar_t> s(L"s"); - return 0; -} -