Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/premake-4.x-stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstarkos <none@none>2008-10-31 21:38:05 +0300
committerstarkos <none@none>2008-10-31 21:38:05 +0300
commitc257e9c746f096ca4294168a8a2c26de538eb36c (patch)
tree8cf84989823ea063e60f805b8dedb619730bd5bc
parentb2f4cfdc24ae7a45049ada7dd2afd91cb52053d1 (diff)
First integration of new Lua-based architecture
-rw-r--r--BUILD.txt88
-rw-r--r--CHANGES.txt238
-rw-r--r--README.txt18
-rw-r--r--premake.lua211
-rw-r--r--premake4.lua140
-rw-r--r--src/_manifest.lua50
-rw-r--r--src/_premake_main.lua132
-rw-r--r--src/actions/actions.c27
-rw-r--r--src/actions/actions.h46
-rw-r--r--src/actions/clean/_clean.lua76
-rw-r--r--src/actions/make/_make.lua93
-rw-r--r--src/actions/make/gmake.c88
-rw-r--r--src/actions/make/gmake_project.c46
-rw-r--r--src/actions/make/make.c187
-rw-r--r--src/actions/make/make.h18
-rw-r--r--src/actions/make/make_cpp_project.tmpl99
-rw-r--r--src/actions/make/make_project.c329
-rw-r--r--src/actions/make/make_project.h35
-rw-r--r--src/actions/make/make_solution.c190
-rw-r--r--src/actions/make/make_solution.h19
-rw-r--r--src/actions/make/make_solution.tmpl32
-rw-r--r--src/actions/make/tests/make_config_tests.cpp182
-rw-r--r--src/actions/make/tests/make_project_tests.cpp186
-rw-r--r--src/actions/make/tests/make_solution_tests.cpp123
-rw-r--r--src/actions/make/tests/make_tests.cpp98
-rw-r--r--src/actions/support/sourcetree.c107
-rw-r--r--src/actions/support/sourcetree.h37
-rw-r--r--src/actions/tests/action_tests.h78
-rw-r--r--src/actions/vs200x/tests/vs2002_solution_tests.cpp108
-rw-r--r--src/actions/vs200x/tests/vs2003_solution_tests.cpp45
-rw-r--r--src/actions/vs200x/tests/vs2005_solution_tests.cpp80
-rw-r--r--src/actions/vs200x/tests/vs2008_solution_tests.cpp30
-rw-r--r--src/actions/vs200x/tests/vs200x_compiler_tests.cpp102
-rw-r--r--src/actions/vs200x/tests/vs200x_config_tests.cpp192
-rw-r--r--src/actions/vs200x/tests/vs200x_linker_tests.cpp81
-rw-r--r--src/actions/vs200x/tests/vs200x_project_tests.cpp468
-rw-r--r--src/actions/vs200x/tests/vs200x_tests.cpp56
-rw-r--r--src/actions/vs200x/tests/vs200x_xml_tests.cpp121
-rw-r--r--src/actions/vs200x/vs2002.c85
-rw-r--r--src/actions/vs200x/vs2002_solution.c130
-rw-r--r--src/actions/vs200x/vs2003.c84
-rw-r--r--src/actions/vs200x/vs2003_solution.c45
-rw-r--r--src/actions/vs200x/vs2005.c92
-rw-r--r--src/actions/vs200x/vs2005_solution.c90
-rw-r--r--src/actions/vs200x/vs2008.c91
-rw-r--r--src/actions/vs200x/vs2008_solution.c24
-rw-r--r--src/actions/vs200x/vs200x.c190
-rw-r--r--src/actions/vs200x/vs200x.h22
-rw-r--r--src/actions/vs200x/vs200x_config.c120
-rw-r--r--src/actions/vs200x/vs200x_config.h18
-rw-r--r--src/actions/vs200x/vs200x_project.c472
-rw-r--r--src/actions/vs200x/vs200x_project.h39
-rw-r--r--src/actions/vs200x/vs200x_solution.c29
-rw-r--r--src/actions/vs200x/vs200x_solution.h30
-rw-r--r--src/actions/vstudio/_vstudio.lua15
-rw-r--r--src/actions/vstudio/vs2002_solution.tmpl23
-rw-r--r--src/base/array.c127
-rw-r--r--src/base/array.h27
-rw-r--r--src/base/base.h12
-rw-r--r--src/base/buffers.c85
-rw-r--r--src/base/buffers.h25
-rw-r--r--src/base/cstr.c235
-rw-r--r--src/base/cstr.h27
-rw-r--r--src/base/dir.c106
-rw-r--r--src/base/dir.h22
-rw-r--r--src/base/env.c98
-rw-r--r--src/base/env.h41
-rw-r--r--src/base/error.c51
-rw-r--r--src/base/error.h21
-rw-r--r--src/base/file.c31
-rw-r--r--src/base/file.h19
-rw-r--r--src/base/functions.lua319
-rw-r--r--src/base/gcc.lua124
-rw-r--r--src/base/globals.lua126
-rw-r--r--src/base/guid.c109
-rw-r--r--src/base/guid.h20
-rw-r--r--src/base/luastate.c44
-rw-r--r--src/base/luastate.h31
-rw-r--r--src/base/os.lua91
-rw-r--r--src/base/path.c353
-rw-r--r--src/base/path.h29
-rw-r--r--src/base/path.lua229
-rw-r--r--src/base/premake.lua121
-rw-r--r--src/base/project.lua540
-rw-r--r--src/base/stream.c330
-rw-r--r--src/base/stream.h40
-rw-r--r--src/base/string.c67
-rw-r--r--src/base/string.h23
-rw-r--r--src/base/string.lua56
-rw-r--r--src/base/strings.c158
-rw-r--r--src/base/strings.h30
-rw-r--r--src/base/table.lua77
-rw-r--r--src/base/template.lua131
-rw-r--r--src/base/tests/base_tests.cpp23
-rw-r--r--src/base/tests/cstr_tests.cpp190
-rw-r--r--src/base/tests/dir_tests.cpp27
-rw-r--r--src/base/tests/env_tests.cpp28
-rw-r--r--src/base/tests/guid_tests.cpp86
-rw-r--r--src/base/tests/path_tests.cpp266
-rw-r--r--src/base/tests/stream_tests.cpp117
-rw-r--r--src/base/tests/string_tests.cpp46
-rw-r--r--src/host/bytecode.c43
-rw-r--r--src/host/host.c184
-rw-r--r--src/host/host.h39
-rw-r--r--src/host/lua-5.1.2/COPYRIGHT (renamed from src/base/lua-5.1.2/COPYRIGHT)0
-rw-r--r--src/host/lua-5.1.2/HISTORY (renamed from src/base/lua-5.1.2/HISTORY)0
-rw-r--r--src/host/lua-5.1.2/INSTALL (renamed from src/base/lua-5.1.2/INSTALL)0
-rw-r--r--src/host/lua-5.1.2/Makefile (renamed from src/base/lua-5.1.2/Makefile)0
-rw-r--r--src/host/lua-5.1.2/PREMAKE_CHANGES.txt (renamed from src/base/lua-5.1.2/PREMAKE_CHANGES.txt)0
-rw-r--r--src/host/lua-5.1.2/README (renamed from src/base/lua-5.1.2/README)0
-rw-r--r--src/host/lua-5.1.2/doc/amazon.gif (renamed from src/base/lua-5.1.2/doc/amazon.gif)bin797 -> 797 bytes
-rw-r--r--src/host/lua-5.1.2/doc/contents.html (renamed from src/base/lua-5.1.2/doc/contents.html)0
-rw-r--r--src/host/lua-5.1.2/doc/cover.png (renamed from src/base/lua-5.1.2/doc/cover.png)bin3305 -> 3305 bytes
-rw-r--r--src/host/lua-5.1.2/doc/logo.gif (renamed from src/base/lua-5.1.2/doc/logo.gif)bin4232 -> 4232 bytes
-rw-r--r--src/host/lua-5.1.2/doc/lua.1 (renamed from src/base/lua-5.1.2/doc/lua.1)0
-rw-r--r--src/host/lua-5.1.2/doc/lua.css (renamed from src/base/lua-5.1.2/doc/lua.css)0
-rw-r--r--src/host/lua-5.1.2/doc/lua.html (renamed from src/base/lua-5.1.2/doc/lua.html)0
-rw-r--r--src/host/lua-5.1.2/doc/luac.1 (renamed from src/base/lua-5.1.2/doc/luac.1)0
-rw-r--r--src/host/lua-5.1.2/doc/luac.html (renamed from src/base/lua-5.1.2/doc/luac.html)0
-rw-r--r--src/host/lua-5.1.2/doc/manual.css (renamed from src/base/lua-5.1.2/doc/manual.css)0
-rw-r--r--src/host/lua-5.1.2/doc/manual.html (renamed from src/base/lua-5.1.2/doc/manual.html)0
-rw-r--r--src/host/lua-5.1.2/doc/readme.html (renamed from src/base/lua-5.1.2/doc/readme.html)0
-rw-r--r--src/host/lua-5.1.2/etc/Makefile (renamed from src/base/lua-5.1.2/etc/Makefile)0
-rw-r--r--src/host/lua-5.1.2/etc/README (renamed from src/base/lua-5.1.2/etc/README)0
-rw-r--r--src/host/lua-5.1.2/etc/all.c (renamed from src/base/lua-5.1.2/etc/all.c)0
-rw-r--r--src/host/lua-5.1.2/etc/lua.hpp (renamed from src/base/lua-5.1.2/etc/lua.hpp)0
-rw-r--r--src/host/lua-5.1.2/etc/lua.ico (renamed from src/base/lua-5.1.2/etc/lua.ico)bin1078 -> 1078 bytes
-rw-r--r--src/host/lua-5.1.2/etc/lua.pc (renamed from src/base/lua-5.1.2/etc/lua.pc)0
-rw-r--r--src/host/lua-5.1.2/etc/luavs.bat (renamed from src/base/lua-5.1.2/etc/luavs.bat)0
-rw-r--r--src/host/lua-5.1.2/etc/min.c (renamed from src/base/lua-5.1.2/etc/min.c)0
-rw-r--r--src/host/lua-5.1.2/etc/noparser.c (renamed from src/base/lua-5.1.2/etc/noparser.c)0
-rw-r--r--src/host/lua-5.1.2/etc/strict.lua (renamed from src/base/lua-5.1.2/etc/strict.lua)0
-rw-r--r--src/host/lua-5.1.2/src/Makefile (renamed from src/base/lua-5.1.2/src/Makefile)0
-rw-r--r--src/host/lua-5.1.2/src/lapi.c (renamed from src/base/lua-5.1.2/src/lapi.c)0
-rw-r--r--src/host/lua-5.1.2/src/lapi.h (renamed from src/base/lua-5.1.2/src/lapi.h)0
-rw-r--r--src/host/lua-5.1.2/src/lauxlib.c (renamed from src/base/lua-5.1.2/src/lauxlib.c)0
-rw-r--r--src/host/lua-5.1.2/src/lauxlib.h (renamed from src/base/lua-5.1.2/src/lauxlib.h)0
-rw-r--r--src/host/lua-5.1.2/src/lbaselib.c (renamed from src/base/lua-5.1.2/src/lbaselib.c)0
-rw-r--r--src/host/lua-5.1.2/src/lcode.c (renamed from src/base/lua-5.1.2/src/lcode.c)0
-rw-r--r--src/host/lua-5.1.2/src/lcode.h (renamed from src/base/lua-5.1.2/src/lcode.h)0
-rw-r--r--src/host/lua-5.1.2/src/ldblib.c (renamed from src/base/lua-5.1.2/src/ldblib.c)0
-rw-r--r--src/host/lua-5.1.2/src/ldebug.c (renamed from src/base/lua-5.1.2/src/ldebug.c)0
-rw-r--r--src/host/lua-5.1.2/src/ldebug.h (renamed from src/base/lua-5.1.2/src/ldebug.h)0
-rw-r--r--src/host/lua-5.1.2/src/ldo.c (renamed from src/base/lua-5.1.2/src/ldo.c)0
-rw-r--r--src/host/lua-5.1.2/src/ldo.h (renamed from src/base/lua-5.1.2/src/ldo.h)0
-rw-r--r--src/host/lua-5.1.2/src/ldump.c (renamed from src/base/lua-5.1.2/src/ldump.c)0
-rw-r--r--src/host/lua-5.1.2/src/lfunc.c (renamed from src/base/lua-5.1.2/src/lfunc.c)0
-rw-r--r--src/host/lua-5.1.2/src/lfunc.h (renamed from src/base/lua-5.1.2/src/lfunc.h)0
-rw-r--r--src/host/lua-5.1.2/src/lgc.c (renamed from src/base/lua-5.1.2/src/lgc.c)0
-rw-r--r--src/host/lua-5.1.2/src/lgc.h (renamed from src/base/lua-5.1.2/src/lgc.h)0
-rw-r--r--src/host/lua-5.1.2/src/linit.c (renamed from src/base/lua-5.1.2/src/linit.c)0
-rw-r--r--src/host/lua-5.1.2/src/liolib.c (renamed from src/base/lua-5.1.2/src/liolib.c)0
-rw-r--r--src/host/lua-5.1.2/src/llex.c (renamed from src/base/lua-5.1.2/src/llex.c)0
-rw-r--r--src/host/lua-5.1.2/src/llex.h (renamed from src/base/lua-5.1.2/src/llex.h)0
-rw-r--r--src/host/lua-5.1.2/src/llimits.h (renamed from src/base/lua-5.1.2/src/llimits.h)0
-rw-r--r--src/host/lua-5.1.2/src/lmathlib.c (renamed from src/base/lua-5.1.2/src/lmathlib.c)0
-rw-r--r--src/host/lua-5.1.2/src/lmem.c (renamed from src/base/lua-5.1.2/src/lmem.c)0
-rw-r--r--src/host/lua-5.1.2/src/lmem.h (renamed from src/base/lua-5.1.2/src/lmem.h)0
-rw-r--r--src/host/lua-5.1.2/src/loadlib.c (renamed from src/base/lua-5.1.2/src/loadlib.c)0
-rw-r--r--src/host/lua-5.1.2/src/lobject.c (renamed from src/base/lua-5.1.2/src/lobject.c)0
-rw-r--r--src/host/lua-5.1.2/src/lobject.h (renamed from src/base/lua-5.1.2/src/lobject.h)0
-rw-r--r--src/host/lua-5.1.2/src/lopcodes.c (renamed from src/base/lua-5.1.2/src/lopcodes.c)0
-rw-r--r--src/host/lua-5.1.2/src/lopcodes.h (renamed from src/base/lua-5.1.2/src/lopcodes.h)0
-rw-r--r--src/host/lua-5.1.2/src/loslib.c (renamed from src/base/lua-5.1.2/src/loslib.c)0
-rw-r--r--src/host/lua-5.1.2/src/lparser.c (renamed from src/base/lua-5.1.2/src/lparser.c)0
-rw-r--r--src/host/lua-5.1.2/src/lparser.h (renamed from src/base/lua-5.1.2/src/lparser.h)0
-rw-r--r--src/host/lua-5.1.2/src/lstate.c (renamed from src/base/lua-5.1.2/src/lstate.c)0
-rw-r--r--src/host/lua-5.1.2/src/lstate.h (renamed from src/base/lua-5.1.2/src/lstate.h)0
-rw-r--r--src/host/lua-5.1.2/src/lstring.c (renamed from src/base/lua-5.1.2/src/lstring.c)0
-rw-r--r--src/host/lua-5.1.2/src/lstring.h (renamed from src/base/lua-5.1.2/src/lstring.h)0
-rw-r--r--src/host/lua-5.1.2/src/lstrlib.c (renamed from src/base/lua-5.1.2/src/lstrlib.c)0
-rw-r--r--src/host/lua-5.1.2/src/ltable.c (renamed from src/base/lua-5.1.2/src/ltable.c)0
-rw-r--r--src/host/lua-5.1.2/src/ltable.h (renamed from src/base/lua-5.1.2/src/ltable.h)0
-rw-r--r--src/host/lua-5.1.2/src/ltablib.c (renamed from src/base/lua-5.1.2/src/ltablib.c)0
-rw-r--r--src/host/lua-5.1.2/src/ltm.c (renamed from src/base/lua-5.1.2/src/ltm.c)0
-rw-r--r--src/host/lua-5.1.2/src/ltm.h (renamed from src/base/lua-5.1.2/src/ltm.h)0
-rw-r--r--src/host/lua-5.1.2/src/lua.c (renamed from src/base/lua-5.1.2/src/lua.c)0
-rw-r--r--src/host/lua-5.1.2/src/lua.h (renamed from src/base/lua-5.1.2/src/lua.h)0
-rw-r--r--src/host/lua-5.1.2/src/luac.c (renamed from src/base/lua-5.1.2/src/luac.c)0
-rw-r--r--src/host/lua-5.1.2/src/luaconf.h (renamed from src/base/lua-5.1.2/src/luaconf.h)0
-rw-r--r--src/host/lua-5.1.2/src/lualib.h (renamed from src/base/lua-5.1.2/src/lualib.h)0
-rw-r--r--src/host/lua-5.1.2/src/lundump.c (renamed from src/base/lua-5.1.2/src/lundump.c)0
-rw-r--r--src/host/lua-5.1.2/src/lundump.h (renamed from src/base/lua-5.1.2/src/lundump.h)0
-rw-r--r--src/host/lua-5.1.2/src/lvm.c (renamed from src/base/lua-5.1.2/src/lvm.c)0
-rw-r--r--src/host/lua-5.1.2/src/lvm.h (renamed from src/base/lua-5.1.2/src/lvm.h)0
-rw-r--r--src/host/lua-5.1.2/src/lzio.c (renamed from src/base/lua-5.1.2/src/lzio.c)0
-rw-r--r--src/host/lua-5.1.2/src/lzio.h (renamed from src/base/lua-5.1.2/src/lzio.h)0
-rw-r--r--src/host/lua-5.1.2/src/print.c (renamed from src/base/lua-5.1.2/src/print.c)0
-rw-r--r--src/host/lua-5.1.2/test/README (renamed from src/base/lua-5.1.2/test/README)0
-rw-r--r--src/host/lua-5.1.2/test/bisect.lua (renamed from src/base/lua-5.1.2/test/bisect.lua)0
-rw-r--r--src/host/lua-5.1.2/test/cf.lua (renamed from src/base/lua-5.1.2/test/cf.lua)0
-rw-r--r--src/host/lua-5.1.2/test/echo.lua (renamed from src/base/lua-5.1.2/test/echo.lua)0
-rw-r--r--src/host/lua-5.1.2/test/env.lua (renamed from src/base/lua-5.1.2/test/env.lua)0
-rw-r--r--src/host/lua-5.1.2/test/factorial.lua (renamed from src/base/lua-5.1.2/test/factorial.lua)0
-rw-r--r--src/host/lua-5.1.2/test/fib.lua (renamed from src/base/lua-5.1.2/test/fib.lua)0
-rw-r--r--src/host/lua-5.1.2/test/fibfor.lua (renamed from src/base/lua-5.1.2/test/fibfor.lua)0
-rw-r--r--src/host/lua-5.1.2/test/globals.lua (renamed from src/base/lua-5.1.2/test/globals.lua)0
-rw-r--r--src/host/lua-5.1.2/test/hello.lua (renamed from src/base/lua-5.1.2/test/hello.lua)0
-rw-r--r--src/host/lua-5.1.2/test/life.lua (renamed from src/base/lua-5.1.2/test/life.lua)0
-rw-r--r--src/host/lua-5.1.2/test/luac.lua (renamed from src/base/lua-5.1.2/test/luac.lua)0
-rw-r--r--src/host/lua-5.1.2/test/printf.lua (renamed from src/base/lua-5.1.2/test/printf.lua)0
-rw-r--r--src/host/lua-5.1.2/test/readonly.lua (renamed from src/base/lua-5.1.2/test/readonly.lua)0
-rw-r--r--src/host/lua-5.1.2/test/sieve.lua (renamed from src/base/lua-5.1.2/test/sieve.lua)0
-rw-r--r--src/host/lua-5.1.2/test/sort.lua (renamed from src/base/lua-5.1.2/test/sort.lua)0
-rw-r--r--src/host/lua-5.1.2/test/table.lua (renamed from src/base/lua-5.1.2/test/table.lua)0
-rw-r--r--src/host/lua-5.1.2/test/trace-calls.lua (renamed from src/base/lua-5.1.2/test/trace-calls.lua)0
-rw-r--r--src/host/lua-5.1.2/test/trace-globals.lua (renamed from src/base/lua-5.1.2/test/trace-globals.lua)0
-rw-r--r--src/host/lua-5.1.2/test/xd.lua (renamed from src/base/lua-5.1.2/test/xd.lua)0
-rw-r--r--src/host/os_chdir.c32
-rw-r--r--src/host/os_getcwd.c30
-rw-r--r--src/host/os_isdir.c34
-rw-r--r--src/host/os_isfile.c30
-rw-r--r--src/host/os_match.c178
-rw-r--r--src/host/os_mkdir.c33
-rw-r--r--src/host/os_pathsearch.c84
-rw-r--r--src/host/os_rmdir.c35
-rw-r--r--src/host/premake.c265
-rw-r--r--src/host/premake.h60
-rw-r--r--src/host/tests/host_args_tests.cpp47
-rw-r--r--src/host/tests/host_help_tests.cpp79
-rw-r--r--src/host/tests/host_results_tests.cpp48
-rw-r--r--src/host/tests/host_run_tests.cpp54
-rw-r--r--src/host/tests/host_tests.cpp31
-rw-r--r--src/objects/block.c140
-rw-r--r--src/objects/block.h45
-rw-r--r--src/objects/blocks.c84
-rw-r--r--src/objects/blocks.h25
-rw-r--r--src/objects/fields.c173
-rw-r--r--src/objects/fields.h66
-rw-r--r--src/objects/objects.h12
-rw-r--r--src/objects/objects_internal.h9
-rw-r--r--src/objects/project.c507
-rw-r--r--src/objects/project.h76
-rw-r--r--src/objects/session.c301
-rw-r--r--src/objects/session.h73
-rw-r--r--src/objects/solution.c327
-rw-r--r--src/objects/solution.h69
-rw-r--r--src/objects/tests/block_tests.cpp80
-rw-r--r--src/objects/tests/fields_tests.cpp64
-rw-r--r--src/objects/tests/objects_tests.cpp26
-rw-r--r--src/objects/tests/project_config_tests.cpp72
-rw-r--r--src/objects/tests/project_tests.cpp125
-rw-r--r--src/objects/tests/session_tests.cpp341
-rw-r--r--src/objects/tests/solution_tests.cpp110
-rw-r--r--src/platform/platform.h93
-rw-r--r--src/platform/posix.c136
-rw-r--r--src/platform/windows.c105
-rw-r--r--src/premake.c48
-rw-r--r--src/premake.h43
-rw-r--r--src/premake.lua55
-rw-r--r--src/script/fn_accessor.c246
-rw-r--r--src/script/fn_configuration.c36
-rw-r--r--src/script/fn_configurations.c43
-rw-r--r--src/script/fn_dofile.c76
-rw-r--r--src/script/fn_error.c21
-rw-r--r--src/script/fn_getcwd.c20
-rw-r--r--src/script/fn_include.c26
-rw-r--r--src/script/fn_match.c101
-rw-r--r--src/script/fn_project.c86
-rw-r--r--src/script/fn_solution.c67
-rw-r--r--src/script/script.c275
-rw-r--r--src/script/script.h29
-rw-r--r--src/script/script_internal.c201
-rw-r--r--src/script/script_internal.h76
-rw-r--r--src/script/tests/fn_accessor_tests.cpp142
-rw-r--r--src/script/tests/fn_configuration_tests.cpp99
-rw-r--r--src/script/tests/fn_configurations_tests.cpp44
-rw-r--r--src/script/tests/fn_defines_tests.cpp35
-rw-r--r--src/script/tests/fn_dofile_tests.cpp73
-rw-r--r--src/script/tests/fn_error_tests.cpp25
-rw-r--r--src/script/tests/fn_files_tests.cpp35
-rw-r--r--src/script/tests/fn_flags_tests.cpp42
-rw-r--r--src/script/tests/fn_getcwd_tests.cpp29
-rw-r--r--src/script/tests/fn_guid_tests.cpp45
-rw-r--r--src/script/tests/fn_include_tests.cpp36
-rw-r--r--src/script/tests/fn_language_tests.cpp42
-rw-r--r--src/script/tests/fn_location_tests.cpp35
-rw-r--r--src/script/tests/fn_match_tests.cpp58
-rw-r--r--src/script/tests/fn_project_tests.cpp132
-rw-r--r--src/script/tests/fn_solution_tests.cpp126
-rw-r--r--src/script/tests/script_tests.cpp52
-rw-r--r--src/script/tests/script_tests.h40
-rw-r--r--src/script/tests/unload_block_tests.cpp65
-rw-r--r--src/script/tests/unload_project_tests.cpp122
-rw-r--r--src/script/tests/unload_solution_tests.cpp74
-rw-r--r--src/script/tests/unload_tests.cpp226
-rw-r--r--src/script/unload.c264
-rw-r--r--src/testing/UnitTest++/COPYING20
-rw-r--r--src/testing/UnitTest++/Makefile93
-rw-r--r--src/testing/UnitTest++/PREMAKE_CHANGES.txt3
-rw-r--r--src/testing/UnitTest++/README62
-rw-r--r--src/testing/UnitTest++/TestUnitTest++.vsnet2003.vcproj168
-rw-r--r--src/testing/UnitTest++/TestUnitTest++.vsnet2005.vcproj248
-rw-r--r--src/testing/UnitTest++/UnitTest++.vsnet2003.sln30
-rw-r--r--src/testing/UnitTest++/UnitTest++.vsnet2003.vcproj217
-rw-r--r--src/testing/UnitTest++/UnitTest++.vsnet2005.sln29
-rw-r--r--src/testing/UnitTest++/UnitTest++.vsnet2005.vcproj306
-rw-r--r--src/testing/UnitTest++/docs/UnitTest++.html260
-rw-r--r--src/testing/UnitTest++/src/AssertException.cpp32
-rw-r--r--src/testing/UnitTest++/src/AssertException.h28
-rw-r--r--src/testing/UnitTest++/src/CheckMacros.h102
-rw-r--r--src/testing/UnitTest++/src/Checks.cpp79
-rw-r--r--src/testing/UnitTest++/src/Checks.h146
-rw-r--r--src/testing/UnitTest++/src/Config.h25
-rw-r--r--src/testing/UnitTest++/src/DeferredTestReporter.cpp28
-rw-r--r--src/testing/UnitTest++/src/DeferredTestReporter.h28
-rw-r--r--src/testing/UnitTest++/src/DeferredTestResult.cpp26
-rw-r--r--src/testing/UnitTest++/src/DeferredTestResult.h29
-rw-r--r--src/testing/UnitTest++/src/MemoryOutStream.cpp143
-rw-r--r--src/testing/UnitTest++/src/MemoryOutStream.h67
-rw-r--r--src/testing/UnitTest++/src/Posix/SignalTranslator.cpp46
-rw-r--r--src/testing/UnitTest++/src/Posix/SignalTranslator.h42
-rw-r--r--src/testing/UnitTest++/src/Posix/TimeHelpers.cpp33
-rw-r--r--src/testing/UnitTest++/src/Posix/TimeHelpers.h28
-rw-r--r--src/testing/UnitTest++/src/ReportAssert.cpp10
-rw-r--r--src/testing/UnitTest++/src/ReportAssert.h10
-rw-r--r--src/testing/UnitTest++/src/Test.cpp62
-rw-r--r--src/testing/UnitTest++/src/Test.h34
-rw-r--r--src/testing/UnitTest++/src/TestDetails.cpp22
-rw-r--r--src/testing/UnitTest++/src/TestDetails.h24
-rw-r--r--src/testing/UnitTest++/src/TestList.cpp39
-rw-r--r--src/testing/UnitTest++/src/TestList.h32
-rw-r--r--src/testing/UnitTest++/src/TestMacros.h99
-rw-r--r--src/testing/UnitTest++/src/TestReporter.cpp10
-rw-r--r--src/testing/UnitTest++/src/TestReporter.h20
-rw-r--r--src/testing/UnitTest++/src/TestReporterStdout.cpp36
-rw-r--r--src/testing/UnitTest++/src/TestReporterStdout.h19
-rw-r--r--src/testing/UnitTest++/src/TestResults.cpp60
-rw-r--r--src/testing/UnitTest++/src/TestResults.h36
-rw-r--r--src/testing/UnitTest++/src/TestRunner.cpp60
-rw-r--r--src/testing/UnitTest++/src/TestRunner.h17
-rw-r--r--src/testing/UnitTest++/src/TestSuite.h14
-rw-r--r--src/testing/UnitTest++/src/TimeConstraint.cpp28
-rw-r--r--src/testing/UnitTest++/src/TimeConstraint.h34
-rw-r--r--src/testing/UnitTest++/src/TimeHelpers.h7
-rw-r--r--src/testing/UnitTest++/src/UnitTest++.h17
-rw-r--r--src/testing/UnitTest++/src/Win32/TimeHelpers.cpp46
-rw-r--r--src/testing/UnitTest++/src/Win32/TimeHelpers.h48
-rw-r--r--src/testing/UnitTest++/src/XmlTestReporter.cpp126
-rw-r--r--src/testing/UnitTest++/src/XmlTestReporter.h34
-rw-r--r--src/testing/UnitTest++/src/tests/Main.cpp8
-rw-r--r--src/testing/UnitTest++/src/tests/RecordingReporter.h92
-rw-r--r--src/testing/UnitTest++/src/tests/TestAssertHandler.cpp44
-rw-r--r--src/testing/UnitTest++/src/tests/TestCheckMacros.cpp710
-rw-r--r--src/testing/UnitTest++/src/tests/TestChecks.cpp290
-rw-r--r--src/testing/UnitTest++/src/tests/TestDeferredTestReporter.cpp104
-rw-r--r--src/testing/UnitTest++/src/tests/TestMemoryOutStream.cpp150
-rw-r--r--src/testing/UnitTest++/src/tests/TestTest.cpp97
-rw-r--r--src/testing/UnitTest++/src/tests/TestTestList.cpp50
-rw-r--r--src/testing/UnitTest++/src/tests/TestTestMacros.cpp171
-rw-r--r--src/testing/UnitTest++/src/tests/TestTestResults.cpp111
-rw-r--r--src/testing/UnitTest++/src/tests/TestTestRunner.cpp233
-rw-r--r--src/testing/UnitTest++/src/tests/TestTestSuite.cpp13
-rw-r--r--src/testing/UnitTest++/src/tests/TestTimeConstraint.cpp57
-rw-r--r--src/testing/UnitTest++/src/tests/TestTimeConstraintMacro.cpp29
-rw-r--r--src/testing/UnitTest++/src/tests/TestUnitTest++.cpp137
-rw-r--r--src/testing/UnitTest++/src/tests/TestXmlTestReporter.cpp183
-rw-r--r--src/testing/test_files/_FILE.lua2
-rw-r--r--src/testing/test_files/dofile.lua2
-rw-r--r--src/testing/test_files/dofile_getcwd.lua4
-rw-r--r--src/testing/test_files/error.lua1
-rw-r--r--src/testing/test_files/getcwd.lua1
-rw-r--r--src/testing/test_files/nested/getcwd.lua1
-rw-r--r--src/testing/test_files/premake4.lua3
-rw-r--r--src/testing/test_files/true.lua2
-rw-r--r--src/testing/testing.cpp22
-rw-r--r--src/testing/testing.h9
-rw-r--r--tests/folder/ok.lua1
-rw-r--r--tests/premake4.lua36
-rwxr-xr-xtests/run.sh4
-rw-r--r--tests/test_dofile.lua36
-rw-r--r--tests/test_file.lua43
-rw-r--r--tests/test_functions.lua134
-rw-r--r--tests/test_path.lua142
-rw-r--r--tests/test_premake.lua33
-rw-r--r--tests/test_project.lua321
-rw-r--r--tests/test_string.lua43
-rw-r--r--tests/test_table.lua33
-rw-r--r--tests/test_template.lua45
-rw-r--r--tests/testfx.lua135
380 files changed, 4490 insertions, 20572 deletions
diff --git a/BUILD.txt b/BUILD.txt
new file mode 100644
index 0000000..1a434d2
--- /dev/null
+++ b/BUILD.txt
@@ -0,0 +1,88 @@
+PREMAKE BUILD INSTRUCTIONS
+
+ As of version 4.0, Premake is written in a mix of C and Lua. This mix
+ makes it smaller, enables the templating features, and easier the
+ whole thing easier to maintain. The trade-off is a couple of wrinkles
+ in the build process.
+
+ If you downloaded a source code package from SourceForge, you can just
+ build using the default "Release" configuration and go. The information
+ in this file is primarily for people who got the code from Subversion,
+ or developers who want to make changes to the Premake code.
+
+
+GENERATING THE PROJECT FILES
+
+ If you downloaded a source code package from SourceForge, the project
+ files are already included and you can skip ahead to the next section.
+ If you downloaded the sources from Subversion, you'll need to generate
+ new projects files before you can build.
+
+ In order to generate the project files, you need a working version of
+ Premake, either 3.x or 4.x versions, installed on your system. You can
+ get it as source code or a prebuilt binary from the SourceForge
+ download page.
+
+ Once you have a working Premake installed, generate the project files
+ in the normal way. For Premake 4.x, type a command like:
+
+ premake4 gmake -- for GNU makefiles using GCC
+ premake4 vs2005 -- for a Visual Studio 2005 solution
+
+ For Premake 3.x, use the old command line format:
+
+ premake --target gnu
+ premake --target vs2005
+
+ Use the "--help" option to see all available targets.
+
+
+RELEASE AND DEBUG BUILDS
+
+ Premake can be built in either "release" or "debug" modes. You can
+ choose which configuration to build with the CONFIG argument:
+
+ make CONFIG=Debug -- build in debug mode
+ make CONFIG=Release -- build in release mode
+
+ (IDEs like Visual Studio provide their own mechanism for switching
+ build configurations).
+
+ In release mode (the default) you can build and run Premake like any
+ other C application. In debug mode, Premake reads the Lua scripts from
+ the disk at runtime, enabling compile-less code/test iterations. But
+ it needs some help to find the scripts.
+
+ You can specify the location of the scripts in one of two ways. You
+ can use the /scripts command line argument, like so:
+
+ premake4 /scripts=~/Code/premake4/src gmake
+
+ Or by setting a PREMAKE_PATH environment variable.
+
+ PREMAKE_PATH=~/Code/premake4/src
+
+ As you can see, you need to specify the location of the Premake "src"
+ directory, the one containing "_premake_main.lua".
+
+
+COMPILING SCRIPTS
+
+ If you make changes to the core Lua scripts, you can integrate them
+ into the release build using the "compile" command:
+
+ premake4 compile -- for Premake 4.x
+ premake --compile -- for Premake 3.x
+
+ This command compiles all of the scripts listed in _manifest.lua into
+ bytecode and embeds them into src/host/bytecode.c. The next release
+ build will include the updated scripts.
+
+
+CONFUSED?
+
+ I'll be glad to help you out. Stop by the main project website where
+ you leave a note in the forums (the preferred approach), join the
+ mailing list, or contact me directly.
+
+ http://industriousone.com/premake
diff --git a/CHANGES.txt b/CHANGES.txt
index e01b308..732c74b 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -5,241 +5,5 @@ This version is a complete rewrite of Premake.
- New, more readable syntax for project information
- Better validation of command-line arguments
- Standardized path handling across all project settings
+- Template system allows script-based custom generators
- Upgraded to Lua 5.1.2
-
- 3.5
---------------------
-- Prevent creation of import libraries on OS X
-- Improved handling of dylibs on OS X
-- Patch 1771977: Ability to compile C source as C++ in Code::Blocks (Ryan Pusztai)
-- Patch 1771168: luaL_getn speed optimization (Richard O'Grady)
-- Bug 1804810: out-implib not present in linux gnu compler toolchain
-- Bug 1806949: .Net reference paths are broken when bindir is specified
-- Bug 1806960: Make clean does not remove .mdb files
-- Bug 1831389: Makefiles stored in subdirs contain no targets on first run
-
- 3.4
---------------------
-- Added `no-pch` flag to suppress precompiled headers
-- Added App.config support to GNU makefiles
-- Add os.mkdir() to script environment
-- Makefile now creates target directory before copying .NET references
-- Feature 1520182: Enhanced file-handling functions
-- Bug 531878: Problems with relative paths
-- Bug 1723867: Config-specific post-build on GNU target (Benoit Miller)
-- Bug 1596826: XML targets doesn't escape xml entities
-- Bug 1600155: Core dump due to newpackage() and matchfiles()
-- Bug 1608895: resgen command shown
-- Bug 1639730: Output filename is not set
-- Bug 1729227: non-portable executable with relative library path
-- Bug 1559951: default clean rule removes package dir
-- Patch 1733674: PCH support for Code::Block targets (Ryan Pusztai)
-- Patch 1746563: Ability to specify GUID for VS targets (Ryan Pusztai)
-- Patch 1754867: Creating import lib of different name (Ryan Pusztai)
-
- 3.3
---------------------
-- Added support for prebuild, prelink, and postbuild commands
-- Added `target` global variable to script environment
-- Added build flag `no-edit-and-continue`
-- Added build flags `native-wchar` and `no-native-wchar`
-- Added build flag `no-manifest`
-- Added build flag `seh-exceptions` (VS2005 only)
-- Added `resdefines`, `respaths`, and `resoptions`
-- Added `prebuildcommands`, `prelinkcommands`, and `postbuildcommands`
-- Added `pchheader` and `pchsource` (Visual Studio only)
-- Feature 1337547: Package-level bindir and libdir
-- Bug 1565755: Generated makefiles do not work with MSYS
-- Bug 1587955: Target path ignored for libs
-- Bug 1574725: Static library extension for "gnu" target
-- Bug 1522861: Fixed by using "ar -rcs" instead of "ar -cr && ranlib"
-- Bug 1656816: Mkdir set wrong directory rights
-- Bug 1655595: Compile/build problem on FreeBSD
-- Bug: "gnu" clean rule doesn't work in cmd.exe
-- Improved behavior of Linux findlib()
-- Updated Code::Blocks support to latest project version (major="1" minor="6")
-- Patch 1681666: GNU targets always show the console if kind = 'winexe'
-
- 3.2
---------------------
-- Added support for Code::Blocks
-- Updated MonoDevelop support
-- Upgraded Lua to 5.0.3
-- Added new matchdirs() to Lua script environment
-- Expose list of packages as _PACKAGES global in Lua
-- Turn off edit-and-continue in release builds with symbols
-- Bug 1559873: libpaths inserts extra space after -L
-
- 3.1
---------------------
-- Added support for Visual Studio 2005
-- Added support for Windows resources to GNU make target
-- Added path handling functions to Lua environment
-- Added matchrecursive() for recursive file searches
-- Added os.fileexists() function to Lua environment
-- Added os.appendfile() function to Lua environment
-- Changed `monoresgen` to `resgen` to keep up with Mono project
-- Added `mono2` .NET compiler set for Mono .NET 2.0 support
-- Feature 1096677: exclude files from matchfiles (package.excludes)
-- Bug 1439463: VS2003 RTTI problem
-- Bug 1439446: GNU Makefile problem under Mingw32
-- Bug 1422068: package.path="." causes bad makefiles
-- Bug 1431530: makefile target fails when project path specified
-
- 3.0
---------------------
-- Upgraded Lua interpreter to version 5.0.1
-- The options table now stores simple values, rather than tables
-- Completed MonoDevelop support
-- Improved .NET resource handling for GNU generator
-- Added unit test suite
-- Merged Scott Graham unicode build flag patch
-- Removed package.warninglevel in favor of extra-warnings flag
-- Added package.targetprefix
-- Overhauled structure of generated GNU makefiles
-- Added --os command line option
-- Fixed bug 1268588: Use gcc to link C packages
-- Fixed bug 1363306: GNU C# should copy referenced DLLs
-
- 2.4
---------------------
-- Added chdir() to Lua script environment
-- Merged Thomas Harning's patch for .NET resources on GNU
-- Fixed bug 1194702: Can't put multiple packages in same directory
-- Fixed bug in GNU shared library builds (doh!)
-- Added target 'vs2002' to replace 'vs7'
-
- 2.3
---------------------
-- Added 'project.config[]' with 'bindir' and 'libdir'
-- Merged Scott Graham's "warninglevel" patch.
-- Fixed bug 1153484: Import lib in wrong directory.
-- Fixed bug 1013352: Stack overflow with large projects.
-- Fixed bug 945406: package.files, bad value = crash
-
- 2.2
---------------------
-- Worked around VS.NET bug for .NET assemblies > 64K.
-- Added --very-verbose flag to GNU generator.
-- GNU generator now supports assembly sources.
-
- 2.1
---------------------
-- File extension of generated binaries can now be set
- with config.targetextension.
-- Windows targets now handle .def files for DLLs.
-
- 2.0
---------------------
-- Can now specify build actions per file
-- Include paths are now passed to VC7 resource compiler
-- Removed _WIN32 define from Cygwin makefiles
-- Added package.objdir to set intermediates directory
-- Added rmdir() to Lua script environment
-- A big bag of bug fixes
-
- 1.9
---------------------
-- Made verbose mode even more verbose.
-- posix.c now builds properly as C.
-- Fixed package dependency generation for GNU and VS2003.
-- Display Lua version number in usage text.
-- Fixed VS link between *.aspx and *.aspx.cs files.
-- Fixed VS link between *.resx and *.cs files.
-- Fixed *.d file generation for gcc 2.9x.
-- Unified various help options under '--help'.
-- Bin and Lib paths can now be arbitrarily long.
-- linkoptions are now applied in VC6 and VC7 projects.
-
- 1.8
---------------------
-- Added support for ASP.NET projects.
-- Fixed a bug in VC6 support for static libraries.
-- matchfiles() now uses package path instead of script path.
-- Added --verbose option.
-- No longer apply no-rtti and no-exceptions to *.c files.
-
- 1.7
---------------------
-- Location of generated project files can now be specified with
- the project.path variable.
-- Inter-package dependencies are fixed for GNU makefiles.
-- No longer need to execute in same directory as project script.
-- Added "c" language specifier.
-- Added support for .resx and .config files to C# projects.
-- Added support for full assembly names in .NET references.
-- Fixed handling of paths in package.target variable.
-- Improved support for SharpDevelop.
-- Started support for OS X.
-- Added support for Digital Mars compiler.
-
- 1.6
---------------------
-- VS7 generator crashed if a package was built before one of its
- dependencies. Now immediately assigns UUID before processing.
-- Added support for Visual Studio 2003 and SharpDevelop.
-- Added binaries directory as a reference path for VS7.
-
- 1.5
---------------------
-- Added initial support for building static libraries.
-- Added "no-main" flag, prevents overriding WinMain() on
- Windows builds.
-- Added "--no-rtti" and "no-exceptions" build flags to
- disable those C++ features.
-- Display error message when project has no packages.
-- Moved VC7 *.pdb files into intermediates directory.
-
- 1.4
---------------------
-- Bug fixes to the path manipulation routines.
-- GNU makefiles are regenerated when premake scripts change.
-
- 1.3
---------------------
-- Added support for the Cygwin environment.
-- Added "static-runtime" build flag to statically link against C/C++
- standard runtime libraries.
-- Bug fixes to Visual Studio 6 and 7 generators and path reversing
- algorithm.
-
- 1.2
---------------------
-- Standardized format of command-line options.
-- Can now handle custom command-line options in script.
-- Added new function findlib().
-- Added new C++ build flag "managed" for writing C++ .NET code.
-- Can now use open-source C# compilers in VS6 generator.
-- Several bug fixes to the VS7 generator.
-
- 1.1
---------------------
-- Added support for custom build configurations. Added "optimize",
- "optimize-size", "optimize-speed", and "no-symbols" flags to control
- build settings.
-- Added matchfiles() to select files using wildcards.
-- Added "unsafe" flag for C# projects.
-- Added newpackage() function for creating new package objects inline,
- instead of creating separate scripts.
-- Changed include() to dopackage() and option() to addoption(). The old
- versions have been kept for compatibility, but will be deprecated
- eventually.
-- Major cleanup of the source code.
-
- 1.0
---------------------
-- Fixed a bug related to the reference paths in VS7 C# projects.
-- Display a warning message if a reference path can't be found.
-- Automatically create bin and lib directories if they do not exist.
-- GNU C# projects will now properly use the configured library paths.
-- Added --with-mono and --with-pnet options.
-- VS7 C# projects will now properly use the configured library paths.
-- Switched to Lua (http://www.lua.org/) for project script parsing.
-- Add support for custom project options.
-- Changed 'type' to 'kind' to avoid conflict with Lua function of the same name.
-- Changed 'conexe' to 'exe' because I liked it better.
-- Changed 'library' to 'dll' for C# projects to keep things consistent.
-
- 0.9
---------------------
-- Initial public release.
diff --git a/README.txt b/README.txt
index 3130143..5daa26a 100644
--- a/README.txt
+++ b/README.txt
@@ -8,24 +8,8 @@ A build configuration tool
See their website at http://www.lua.org/
-BUILDING PREMAKE
+ See the file BUILD.txt for instructions on building Premake.
- Until an official release is made you will need to use an existing
- Premake 3.x executable to generate the project files. Grab a binary
- or source package from the project site at:
-
- http://premake.sourceforge.net/
-
- Then use it to create the project files for your particular toolset.
-
- $ cd premake-4.0
- $ premake --target vs2005 # For Visual Studio 2005 files
- $ premake --target gnu # For GNU makefile
-
- Run `premake --help` for a complete list of supported toolsets.
-
-
-SUPPORT
For questions, comments, or more information, visit the project
website at http://industriousone.com/premake
diff --git a/premake.lua b/premake.lua
index b1f5f52..068ff93 100644
--- a/premake.lua
+++ b/premake.lua
@@ -1,10 +1,7 @@
project.name = "Premake4"
--- Project options
-
- addoption("no-tests", "Build without automated tests")
-
-
+ project.configs = { "Release", "Debug" }
+
-- Output directories
project.config["Debug"].bindir = "bin/debug"
@@ -21,140 +18,114 @@ project.name = "Premake4"
function doclean(cmd, arg)
docommand(cmd, arg)
os.rmdir("bin")
- os.rmdir("doc")
end
--- Release code
- REPOS = "https://premake.svn.sourceforge.net/svnroot/premake"
- TRUNK = "/trunk"
- TAGS = "/tags/4.0-dev/"
+-- Functions copied from Premake4; can drop them once I'm self-hosting
- function dorelease(cmd, arg)
-
- if (not arg) then
- error "You must specify a version"
- end
+ path = { }
- -------------------------------------------------------------------
- -- Make sure everything is good before I start
- -------------------------------------------------------------------
- print("")
- print("PRE-FLIGHT CHECKLIST")
- print(" * is README up-to-date?")
- print(" * is CHANGELOG up-to-date?")
- print(" * did you test build with GCC?")
- print(" * did you test build with Doxygen?")
- print(" * are 'svn' (all) and '7z' (Windows) available?")
- print("")
- print("Press [Enter] to continue or [^C] to quit.")
- io.stdin:read("*l")
-
- -------------------------------------------------------------------
- -- Set up environment
- -------------------------------------------------------------------
- local version = arg
-
- os.mkdir("release")
+ function string.findlast(s, pattern, plain)
+ local curr = 0
+ repeat
+ local next = s:find(pattern, curr + 1, plain)
+ if (next) then curr = next end
+ until (not next)
+ if (curr > 0) then
+ return curr
+ end
+ end
- local folder = "premake4-"..version
- local trunk = REPOS..TRUNK
- local branch = REPOS..TAGS..version
-
- -------------------------------------------------------------------
- -- Build and run all automated tests on working copy
- -------------------------------------------------------------------
- print("Building tests on working copy...")
- os.execute("premake --target gnu >release/release.log")
- result = os.execute("make CONFIG=Release >release/release.log")
- if (result ~= 0) then
- error("Test build failed; see release.log for details")
+ function path.getbasename(p)
+ local fn = path.getname(p)
+ local i = fn:findlast(".", true)
+ if (i) then
+ return fn:sub(1, i - 1)
+ else
+ return fn
end
-
- -------------------------------------------------------------------
- -- Look for a release branch in SVN, and create one from trunk if necessary
- -------------------------------------------------------------------
- print("Checking for release branch...")
- os.chdir("release")
- result = os.execute(string.format("svn ls %s >release.log 2>&1", branch))
- if (result ~= 0) then
- print("Creating release branch...")
- result = os.execute(string.format('svn copy %s %s -m "Creating release branch for %s" >release.log', trunk, branch, version))
- if (result ~= 0) then
- error("Failed to create release branch at "..branch)
- end
+ end
+
+ function path.getname(p)
+ local i = p:findlast("/", true)
+ if (i) then
+ return p:sub(i + 1)
+ else
+ return p
end
+ end
- -------------------------------------------------------------------
- -- Checkout a local copy of the release branch
- -------------------------------------------------------------------
- print("Getting source code from release branch...")
- os.execute(string.format("svn co %s %s >release.log", branch, folder))
- if (not os.fileexists(folder.."/README.txt")) then
- error("Unable to checkout from repository at "..branch)
+
+
+-- Compile scripts to bytecodes
+
+ function dumpfile(out, filename)
+ local func = loadfile(filename)
+ local dump = string.dump(func)
+ local len = string.len(dump)
+ out:write("\t\"")
+ for i=1,len do
+ out:write(string.format("\\%03o", string.byte(dump, i)))
end
+ out:write("\",\n")
+ return len
+ end
- -------------------------------------------------------------------
- -- Embed version numbers into the files
- -------------------------------------------------------------------
- -- (embed version #s)
- -- (check into branch)
-
- -------------------------------------------------------------------
- -- Build the release binary for this platform
- -------------------------------------------------------------------
- print("Building release version...")
- os.chdir(folder)
- os.execute("premake --clean --no-tests --target gnu >../release.log")
-
- if (windows) then
- os.execute("make CONFIG=Release >../release.log")
- os.chdir("bin/release")
- result = os.execute(string.format("7z a -tzip ..\\..\\..\\premake4-win32-%s.zip premake4.exe >../release.log", version))
- elseif (macosx) then
- os.execute('TARGET_ARCH="-arch i386 -arch ppc" make CONFIG=Release >../release.log')
- os.chdir("bin/release")
- result = os.execute(string.format("tar czvf ../../../premake4-macosx-%s.tar.gz premake4 >../release.log", version))
- else
- os.execute("make CONFIG=Release >../release.log")
- os.chdir("bin/release")
- result = os.execute(string.format("tar czvf ../../../premake4-linux-%s.tar.gz premake4 >../release.log", version))
+ function dumptmpl(out, filename)
+ local f = io.open(filename)
+ local tmpl = f:read("*a")
+ f:close()
+
+ local name = path.getbasename(filename)
+ local dump = "_TEMPLATES."..name.."=premake.template.loadstring('"..name.."',[["..tmpl.."]])"
+ local len = string.len(dump)
+ out:write("\t\"")
+ for i=1,len do
+ out:write(string.format("\\%03o", string.byte(dump, i)))
end
+ out:write("\",\n")
+ return len
+ end
+
+ function docompile(cmd, arg)
+ local sizes = { }
+
+ scripts, templates, actions = dofile("src/_manifest.lua")
+
+ local out = io.open("src/host/bytecode.c", "w+b")
+ out:write("/* Precompiled bytecodes for built-in Premake scripts */\n")
+ out:write("/* To regenerate this file, run `premake --compile` (Premake 3.x) */\n\n")
+
+ out:write("const char* builtin_bytecode[] = {\n")
- if (result ~= 0) then
- error("Failed to build binary package; see release.log for details")
+ for i,fn in ipairs(scripts) do
+ print(fn)
+ s = dumpfile(out, "src/"..fn)
+ table.insert(sizes, s)
end
- os.chdir("../../..")
+ for i,fn in ipairs(templates) do
+ print(fn)
+ s = dumptmpl(out, "src/"..fn)
+ table.insert(sizes, s)
+ end
- -------------------------------------------------------------------
- -- Build the source code package
- -------------------------------------------------------------------
- if (macosx) then
- result = os.execute(string.format("zip -r9 premake4-src-%s.zip %s/* >release.log", version, folder))
- if (result ~= 0) then
- error("Failed to build source code package; see release.log for details")
- end
+ for i,fn in ipairs(actions) do
+ print(fn)
+ s = dumpfile(out, "src/"..fn)
+ table.insert(sizes, s)
end
- -------------------------------------------------------------------
- -- Clean up
- -------------------------------------------------------------------
- print("Cleaning up...")
- os.rmdir(folder)
- os.remove("release.log")
-
-
- -------------------------------------------------------------------
- -- Next steps
- -------------------------------------------------------------------
- if (windows) then
- print("DONE - now run release script under Linux")
- elseif (linux) then
- print("DONE - now run release script under Mac OS X")
- else
- print("DONE - really this time")
+ out:write("};\n\n");
+ out:write("int builtin_sizes[] = {\n")
+
+ for i,v in ipairs(sizes) do
+ out:write("\t"..v..",\n")
end
+
+ out:write("\t0\n};\n");
+ out:close()
+ print("Done.")
end
diff --git a/premake4.lua b/premake4.lua
index da62d67..98f5d9c 100644
--- a/premake4.lua
+++ b/premake4.lua
@@ -1,21 +1,139 @@
----------------------------------------------------------------------------
--- Premake4 solution script for Premake4
--- Copyright (c) 2002-2008 Jason Perkins and the Premake project
----------------------------------------------------------------------------
+--
+-- Premake 4.x build configuration script
+--
+
solution "Premake4"
-
- configurations { "Debug", "Release" }
+ configurations { "Release", "Debug" }
project "Premake4"
+ targetname "premake4"
+ language "C"
+ kind "ConsoleExe"
+ flags { "No64BitChecks", "ExtraWarnings", "FatalWarnings" }
+ includedirs { "src/host/lua-5.1.2/src" }
- language "c"
- defines { "_CRT_SECURE_NO_WARNINGS" }
- files { "**.h", "**.c" }
+ files
+ {
+ "src/**.h", "src/**.c", "src/**.lua", "src/**.tmpl",
+ "tests/**.lua"
+ }
+ excludes
+ {
+ "src/premake.lua",
+ "src/host/lua-5.1.2/src/lua.c",
+ "src/host/lua-5.1.2/src/luac.c",
+ "src/host/lua-5.1.2/src/print.c",
+ "src/host/lua-5.1.2/**.lua",
+ "src/host/lua-5.1.2/etc/*.c"
+ }
+
configuration "Debug"
- defines { "_DEBUG" }
+ targetdir "bin/debug"
+ defines "_DEBUG"
+ flags { "Symbols" }
configuration "Release"
- defines { "NDEBUG" }
+ targetdir "bin/release"
+ defines "NDEBUG"
+ flags { "OptimizeSize", "NoFramePointer" }
+
+ configuration "vs.*"
+ defines { "_CRT_SECURE_NO_WARNINGS" }
+
+
+
+
+--
+-- A more thorough cleanup
+--
+
+ function onclean()
+ os.rmdir("bin")
+ os.rmdir("obj") -- get rid of this once "clean" is working properly
+ end
+
+
+
+--
+-- "Compile" action compiles scripts to bytecode and embeds into a static
+-- data buffer in src/host/bytecode.c.
+--
+
+ local function dumpfile(out, fname)
+ local func = loadfile(fname)
+ local dump = string.dump(func)
+ local len = string.len(dump)
+ out:write("\t\"")
+ for i=1,len do
+ out:write(string.format("\\%03o", string.byte(dump, i)))
+ end
+ out:write("\",\n")
+ return len
+ end
+
+ local function dumptmpl(out, fname)
+ local f = io.open(fname)
+ local tmpl = f:read("*a")
+ f:close()
+
+ local name = path.getbasename(fname)
+ local dump = "_TEMPLATES."..name.."=premake.template.loadstring('"..name.."',[["..tmpl.."]])"
+ local len = string.len(dump)
+ out:write("\t\"")
+ for i=1,len do
+ out:write(string.format("\\%03o", string.byte(dump, i)))
+ end
+ out:write("\",\n")
+ return len
+ end
+
+ local function docompile()
+ local sizes = { }
+
+ scripts, templates, actions = dofile("src/_manifest.lua")
+
+ local out = io.open("src/host/bytecode.c", "w+b")
+ out:write("/* Precompiled bytecodes for built-in Premake scripts */\n")
+ out:write("/* To regenerate this file, run `premake --compile` (Premake 3.x) */\n\n")
+
+ out:write("const char* builtin_bytecode[] = {\n")
+
+ for i,fn in ipairs(scripts) do
+ print(fn)
+ s = dumpfile(out, "src/"..fn)
+ table.insert(sizes, s)
+ end
+
+ for i,fn in ipairs(templates) do
+ print(fn)
+ s = dumptmpl(out, "src/"..fn)
+ table.insert(sizes, s)
+ end
+
+ for i,fn in ipairs(actions) do
+ print(fn)
+ s = dumpfile(out, "src/"..fn)
+ table.insert(sizes, s)
+ end
+
+ out:write("};\n\n");
+ out:write("int builtin_sizes[] = {\n")
+
+ for i,v in ipairs(sizes) do
+ out:write("\t"..v..",\n")
+ end
+
+ out:write("\t0\n};\n");
+ out:close()
+
+ print("Done.")
+ end
+
+
+ premake.actions["compile"] = {
+ description = "Compile scripts to bytecode and embed in bytecode.c",
+ execute = docompile,
+ }
diff --git a/src/_manifest.lua b/src/_manifest.lua
new file mode 100644
index 0000000..7aa5683
--- /dev/null
+++ b/src/_manifest.lua
@@ -0,0 +1,50 @@
+--
+-- _manifest.lua
+-- Manage the list of built-in Premake scripts.
+-- Copyright (c) 2002-2008 Jason Perkins and the Premake project
+--
+
+
+-- The master list of built-in scripts. Order is important! If you want to
+-- build a new script into Premake, add it to this list.
+
+ local scripts =
+ {
+ "base/path.lua",
+ "base/string.lua",
+ "base/table.lua",
+ "base/os.lua",
+ "base/globals.lua",
+ "base/premake.lua",
+ "base/template.lua",
+ "base/project.lua",
+ "base/functions.lua",
+ "base/gcc.lua",
+
+ -- this one must be last
+ "_premake_main.lua"
+ }
+
+
+-- The list of templates
+
+ local templates =
+ {
+ "actions/make/make_solution.tmpl",
+ "actions/make/make_cpp_project.tmpl",
+ "actions/vstudio/vs2002_solution.tmpl",
+ }
+
+
+-- The list of built in actions
+
+ local actions =
+ {
+ "actions/clean/_clean.lua",
+ "actions/make/_make.lua",
+ "actions/vstudio/_vstudio.lua",
+ }
+
+
+
+ return scripts, templates, actions \ No newline at end of file
diff --git a/src/_premake_main.lua b/src/_premake_main.lua
new file mode 100644
index 0000000..2a357d2
--- /dev/null
+++ b/src/_premake_main.lua
@@ -0,0 +1,132 @@
+--
+-- _premake_main.lua
+-- Script-side entry point for the main program logic.
+-- Copyright (c) 2002-2008 Jason Perkins and the Premake project
+--
+
+
+ local shorthelp = "Type 'premake4 --help' for help"
+ local versionhelp = "premake4 (Premake Build Script Generator) %s"
+ local scriptfile = "premake4.lua"
+
+
+
+--
+-- Display the help text
+--
+
+ local function showhelp()
+ actions = { }
+ for name,_ in pairs(premake.actions) do table.insert(actions, name) end
+ table.sort(actions)
+
+ printf("Premake %s, a build script generator", _PREMAKE_VERSION)
+ printf(_PREMAKE_COPYRIGHT)
+ printf("%s %s", _VERSION, _COPYRIGHT)
+ printf("")
+ printf("Usage: premake4 [options] action [arguments]")
+ printf("")
+
+ printf("ACTIONS")
+ printf("")
+ for _,name in ipairs(actions) do
+ printf(" %-17s %s", name, premake.actions[name].description)
+ end
+ printf("")
+
+ printf("OPTIONS")
+ printf("")
+ printf(" --file=name Process the specified Premake script file")
+ printf(" --help Display this information")
+ printf(" --scripts=path Search for additional scripts on the given path")
+ printf(" --version Display version information")
+ printf("")
+
+ printf("For additional information, see http://industriousone.com/premake")
+ end
+
+
+--
+-- Script-side program entry point.
+--
+
+ function _premake_main(scriptpath)
+
+ -- if running off the disk (in debug mode), load everything
+ -- listed in _manifest.lua; the list divisions make sure
+ -- everything gets initialized in the proper order.
+
+ if (scriptpath) then
+ -- core code first
+ local s, t, a = dofile(scriptpath .. "/_manifest.lua")
+ for i = 1, #s - 1 do
+ dofile(scriptpath.."/"..s[i])
+ end
+
+ -- then the templates
+ for _,v in ipairs(t) do
+ local n = path.getbasename(v)
+ _TEMPLATES[n] = premake.template.loadfile(scriptpath.."/"..v)
+ end
+
+ -- finally the actions
+ for _,v in ipairs(a) do
+ dofile(scriptpath.."/"..v)
+ end
+ end
+
+
+ -- If there is a project script available, run it to get the
+ -- project information, available options and actions, etc.
+
+ local fname = _OPTIONS["file"] or scriptfile
+ if (os.isfile(fname)) then
+ dofile(fname)
+ end
+
+
+ -- Process special options like /version and /help
+
+ if (_OPTIONS["version"]) then
+ printf(versionhelp, _PREMAKE_VERSION)
+ return 1
+ end
+
+ if (_OPTIONS["help"]) then
+ showhelp()
+ return 1
+ end
+
+
+ -- If no action was specified, show a short help message
+
+ if (not _ACTION) then
+ print(shorthelp)
+ return 1
+ end
+
+
+ -- If there wasn't a project script I've got to bail now
+
+ if (not os.isfile(fname)) then
+ error("No Premake script ("..scriptfile..") found!", 2)
+ end
+
+
+ -- Prep the session, and then hand off control to the action
+ local action = premake.actions[name]
+ if (not premake.actions[_ACTION]) then
+ error("Error: No such action '".._ACTION.."'", 0)
+ end
+
+ ok, err = premake.checktools()
+ if (not ok) then error("Error: " .. err, 0) end
+
+ ok, err = premake.project.checkall()
+ if (not ok) then error("Error: " .. err, 0) end
+
+ premake.doaction(_ACTION)
+ return 0
+
+ end
+ \ No newline at end of file
diff --git a/src/actions/actions.c b/src/actions/actions.c
deleted file mode 100644
index f237ea1..0000000
--- a/src/actions/actions.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * \file actions.c
- * \brief Built-in engine actions.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include <string.h>
-#include "premake.h"
-#include "actions/actions.h"
-
-
-int gmake_action (Session sess);
-int vs2002_action(Session sess);
-int vs2003_action(Session sess);
-int vs2005_action(Session sess);
-int vs2008_action(Session sess);
-
-
-ActionInfo Actions[] =
-{
- { "gmake", "GNU Makefiles for POSIX, MinGW, and Cygwin", gmake_action },
- { "vs2002", "Microsoft Visual Studio 2002", vs2002_action },
- { "vs2003", "Microsoft Visual Studio 2003", vs2003_action },
- { "vs2005", "Microsoft Visual Studio 2005 (includes Express editions)", vs2005_action },
- { "vs2008", "Microsoft Visual Studio 2008 (includes Express editions)", vs2008_action },
- { 0, 0, 0 }
-};
diff --git a/src/actions/actions.h b/src/actions/actions.h
deleted file mode 100644
index 7b041cc..0000000
--- a/src/actions/actions.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * \file actions.h
- * \brief Built-in engine actions.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- *
- * \defgroup action Actions
- *
- * The actions component contains the implementation of all of the built-in
- * Premake actions, along with a few common support functions.
- *
- * @{
- */
-#if !defined(PREMAKE_ACTIONS_H)
-#define PREMAKE_ACTIONS_H
-
-#include "objects/session.h"
-
-
-/**
- * Callback signature for Premake action handlers, which will get triggered
- * if user specifies that action on the command line for processing.
- * \param sess The current execution session context.
- * \returns OKAY If successful.
- */
-typedef int (*ActionCallback)(Session sess);
-
-
-/**
- * Describe a Premake action, including the handler function and the metadata
- * required to list it in the user help.
- */
-typedef struct struct_ActionInfo
-{
- const char* name;
- const char* description;
- ActionCallback callback;
-} ActionInfo;
-
-
-/* the list of built-in Premake actions */
-extern ActionInfo Actions[];
-
-
-
-#endif
-/** @} */
diff --git a/src/actions/clean/_clean.lua b/src/actions/clean/_clean.lua
new file mode 100644
index 0000000..53400af
--- /dev/null
+++ b/src/actions/clean/_clean.lua
@@ -0,0 +1,76 @@
+--
+-- _clean.lua
+-- The "clean" action: removes all generated files.
+-- Copyright (c) 2002-2008 Jason Perkins and the Premake project
+--
+
+
+ clean = { }
+
+--
+-- Remove configuration specific files
+--
+
+ function clean.config(cfg)
+ -- remove the target binary
+ os.remove(cfg.target)
+
+ -- if there is an import library, remove that too
+ os.remove(premake.project.gettargetfile(cfg, "implib", "StaticLib", "linux"))
+ os.remove(premake.project.gettargetfile(cfg, "implib", "StaticLib", "windows"))
+
+ -- remove object directory
+ -- os.rmdir(cfg.objdir)
+ end
+
+
+--
+-- Remove files created by an object's templates.
+--
+
+ function clean.templatefiles(this, templates)
+ if (templates) then
+ for _,tmpl in ipairs(templates) do
+ local fname = premake.getoutputname(this, tmpl[1])
+ os.remove(fname)
+ end
+ end
+ end
+
+
+--
+-- For each registered action, walk all of the objects in the session and
+-- remove the files created by their templates.
+--
+
+ function clean.all()
+ -- remove all template-driven files
+ for _,action in pairs(premake.actions) do
+ for _,sln in ipairs(_SOLUTIONS) do
+ clean.templatefiles(sln, action.solutiontemplates)
+
+ for prj in premake.project.projects(sln) do
+ clean.templatefiles(prj, action.projecttemplates)
+
+ for cfg in premake.project.configs(prj) do
+ clean.config(cfg)
+ end
+ end
+ end
+ end
+
+ -- project custom clean-up
+ if (type(onclean) == "function") then
+ onclean()
+ end
+ end
+
+
+--
+-- Register the "clean" action.
+--
+
+ premake.actions["clean"] = {
+ description = "Remove all binaries and generated files",
+ execute = clean.all,
+ }
diff --git a/src/actions/make/_make.lua b/src/actions/make/_make.lua
new file mode 100644
index 0000000..eea98ac
--- /dev/null
+++ b/src/actions/make/_make.lua
@@ -0,0 +1,93 @@
+--
+-- _make.lua
+-- Define the makefile action(s).
+-- Copyright (c) 2008 Jason Perkins and the Premake project
+--
+
+ make = { }
+
+
+--
+-- Escape a string so it can be written to a makefile.
+--
+
+ function make.esc(value)
+ if (type(value) == "table") then
+ local result = { }
+ for _,v in ipairs(value) do
+ table.insert(result, make.esc(v))
+ end
+ return result
+ else
+ local result = value:gsub(" ", "\\ ")
+ return result
+ end
+ end
+
+
+--
+-- Get the makefile file name for a solution or a project. If this object is the
+-- only one writing to a location then I can use "Makefile". If more than one object
+-- writes to the same location I use name + ".make" to keep it unique.
+--
+
+ function make.getmakefilename(this, searchprjs)
+ -- how many projects/solutions use this location?
+ local count = 0
+ for _,sln in ipairs(_SOLUTIONS) do
+ if (sln.location == this.location) then count = count + 1 end
+ if (searchprjs) then
+ for _,prj in ipairs(sln.projects) do
+ if (prj.location == this.location) then count = count + 1 end
+ end
+ end
+ end
+
+ if (count == 1) then
+ return "Makefile"
+ else
+ return this.name .. ".make"
+ end
+ end
+
+
+--
+-- Returns a list of object names, properly escaped to be included in the makefile.
+--
+
+ function make.getnames(tbl)
+ local result = table.extract(tbl, "name")
+ for k,v in pairs(result) do
+ result[k] = make.esc(v)
+ end
+ return result
+ end
+
+
+--
+-- Register the "gmake" action
+--
+
+ premake.actions["gmake"] = {
+ shortname = "GNU Make",
+ description = "GNU makefiles for POSIX, MinGW, and Cygwin",
+
+ valid_kinds = { "ConsoleExe", "WindowedExe", "StaticLib", "SharedLib" },
+
+ valid_languages = { "C", "C++" },
+
+ valid_tools = {
+ cc = { "gcc" },
+ csc = { "mcs" },
+ },
+
+ solutiontemplates =
+ {
+ { function(this) return make.getmakefilename(this, false) end, _TEMPLATES.make_solution },
+ },
+
+ projecttemplates =
+ {
+ { function(this) return make.getmakefilename(this, true) end, _TEMPLATES.make_cpp_project },
+ },
+ }
diff --git a/src/actions/make/gmake.c b/src/actions/make/gmake.c
deleted file mode 100644
index 073cb5e..0000000
--- a/src/actions/make/gmake.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/**
- * \file gmake.c
- * \brief GNU makefile generation action.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include <stdlib.h>
-#include "premake.h"
-#include "actions/actions.h"
-#include "make.h"
-#include "make_solution.h"
-#include "make_project.h"
-
-
-/** The project features supported by this action */
-static SessionFeatures Features =
-{
- { "c", "c++", NULL },
-};
-
-
-/** The GNU make solution writing process, for session_enumerate_objects() */
-static SessionSolutionCallback SolutionCallbacks[] =
-{
- make_solution_create,
- make_solution_signature,
- make_solution_default_config,
- make_solution_phony_rule,
- make_solution_all_rule,
- make_solution_projects,
- make_solution_clean_rule,
- NULL
-};
-
-/** The GNU make project writing process, for session_enumerate_objects() */
-static SessionProjectCallback ProjectCallbacks[] =
-{
- make_project_create,
- make_project_signature,
- session_enumerate_configurations,
- make_project_objects,
- make_project_resources,
- gmake_project_shell_detect,
- make_project_phony_rule,
- make_project_target,
- make_project_mkdir_rules,
- make_project_clean_rules,
- make_project_source_rules,
- make_project_include_dependencies,
- NULL
-};
-
-
-/** The GNU make configuration writing process, for session_enumerate_configurations() */
-static SessionProjectCallback ConfigCallbacks[] =
-{
- make_project_config_conditional,
- make_project_config_outdir,
- make_project_config_outfile,
- make_project_config_objdir,
- make_project_config_cppflags,
- make_project_config_cflags,
- make_project_config_cxxflags,
- make_project_config_ldflags,
- make_project_config_lddeps,
- make_project_config_resflags,
- make_project_config_end,
- NULL
-};
-
-
-/**
- * The GNU make action handler.
- * \param sess The active session object.
- * \returns OKAY if successful.
- */
-int gmake_action(Session sess)
-{
- /* make sure I can support all of the features used in the session */
- if (session_validate(sess, &Features) != OKAY)
- {
- return !OKAY;
- }
-
- stream_writeline(Console, "Generating project files for GNU make...");
- return session_enumerate_objects(sess, SolutionCallbacks, ProjectCallbacks, ConfigCallbacks);
-}
-
diff --git a/src/actions/make/gmake_project.c b/src/actions/make/gmake_project.c
deleted file mode 100644
index 970f04b..0000000
--- a/src/actions/make/gmake_project.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * \file gmake_project.c
- * \brief GNU makefile project generation functions.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "make_project.h"
-
-
-/**
- * Write the shell detection block, which is used while building on Windows in
- * order to detect the enclosing shell type: MS-DOS, Cygwin, or MinGW. The shell
- * determines how directories and files should be created and removed.
- *
- * While the detection in important only on Windows, I write for all platforms.
- * This simplifies the code generation, and makes portable makefiles possible
- * (even though most will have platform-specific bits in them).
- */
-int gmake_project_shell_detect(Project prj, Stream strm)
-{
- int z = OKAY;
- UNUSED(prj);
- z |= stream_writeline(strm, "SHELLTYPE := msdos");
- z |= stream_writeline(strm, "ifeq (,$(ComSpec)$(COMSPEC))");
- z |= stream_writeline(strm, " SHELLTYPE := posix");
- z |= stream_writeline(strm, "endif");
- z |= stream_writeline(strm, "ifeq (/bin,$(findstring /bin,$(SHELL)))");
- z |= stream_writeline(strm, " SHELLTYPE := posix");
- z |= stream_writeline(strm, "endif");
- z |= stream_writeline(strm, "");
- z |= stream_writeline(strm, "ifeq (posix,$(SHELLTYPE))");
- z |= stream_writeline(strm, " MKDIR := mkdir -p");
- z |= stream_writeline(strm, " PATHSEP := /");
- z |= stream_writeline(strm, "else");
- z |= stream_writeline(strm, " MKDIR := mkdir");
- z |= stream_writeline(strm, " PATHSEP := \\\\");
- z |= stream_writeline(strm, "endif");
- z |= stream_writeline(strm, "");
- z |= stream_writeline(strm, "SYS_OUTDIR := $(subst /,$(PATHSEP),$(OUTDIR))");
- z |= stream_writeline(strm, "SYS_OUTFILE := $(subst /,$(PATHSEP),$(OUTFILE))");
- z |= stream_writeline(strm, "SYS_OBJDIR := $(subst /,$(PATHSEP),$(OBJDIR))");
- z |= stream_writeline(strm, "");
- return z;
-}
-
diff --git a/src/actions/make/make.c b/src/actions/make/make.c
deleted file mode 100644
index b55b90e..0000000
--- a/src/actions/make/make.c
+++ /dev/null
@@ -1,187 +0,0 @@
-/**
- * \file make.c
- * \brief Support functions for the makefile action.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include <assert.h>
-#include <stdlib.h>
-#include "premake.h"
-#include "make.h"
-#include "base/buffers.h"
-#include "base/cstr.h"
-#include "base/error.h"
-#include "base/path.h"
-
-
-/**
- * Escapes spaces in a string value, so it can be safely written to the makefile.
- * \param value The string value to escape.
- * \returns The same string value, with spaces escaped.
- */
-const char* make_escape(const char* value)
-{
- char* buffer = buffers_next();
-
- const char* src = value;
- char* dst = buffer;
- while (*src != '\0')
- {
- if (*src == ' ')
- {
- *(dst++) = '\\';
- }
- *(dst++) = *(src++);
- }
-
- *dst = '\0';
- return buffer;
-}
-
-
-/**
- * Given a source file filename, returns the name of the corresponding .o file.
- * \param filename The source code filename.
- * \returns The filename of the .o file.
- */
-const char* make_get_obj_filename(const char* filename)
-{
- const char* basename = path_basename(filename);
- const char* obj_name = cstr_format("$(OBJDIR)/%s.o", basename);
- return obj_name;
-}
-
-
-/**
- * Get the name of the project makefile for a particular project.
- * If this project is the only object which will generate output to
- * its target location, then this function will return "Makefile" as
- * the filename. If any other object shares this output location, it
- * will return "ProjectName.make" instead, so that both objects may
- * coexist in the same directory.
- */
-const char* make_get_project_makefile(Project prj)
-{
- const char* my_path;
- int si, sn, in_conflict = 0;
-
- Session sess = project_get_session(prj);
-
- /* get the default filename for this project */
- my_path = project_get_filename(prj, "Makefile", "");
-
- /* see if any other solution wants to use this same path */
- sn = session_num_solutions(sess);
- for (si = 0; si < sn && !in_conflict; ++si)
- {
- const char* their_path;
- int pi, pn;
-
- Solution sln = session_get_solution(sess, si);
- their_path = solution_get_filename(sln, "Makefile", "");
- if (cstr_eq(my_path, their_path))
- {
- in_conflict = 1;
- }
-
- /* check any projects contained by this solution */
- pn = solution_num_projects(sln);
- for (pi = 0; pi < pn && !in_conflict; ++pi)
- {
- Project prj2 = solution_get_project(sln, pi);
- if (prj != prj2)
- {
- their_path = project_get_filename(prj2, "Makefile", "");
- if (cstr_eq(my_path, their_path))
- {
- in_conflict = 1;
- }
- }
- }
- }
-
- /* if a conflict was detected use an alternate name */
- if (in_conflict)
- {
- my_path = project_get_filename(prj, NULL, ".make");
- }
-
- /* all good */
- return my_path;
-}
-
-
-/**
- * Build a list of project names contained by the solution.
- * \param sln The solution to query.
- * \returns A list of project names. The caller owns this list and must destroy it when done.
- */
-Strings make_get_project_names(Solution sln)
-{
- Strings result;
- int i, n;
-
- result = strings_create();
- n = solution_num_projects(sln);
- for (i = 0; i < n; ++i)
- {
- Project prj = solution_get_project(sln, i);
- const char* name = project_get_name(prj);
- strings_add(result, name);
- }
-
- return result;
-}
-
-
-/**
- * Get the name of the solution makefile for a particular solution.
- * If this solution is the only object which will generate output to
- * its target location, then this function will return "Makefile" as
- * the filename. If any other solution shares this output location, it
- * will return "SolutionName.make" instead, so that both objects may
- * coexist in the same directory.
- */
-const char* make_get_solution_makefile(Solution sln)
-{
- const char* my_path;
- int i, n;
-
- Session sess = solution_get_session(sln);
-
- /* get the default file name for this solution */
- my_path = solution_get_filename(sln, "Makefile", "");
-
- /* see if any other solution wants to use this same path */
- n = session_num_solutions(sess);
- for (i = 0; i < n; ++i)
- {
- Solution them = session_get_solution(sess, i);
- if (them != sln)
- {
- const char* their_path = solution_get_filename(them, "Makefile", "");
- if (cstr_eq(my_path, their_path))
- {
- /* conflict; use the alternate name */
- my_path = solution_get_filename(sln, NULL, ".make");
- return my_path;
- }
- }
- }
-
- /* all good */
- return my_path;
-}
-
-
-/**
- * Write a string value to a stream, escape any space characters it contains.
- * \param strm The output stream.
- * \param value The string value to escape.
- * \returns OKAY if successful.
- */
-int make_write_escaped(Stream strm, const char* value)
-{
- const char* escaped = make_escape(value);
- return stream_write(strm, escaped);
-}
diff --git a/src/actions/make/make.h b/src/actions/make/make.h
deleted file mode 100644
index d69a2e1..0000000
--- a/src/actions/make/make.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/**
- * \file make.h
- * \brief Support functions for the makefile action.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-#if !defined(PREMAKE_MAKE_H)
-#define PREMAKE_MAKE_H
-
-#include "objects/project.h"
-
-const char* make_escape(const char* value);
-const char* make_get_obj_filename(const char* filename);
-const char* make_get_project_makefile(Project prj);
-Strings make_get_project_names(Solution sln);
-const char* make_get_solution_makefile(Solution sln);
-int make_write_escaped(Stream strm, const char* value);
-
-#endif
diff --git a/src/actions/make/make_cpp_project.tmpl b/src/actions/make/make_cpp_project.tmpl
new file mode 100644
index 0000000..baf7211
--- /dev/null
+++ b/src/actions/make/make_cpp_project.tmpl
@@ -0,0 +1,99 @@
+# <%= premake.actions[_ACTION].shortname %> project makefile autogenerated by Premake
+
+ifndef CONFIG
+ CONFIG=<%= make.esc(this.configurations[1]) %>
+endif
+
+<% for cfg in premake.project.configs(this) do %>
+ifeq ($(CONFIG),<%= make.esc(cfg.name)%>)
+ TARGETDIR = <%= make.esc(path.getdirectory(cfg.target)) %>
+ TARGET = $(TARGETDIR)/<%= make.esc(path.getname(cfg.target)) %>
+ OBJDIR = <%= make.esc(premake.project.getobjdir(cfg)) %>
+ DEFINES += <%= premake.tools[_OPTIONS.cc].make_defines(cfg) %>
+ INCLUDES += <%= premake.tools[_OPTIONS.cc].make_includes(cfg) %>
+ CPPFLAGS += <%= premake.tools[_OPTIONS.cc].make_cppflags(cfg) %> $(DEFINES) $(INCLUDES)
+ CFLAGS += $(CPPFLAGS) $(ARCH) <%= premake.tools[_OPTIONS.cc].make_cflags(cfg) %> <%= table.concat(cfg.buildoptions, " ") %>
+ CXXFLAGS += $(CFLAGS) <%= premake.tools[_OPTIONS.cc].make_cxxflags(cfg) %>
+ LDFLAGS += <%= premake.tools[_OPTIONS.cc].make_ldflags(cfg) %> <%= table.concat(cfg.linkoptions, " ") %>
+ RESFLAGS += $(DEFINES) $(INCLUDES) <%= table.concat(cfg.resoptions, " ") %>
+ LDDEPS += <%= table.concat(premake.project.getlibraries(cfg, premake.project.getdependencies(cfg))) %>
+endif
+
+<% end %>
+
+OBJECTS := \
+<% for _, file in ipairs(this.files) do %>
+<% if path.iscppfile(file) then %>
+ $(OBJDIR)/<%= make.esc(path.getbasename(file)) %>.o \
+<% end %>
+<% end %>
+
+RESOURCES := \
+<% for _, file in ipairs(this.files) do %>
+<% if path.isresourcefile(file) then %>
+ $(OBJDIR)/<%= make.esc(path.getbasename(file)) %>.res \
+<% end %>
+<% end %>
+
+SHELLTYPE := msdos
+ifeq (,$(ComSpec)$(COMSPEC))
+ SHELLTYPE := posix
+endif
+ifeq (/bin,$(findstring /bin,$(SHELL)))
+ SHELLTYPE := posix
+endif
+
+ifeq (posix,$(SHELLTYPE))
+ MKDIR := mkdir -p
+ PATHSEP := /
+else
+ MKDIR := mkdir
+ PATHSEP := \\
+endif
+
+SYS_TARGET := $(subst /,$(PATHSEP),$(TARGET))
+SYS_TARGETDIR := $(subst /,$(PATHSEP),$(TARGETDIR))
+SYS_OBJDIR := $(subst /,$(PATHSEP),$(OBJDIR))
+
+.PHONY: clean
+
+<% if os.is("MacOSX") and this.kind == "WindowedExe" then %>
+all: $(TARGET) $(dir $(TARGETDIR))PkgInfo $(dir $(TARGETDIR))Info.plist
+
+$(dir $(TARGETDIR))PkgInfo:
+
+$(dir $(TARGETDIR))Info.plist:
+<% end %>
+
+$(TARGET): $(TARGETDIR) $(OBJDIR) $(OBJECTS) $(LDDEPS) $(RESOURCES)
+ @echo Linking <%= this.name %>
+ @$(CXX) -o $@ $(LDFLAGS) $(ARCH) $(OBJECTS) $(RESOURCES)
+
+$(TARGETDIR):
+ @echo Creating $@
+ @$(MKDIR) $(SYS_TARGETDIR)
+
+$(OBJDIR):
+ @echo Creating $@
+ @$(MKDIR) $(SYS_OBJDIR)
+
+clean:
+ @echo Cleaning <%= this.name %>
+ifeq (posix,$(SHELLTYPE))
+ @rm -f $(TARGET)
+ @rm -rf $(OBJDIR)
+else
+ @if exist $(SYS_TARGET) del $(SYS_TARGET)
+ @if exist $(SYS_OBJDIR) rmdir /s /q $(SYS_OBJDIR)
+endif
+
+<% for _, file in ipairs(this.files) do %>
+<% if path.iscppfile(file) then %>
+$(OBJDIR)/<%= make.esc(path.getbasename(file)) %>.o: <%= make.esc(file) %>
+ @echo $(notdir $<)
+ @<%= premake.tools[_OPTIONS.cc].make_file_rule(file) %>
+
+<% end %>
+<% end %>
+
+-include $(OBJECTS:%.o=%.d)
diff --git a/src/actions/make/make_project.c b/src/actions/make/make_project.c
deleted file mode 100644
index 5188ca4..0000000
--- a/src/actions/make/make_project.c
+++ /dev/null
@@ -1,329 +0,0 @@
-/**
- * \file make_project.c
- * \brief Makefile project generation functions.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include <assert.h>
-#include <stdlib.h>
-#include "premake.h"
-#include "actions/make/make.h"
-#include "actions/make/make_project.h"
-#include "base/error.h"
-#include "base/path.h"
-
-
-/**
- * Write the rules to clean up output files on a `make clean`.
- */
-int make_project_clean_rules(Project prj, Stream strm)
-{
- int z = OKAY;
- z |= stream_writeline(strm, "clean:");
- z |= stream_writeline(strm, "\t@echo Cleaning %s", project_get_name(prj));
- z |= stream_writeline(strm, "ifeq (posix, $(SHELLTYPE))");
- z |= stream_writeline(strm, "\t@rm -f $(SYS_OUTFILE)");
- z |= stream_writeline(strm, "\t@rm -rf $(SYS_OBJDIR)");
- z |= stream_writeline(strm, "else");
- z |= stream_writeline(strm, "\t@if exist $(SYS_OUTFILE) del $(SYS_OUTFILE)");
- z |= stream_writeline(strm, "\t@if exist $(SYS_OBJDIR) rmdir /s /q $(SYS_OBJDIR)");
- z |= stream_writeline(strm, "endif");
- z |= stream_writeline(strm, "");
- return OKAY;
-}
-
-
-/**
- * Write the opening conditional for a configuration block.
- */
-int make_project_config_conditional(Project prj, Stream strm)
-{
- const char* cfg_name = project_get_config(prj);
- return stream_writeline(strm, "ifeq ($(CONFIG),%s)", cfg_name);
-}
-
-
-/**
- * Write the CFLAGS configuration variable.
- */
-int make_project_config_cflags(Project prj, Stream strm)
-{
- int z = OKAY;
-
- z |= stream_write(strm, " CFLAGS += $(CPPFLAGS) $(ARCHFLAGS)");
-
- /* debugging symbols */
- if (project_has_flag(prj, "Symbols"))
- {
- z |= stream_write(strm, " -g");
- }
-
- /* optimizations */
- if (project_has_flag(prj, "Optimize"))
- {
- z |= stream_write(strm, " -O2");
- }
- else if (project_has_flag(prj, "OptimizeSize"))
- {
- z |= stream_write(strm, " -Os");
- }
- else if (project_has_flag(prj, "OptimizeSpeed"))
- {
- z |= stream_write(strm, " -O3");
- }
-
- z |= stream_writeline(strm, "");
- return z;
-}
-
-
-/**
- * Write the CPPFLAGS configuration variable.
- */
-int make_project_config_cppflags(Project prj, Stream strm)
-{
- int z = OKAY;
- Strings values = project_get_config_values(prj, BlockDefines);
- z |= stream_write(strm, " CPPFLAGS += -MMD");
- z |= stream_write_strings(strm, values, "", " -D \"", "\"", "", "", NULL);
- z |= stream_writeline(strm, "");
- return z;
-}
-
-
-/**
- * Write the CXXFLAGS configuration variable.
- */
-int make_project_config_cxxflags(Project prj, Stream strm)
-{
- UNUSED(prj);
- return stream_writeline(strm, " CXXFLAGS += $(CFLAGS)");
-}
-
-
-/**
- * Write the opening conditional for a configuration block.
- */
-int make_project_config_end(Project prj, Stream strm)
-{
- int z = OKAY;
- UNUSED(prj);
- z |= stream_writeline(strm, "endif");
- z |= stream_writeline(strm, "");
- return z;
-}
-
-
-/**
- * Write the LDDEPS configuration variable.
- */
-int make_project_config_lddeps(Project prj, Stream strm)
-{
- UNUSED(prj);
- return stream_writeline(strm, " LDDEPS :=");
-}
-
-
-/**
- * Write the LDFLAGS configuration variable.
- */
-int make_project_config_ldflags(Project prj, Stream strm)
-{
- UNUSED(prj);
- return stream_writeline(strm, " LDFLAGS +=");
-}
-
-
-/**
- * Write the OBJDIR configuration variable.
- */
-int make_project_config_objdir(Project prj, Stream strm)
-{
- const char* cfg_name = project_get_config(prj);
- return stream_writeline(strm, " OBJDIR := obj/%s", make_escape(cfg_name));
-}
-
-
-/**
- * Write the OUTDIR configuration variable.
- */
-int make_project_config_outdir(Project prj, Stream strm)
-{
- UNUSED(prj);
- return stream_writeline(strm, " OUTDIR := .");
-}
-
-
-/**
- * Write the OUTFILE configuration variable.
- */
-int make_project_config_outfile(Project prj, Stream strm)
-{
- const char* outfile = project_get_outfile(prj);
- return stream_writeline(strm, " OUTFILE := $(OUTDIR)/%s", make_escape(outfile));
-}
-
-
-/**
- * Write the RESFLAGS configuration variable.
- */
-int make_project_config_resflags(Project prj, Stream strm)
-{
- UNUSED(prj);
- return stream_writeline(strm, " RESFLAGS +=");
-}
-
-
-/**
- * Create a new output stream for a project , and make it active for subsequent writes.
- */
-int make_project_create(Project prj, Stream strm)
-{
- /* create the makefile */
- const char* filename = make_get_project_makefile(prj);
- strm = stream_create_file(filename);
- if (!strm)
- {
- return !OKAY;
- }
-
- /* make the stream active for the functions that come after */
- session_set_active_stream(project_get_session(prj), strm);
- return OKAY;
-}
-
-
-/**
- * Include the auto-generated dependencies into the project makefile.
- */
-int make_project_include_dependencies(Project prj, Stream strm)
-{
- UNUSED(prj);
- return stream_writeline(strm, "-include $(OBJECTS:%%.o=%%.d)");
-}
-
-
-/**
- * Write the rules to create the output and object directories.
- */
-int make_project_mkdir_rules(Project prj, Stream strm)
-{
- int z = OKAY;
- UNUSED(prj);
- z |= stream_writeline(strm, "$(OUTDIR):");
- z |= stream_writeline(strm, "\t@echo Creating $(OUTDIR)");
- z |= stream_writeline(strm, "\t@$(MKDIR) $(SYS_OUTDIR)");
- z |= stream_writeline(strm, "");
- z |= stream_writeline(strm, "$(OBJDIR):");
- z |= stream_writeline(strm, "\t@echo Creating $(OBJDIR)");
- z |= stream_writeline(strm, "\t@$(MKDIR) $(SYS_OBJDIR)");
- z |= stream_writeline(strm, "");
- return z;
-}
-
-
-/**
- * Write the OBJECTS project variable.
- */
-int make_project_objects(Project prj, Stream strm)
-{
- Strings files;
- int i, n, z;
-
- z = stream_writeline(strm, "OBJECTS := \\");
-
- files = project_get_files(prj);
- n = strings_size(files);
- for (i = 0; i < n; ++i)
- {
- const char* filename = strings_item(files, i);
- if (path_is_cpp_source(filename))
- {
- const char* obj_name = make_get_obj_filename(filename);
- z |= stream_writeline(strm, "\t%s \\", make_escape(obj_name));
- }
- }
-
- z |= stream_writeline(strm, "");
- return z;
-}
-
-
-/**
- * Write the .PHONY rule for a project.
- */
-int make_project_phony_rule(Project prj, Stream strm)
-{
- int z = OKAY;
- UNUSED(prj);
- z |= stream_writeline(strm, ".PHONY: clean");
- z |= stream_writeline(strm, "");
- return z;
-}
-
-
-/**
- * Write the RESOURCES project variable.
- */
-int make_project_resources(Project prj, Stream strm)
-{
- int z = OKAY;
- UNUSED(prj);
- z |= stream_writeline(strm, "RESOURCES := \\");
- z |= stream_writeline(strm, "");
- return z;
-}
-
-
-/**
- * Write the project makefile signature.
- */
-int make_project_signature(Project prj, Stream strm)
-{
- int z = OKAY;
- UNUSED(prj);
- z |= stream_writeline(strm, "# GNU Makefile autogenerated by Premake");
- z |= stream_writeline(strm, "");
- return z;
-}
-
-
-/**
- * Write makefile rules for each source code file.
- */
-int make_project_source_rules(Project prj, Stream strm)
-{
- Strings files;
- int i, n, z = OKAY;
-
- files = project_get_files(prj);
- n = strings_size(files);
- for (i = 0; i < n; ++i)
- {
- const char* filename = make_escape(strings_item(files, i));
- if (path_is_cpp_source(filename))
- {
- const char* obj_name = make_get_obj_filename(filename);
- z |= stream_writeline(strm, "%s: %s", obj_name, filename);
- z |= stream_writeline(strm, "\t@echo $(notdir $<)");
- z |= stream_writeline(strm, "\t@$(CXX) $(CXXFLAGS) -o $@ -c $<");
- z |= stream_writeline(strm, "");
- }
- }
-
- return z;
-}
-
-
-/**
- * Write the project output target rule.
- */
-int make_project_target(Project prj, Stream strm)
-{
- int z = OKAY;
- z |= stream_writeline(strm, "$(OUTFILE): $(OUTDIR) $(OBJDIR) $(OBJECTS) $(LDDEPS) $(RESOURCES)");
- z |= stream_writeline(strm, "\t@echo Linking %s", project_get_name(prj));
- z |= stream_writeline(strm, "\t@$(CXX) -o $@ $(LDFLAGS) $(ARCHFLAGS) $(OBJECTS) $(RESOURCES)");
- z |= stream_writeline(strm, "");
- return z;
-}
diff --git a/src/actions/make/make_project.h b/src/actions/make/make_project.h
deleted file mode 100644
index df37ac6..0000000
--- a/src/actions/make/make_project.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * \file make_project.h
- * \brief Makefile project generation functions.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-#if !defined(PREMAKE_MAKE_PROJECT_H)
-#define PREMAKE_MAKE_PROJECT_H
-
-#include "objects/session.h"
-
-int gmake_project_shell_detect(Project prj, Stream strm);
-
-int make_project_clean_rules(Project prj, Stream strm);
-int make_project_config_conditional(Project prj, Stream strm);
-int make_project_config_cflags(Project prj, Stream strm);
-int make_project_config_cppflags(Project prj, Stream strm);
-int make_project_config_cxxflags(Project prj, Stream strm);
-int make_project_config_end(Project prj, Stream strm);
-int make_project_config_lddeps(Project prj, Stream strm);
-int make_project_config_ldflags(Project prj, Stream strm);
-int make_project_config_objdir(Project prj, Stream strm);
-int make_project_config_outdir(Project prj, Stream strm);
-int make_project_config_outfile(Project prj, Stream strm);
-int make_project_config_resflags(Project prj, Stream strm);
-int make_project_create(Project prj, Stream strm);
-int make_project_include_dependencies(Project prj, Stream strm);
-int make_project_mkdir_rules(Project prj, Stream strm);
-int make_project_objects(Project prj, Stream strm);
-int make_project_phony_rule(Project prj, Stream strm);
-int make_project_resources(Project prj, Stream strm);
-int make_project_signature(Project prj, Stream strm);
-int make_project_source_rules(Project prj, Stream strm);
-int make_project_target(Project prj, Stream strm);
-
-#endif
diff --git a/src/actions/make/make_solution.c b/src/actions/make/make_solution.c
deleted file mode 100644
index 1f8d056..0000000
--- a/src/actions/make/make_solution.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/**
- * \file make_solution.c
- * \brief Makefile solution generation functions.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-#include "premake.h"
-#include "actions/make/make.h"
-#include "actions/make/make_solution.h"
-#include "base/buffers.h"
-#include "base/cstr.h"
-#include "base/env.h"
-#include "base/error.h"
-#include "base/path.h"
-
-
-static const char* make_solution_project_rule(Solution sln, Project prj);
-
-
-/**
- * Write the GNU solution makefile clean rules.
- */
-int make_solution_clean_rule(Solution sln, Stream strm)
-{
- int i, n, z;
- z = stream_writeline(strm, "clean:");
- n = solution_num_projects(sln);
- for (i = 0; i < n; ++i)
- {
- Project prj = solution_get_project(sln, i);
- const char* rule = make_solution_project_rule(sln, prj);
- z |= stream_writeline(strm, "%s clean", rule);
- }
-
- return z;
-}
-
-
-/**
- * Write the makefile "all" rule.
- */
-int make_solution_all_rule(Solution sln, Stream strm)
-{
- int z;
- Strings prj_names = make_get_project_names(sln);
- z = stream_writeline_strings(strm, prj_names, "all:", " ", "", "", "", make_write_escaped);
- z |= stream_writeline(strm, "");
- strings_destroy(prj_names);
- return z;
-}
-
-
-/**
- * Create a new output stream for a solution, and make it active for subsequent writes.
- */
-int make_solution_create(Solution sln, Stream strm)
-{
- /* create the makefile */
- const char* filename = make_get_solution_makefile(sln);
- strm = stream_create_file(filename);
- if (!strm)
- {
- return !OKAY;
- }
-
- /* make the stream active for the functions that come after */
- session_set_active_stream(solution_get_session(sln), strm);
- return OKAY;
-}
-
-
-/**
- * Write makefile rules to set a default build configuration.
- */
-int make_solution_default_config(Solution sln, Stream strm)
-{
- int z = OKAY;
- const char* default_config_name = solution_get_config(sln, 0);
- z |= stream_writeline(strm, "ifndef CONFIG");
- z |= stream_writeline(strm, " CONFIG=%s", default_config_name);
- z |= stream_writeline(strm, "endif");
- z |= stream_writeline(strm, "export CONFIG");
- z |= stream_writeline(strm, "");
- return z;
-}
-
-
-/**
- * Write the makefile .PHONY rule.
- */
-int make_solution_phony_rule(Solution sln, Stream strm)
-{
- int z = OKAY;
- Strings prj_names = make_get_project_names(sln);
- z |= stream_writeline_strings(strm, prj_names, ".PHONY: all clean", " ", "", "", "", make_write_escaped);
- z |= stream_writeline(strm, "");
- strings_destroy(prj_names);
- return z;
-}
-
-
-
-/**
- * Build the makefile rule to call an individual project.
- */
-const char* make_solution_project_rule(Solution sln, Project prj)
-{
- char* buffer = buffers_next();
-
- /* project file paths are specified relative to the solution */
- const char* sln_file_dir = solution_get_location(sln);
-
- const char* prj_file = make_get_project_makefile(prj);
- const char* prj_file_dir = path_directory(prj_file);
- const char* prj_file_name = path_filename(prj_file);
-
- prj_file_dir = path_relative(sln_file_dir, prj_file_dir);
-
- /* build the rule */
- strcpy(buffer, "\t@$(MAKE)");
- if (!cstr_eq(".", prj_file_dir))
- {
- strcat(buffer, " --no-print-directory -C ");
- strcat(buffer, make_escape(prj_file_dir));
- }
- if (!cstr_eq("Makefile", prj_file_name))
- {
- strcat(buffer, " -f ");
- strcat(buffer, make_escape(prj_file_name));
- }
-
- return buffer;
-}
-
-
-/**
- * Write the solution makefile project entries.
- */
-int make_solution_projects(Solution sln, Stream strm)
-{
- int i, n, z = OKAY;
- n = solution_num_projects(sln);
- for (i = 0; i < n; ++i)
- {
- Project prj = solution_get_project(sln, i);
- const char* prj_name = project_get_name(prj);
- const char* rule = make_solution_project_rule(sln, prj);
-
- z |= stream_writeline(strm, "%s:", make_escape(prj_name));
- z |= stream_writeline(strm, "\t@echo ==== Building %s ====", prj_name);
- z |= stream_writeline(strm, rule);
- z |= stream_writeline(strm, "");
- }
-
- return z;
-}
-
-
-/**
- * Write the makefile solution file signature block.
- */
-int make_solution_signature(Solution sln, Stream strm)
-{
- const char* file_type;
- Strings config_names;
- int z;
-
- if (cstr_eq(env_get_action(), "gmake"))
- {
- file_type = "GNU Make";
- }
- else
- {
- file_type = "(unknown)";
- assert(0);
- }
-
- z = stream_writeline(strm, "# %s makefile autogenerated by Premake", file_type);
- z |= stream_writeline(strm, "# Usage: make [ CONFIG=config_name ]");
- z |= stream_writeline(strm, "# Where {config_name} is one of:");
-
- config_names = solution_get_configs(sln);
- z |= stream_writeline_strings(strm, config_names, "# ", " ", "", ",", "", NULL);
- z |= stream_writeline(strm, "");
-
- return z;
-}
diff --git a/src/actions/make/make_solution.h b/src/actions/make/make_solution.h
deleted file mode 100644
index f7f1311..0000000
--- a/src/actions/make/make_solution.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * \file make_solution.h
- * \brief Makefile solution generation functions.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-#if !defined(PREMAKE_MAKE_SOLUTION_H)
-#define PREMAKE_MAKE_SOLUTION_H
-
-#include "objects/session.h"
-
-int make_solution_clean_rule(Solution sln, Stream strm);
-int make_solution_all_rule(Solution sln, Stream strm);
-int make_solution_create(Solution sln, Stream strm);
-int make_solution_default_config(Solution sln, Stream strm);
-int make_solution_phony_rule(Solution sln, Stream strm);
-int make_solution_projects(Solution sln, Stream strm);
-int make_solution_signature(Solution sln, Stream strm);
-
-#endif
diff --git a/src/actions/make/make_solution.tmpl b/src/actions/make/make_solution.tmpl
new file mode 100644
index 0000000..9661ce9
--- /dev/null
+++ b/src/actions/make/make_solution.tmpl
@@ -0,0 +1,32 @@
+# <%= premake.actions[_ACTION].shortname %> solution makefile autogenerated by Premake
+# Usage: make [ CONFIG=config_name ]
+# Where {config_name} is one of: <%= table.implode(this.configurations, '"', '"', ', ') %>.
+
+ifndef CONFIG
+ CONFIG=<%= make.esc(this.configurations[1]) %>
+endif
+export CONFIG
+
+PROJECTS := <%= table.concat(make.esc(table.extract(this.projects, "name")), " ") %>
+
+.PHONY: all clean $(PROJECTS)
+
+all: $(PROJECTS)
+
+<% for _,prj in ipairs(this.projects) do %>
+<% for cfg in premake.project.configs(prj) do %>
+ifeq ($(CONFIG),<%= make.esc(cfg.name)%>)
+ DEPENDENCIES := <%= table.concat(make.esc(premake.project.getdependencies(cfg)), " ") %>
+endif
+<% end %>
+
+<%= make.esc(prj.name) %>: ${DEPENDENCIES}
+ @echo ==== Building <%= prj.name %> ====
+ @${MAKE} --no-print-directory -C <%=make.esc(path.getrelative(this.location, prj.location))%> -f <%=make.esc(make.getmakefilename(prj, true))%>
+
+<% end %>
+
+clean:
+<% for _,prj in ipairs(this.projects) do %>
+ @${MAKE} --no-print-directory -C <%=make.esc(path.getrelative(this.location, prj.location))%> -f <%=make.esc(make.getmakefilename(prj, true))%> clean
+<% end %>
diff --git a/src/actions/make/tests/make_config_tests.cpp b/src/actions/make/tests/make_config_tests.cpp
deleted file mode 100644
index 9afe671..0000000
--- a/src/actions/make/tests/make_config_tests.cpp
+++ /dev/null
@@ -1,182 +0,0 @@
-/**
- * \file make_config_tests.cpp
- * \brief Automated tests for makefile configuration block processing.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "actions/tests/action_tests.h"
-extern "C" {
-#include "actions/make/make_project.h"
-#include "base/env.h"
-}
-
-SUITE(action)
-{
- /**********************************************************************
- * CPPFLAGS tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, MakeCppFlags_Defaults)
- {
- make_project_config_cppflags(prj, strm);
- CHECK_EQUAL(
- " CPPFLAGS += -MMD\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, MakeCppFlags_WithDefines)
- {
- const char* defines[] = { "DEFINE0", "DEFINE1", NULL};
- SetConfigField(prj, BlockDefines, defines);
- make_project_config_cppflags(prj, strm);
- CHECK_EQUAL(
- " CPPFLAGS += -MMD -D \"DEFINE0\" -D \"DEFINE1\"\n",
- buffer);
- }
-
-
- /**********************************************************************
- * CFLAGS tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, MakeProject_Config_CFlags)
- {
- make_project_config_cflags(prj, strm);
- CHECK_EQUAL(
- " CFLAGS += $(CPPFLAGS) $(ARCHFLAGS)\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, MakeProject_Config_WithSymbols)
- {
- const char* flags[] = { "Symbols", NULL };
- SetConfigField(prj, BlockFlags, flags);
- make_project_config_cflags(prj, strm);
- CHECK_EQUAL(
- " CFLAGS += $(CPPFLAGS) $(ARCHFLAGS) -g\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, MakeProject_Config_WithOptimize)
- {
- const char* flags[] = { "Optimize", NULL };
- SetConfigField(prj, BlockFlags, flags);
- make_project_config_cflags(prj, strm);
- CHECK_EQUAL(
- " CFLAGS += $(CPPFLAGS) $(ARCHFLAGS) -O2\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, MakeProject_Config_WithOptimizeSize)
- {
- const char* flags[] = { "OptimizeSize", NULL };
- SetConfigField(prj, BlockFlags, flags);
- make_project_config_cflags(prj, strm);
- CHECK_EQUAL(
- " CFLAGS += $(CPPFLAGS) $(ARCHFLAGS) -Os\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, MakeProject_Config_WithOptimizeSpeed)
- {
- const char* flags[] = { "OptimizeSpeed", NULL };
- SetConfigField(prj, BlockFlags, flags);
- make_project_config_cflags(prj, strm);
- CHECK_EQUAL(
- " CFLAGS += $(CPPFLAGS) $(ARCHFLAGS) -O3\n",
- buffer);
- }
-
-
- /**********************************************************************
- * CXXFLAGS tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, MakeProject_Config_CxxFlags)
- {
- make_project_config_cxxflags(prj, strm);
- CHECK_EQUAL(
- " CXXFLAGS += $(CFLAGS)\n",
- buffer);
- }
-
-
- /**********************************************************************
- * LDDEPS tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, MakeProject_Config_LdDeps)
- {
- make_project_config_lddeps(prj, strm);
- CHECK_EQUAL(
- " LDDEPS :=\n",
- buffer);
- }
-
-
- /**********************************************************************
- * LDFLAGS tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, MakeProject_Config_LdFlags)
- {
- make_project_config_ldflags(prj, strm);
- CHECK_EQUAL(
- " LDFLAGS +=\n",
- buffer);
- }
-
-
- /**********************************************************************
- * OBJDIR tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, MakeProject_Config_ObjDir)
- {
- make_project_config_objdir(prj, strm);
- CHECK_EQUAL(
- " OBJDIR := obj/Debug\\ DLL\n",
- buffer);
- }
-
-
- /**********************************************************************
- * OUTFILE tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, MakeProject_Config_OutFile)
- {
- env_set_os(MacOSX);
- make_project_config_outfile(prj, strm);
- CHECK_EQUAL(
- " OUTFILE := $(OUTDIR)/My\\ Project\n",
- buffer);
- }
-
-
- /**********************************************************************
- * OUTDIR tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, MakeProject_Config_OutDir)
- {
- make_project_config_outdir(prj, strm);
- CHECK_EQUAL(
- " OUTDIR := .\n",
- buffer);
- }
-
-
- /**********************************************************************
- * RESFLAGS tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, MakeProject_Config_ResFlags)
- {
- make_project_config_resflags(prj, strm);
- CHECK_EQUAL(
- " RESFLAGS +=\n",
- buffer);
- }
-}
diff --git a/src/actions/make/tests/make_project_tests.cpp b/src/actions/make/tests/make_project_tests.cpp
deleted file mode 100644
index 40f4e6e..0000000
--- a/src/actions/make/tests/make_project_tests.cpp
+++ /dev/null
@@ -1,186 +0,0 @@
-/**
- * \file make_project_tests.cpp
- * \brief Automated tests for GNU makefile project processing.
- * \author Copyright (c) 2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "actions/tests/action_tests.h"
-extern "C" {
-#include "actions/make/make_project.h"
-#include "base/env.h"
-}
-
-SUITE(action)
-{
- /**********************************************************************
- * Signature tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, MakeProject_SignatureIsCorrect_OnGmake)
- {
- env_set_action("gmake");
- make_project_signature(prj, strm);
- CHECK_EQUAL(
- "# GNU Makefile autogenerated by Premake\n"
- "\n",
- buffer);
- }
-
-
- /**********************************************************************
- * Config block conditional tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, MakeProject_Config_Conditional)
- {
- make_project_config_conditional(prj, strm);
- CHECK_EQUAL(
- "ifeq ($(CONFIG),Debug DLL)\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, MakeProject_Config_End)
- {
- make_project_config_end(prj, strm);
- CHECK_EQUAL(
- "endif\n"
- "\n",
- buffer);
- }
-
-
- /**********************************************************************
- * Object file list tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, MakeProject_Objects_ConvertsFileExtension)
- {
- const char* files[] = { "Hello.cpp", "Good Bye.cpp", NULL };
- SetField(prj, ProjectFiles, files);
- make_project_objects(prj, strm);
- CHECK_EQUAL(
- "OBJECTS := \\\n"
- "\t$(OBJDIR)/Hello.o \\\n"
- "\t$(OBJDIR)/Good\\ Bye.o \\\n"
- "\n",
- buffer);
- }
-
-
- /**********************************************************************
- * Resource file list tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, MakeProject_Resources)
- {
- make_project_resources(prj, strm);
- CHECK_EQUAL(
- "RESOURCES := \\\n"
- "\n",
- buffer);
- }
-
-
- /**********************************************************************
- * .PHONY rule tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, MakeProject_PhonyRule)
- {
- make_project_phony_rule(prj, strm);
- CHECK_EQUAL(
- ".PHONY: clean\n"
- "\n",
- buffer);
- }
-
-
- /**********************************************************************
- * Output target tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, MakeProject_OutputTarget)
- {
- make_project_target(prj, strm);
- CHECK_EQUAL(
- "$(OUTFILE): $(OUTDIR) $(OBJDIR) $(OBJECTS) $(LDDEPS) $(RESOURCES)\n"
- "\t@echo Linking My Project\n"
- "\t@$(CXX) -o $@ $(LDFLAGS) $(ARCHFLAGS) $(OBJECTS) $(RESOURCES)\n"
- "\n",
- buffer);
- }
-
-
- /**********************************************************************
- * Directory creation rules
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, MakeProject_MkdirRules)
- {
- make_project_mkdir_rules(prj, strm);
- CHECK_EQUAL(
- "$(OUTDIR):\n"
- "\t@echo Creating $(OUTDIR)\n"
- "\t@$(MKDIR) $(SYS_OUTDIR)\n"
- "\n"
- "$(OBJDIR):\n"
- "\t@echo Creating $(OBJDIR)\n"
- "\t@$(MKDIR) $(SYS_OBJDIR)\n"
- "\n",
- buffer);
- }
-
-
- /**********************************************************************
- * Clean rules
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, MakeProject_CleanRules)
- {
- make_project_clean_rules(prj, strm);
- CHECK_EQUAL(
- "clean:\n"
- "\t@echo Cleaning My Project\n"
- "ifeq (posix, $(SHELLTYPE))\n"
- "\t@rm -f $(SYS_OUTFILE)\n"
- "\t@rm -rf $(SYS_OBJDIR)\n"
- "else\n"
- "\t@if exist $(SYS_OUTFILE) del $(SYS_OUTFILE)\n"
- "\t@if exist $(SYS_OBJDIR) rmdir /s /q $(SYS_OBJDIR)\n"
- "endif\n"
- "\n",
- buffer);
- }
-
-
- /**********************************************************************
- * Source rule tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, MakeProject_SourceRules)
- {
- const char* files[] = { "Good Bye.cpp", NULL };
- SetField(prj, ProjectFiles, files);
- make_project_source_rules(prj, strm);
- CHECK_EQUAL(
- "$(OBJDIR)/Good\\ Bye.o: Good\\ Bye.cpp\n"
- "\t@echo $(notdir $<)\n"
- "\t@$(CXX) $(CXXFLAGS) -o $@ -c $<\n"
- "\n",
- buffer);
- }
-
-
- /**********************************************************************
- * File dependency generation tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, MakeProject_IncludeDependencies)
- {
- make_project_include_dependencies(prj, strm);
- CHECK_EQUAL(
- "-include $(OBJECTS:%.o=%.d)\n",
- buffer);
- }
-}
diff --git a/src/actions/make/tests/make_solution_tests.cpp b/src/actions/make/tests/make_solution_tests.cpp
deleted file mode 100644
index a6169f8..0000000
--- a/src/actions/make/tests/make_solution_tests.cpp
+++ /dev/null
@@ -1,123 +0,0 @@
-/**
- * \file make_solution_tests.cpp
- * \brief Automated tests for makefile "solution" processing.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "actions/tests/action_tests.h"
-extern "C" {
-#include "actions/make/make_solution.h"
-#include "base/env.h"
-}
-
-
-SUITE(action)
-{
- /**********************************************************************
- * Signature tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, MakeSolution_SignatureIsCorrect_OnGmake)
- {
- env_set_action("gmake");
- make_solution_signature(sln, strm);
- CHECK_EQUAL(
- "# GNU Make makefile autogenerated by Premake\n"
- "# Usage: make [ CONFIG=config_name ]\n"
- "# Where {config_name} is one of:\n"
- "# Debug DLL, Release DLL\n"
- "\n",
- buffer);
- }
-
-
- /**********************************************************************
- * Default configuration tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, MakeSolution_DefaultConfigIsCorrect)
- {
- make_solution_default_config(sln, strm);
- CHECK_EQUAL(
- "ifndef CONFIG\n"
- " CONFIG=Debug DLL\n"
- "endif\n"
- "export CONFIG\n"
- "\n",
- buffer);
- }
-
-
- /**********************************************************************
- * Phony rule tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, MakeSolution_PhonyRuleIsCorrect)
- {
- make_solution_phony_rule(sln, strm);
- CHECK_EQUAL(
- ".PHONY: all clean My\\ Project\n"
- "\n",
- buffer);
- }
-
-
- /**********************************************************************
- * All rule tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, MakeSolution_AllRuleIsCorrect)
- {
- make_solution_all_rule(sln, strm);
- CHECK_EQUAL(
- "all: My\\ Project\n"
- "\n",
- buffer);
- }
-
-
- /**********************************************************************
- * Project entry tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, Make_ProjectEntry_InSameDirectory)
- {
- project_set_location(prj, solution_get_location(sln));
- make_solution_projects(sln, strm);
- CHECK_EQUAL(
- "My\\ Project:\n"
- "\t@echo ==== Building My Project ====\n"
- "\t@$(MAKE) -f My\\ Project.make\n"
- "\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, Make_ProjectEntry_InDifferentDirectory)
- {
- project_set_location(prj, "Root Folder/Solution Folder/My Project");
- make_solution_projects(sln, strm);
- CHECK_EQUAL(
- "My\\ Project:\n"
- "\t@echo ==== Building My Project ====\n"
- "\t@$(MAKE) --no-print-directory -C My\\ Project\n"
- "\n",
- buffer);
- }
-
-
- /**********************************************************************
- * Clean rule tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, Gmake_CleanRule_IsCorrect)
- {
- project_set_location(prj, solution_get_location(sln));
- make_solution_clean_rule(sln, strm);
- CHECK_EQUAL(
- "clean:\n"
- "\t@$(MAKE) -f My\\ Project.make clean\n",
- buffer);
- }
-
-}
diff --git a/src/actions/make/tests/make_tests.cpp b/src/actions/make/tests/make_tests.cpp
deleted file mode 100644
index d02947a..0000000
--- a/src/actions/make/tests/make_tests.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-/**
- * \file make_tests.cpp
- * \brief Automated tests for the makefile generator support functions.
- * \author Copyright (c) 2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "testing/testing.h"
-extern "C" {
-#include "actions/make/make.h"
-#include "base/error.h"
-}
-
-
-struct FxMake
-{
- Session sess;
- Solution sln1;
- Solution sln2;
- Project prj1;
- Project prj2;
-
- FxMake()
- {
- sess = session_create();
- sln1 = AddSolution("MySolution1");
- sln2 = AddSolution("MySolution2");
- prj1 = AddProject("MyProject1");
- prj2 = AddProject("MyProject2");
- }
-
- ~FxMake()
- {
- session_destroy(sess);
- error_clear();
- }
-
- Solution AddSolution(const char* name)
- {
- Solution sln = solution_create();
- session_add_solution(sess, sln);
- solution_set_name(sln, name);
- solution_set_location(sln, ".");
- return sln;
- }
-
- Project AddProject(const char* name)
- {
- Project prj = project_create();
- solution_add_project(sln1, prj);
- project_set_name(prj, name);
- project_set_location(prj, ".");
- return prj;
- }
-};
-
-
-SUITE(action)
-{
- /**********************************************************************
- * Makefile naming tests
- **********************************************************************/
-
- TEST_FIXTURE(FxMake, GetSolutionMakefile_ReturnsMakefile_OnUniqueLocation)
- {
- solution_set_location(sln1, "./MySolution");
- const char* result = make_get_solution_makefile(sln1);
- CHECK_EQUAL("./MySolution/Makefile", result);
- }
-
- TEST_FIXTURE(FxMake, GetSolutionMakefile_ReturnsDotMake_OnSharedLocation)
- {
- const char* result = make_get_solution_makefile(sln1);
- CHECK_EQUAL("./MySolution1.make", result);
- }
-
- TEST_FIXTURE(FxMake, GetProjectMakefile_ReturnsMakefile_OnUniqueLocation)
- {
- project_set_location(prj1, "./MyProject");
- const char* result = make_get_project_makefile(prj1);
- CHECK_EQUAL("./MyProject/Makefile", result);
- }
-
- TEST_FIXTURE(FxMake, GetProjectMakefile_ReturnsDotMake_OnSharedWithSolution)
- {
- project_set_location(prj2, "./MyProject");
- const char* result = make_get_project_makefile(prj1);
- CHECK_EQUAL("./MyProject1.make", result);
- }
-
- TEST_FIXTURE(FxMake, GetProjectMakefile_ReturnsDotMake_OnSharedWithProject)
- {
- project_set_location(prj1, "./MyProject");
- project_set_location(prj2, "./MyProject");
- const char* result = make_get_project_makefile(prj1);
- CHECK_EQUAL("./MyProject/MyProject1.make", result);
- }
-}
diff --git a/src/actions/support/sourcetree.c b/src/actions/support/sourcetree.c
deleted file mode 100644
index b1bf7f1..0000000
--- a/src/actions/support/sourcetree.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/**
- * \file sourcetree.h
- * \brief Source code tree enumerator.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include <string.h>
-#include "premake.h"
-#include "sourcetree.h"
-#include "base/buffers.h"
-#include "base/cstr.h"
-#include "base/string.h"
-
-
-static int sourcetree_do(Project prj, Stream strm, SourceTreeCallback handler, const char* group);
-
-
-/**
- * Walk a list of source files and pass them off, in nesting order, to
- * the specified callback. Handles the grouping of related files info
- * groups (by directory currently).
- * \param prj The project containing the files to enumerate.
- * \param strm The active output stream.
- * \param handler The per-file handler function.
- * \returns OKAY on success.
- */
-int sourcetree_walk(Project prj, Stream strm, SourceTreeCallback handler)
-{
- return sourcetree_do(prj, strm, handler, "");
-}
-
-
-static int sourcetree_do(Project prj, Stream strm, SourceTreeCallback handler, const char* group)
-{
- int i, n;
- unsigned group_len;
- Strings files;
- char* buffer;
-
- group_len = strlen(group);
-
- /* open an enclosing group */
- buffer = buffers_next();
- strcpy(buffer, group);
- cstr_trim(buffer, '/');
- handler(prj, strm, buffer, GroupStart);
-
- /* scan all files in this group and process any subdirectories (subgroups) */
- files = project_get_files(prj);
- n = strings_size(files);
- for (i = 0; i < n; ++i)
- {
- const char* filename = strings_item(files, i);
-
- /* is this file in the group that I am currently processing? */
- if (cstr_starts_with(filename, group))
- {
- /* see if this file contains an additional directory level (a new group) */
- const char* ptr = strchr(filename + group_len, '/');
- if (ptr)
- {
- int j;
-
- /* pull out the name of this new group */
- size_t len = ptr - filename + 1;
- buffer = buffers_next();
- strncpy(buffer, filename, len);
- buffer[len] = '\0';
-
- /* have I processed this subdirectory already? See if it appears earlier in the list */
- for (j = 0; j < i; ++j)
- {
- if (cstr_starts_with(strings_item(files, j), buffer))
- break;
- }
-
- if (i == j)
- {
- /* a new group, process it now */
- String new_group = string_create(buffer);
- int z = sourcetree_do(prj, strm, handler, string_cstr(new_group));
- string_destroy(new_group);
- if (z != OKAY) return !OKAY;
- }
- }
- }
- }
-
- /* now process all files that belong to this current group (and not a subgroup) */
- for (i = 0; i < n; ++i)
- {
- const char* filename = strings_item(files, i);
- if (cstr_starts_with(filename, group) && strchr(filename + group_len, '/') == NULL)
- {
- if (handler(prj, strm, filename, SourceFile) != OKAY)
- return !OKAY;
- }
- }
-
- /* close the group */
- buffer = buffers_next();
- strcpy(buffer, group);
- cstr_trim(buffer, '/');
- handler(prj, strm, buffer, GroupEnd);
- return OKAY;
-}
-
diff --git a/src/actions/support/sourcetree.h b/src/actions/support/sourcetree.h
deleted file mode 100644
index 504f052..0000000
--- a/src/actions/support/sourcetree.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * \file sourcetree.h
- * \brief Source code tree enumerator.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-#if !defined(PREMAKE_SOURCETREE_H)
-#define PREMAKE_SOURCETREE_H
-
-#include "objects/project.h"
-
-
-/**
- * State values for the source tree enumeration functions.
- */
-enum SourceTreeState
-{
- GroupStart,
- GroupEnd,
- SourceFile
-};
-
-
-/**
- * Per-file callback signature for action_source_tree.
- * \param prj The current project; contains the file being enumerated.
- * \param strm The active output stream; for writing the file markup.
- * \param filename The name of the file to process.
- * \param state One of the ActionSourceStates, enabling file grouping.
- * \returns OKAY if successful.
- */
-typedef int (*SourceTreeCallback)(Project prj, Stream strm, const char* filename, int state);
-
-
-int sourcetree_walk(Project prj, Stream strm, SourceTreeCallback handler);
-
-
-#endif
diff --git a/src/actions/tests/action_tests.h b/src/actions/tests/action_tests.h
deleted file mode 100644
index 7537b5e..0000000
--- a/src/actions/tests/action_tests.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * \file action_tests.h
- * \brief Common test fixtures for all action tests.
- * \author Copyright (c) 2008 Jason Perkins and the Premake project
- */
-
-#include "testing/testing.h"
-extern "C" {
-#include "objects/session.h"
-}
-
-struct FxAction
-{
- Session sess;
- Stream strm;
- Solution sln;
- Project prj;
- char buffer[8192];
-
- FxAction()
- {
- sess = session_create();
-
- strm = stream_create_null();
- stream_set_buffer(strm, buffer);
- session_set_active_stream(sess, strm);
-
- sln = solution_create();
- session_add_solution(sess, sln);
- solution_set_name(sln, "My Solution");
- solution_set_base_dir(sln, "Root Folder");
- solution_set_location(sln, "Root Folder/Solution Folder");
- solution_add_config(sln, "Debug DLL");
- solution_add_config(sln, "Release DLL");
-
- prj = project_create();
- solution_add_project(sln, prj);
- project_set_name(prj, "My Project");
- project_set_base_dir(prj, "Root Folder");
- project_set_location(prj, "Root Folder/Project Folder");
- project_set_guid(prj, "AE2461B7-236F-4278-81D3-F0D476F9A4C0");
- project_set_language(prj, "c++");
- project_set_config(prj, "Debug DLL");
- }
-
- ~FxAction()
- {
- stream_destroy(strm);
- session_destroy(sess);
- }
-
-
- void SetField(Project prj, ProjectField index, const char** values)
- {
- Strings strs = strings_create();
- for (const char** value = values; (*value) != NULL; ++value)
- {
- strings_add(strs, *value);
- }
-
- project_set_values(prj, index, strs);
- }
-
- void SetConfigField(Project prj, BlockField index, const char** values)
- {
- Strings strs = strings_create();
- for (const char** value = values; (*value) != NULL; ++value)
- {
- strings_add(strs, *value);
- }
-
- Block blk = block_create();
- block_set_values(blk, index, strs);
-
- Blocks blks = project_get_blocks(prj);
- blocks_add(blks, blk);
- }
-};
diff --git a/src/actions/vs200x/tests/vs2002_solution_tests.cpp b/src/actions/vs200x/tests/vs2002_solution_tests.cpp
deleted file mode 100644
index 2042fa7..0000000
--- a/src/actions/vs200x/tests/vs2002_solution_tests.cpp
+++ /dev/null
@@ -1,108 +0,0 @@
-/**
- * \file vs2002_solution_tests.cpp
- * \brief Automated tests for VS2002 solution processing.
- * \author Copyright (c) 2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "actions/tests/action_tests.h"
-extern "C" {
-#include "actions/vs200x/vs200x_solution.h"
-}
-
-
-SUITE(action)
-{
- /**********************************************************************
- * Signature tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, Vs2002_Signature_IsCorrect)
- {
- vs2002_solution_signature(sln, strm);
- CHECK_EQUAL(
- "Microsoft Visual Studio Solution File, Format Version 7.00\r\n",
- buffer);
- }
-
-
- /**********************************************************************
- * Project entry tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, Vs2002_ProjectEntry_UsesRelativePath)
- {
- vs2002_solution_projects(sln, strm);
- CHECK_EQUAL(
- "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"My Project\", \"..\\Project Folder\\My Project.vcproj\", \"{AE2461B7-236F-4278-81D3-F0D476F9A4C0}\"\n"
- "EndProject\n",
- buffer);
- }
-
-
- /**********************************************************************
- * Solution configuration tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, Vs2002_SolutionConfiguration_IsCorrect)
- {
- vs2002_solution_configuration(sln, strm);
- CHECK_EQUAL(
- "Global\n"
- "\tGlobalSection(SolutionConfiguration) = preSolution\n"
- "\t\tConfigName.0 = Debug DLL\n"
- "\t\tConfigName.1 = Release DLL\n"
- "\tEndGlobalSection\n",
- buffer);
- }
-
-
- /**********************************************************************
- * Project dependencies tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, Vs2002_ProjectDependencies_IsCorrect)
- {
- vs2002_solution_dependencies(sln, strm);
- CHECK_EQUAL(
- "\tGlobalSection(ProjectDependencies) = postSolution\n"
- "\tEndGlobalSection\n",
- buffer);
- }
-
-
- /**********************************************************************
- * Project configuration tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, Vs2002_ProjectConfiguration_IsCorrect)
- {
- vs2002_solution_project_configuration(sln, strm);
- CHECK_EQUAL(
- "\tGlobalSection(ProjectConfiguration) = postSolution\n"
- "\t\t{AE2461B7-236F-4278-81D3-F0D476F9A4C0}.Debug DLL.ActiveCfg = Debug DLL|Win32\n"
- "\t\t{AE2461B7-236F-4278-81D3-F0D476F9A4C0}.Debug DLL.Build.0 = Debug DLL|Win32\n"
- "\t\t{AE2461B7-236F-4278-81D3-F0D476F9A4C0}.Release DLL.ActiveCfg = Release DLL|Win32\n"
- "\t\t{AE2461B7-236F-4278-81D3-F0D476F9A4C0}.Release DLL.Build.0 = Release DLL|Win32\n"
- "\tEndGlobalSection\n",
- buffer);
- }
-
-
- /**********************************************************************
- * Solution extensibility tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, Vs2002_Extensibility_IsCorrect)
- {
- vs2002_solution_extensibility(sln, strm);
- CHECK_EQUAL(
- "\tGlobalSection(ExtensibilityGlobals) = postSolution\n"
- "\tEndGlobalSection\n"
- "\tGlobalSection(ExtensibilityAddIns) = postSolution\n"
- "\tEndGlobalSection\n"
- "EndGlobal\n",
- buffer);
- }
-
-}
diff --git a/src/actions/vs200x/tests/vs2003_solution_tests.cpp b/src/actions/vs200x/tests/vs2003_solution_tests.cpp
deleted file mode 100644
index 00aab54..0000000
--- a/src/actions/vs200x/tests/vs2003_solution_tests.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * \file vs2003_solution_tests.cpp
- * \brief Automated tests for VS2003 solution processing.
- * \author Copyright (c) 2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "actions/tests/action_tests.h"
-extern "C" {
-#include "actions/vs200x/vs200x_solution.h"
-}
-
-
-SUITE(action)
-{
- /**********************************************************************
- * Signature tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, Vs2003_Signature_IsCorrect)
- {
- vs2003_solution_signature(sln, strm);
- CHECK_EQUAL(
- "Microsoft Visual Studio Solution File, Format Version 8.00\r\n",
- buffer);
- }
-
-
- /**********************************************************************
- * Solution configuration tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, Vs2003_SolutionConfiguration_IsCorrect)
- {
- vs2003_solution_configuration(sln, strm);
- CHECK_EQUAL(
- "Global\n"
- "\tGlobalSection(SolutionConfiguration) = preSolution\n"
- "\t\tDebug DLL = Debug DLL\n"
- "\t\tRelease DLL = Release DLL\n"
- "\tEndGlobalSection\n",
- buffer);
- }
-
-}
diff --git a/src/actions/vs200x/tests/vs2005_solution_tests.cpp b/src/actions/vs200x/tests/vs2005_solution_tests.cpp
deleted file mode 100644
index 4707c6b..0000000
--- a/src/actions/vs200x/tests/vs2005_solution_tests.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-/**
- * \file vs2005_solution_tests.cpp
- * \brief Automated tests for VS2005 solution processing.
- * \author Copyright (c) 2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "actions/tests/action_tests.h"
-extern "C" {
-#include "actions/vs200x/vs200x_solution.h"
-}
-
-
-SUITE(action)
-{
- /**********************************************************************
- * Signature tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, Vs2005_Signature_IsCorrect)
- {
- vs2005_solution_signature(sln, strm);
- CHECK_EQUAL(
- "\357\273\277\r\n"
- "Microsoft Visual Studio Solution File, Format Version 9.00\r\n"
- "# Visual Studio 2005\r\n",
- buffer);
- }
-
-
- /**********************************************************************
- * Solution Configuration Platforms tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, Platforms_IsCorrect)
- {
- vs2005_solution_platforms(sln, strm);
- CHECK_EQUAL(
- "Global\n"
- "\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n"
- "\t\tDebug DLL|Win32 = Debug DLL|Win32\n"
- "\t\tRelease DLL|Win32 = Release DLL|Win32\n"
- "\tEndGlobalSection\n",
- buffer);
- }
-
-
- /**********************************************************************
- * Project Configuration Platforms tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, ProjectPlatforms_IsCorrect)
- {
- vs2005_solution_project_platforms(sln, strm);
- CHECK_EQUAL(
- "\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n"
- "\t\t{AE2461B7-236F-4278-81D3-F0D476F9A4C0}.Debug DLL|Win32.ActiveCfg = Debug DLL|Win32\n"
- "\t\t{AE2461B7-236F-4278-81D3-F0D476F9A4C0}.Debug DLL|Win32.Build.0 = Debug DLL|Win32\n"
- "\t\t{AE2461B7-236F-4278-81D3-F0D476F9A4C0}.Release DLL|Win32.ActiveCfg = Release DLL|Win32\n"
- "\t\t{AE2461B7-236F-4278-81D3-F0D476F9A4C0}.Release DLL|Win32.Build.0 = Release DLL|Win32\n"
- "\tEndGlobalSection\n",
- buffer);
- }
-
-
- /**********************************************************************
- * Solution Project tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, Properties_IsCorrect)
- {
- vs2005_solution_properties(sln, strm);
- CHECK_EQUAL(
- "\tGlobalSection(SolutionProperties) = preSolution\n"
- "\t\tHideSolutionNode = FALSE\n"
- "\tEndGlobalSection\n"
- "EndGlobal\n",
- buffer);
- }
-}
diff --git a/src/actions/vs200x/tests/vs2008_solution_tests.cpp b/src/actions/vs200x/tests/vs2008_solution_tests.cpp
deleted file mode 100644
index 4579be1..0000000
--- a/src/actions/vs200x/tests/vs2008_solution_tests.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * \file vs2008_solution_tests.cpp
- * \brief Automated tests for VS2008 solution processing.
- * \author Copyright (c) 2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "actions/tests/action_tests.h"
-extern "C" {
-#include "actions/vs200x/vs200x_solution.h"
-}
-
-
-SUITE(action)
-{
- /**********************************************************************
- * Signature tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, Vs2008_Signature_IsCorrect)
- {
- vs2008_solution_signature(sln, strm);
- CHECK_EQUAL(
- "\357\273\277\r\n"
- "Microsoft Visual Studio Solution File, Format Version 10.00\r\n"
- "# Visual Studio 2008\r\n",
- buffer);
- }
-
-}
diff --git a/src/actions/vs200x/tests/vs200x_compiler_tests.cpp b/src/actions/vs200x/tests/vs200x_compiler_tests.cpp
deleted file mode 100644
index 016cd1f..0000000
--- a/src/actions/vs200x/tests/vs200x_compiler_tests.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-/**
- * \file vs200x_compiler_tests.cpp
- * \brief Automated tests for VS200x compiler block processing.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "actions/tests/action_tests.h"
-extern "C" {
-#include "actions/vs200x/vs200x_project.h"
-#include "base/env.h"
-}
-
-SUITE(action)
-{
- /**********************************************************************
- * Default settings
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, VCCLCompilerTool_Defaults_OnVs2002)
- {
- env_set_action("vs2002");
- vs200x_project_vc_cl_compiler_tool(prj, strm);
- CHECK_EQUAL(
- "\t\t\t<Tool\n"
- "\t\t\t\tName=\"VCCLCompilerTool\"\n"
- "\t\t\t\tOptimization=\"0\"\n"
- "\t\t\t\tMinimalRebuild=\"TRUE\"\n"
- "\t\t\t\tBasicRuntimeChecks=\"3\"\n"
- "\t\t\t\tRuntimeLibrary=\"3\"\n"
- "\t\t\t\tRuntimeTypeInfo=\"TRUE\"\n"
- "\t\t\t\tUsePrecompiledHeader=\"2\"\n"
- "\t\t\t\tWarningLevel=\"3\"\n"
- "\t\t\t\tDetect64BitPortabilityProblems=\"TRUE\"\n"
- "\t\t\t\tDebugInformationFormat=\"0\"/>\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, VCCLCompilerTool_Defaults_OnVs2005)
- {
- env_set_action("vs2005");
- vs200x_project_vc_cl_compiler_tool(prj, strm);
- CHECK_EQUAL(
- "\t\t\t<Tool\n"
- "\t\t\t\tName=\"VCCLCompilerTool\"\n"
- "\t\t\t\tOptimization=\"0\"\n"
- "\t\t\t\tMinimalRebuild=\"true\"\n"
- "\t\t\t\tBasicRuntimeChecks=\"3\"\n"
- "\t\t\t\tRuntimeLibrary=\"3\"\n"
- "\t\t\t\tUsePrecompiledHeader=\"0\"\n"
- "\t\t\t\tWarningLevel=\"3\"\n"
- "\t\t\t\tDetect64BitPortabilityProblems=\"true\"\n"
- "\t\t\t\tDebugInformationFormat=\"0\"\n"
- "\t\t\t/>\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, VCCLCompilerTool_Defaults_OnVs2008)
- {
- env_set_action("vs2008");
- vs200x_project_vc_cl_compiler_tool(prj, strm);
- CHECK_EQUAL(
- "\t\t\t<Tool\n"
- "\t\t\t\tName=\"VCCLCompilerTool\"\n"
- "\t\t\t\tOptimization=\"0\"\n"
- "\t\t\t\tMinimalRebuild=\"true\"\n"
- "\t\t\t\tBasicRuntimeChecks=\"3\"\n"
- "\t\t\t\tRuntimeLibrary=\"3\"\n"
- "\t\t\t\tUsePrecompiledHeader=\"0\"\n"
- "\t\t\t\tWarningLevel=\"3\"\n"
- "\t\t\t\tDebugInformationFormat=\"0\"\n"
- "\t\t\t/>\n",
- buffer);
- }
-
-
- /**********************************************************************
- * Defines tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, VCCLCompilerTool_WithDefines)
- {
- env_set_action("vs2002");
- const char* defines[] = { "DEFINE0", "DEFINE1", NULL };
- SetConfigField(prj, BlockDefines, defines);
- vs200x_project_vc_cl_compiler_tool(prj, strm);
- CHECK_EQUAL(
- "\t\t\t<Tool\n"
- "\t\t\t\tName=\"VCCLCompilerTool\"\n"
- "\t\t\t\tOptimization=\"0\"\n"
- "\t\t\t\tPreprocessorDefinitions=\"DEFINE0;DEFINE1\"\n"
- "\t\t\t\tMinimalRebuild=\"TRUE\"\n"
- "\t\t\t\tBasicRuntimeChecks=\"3\"\n"
- "\t\t\t\tRuntimeLibrary=\"3\"\n"
- "\t\t\t\tRuntimeTypeInfo=\"TRUE\"\n"
- "\t\t\t\tUsePrecompiledHeader=\"2\"\n"
- "\t\t\t\tWarningLevel=\"3\"\n"
- "\t\t\t\tDetect64BitPortabilityProblems=\"TRUE\"\n"
- "\t\t\t\tDebugInformationFormat=\"0\"/>\n",
- buffer);
- }
-}
diff --git a/src/actions/vs200x/tests/vs200x_config_tests.cpp b/src/actions/vs200x/tests/vs200x_config_tests.cpp
deleted file mode 100644
index 0463d99..0000000
--- a/src/actions/vs200x/tests/vs200x_config_tests.cpp
+++ /dev/null
@@ -1,192 +0,0 @@
-/**
- * \file vs200x_config_tests.cpp
- * \brief Automated tests for VS200x configuration settings processing.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "actions/tests/action_tests.h"
-extern "C" {
-#include "actions/vs200x/vs200x_config.h"
-#include "base/env.h"
-}
-
-SUITE(action)
-{
- /*************************************************************************
- * Character set tests
- *************************************************************************/
-
- TEST_FIXTURE(FxAction, VsCharacterSet_Defaults_OnVs2002)
- {
- env_set_action("vs2002");
- vs200x_config_character_set(strm);
- CHECK_EQUAL("\n\t\t\tCharacterSet=\"2\"", buffer);
- }
-
- TEST_FIXTURE(FxAction, VsCharacterSet_Defaults_OnVs2003)
- {
- env_set_action("vs2003");
- vs200x_config_character_set(strm);
- CHECK_EQUAL("\n\t\t\tCharacterSet=\"2\"", buffer);
- }
-
- TEST_FIXTURE(FxAction, VsCharacterSet_Defaults_OnVs2005)
- {
- env_set_action("vs2005");
- vs200x_config_character_set(strm);
- CHECK_EQUAL("\n\t\t\tCharacterSet=\"1\"", buffer);
- }
-
- TEST_FIXTURE(FxAction, VsCharacterSet_Defaults_OnVs2008)
- {
- env_set_action("vs2008");
- vs200x_config_character_set(strm);
- CHECK_EQUAL("\n\t\t\tCharacterSet=\"1\"", buffer);
- }
-
-
- /*************************************************************************
- * Debug information tests
- *************************************************************************/
-
- TEST_FIXTURE(FxAction, VsDebugFormat_Is0_OnNoSymbols)
- {
- env_set_action("vs2002");
- vs200x_config_debug_information_format(prj, strm);
- CHECK_EQUAL("\n\t\t\t\tDebugInformationFormat=\"0\"", buffer);
- }
-
- TEST_FIXTURE(FxAction, VsDebugFormat_Is4_OnSymbols)
- {
- env_set_action("vs2002");
- const char* flags[] = { "Symbols", NULL };
- SetConfigField(prj, BlockFlags, flags);
- vs200x_config_debug_information_format(prj, strm);
- CHECK_EQUAL("\n\t\t\t\tDebugInformationFormat=\"4\"", buffer);
- }
-
- TEST_FIXTURE(FxAction, VsDebugFormat_Is3_OnSymbolsAndManaged)
- {
- env_set_action("vs2002");
- const char* flags[] = { "Symbols", "Managed", NULL };
- SetConfigField(prj, BlockFlags, flags);
- vs200x_config_debug_information_format(prj, strm);
- CHECK_EQUAL("\n\t\t\t\tDebugInformationFormat=\"3\"", buffer);
- }
-
- TEST_FIXTURE(FxAction, VsDebugFormat_Is3_OnSymbolsAndOptimize)
- {
- env_set_action("vs2002");
- const char* flags[] = { "Symbols", "Optimize", NULL };
- SetConfigField(prj, BlockFlags, flags);
- vs200x_config_debug_information_format(prj, strm);
- CHECK_EQUAL("\n\t\t\t\tDebugInformationFormat=\"3\"", buffer);
- }
-
- TEST_FIXTURE(FxAction, VsDebugFormat_Is3_OnSymbolsAndOptimizeSize)
- {
- env_set_action("vs2002");
- const char* flags[] = { "Symbols", "OptimizeSize", NULL };
- SetConfigField(prj, BlockFlags, flags);
- vs200x_config_debug_information_format(prj, strm);
- CHECK_EQUAL("\n\t\t\t\tDebugInformationFormat=\"3\"", buffer);
- }
-
- TEST_FIXTURE(FxAction, VsDebugFormat_Is3_OnSymbolsAndOptimizeSpeed)
- {
- env_set_action("vs2002");
- const char* flags[] = { "Symbols", "OptimizeSpeed", NULL };
- SetConfigField(prj, BlockFlags, flags);
- vs200x_config_debug_information_format(prj, strm);
- CHECK_EQUAL("\n\t\t\t\tDebugInformationFormat=\"3\"", buffer);
- }
-
- TEST_FIXTURE(FxAction, VsDebugFormat_Is3_OnSymbolsAndNoEditAndContinue)
- {
- env_set_action("vs2002");
- const char* flags[] = { "Symbols", "NoEditAndContinue", NULL };
- SetConfigField(prj, BlockFlags, flags);
- vs200x_config_debug_information_format(prj, strm);
- CHECK_EQUAL("\n\t\t\t\tDebugInformationFormat=\"3\"", buffer);
- }
-
- TEST_FIXTURE(FxAction, VCDebugInfo_IsOff_WithNoSymbols)
- {
- env_set_action("vs2002");
- vs200x_config_generate_debug_information(prj, strm);
- CHECK_EQUAL("\n\t\t\t\tGenerateDebugInformation=\"FALSE\"", buffer);
- }
-
- TEST_FIXTURE(FxAction, VCDebugInfo_IsOn_WithSymbols)
- {
- env_set_action("vs2002");
- const char* flags[] = { "Symbols", NULL };
- SetConfigField(prj, BlockFlags, flags);
- vs200x_config_generate_debug_information(prj, strm);
- CHECK_EQUAL(
- "\n\t\t\t\tGenerateDebugInformation=\"TRUE\""
- "\n\t\t\t\tProgramDatabaseFile=\"$(OutDir)/My Project.pdb\"",
- buffer);
- }
-
-
- /*************************************************************************
- * Defines tests
- *************************************************************************/
-
- TEST_FIXTURE(FxAction, VsDefines_Empty_OnNoSymbols)
- {
- env_set_action("vs2002");
- vs200x_config_defines(prj, strm);
- CHECK_EQUAL("", buffer);
- }
-
- TEST_FIXTURE(FxAction, VsDefines_SemiSplitList)
- {
- env_set_action("vs2002");
- const char* values[] = { "DEFINE0", "DEFINE1", "DEFINE2", NULL };
- SetConfigField(prj, BlockDefines, values);
- vs200x_config_defines(prj, strm);
- CHECK_EQUAL("\n\t\t\t\tPreprocessorDefinitions=\"DEFINE0;DEFINE1;DEFINE2\"", buffer);
- }
-
-
- /*************************************************************************
- * Optimization tests
- *************************************************************************/
-
- TEST_FIXTURE(FxAction, VsOptimization_Is0_OnNoOptimization)
- {
- env_set_action("vs2002");
- vs200x_config_optimization(prj, strm);
- CHECK_EQUAL("\n\t\t\t\tOptimization=\"0\"", buffer);
- }
-
- TEST_FIXTURE(FxAction, VsOptimization_Is1_OnOptimizeSize)
- {
- env_set_action("vs2002");
- const char* flags[] = { "OptimizeSize", NULL };
- SetConfigField(prj, BlockFlags, flags);
- vs200x_config_optimization(prj, strm);
- CHECK_EQUAL("\n\t\t\t\tOptimization=\"1\"", buffer);
- }
-
- TEST_FIXTURE(FxAction, VsOptimization_Is2_OnOptimizeSpeed)
- {
- env_set_action("vs2002");
- const char* flags[] = { "OptimizeSpeed", NULL };
- SetConfigField(prj, BlockFlags, flags);
- vs200x_config_optimization(prj, strm);
- CHECK_EQUAL("\n\t\t\t\tOptimization=\"2\"", buffer);
- }
-
- TEST_FIXTURE(FxAction, VsOptimization_Is2_OnOptimize)
- {
- env_set_action("vs2002");
- const char* flags[] = { "Optimize", NULL };
- SetConfigField(prj, BlockFlags, flags);
- vs200x_config_optimization(prj, strm);
- CHECK_EQUAL("\n\t\t\t\tOptimization=\"3\"", buffer);
- }
-}
diff --git a/src/actions/vs200x/tests/vs200x_linker_tests.cpp b/src/actions/vs200x/tests/vs200x_linker_tests.cpp
deleted file mode 100644
index ecef088..0000000
--- a/src/actions/vs200x/tests/vs200x_linker_tests.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-/**
- * \file vs200x_linker_tests.cpp
- * \brief Automated tests for VS200x linker block processing.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "actions/tests/action_tests.h"
-extern "C" {
-#include "actions/vs200x/vs200x_project.h"
-#include "base/env.h"
-}
-
-SUITE(action)
-{
- /**********************************************************************
- * Default settings
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, VCLinkerTool_Defaults_OnVs2002)
- {
- env_set_action("vs2002");
- vs200x_project_vc_linker_tool(prj, strm);
- CHECK_EQUAL(
- "\t\t\t<Tool\n"
- "\t\t\t\tName=\"VCLinkerTool\"\n"
- "\t\t\t\tLinkIncremental=\"2\"\n"
- "\t\t\t\tGenerateDebugInformation=\"FALSE\"\n"
- "\t\t\t\tSubSystem=\"1\"\n"
- "\t\t\t\tEntryPointSymbol=\"mainCRTStartup\"\n"
- "\t\t\t\tTargetMachine=\"1\"/>\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, VCLinkerTool_Defaults_OnVs2003)
- {
- env_set_action("vs2003");
- vs200x_project_vc_linker_tool(prj, strm);
- CHECK_EQUAL(
- "\t\t\t<Tool\n"
- "\t\t\t\tName=\"VCLinkerTool\"\n"
- "\t\t\t\tLinkIncremental=\"2\"\n"
- "\t\t\t\tGenerateDebugInformation=\"FALSE\"\n"
- "\t\t\t\tSubSystem=\"1\"\n"
- "\t\t\t\tEntryPointSymbol=\"mainCRTStartup\"\n"
- "\t\t\t\tTargetMachine=\"1\"/>\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, VCLinkerTool_Defaults_OnVs2005)
- {
- env_set_action("vs2005");
- vs200x_project_vc_linker_tool(prj, strm);
- CHECK_EQUAL(
- "\t\t\t<Tool\n"
- "\t\t\t\tName=\"VCLinkerTool\"\n"
- "\t\t\t\tLinkIncremental=\"2\"\n"
- "\t\t\t\tGenerateDebugInformation=\"false\"\n"
- "\t\t\t\tSubSystem=\"1\"\n"
- "\t\t\t\tEntryPointSymbol=\"mainCRTStartup\"\n"
- "\t\t\t\tTargetMachine=\"1\"\n"
- "\t\t\t/>\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, VCLinkerTool_Defaults_OnVs2008)
- {
- env_set_action("vs2008");
- vs200x_project_vc_linker_tool(prj, strm);
- CHECK_EQUAL(
- "\t\t\t<Tool\n"
- "\t\t\t\tName=\"VCLinkerTool\"\n"
- "\t\t\t\tLinkIncremental=\"2\"\n"
- "\t\t\t\tGenerateDebugInformation=\"false\"\n"
- "\t\t\t\tSubSystem=\"1\"\n"
- "\t\t\t\tEntryPointSymbol=\"mainCRTStartup\"\n"
- "\t\t\t\tTargetMachine=\"1\"\n"
- "\t\t\t/>\n",
- buffer);
- }
-}
diff --git a/src/actions/vs200x/tests/vs200x_project_tests.cpp b/src/actions/vs200x/tests/vs200x_project_tests.cpp
deleted file mode 100644
index 75cf880..0000000
--- a/src/actions/vs200x/tests/vs200x_project_tests.cpp
+++ /dev/null
@@ -1,468 +0,0 @@
-/**
- * \file vs200x_project_tests.cpp
- * \brief Automated tests for Visual Studio project processing.
- * \author Copyright (c) 2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "actions/tests/action_tests.h"
-extern "C" {
-#include "actions/vs200x/vs200x_project.h"
-#include "base/env.h"
-}
-
-
-SUITE(action)
-{
- /**********************************************************************
- * Encoding tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, Vs200x_Encoding)
- {
- vs200x_project_encoding(prj, strm);
- CHECK_EQUAL(
- "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\r\n",
- buffer);
- }
-
-
- /**********************************************************************
- * Project element tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, VsProject_OnVs2002)
- {
- env_set_action("vs2002");
- vs200x_project_element(prj, strm);
- CHECK_EQUAL(
- "<VisualStudioProject\n"
- "\tProjectType=\"Visual C++\"\n"
- "\tVersion=\"7.00\"\n"
- "\tName=\"My Project\"\n"
- "\tProjectGUID=\"{AE2461B7-236F-4278-81D3-F0D476F9A4C0}\"\n"
- "\tKeyword=\"Win32Proj\">\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, VsProject_OnVs2003)
- {
- env_set_action("vs2003");
- vs200x_project_element(prj, strm);
- CHECK_EQUAL(
- "<VisualStudioProject\n"
- "\tProjectType=\"Visual C++\"\n"
- "\tVersion=\"7.10\"\n"
- "\tName=\"My Project\"\n"
- "\tProjectGUID=\"{AE2461B7-236F-4278-81D3-F0D476F9A4C0}\"\n"
- "\tKeyword=\"Win32Proj\">\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, VsProject_OnVs2005)
- {
- env_set_action("vs2005");
- vs200x_project_element(prj, strm);
- CHECK_EQUAL(
- "<VisualStudioProject\n"
- "\tProjectType=\"Visual C++\"\n"
- "\tVersion=\"8.00\"\n"
- "\tName=\"My Project\"\n"
- "\tProjectGUID=\"{AE2461B7-236F-4278-81D3-F0D476F9A4C0}\"\n"
- "\tRootNamespace=\"MyProject\"\n"
- "\tKeyword=\"Win32Proj\"\n"
- "\t>\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, VsProject_OnVs2008)
- {
- env_set_action("vs2008");
- vs200x_project_element(prj, strm);
- CHECK_EQUAL(
- "<VisualStudioProject\n"
- "\tProjectType=\"Visual C++\"\n"
- "\tVersion=\"9.00\"\n"
- "\tName=\"My Project\"\n"
- "\tProjectGUID=\"{AE2461B7-236F-4278-81D3-F0D476F9A4C0}\"\n"
- "\tRootNamespace=\"MyProject\"\n"
- "\tKeyword=\"Win32Proj\"\n"
- "\tTargetFrameworkVersion=\"196613\"\n"
- "\t>\n",
- buffer);
- }
-
-
- /**********************************************************************
- * Platforms tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, Vs200x_Platforms)
- {
- env_set_action("vs2002");
- vs200x_project_platforms(prj, strm);
- CHECK_EQUAL(
- "\t<Platforms>\n"
- "\t\t<Platform\n"
- "\t\t\tName=\"Win32\"/>\n"
- "\t</Platforms>\n",
- buffer);
- }
-
-
- /**********************************************************************
- * Tool files tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, VsToolFiles_Defaults_OnVs2002)
- {
- env_set_action("vs2002");
- vs200x_project_tool_files(prj, strm);
- CHECK_EQUAL(
- "\t<Configurations>\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, VsToolFiles_Defaults_OnVs2003)
- {
- env_set_action("vs2003");
- vs200x_project_tool_files(prj, strm);
- CHECK_EQUAL(
- "\t<Configurations>\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, VsToolFiles_Defaults_OnVs2005)
- {
- env_set_action("vs2005");
- vs200x_project_tool_files(prj, strm);
- CHECK_EQUAL(
- "\t<ToolFiles>\n"
- "\t</ToolFiles>\n"
- "\t<Configurations>\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, VsToolFiles_Defaults_OnVs2008)
- {
- env_set_action("vs2008");
- vs200x_project_tool_files(prj, strm);
- CHECK_EQUAL(
- "\t<ToolFiles>\n"
- "\t</ToolFiles>\n"
- "\t<Configurations>\n",
- buffer);
- }
-
-
-
- /**********************************************************************
- * Configuration element tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, Vs200x_Configuration)
- {
- env_set_action("vs2002");
- vs200x_project_config_element(prj, strm);
- CHECK_EQUAL(
- "\t\t<Configuration\n"
- "\t\t\tName=\"Debug DLL|Win32\"\n"
- "\t\t\tOutputDirectory=\"$(SolutionDir)$(ConfigurationName)\"\n"
- "\t\t\tIntermediateDirectory=\"$(ConfigurationName)\"\n"
- "\t\t\tConfigurationType=\"1\"\n"
- "\t\t\tCharacterSet=\"2\">\n",
- buffer);
- }
-
-
- /**********************************************************************
- * Tool element tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, Vs200x_VCALinkTool)
- {
- env_set_action("vs2002");
- vs200x_project_vc_alink_tool(prj, strm);
- CHECK_EQUAL(
- "\t\t\t<Tool\n"
- "\t\t\t\tName=\"VCALinkTool\"/>\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, Vs200x_VCAppVerifierTool)
- {
- env_set_action("vs2002");
- vs200x_project_vc_app_verifier_tool(prj, strm);
- CHECK_EQUAL(
- "\t\t\t<Tool\n"
- "\t\t\t\tName=\"VCAppVerifierTool\"/>\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, Vs200x_VCBscMakeTool)
- {
- env_set_action("vs2002");
- vs200x_project_vc_bsc_make_tool(prj, strm);
- CHECK_EQUAL(
- "\t\t\t<Tool\n"
- "\t\t\t\tName=\"VCBscMakeTool\"/>\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, Vs200x_VCCustomBuildTool)
- {
- env_set_action("vs2002");
- vs200x_project_vc_custom_build_tool(prj, strm);
- CHECK_EQUAL(
- "\t\t\t<Tool\n"
- "\t\t\t\tName=\"VCCustomBuildTool\"/>\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, Vs200x_VCFxCopTool)
- {
- env_set_action("vs2002");
- vs200x_project_vc_fx_cop_tool(prj, strm);
- CHECK_EQUAL(
- "\t\t\t<Tool\n"
- "\t\t\t\tName=\"VCFxCopTool\"/>\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, Vs200x_VCManagedResourceCompilerTool)
- {
- env_set_action("vs2002");
- vs200x_project_vc_managed_resource_compiler_tool(prj, strm);
- CHECK_EQUAL(
- "\t\t\t<Tool\n"
- "\t\t\t\tName=\"VCManagedResourceCompilerTool\"/>\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, Vs200x_VCManifestTool)
- {
- env_set_action("vs2002");
- vs200x_project_vc_manifest_tool(prj, strm);
- CHECK_EQUAL(
- "\t\t\t<Tool\n"
- "\t\t\t\tName=\"VCManifestTool\"/>\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, Vs200x_VCMIDLTool)
- {
- env_set_action("vs2002");
- vs200x_project_vc_midl_tool(prj, strm);
- CHECK_EQUAL(
- "\t\t\t<Tool\n"
- "\t\t\t\tName=\"VCMIDLTool\"/>\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, Vs200x_VCPreBuildEventTool)
- {
- env_set_action("vs2002");
- vs200x_project_vc_pre_build_event_tool(prj, strm);
- CHECK_EQUAL(
- "\t\t\t<Tool\n"
- "\t\t\t\tName=\"VCPreBuildEventTool\"/>\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, Vs200x_VCPreLinkEventTool)
- {
- env_set_action("vs2002");
- vs200x_project_vc_pre_link_event_tool(prj, strm);
- CHECK_EQUAL(
- "\t\t\t<Tool\n"
- "\t\t\t\tName=\"VCPreLinkEventTool\"/>\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, Vs200x_VCPostBuildEventTool)
- {
- env_set_action("vs2002");
- vs200x_project_vc_post_build_event_tool(prj, strm);
- CHECK_EQUAL(
- "\t\t\t<Tool\n"
- "\t\t\t\tName=\"VCPostBuildEventTool\"/>\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, Vs200x_VCResourceCompilerTool)
- {
- env_set_action("vs2002");
- vs200x_project_vc_resource_compiler_tool(prj, strm);
- CHECK_EQUAL(
- "\t\t\t<Tool\n"
- "\t\t\t\tName=\"VCResourceCompilerTool\"/>\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, Vs200x_VCWebDeploymentTool)
- {
- env_set_action("vs2002");
- vs200x_project_vc_web_deployment_tool(prj, strm);
- CHECK_EQUAL(
- "\t\t\t<Tool\n"
- "\t\t\t\tName=\"VCWebDeploymentTool\"/>\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, Vs200x_VCWebServiceProxyGeneratorTool)
- {
- env_set_action("vs2002");
- vs200x_project_vc_web_service_proxy_generator_tool(prj, strm);
- CHECK_EQUAL(
- "\t\t\t<Tool\n"
- "\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"/>\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, Vs200x_VCXDCMakeTool)
- {
- env_set_action("vs2002");
- vs200x_project_vc_xdc_make_tool(prj, strm);
- CHECK_EQUAL(
- "\t\t\t<Tool\n"
- "\t\t\t\tName=\"VCXDCMakeTool\"/>\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, Vs200x_VCXMLDataGeneratorTool)
- {
- env_set_action("vs2002");
- vs200x_project_vc_xml_data_generator_tool(prj, strm);
- CHECK_EQUAL(
- "\t\t\t<Tool\n"
- "\t\t\t\tName=\"VCXMLDataGeneratorTool\"/>\n",
- buffer);
- }
-
-
- /**********************************************************************
- * References section tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, VsReferences_Defaults_OnVs2002)
- {
- env_set_action("vs2002");
- vs200x_project_references(prj, strm);
- CHECK_EQUAL(
- "\t</Configurations>\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, VsReferences_Defaults_OnVs2003)
- {
- env_set_action("vs2003");
- vs200x_project_references(prj, strm);
- CHECK_EQUAL(
- "\t</Configurations>\n"
- "\t<References>\n"
- "\t</References>\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, VsReferences_Defaults_OnVs2005)
- {
- env_set_action("vs2005");
- vs200x_project_references(prj, strm);
- CHECK_EQUAL(
- "\t</Configurations>\n"
- "\t<References>\n"
- "\t</References>\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, VsReferences_Defaults_OnVs2008)
- {
- env_set_action("vs2008");
- vs200x_project_references(prj, strm);
- CHECK_EQUAL(
- "\t</Configurations>\n"
- "\t<References>\n"
- "\t</References>\n",
- buffer);
- }
-
-
- /**********************************************************************
- * Files section tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, Vs200x_Files_OnNoFiles)
- {
- env_set_action("vs2002");
- vs200x_project_files(prj, strm);
- CHECK_EQUAL(
- "\t<Files>\n"
- "\t</Files>\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, Vs200x_Files_OnSingleCppFile)
- {
- env_set_action("vs2002");
- const char* values[] = { "Hello.cpp", 0 };
- SetField(prj, ProjectFiles, values);
- vs200x_project_files(prj, strm);
- CHECK_EQUAL(
- "\t<Files>\n"
- "\t\t<File\n"
- "\t\t\tRelativePath=\".\\Hello.cpp\">\n"
- "\t\t</File>\n"
- "\t</Files>\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, Vs200x_Files_OnUpperDirectory)
- {
- env_set_action("vs2002");
- const char* values[] = { "../../Hello.cpp", 0 };
- SetField(prj, ProjectFiles, values);
- vs200x_project_files(prj, strm);
- CHECK_EQUAL(
- "\t<Files>\n"
- "\t\t<File\n"
- "\t\t\tRelativePath=\"..\\..\\Hello.cpp\">\n"
- "\t\t</File>\n"
- "\t</Files>\n",
- buffer);
- }
-
- TEST_FIXTURE(FxAction, Vs200x_Files_OnGroupedCppFile)
- {
- env_set_action("vs2002");
- const char* values[] = { "Src/Hello.cpp", 0 };
- SetField(prj, ProjectFiles, values);
- vs200x_project_files(prj, strm);
- CHECK_EQUAL(
- "\t<Files>\n"
- "\t\t<Filter\n"
- "\t\t\tName=\"Src\"\n"
- "\t\t\tFilter=\"\">\n"
- "\t\t\t<File\n"
- "\t\t\t\tRelativePath=\".\\Src\\Hello.cpp\">\n"
- "\t\t\t</File>\n"
- "\t\t</Filter>\n"
- "\t</Files>\n",
- buffer);
- }
-
-
- /**********************************************************************
- * Globals section tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, Vs200x_Globals)
- {
- env_set_action("vs2002");
- vs200x_project_globals(prj, strm);
- CHECK_EQUAL(
- "\t<Globals>\n"
- "\t</Globals>\n"
- "</VisualStudioProject>\n",
- buffer);
- }
-}
diff --git a/src/actions/vs200x/tests/vs200x_tests.cpp b/src/actions/vs200x/tests/vs200x_tests.cpp
deleted file mode 100644
index a41a071..0000000
--- a/src/actions/vs200x/tests/vs200x_tests.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * \file vs200x_tests.cpp
- * \brief Automated tests for VS200x support functions.
- * \author Copyright (c) 2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "actions/tests/action_tests.h"
-extern "C" {
-#include "actions/vs200x/vs200x.h"
-}
-
-
-SUITE(action)
-{
- /**********************************************************************
- * Language GUID tests
- **********************************************************************/
-
- TEST(ToolGuid_ReturnsCorrectGUID_OnC)
- {
- const char* result = vs200x_tool_guid("c");
- CHECK_EQUAL("8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942", result);
- }
-
- TEST(ToolGuid_ReturnsCorrectGUID_OnCpp)
- {
- const char* result = vs200x_tool_guid("c++");
- CHECK_EQUAL("8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942", result);
- }
-
- TEST(ToolGuid_ReturnsCorrectGUID_OnCSharp)
- {
- const char* result = vs200x_tool_guid("c#");
- CHECK_EQUAL("FAE04EC0-301F-11D3-BF4B-00C04F79EFBC", result);
- }
-
-
- /**********************************************************************
- * Language file extensions
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, ProjectExtension_IsVcproj_ForC)
- {
- project_set_language(prj, "c");
- const char* result = vs200x_project_file_extension(prj);
- CHECK_EQUAL(".vcproj", result);
- }
-
- TEST_FIXTURE(FxAction, ProjectExtension_IsVcproj_ForCpp)
- {
- project_set_language(prj, "c++");
- const char* result = vs200x_project_file_extension(prj);
- CHECK_EQUAL(".vcproj", result);
- }
-}
diff --git a/src/actions/vs200x/tests/vs200x_xml_tests.cpp b/src/actions/vs200x/tests/vs200x_xml_tests.cpp
deleted file mode 100644
index cc9ce36..0000000
--- a/src/actions/vs200x/tests/vs200x_xml_tests.cpp
+++ /dev/null
@@ -1,121 +0,0 @@
-/**
- * \file vs200x_xml_tests.cpp
- * \brief Automated tests for Visual Studio XML output functions.
- * \author Copyright (c) 2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "actions/tests/action_tests.h"
-extern "C" {
-#include "actions/vs200x/vs200x.h"
-#include "base/env.h"
-}
-
-
-SUITE(action)
-{
- /**********************************************************************
- * Element end tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, ElementEnd_SlashBracket_Vs2002)
- {
- env_set_action("vs2002");
- vs200x_element_end(strm, 0, "/>");
- CHECK_EQUAL("/>\n", buffer);
- }
-
- TEST_FIXTURE(FxAction, ElementEnd_SlashBracket_Vs2003)
- {
- env_set_action("vs2003");
- vs200x_element_end(strm, 0, "/>");
- CHECK_EQUAL("/>\n", buffer);
- }
-
- TEST_FIXTURE(FxAction, ElementEnd_SlashBracket_Vs2005)
- {
- env_set_action("vs2005");
- vs200x_element_end(strm, 0, "/>");
- CHECK_EQUAL("\n/>\n", buffer);
- }
-
- TEST_FIXTURE(FxAction, ElementEnd_SlashBracket_Vs2008)
- {
- env_set_action("vs2008");
- vs200x_element_end(strm, 0, "/>");
- CHECK_EQUAL("\n/>\n", buffer);
- }
-
- TEST_FIXTURE(FxAction, ElementEnd_Bracket_Vs2002)
- {
- env_set_action("vs2002");
- vs200x_element_end(strm, 0, ">");
- CHECK_EQUAL(">\n", buffer);
- }
-
- TEST_FIXTURE(FxAction, ElementEnd_Bracket_Vs2003)
- {
- env_set_action("vs2003");
- vs200x_element_end(strm, 0, ">");
- CHECK_EQUAL(">\n", buffer);
- }
-
- TEST_FIXTURE(FxAction, ElementEnd_Bracket_Vs2005)
- {
- env_set_action("vs2005");
- vs200x_element_end(strm, 0, ">");
- CHECK_EQUAL("\n\t>\n", buffer);
- }
-
- TEST_FIXTURE(FxAction, ElementEnd_Bracket_Vs2008)
- {
- env_set_action("vs2008");
- vs200x_element_end(strm, 0, ">");
- CHECK_EQUAL("\n\t>\n", buffer);
- }
-
-
- /**********************************************************************
- * Attribute tests
- **********************************************************************/
-
- TEST_FIXTURE(FxAction, Attribute_OnLevel0)
- {
- env_set_action("vs2002");
- vs200x_attribute(strm, 0, "ProjectType", "Visual C++");
- CHECK_EQUAL("\nProjectType=\"Visual C++\"", buffer);
- }
-
- TEST_FIXTURE(FxAction, Attribute_OnLevel3)
- {
- env_set_action("vs2002");
- vs200x_attribute(strm, 3, "ProjectType", "Visual C++");
- CHECK_EQUAL("\n\t\t\tProjectType=\"Visual C++\"", buffer);
- }
-
- TEST_FIXTURE(FxAction, Attribute_IsEscaped)
- {
- env_set_action("vs2002");
- vs200x_attribute(strm, 1, "PreprocessorSymbols", "DEBUG;MSG=\"Hello\";TRACE");
- CHECK_EQUAL("\n\tPreprocessorSymbols=\"DEBUG;MSG=&quot;Hello&quot;;TRACE\"", buffer);
- }
-
- TEST_FIXTURE(FxAction, AttributeList_OnLevel0)
- {
- const char* values[] = { "VALUE0", "VALUE1", "VALUE2", NULL };
- Strings strs = strings_create_from_array(values);
- vs200x_list_attribute(strm, 0, "Values", strs);
- CHECK_EQUAL("\nValues=\"VALUE0;VALUE1;VALUE2\"", buffer);
- strings_destroy(strs);
- }
-
- TEST_FIXTURE(FxAction, AttributeList_IsEscaped)
- {
- const char* values[] = { "VALUE0", "VALUE1=\"Hello\"", "VALUE2", NULL };
- Strings strs = strings_create_from_array(values);
- vs200x_list_attribute(strm, 0, "Values", strs);
- CHECK_EQUAL("\nValues=\"VALUE0;VALUE1=&quot;Hello&quot;;VALUE2\"", buffer);
- strings_destroy(strs);
- }
-
-}
diff --git a/src/actions/vs200x/vs2002.c b/src/actions/vs200x/vs2002.c
deleted file mode 100644
index 8abc23b..0000000
--- a/src/actions/vs200x/vs2002.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/**
- * \file vs2002.c
- * \brief Visual Studio 2002 project file generation action.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include <stdlib.h>
-#include "premake.h"
-#include "actions/actions.h"
-#include "vs200x.h"
-#include "vs200x_solution.h"
-#include "vs200x_project.h"
-
-
-/** The project features supported by this action */
-static SessionFeatures Features =
-{
- { "c", "c++", NULL },
-};
-
-
-/** The VS2002 solution writing process, for session_enumerate_objects() */
-static SessionSolutionCallback SolutionCallbacks[] =
-{
- vs200x_solution_create,
- vs2002_solution_signature,
- vs2002_solution_projects,
- vs2002_solution_configuration,
- vs2002_solution_dependencies,
- vs2002_solution_project_configuration,
- vs2002_solution_extensibility,
- NULL
-};
-
-/** The VS2002 project writing process, for session_enumerate_objects() */
-static SessionProjectCallback ProjectCallbacks[] =
-{
- vs200x_project_create,
- vs200x_project_encoding,
- vs200x_project_element,
- vs200x_project_platforms,
- vs200x_project_tool_files,
- session_enumerate_configurations,
- vs200x_project_references,
- vs200x_project_files,
- vs200x_project_globals,
- NULL
-};
-
-/** The VS2002 configuration writing process, for session_enumerate_configurations() */
-static SessionProjectCallback ConfigCallbacks[] =
-{
- vs200x_project_config_element,
- vs200x_project_vc_cl_compiler_tool,
- vs200x_project_vc_custom_build_tool,
- vs200x_project_vc_linker_tool,
- vs200x_project_vc_midl_tool,
- vs200x_project_vc_post_build_event_tool,
- vs200x_project_vc_pre_build_event_tool,
- vs200x_project_vc_pre_link_event_tool,
- vs200x_project_vc_resource_compiler_tool,
- vs200x_project_vc_web_service_proxy_generator_tool,
- vs200x_project_vc_web_deployment_tool,
- vs200x_project_config_end,
- NULL
-};
-
-
-/**
- * The Visual Studio 2002 action handler.
- * \param sess The active session object.
- * \returns OKAY if successful.
- */
-int vs2002_action(Session sess)
-{
- /* make sure I can support all of the features used in the session */
- if (session_validate(sess, &Features) != OKAY)
- {
- return !OKAY;
- }
-
- stream_writeline(Console, "Generating project files for Visual Studio 2002...");
- return session_enumerate_objects(sess, SolutionCallbacks, ProjectCallbacks, ConfigCallbacks);
-}
-
diff --git a/src/actions/vs200x/vs2002_solution.c b/src/actions/vs200x/vs2002_solution.c
deleted file mode 100644
index 2338fc4..0000000
--- a/src/actions/vs200x/vs2002_solution.c
+++ /dev/null
@@ -1,130 +0,0 @@
-/**
- * \file vs2002_solution.c
- * \brief Visual Studio 2002 solution generation functions.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include <assert.h>
-#include <stdlib.h>
-#include "premake.h"
-#include "vs200x.h"
-#include "vs200x_solution.h"
-#include "vs200x_project.h"
-#include "base/path.h"
-
-
-/**
- * Create the Visual Studio 2002 solution configuration block.
- */
-int vs2002_solution_configuration(Solution sln, Stream strm)
-{
- int i, n, z;
-
- z = stream_writeline(strm, "Global");
- z |= stream_writeline(strm, "\tGlobalSection(SolutionConfiguration) = preSolution");
-
- n = solution_num_configs(sln);
- for (i = 0; i < n; ++i)
- {
- const char* config_name = solution_get_config(sln, i);
- z |= stream_writeline(strm, "\t\tConfigName.%d = %s", i, config_name);
- }
-
- z |= stream_writeline(strm, "\tEndGlobalSection");
- return z;
-}
-
-
-/**
- * Create the Visual Studio 2002 project dependencies block.
- */
-int vs2002_solution_dependencies(Solution sln, Stream strm)
-{
- int z;
- UNUSED(sln);
- z = stream_writeline(strm, "\tGlobalSection(ProjectDependencies) = postSolution");
- z |= stream_writeline(strm, "\tEndGlobalSection");
- return z;
-}
-
-
-/**
- * Write out the Visual Studio 2002 solution extensibility block.
- */
-int vs2002_solution_extensibility(Solution sln, Stream strm)
-{
- int z;
- UNUSED(sln);
- z = stream_writeline(strm, "\tGlobalSection(ExtensibilityGlobals) = postSolution");
- z |= stream_writeline(strm, "\tEndGlobalSection");
- z |= stream_writeline(strm, "\tGlobalSection(ExtensibilityAddIns) = postSolution");
- z |= stream_writeline(strm, "\tEndGlobalSection");
- z |= stream_writeline(strm, "EndGlobal");
- return z;
-}
-
-
-/**
- * Write out the Visual Studio 2002 project configurations block.
- */
-int vs2002_solution_project_configuration(Solution sln, Stream strm)
-{
- int pi, pn, z;
- z = stream_writeline(strm, "\tGlobalSection(ProjectConfiguration) = postSolution");
- pn = solution_num_projects(sln);
- for (pi = 0; pi < pn; ++pi)
- {
- int ci, cn;
- Project prj = solution_get_project(sln, pi);
- const char* prj_id = project_get_guid(prj);
-
- cn = solution_num_configs(sln);
- for (ci = 0; ci < cn; ++ci)
- {
- const char* config_name = solution_get_config(sln, ci);
- z |= stream_writeline(strm, "\t\t{%s}.%s.ActiveCfg = %s|Win32", prj_id, config_name, config_name);
- z |= stream_writeline(strm, "\t\t{%s}.%s.Build.0 = %s|Win32", prj_id, config_name, config_name);
- }
- }
- z |= stream_writeline(strm, "\tEndGlobalSection");
- return z;
-}
-
-
-/**
- * Write out the list of projects contained by the solution.
- */
-int vs2002_solution_projects(Solution sln, Stream strm)
-{
- int i, n, z = OKAY;
- n = solution_num_projects(sln);
- for (i = 0; i < n; ++i)
- {
- Project prj = solution_get_project(sln, i);
- const char* prj_name = project_get_name(prj);
- const char* prj_id = project_get_guid(prj);
- const char* prj_lang = project_get_language(prj);
- const char* prj_ext = vs200x_project_file_extension(prj);
- const char* prj_file = project_get_filename_relative(prj, prj_name, prj_ext);
- const char* tool_id = vs200x_tool_guid(prj_lang);
-
- prj_file = path_translate(prj_file, "\\");
- z |= stream_writeline(strm, "Project(\"{%s}\") = \"%s\", \"%s\", \"{%s}\"", tool_id, prj_name, prj_file, prj_id);
- z |= stream_writeline(strm, "EndProject");
- }
-
- return z;
-}
-
-
-/**
- * Write the Visual Studio 2002 solution file signature.
- */
-int vs2002_solution_signature(Solution sln, Stream strm)
-{
- int z;
- UNUSED(sln);
- stream_set_newline(strm, "\r\n");
- z = stream_writeline(strm, "Microsoft Visual Studio Solution File, Format Version 7.00");
- return z;
-}
diff --git a/src/actions/vs200x/vs2003.c b/src/actions/vs200x/vs2003.c
deleted file mode 100644
index db83666..0000000
--- a/src/actions/vs200x/vs2003.c
+++ /dev/null
@@ -1,84 +0,0 @@
-/**
- * \file vs2003.c
- * \brief Visual Studio 2003 project file generation action.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include <stdlib.h>
-#include "premake.h"
-#include "actions/actions.h"
-#include "vs200x.h"
-#include "vs200x_solution.h"
-#include "vs200x_project.h"
-
-
-/** The project features supported by this action */
-static SessionFeatures Features =
-{
- { "c", "c++", NULL },
-};
-
-
-/** The VS2003 solution writing process, for session_enumerate_objects() */
-static SessionSolutionCallback SolutionCallbacks[] =
-{
- vs200x_solution_create,
- vs2003_solution_signature,
- vs2002_solution_projects,
- vs2003_solution_configuration,
- vs2002_solution_project_configuration,
- vs2002_solution_extensibility,
- NULL
-};
-
-/** The VS2003 project writing process, for session_enumerate_objects() */
-static SessionProjectCallback ProjectCallbacks[] =
-{
- vs200x_project_create,
- vs200x_project_encoding,
- vs200x_project_element,
- vs200x_project_platforms,
- vs200x_project_tool_files,
- session_enumerate_configurations,
- vs200x_project_references,
- vs200x_project_files,
- vs200x_project_globals,
- NULL
-};
-
-/** The VS2003 configuration writing process, for session_enumerate_configurations() */
-static SessionProjectCallback ConfigCallbacks[] =
-{
- vs200x_project_config_element,
- vs200x_project_vc_cl_compiler_tool,
- vs200x_project_vc_custom_build_tool,
- vs200x_project_vc_linker_tool,
- vs200x_project_vc_midl_tool,
- vs200x_project_vc_post_build_event_tool,
- vs200x_project_vc_pre_build_event_tool,
- vs200x_project_vc_pre_link_event_tool,
- vs200x_project_vc_resource_compiler_tool,
- vs200x_project_vc_web_service_proxy_generator_tool,
- vs200x_project_vc_xml_data_generator_tool,
- vs200x_project_vc_web_deployment_tool,
- vs200x_project_config_end,
- NULL
-};
-
-
-/**
- * The Visual Studio 2003 action handler.
- * \param sess The active session object.
- * \returns OKAY if successful.
- */
-int vs2003_action(Session sess)
-{
- /* make sure I can support all of the features used in the session */
- if (session_validate(sess, &Features) != OKAY)
- {
- return !OKAY;
- }
-
- stream_writeline(Console, "Generating project files for Visual Studio 2003...");
- return session_enumerate_objects(sess, SolutionCallbacks, ProjectCallbacks, ConfigCallbacks);
-}
diff --git a/src/actions/vs200x/vs2003_solution.c b/src/actions/vs200x/vs2003_solution.c
deleted file mode 100644
index 448cc70..0000000
--- a/src/actions/vs200x/vs2003_solution.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * \file vs2003_solution.c
- * \brief Visual Studio 2003 solution generation functions.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include <assert.h>
-#include <stdlib.h>
-#include "premake.h"
-#include "vs200x_solution.h"
-
-
-/**
- * Create the Visual Studio 2003 solution configuration block.
- */
-int vs2003_solution_configuration(Solution sln, Stream strm)
-{
- int i, n, z;
-
- z = stream_writeline(strm, "Global");
- z |= stream_writeline(strm, "\tGlobalSection(SolutionConfiguration) = preSolution");
-
- n = solution_num_configs(sln);
- for (i = 0; i < n; ++i)
- {
- const char* config_name = solution_get_config(sln, i);
- z |= stream_writeline(strm, "\t\t%s = %s", config_name, config_name);
- }
-
- z |= stream_writeline(strm, "\tEndGlobalSection");
- return z;
-}
-
-
-/**
- * Write the Visual Studio 2003 solution file signature.
- */
-int vs2003_solution_signature(Solution sln, Stream strm)
-{
- int z;
- UNUSED(sln);
- stream_set_newline(strm, "\r\n");
- z = stream_writeline(strm, "Microsoft Visual Studio Solution File, Format Version 8.00");
- return z;
-}
diff --git a/src/actions/vs200x/vs2005.c b/src/actions/vs200x/vs2005.c
deleted file mode 100644
index 47e835c..0000000
--- a/src/actions/vs200x/vs2005.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/**
- * \file vs2005.c
- * \brief Visual Studio 2005 project file generation action.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include <stdlib.h>
-#include "premake.h"
-#include "actions/actions.h"
-#include "vs200x.h"
-#include "vs200x_solution.h"
-#include "vs200x_project.h"
-
-
-/** The project features supported by this action */
-static SessionFeatures Features =
-{
- { "c", "c++", NULL },
-};
-
-
-/** The VS2005 solution writing process, for session_enumerate_objects() */
-static SessionSolutionCallback SolutionCallbacks[] =
-{
- vs200x_solution_create,
- vs2005_solution_signature,
- vs2002_solution_projects,
- vs2005_solution_platforms,
- vs2005_solution_project_platforms,
- vs2005_solution_properties,
- NULL
-};
-
-/** The VS2005 project writing process, for session_enumerate_objects() */
-static SessionProjectCallback ProjectCallbacks[] =
-{
- vs200x_project_create,
- vs200x_project_encoding,
- vs200x_project_element,
- vs200x_project_platforms,
- vs200x_project_tool_files,
- session_enumerate_configurations,
- vs200x_project_references,
- vs200x_project_files,
- vs200x_project_globals,
- NULL
-};
-
-/** The VS2005 configuration writing process, for session_enumerate_configurations() */
-static SessionProjectCallback ConfigCallbacks[] =
-{
- vs200x_project_config_element,
- vs200x_project_vc_pre_build_event_tool,
- vs200x_project_vc_custom_build_tool,
- vs200x_project_vc_xml_data_generator_tool,
- vs200x_project_vc_web_service_proxy_generator_tool,
- vs200x_project_vc_midl_tool,
- vs200x_project_vc_cl_compiler_tool,
- vs200x_project_vc_managed_resource_compiler_tool,
- vs200x_project_vc_resource_compiler_tool,
- vs200x_project_vc_pre_link_event_tool,
- vs200x_project_vc_linker_tool,
- vs200x_project_vc_alink_tool,
- vs200x_project_vc_manifest_tool,
- vs200x_project_vc_xdc_make_tool,
- vs200x_project_vc_bsc_make_tool,
- vs200x_project_vc_fx_cop_tool,
- vs200x_project_vc_app_verifier_tool,
- vs200x_project_vc_web_deployment_tool,
- vs200x_project_vc_post_build_event_tool,
- vs200x_project_config_end,
- NULL
-};
-
-
-/**
- * The Visual Studio 2005 action handler.
- * \param sess The active session object.
- * \returns OKAY if successful.
- */
-int vs2005_action(Session sess)
-{
- /* make sure I can support all of the features used in the session */
- if (session_validate(sess, &Features) != OKAY)
- {
- return !OKAY;
- }
-
- stream_writeline(Console, "Generating project files for Visual Studio 2005...");
- return session_enumerate_objects(sess, SolutionCallbacks, ProjectCallbacks, ConfigCallbacks);
-}
-
diff --git a/src/actions/vs200x/vs2005_solution.c b/src/actions/vs200x/vs2005_solution.c
deleted file mode 100644
index 6a659d0..0000000
--- a/src/actions/vs200x/vs2005_solution.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/**
- * \file vs2005_solution.c
- * \brief Visual Studio 2005 solution generation functions.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include <assert.h>
-#include <stdlib.h>
-#include "premake.h"
-#include "vs200x_solution.h"
-
-
-/**
- * Write out the Visual Studio solution-level platform configuration block.
- */
-int vs2005_solution_platforms(Solution sln, Stream strm)
-{
- int i, n, z;
-
- z = stream_writeline(strm, "Global");
- z |= stream_writeline(strm, "\tGlobalSection(SolutionConfigurationPlatforms) = preSolution");
-
- n = solution_num_configs(sln);
- for (i = 0; i < n; ++i)
- {
- const char* config_name = solution_get_config(sln, i);
- z |= stream_writeline(strm, "\t\t%s|Win32 = %s|Win32", config_name, config_name);
- }
-
- z |= stream_writeline(strm, "\tEndGlobalSection");
- return z;
-}
-
-
-/**
- * Write out the Visual Studio 2005 project-level platform configurations block.
- */
-int vs2005_solution_project_platforms(Solution sln, Stream strm)
-{
- int pi, pn, z;
- z = stream_writeline(strm, "\tGlobalSection(ProjectConfigurationPlatforms) = postSolution");
- pn = solution_num_projects(sln);
- for (pi = 0; pi < pn; ++pi)
- {
- int ci, cn;
- Project prj = solution_get_project(sln, pi);
- const char* prj_id = project_get_guid(prj);
-
- cn = solution_num_configs(sln);
- for (ci = 0; ci < cn; ++ci)
- {
- const char* config_name = solution_get_config(sln, ci);
- z |= stream_writeline(strm, "\t\t{%s}.%s|Win32.ActiveCfg = %s|Win32", prj_id, config_name, config_name);
- z |= stream_writeline(strm, "\t\t{%s}.%s|Win32.Build.0 = %s|Win32", prj_id, config_name, config_name);
- }
- }
- z |= stream_writeline(strm, "\tEndGlobalSection");
- return z;
-}
-
-
-/**
- * Write out the Visual Studio 2005 solution properties block.
- */
-int vs2005_solution_properties(Solution sln, Stream strm)
-{
- int z;
- UNUSED(sln);
- z = stream_writeline(strm, "\tGlobalSection(SolutionProperties) = preSolution");
- z |= stream_writeline(strm, "\t\tHideSolutionNode = FALSE");
- z |= stream_writeline(strm, "\tEndGlobalSection");
- z |= stream_writeline(strm, "EndGlobal");
- return z;
-}
-
-
-/**
- * Write the Visual Studio 2005 solution file signature.
- */
-int vs2005_solution_signature(Solution sln, Stream strm)
-{
- int z;
- UNUSED(sln);
- stream_set_newline(strm, "\r\n");
- z = stream_write_unicode_marker(strm);
- z |= stream_writeline(strm, "");
- z |= stream_writeline(strm, "Microsoft Visual Studio Solution File, Format Version 9.00");
- z |= stream_writeline(strm, "# Visual Studio 2005");
- return z;
-}
diff --git a/src/actions/vs200x/vs2008.c b/src/actions/vs200x/vs2008.c
deleted file mode 100644
index 9af42ad..0000000
--- a/src/actions/vs200x/vs2008.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/**
- * \file vs2008.c
- * \brief Visual Studio 2008 project file generation action.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include <stdlib.h>
-#include "premake.h"
-#include "actions/actions.h"
-#include "vs200x.h"
-#include "vs200x_solution.h"
-#include "vs200x_project.h"
-
-
-/** The project features supported by this action */
-static SessionFeatures Features =
-{
- { "c", "c++", NULL },
-};
-
-
-/** The VS2008 solution writing process, for session_enumerate_objects() */
-static SessionSolutionCallback SolutionCallbacks[] =
-{
- vs200x_solution_create,
- vs2008_solution_signature,
- vs2002_solution_projects,
- vs2005_solution_platforms,
- vs2005_solution_project_platforms,
- vs2005_solution_properties,
- NULL
-};
-
-/** The VS2008 project writing process, for session_enumerate_objects() */
-static SessionProjectCallback ProjectCallbacks[] =
-{
- vs200x_project_create,
- vs200x_project_encoding,
- vs200x_project_element,
- vs200x_project_platforms,
- vs200x_project_tool_files,
- session_enumerate_configurations,
- vs200x_project_references,
- vs200x_project_files,
- vs200x_project_globals,
- NULL
-};
-
-/** The VS2008 configuration writing process, for session_enumerate_configurations() */
-static SessionProjectCallback ConfigCallbacks[] =
-{
- vs200x_project_config_element,
- vs200x_project_vc_pre_build_event_tool,
- vs200x_project_vc_custom_build_tool,
- vs200x_project_vc_xml_data_generator_tool,
- vs200x_project_vc_web_service_proxy_generator_tool,
- vs200x_project_vc_midl_tool,
- vs200x_project_vc_cl_compiler_tool,
- vs200x_project_vc_managed_resource_compiler_tool,
- vs200x_project_vc_resource_compiler_tool,
- vs200x_project_vc_pre_link_event_tool,
- vs200x_project_vc_linker_tool,
- vs200x_project_vc_alink_tool,
- vs200x_project_vc_manifest_tool,
- vs200x_project_vc_xdc_make_tool,
- vs200x_project_vc_bsc_make_tool,
- vs200x_project_vc_fx_cop_tool,
- vs200x_project_vc_app_verifier_tool,
- vs200x_project_vc_post_build_event_tool,
- vs200x_project_config_end,
- NULL
-};
-
-
-/**
- * The Visual Studio 2008 action handler.
- * \param sess The active session object.
- * \returns OKAY if successful.
- */
-int vs2008_action(Session sess)
-{
- /* make sure I can support all of the features used in the session */
- if (session_validate(sess, &Features) != OKAY)
- {
- return !OKAY;
- }
-
- stream_writeline(Console, "Generating project files for Visual Studio 2008...");
- return session_enumerate_objects(sess, SolutionCallbacks, ProjectCallbacks, ConfigCallbacks);
-}
-
diff --git a/src/actions/vs200x/vs2008_solution.c b/src/actions/vs200x/vs2008_solution.c
deleted file mode 100644
index d116a53..0000000
--- a/src/actions/vs200x/vs2008_solution.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/**
- * \file vs2008_solution.c
- * \brief Visual Studio 2008 solution generation functions.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "vs200x_solution.h"
-
-
-/**
- * Write the Visual Studio 2008 solution file signature.
- */
-int vs2008_solution_signature(Solution sln, Stream strm)
-{
- int z;
- UNUSED(sln);
- stream_set_newline(strm, "\r\n");
- z = stream_write_unicode_marker(strm);
- z |= stream_writeline(strm, "");
- z |= stream_writeline(strm, "Microsoft Visual Studio Solution File, Format Version 10.00");
- z |= stream_writeline(strm, "# Visual Studio 2008");
- return z;
-}
diff --git a/src/actions/vs200x/vs200x.c b/src/actions/vs200x/vs200x.c
deleted file mode 100644
index 9273c19..0000000
--- a/src/actions/vs200x/vs200x.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/**
- * \file vs200x.c
- * \brief General purpose Visual Studio support functions.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "premake.h"
-#include "vs200x.h"
-#include "base/buffers.h"
-#include "base/cstr.h"
-#include "base/env.h"
-#include "base/error.h"
-
-
-/**
- * Write an XML attribute, adjusting for the differing Visual Studio formats.
- * \param strm The output stream, the attribute will be written here.
- * \param indent_size How far to indent (with tabs) the attribute.
- * \param name The attribute name.
- * \param value The attribute value; may contain printf-style formatting codes.
- * \returns OKAY if successful.
- */
-int vs200x_attribute(Stream strm, int indent_size, const char* name, const char* value, ...)
-{
- va_list args;
- char* buffer;
- int z = OKAY;
-
- z |= stream_writeline(strm, "");
- z |= stream_write_n(strm, "\t", indent_size);
- z |= stream_write(strm, "%s=\"", name);
-
- buffer = buffers_next();
- va_start(args, value);
- vsprintf(buffer, value, args);
- z |= stream_write_escaped(strm, buffer);
- va_end(args);
-
- z |= stream_write(strm, "\"");
- return z;
-}
-
-
-/**
- * Write an XML attribute containing a list of values, adjusting for the differing Visual Studio formats.
- * \param strm The output stream, the attribute will be written here.
- * \param indent_size How far to indent (with tabs) the attribute.
- * \param name The attribute name.
- * \param values The attribute list value.
- * \returns OKAY if successful.
- */
-int vs200x_list_attribute(Stream strm, int indent_size, const char* name, Strings values)
-{
- int z = OKAY;
-
- z |= stream_writeline(strm, "");
- z |= stream_write_n(strm, "\t", indent_size);
- z |= stream_write(strm, "%s=", name);
- z |= stream_write_strings(strm, values, "\"", "", "", ";", "\"", stream_write_escaped);
- return z;
-}
-
-
-/**
- * Write the ending part of an XML tag, adjust for the differing Visual Studio formats.
- * \param strm The output stream.
- * \param level The XML element nesting level.
- * \param markup The end tag markup.
- * \returns OKAY if successful.
- */
-int vs200x_element_end(Stream strm, int level, const char* markup)
-{
- int z, version;
-
- version = vs200x_get_target_version();
- if (version >= 2005)
- {
- z = stream_writeline(strm, "");
- if (markup[0] == '>')
- {
- level++;
- }
- z |= stream_write_n(strm, "\t", level);
- z |= stream_writeline(strm, "%s", markup);
- }
- else
- {
- z = stream_writeline(strm, markup);
- }
- return z;
-}
-
-
-/**
- * Return the Visual Studio version appropriate version of the string for a false
- * value. Before 2005 this was "FALSE", after it is "false".
- */
-const char* vs200x_false(void)
-{
- int version = vs200x_get_target_version();
- return (version < 2005) ? "FALSE" : "false";
-}
-
-
-/**
- * Converts the session action string to a Visual Studio version number.
- * \returns The Visual Studio version number corresponding to the current action.
- */
-int vs200x_get_target_version(void)
-{
- const char* action = env_get_action();
- if (cstr_eq(action, "vs2002"))
- {
- return 2002;
- }
- else if (cstr_eq(action, "vs2003"))
- {
- return 2003;
- }
- else if (cstr_eq(action, "vs2005"))
- {
- return 2005;
- }
- else if (cstr_eq(action, "vs2008"))
- {
- return 2008;
- }
- else
- {
- assert(0);
- return 0;
- }
-}
-
-
-/**
- * Return the appropriate file extension for a particular project.
- * \param prj The project object.
- * \returns The appropriate project file extension, based on the project settings.
- */
-const char* vs200x_project_file_extension(Project prj)
-{
- const char* language = project_get_language(prj);
- if (cstr_eq(language, "c") || cstr_eq(language, "c++"))
- {
- return ".vcproj";
- }
- else
- {
- error_set("unsupported language '%s'", language);
- return NULL;
- }
-}
-
-
-/**
- * Returns the Visual Studio GUID for a particular project type.
- * \param language The programming language used in the project.
- * \returns The GUID corresponding the programming language.
- */
-const char* vs200x_tool_guid(const char* language)
-{
- if (cstr_eq(language, "c") || cstr_eq(language, "c++"))
- {
- return "8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942";
- }
- else if (cstr_eq(language, "c#"))
- {
- return "FAE04EC0-301F-11D3-BF4B-00C04F79EFBC";
- }
- else
- {
- error_set("unsupported language '%s'", language);
- return NULL;
- }
-}
-
-
-/**
- * Return the Visual Studio version appropriate version of the string for a true
- * value. Before 2005 this was "TRUE", after it is "true".
- */
-const char* vs200x_true(void)
-{
- int version = vs200x_get_target_version();
- return (version < 2005) ? "TRUE" : "true";
-}
diff --git a/src/actions/vs200x/vs200x.h b/src/actions/vs200x/vs200x.h
deleted file mode 100644
index 3069b8d..0000000
--- a/src/actions/vs200x/vs200x.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * \file vs200x.h
- * \brief General purpose Visual Studio support functions.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-#if !defined(PREMAKE_VS200X_H)
-#define PREMAKE_VS200X_H
-
-#include "objects/project.h"
-#include "base/stream.h"
-
-int vs200x_attribute(Stream strm, int indent_size, const char* name, const char* value, ...);
-int vs200x_list_attribute(Stream strm, int indent_size, const char* name, Strings values);
-int vs200x_element_end(Stream strm, int level, const char* markup);
-const char* vs200x_false(void);
-int vs200x_get_target_version(void);
-const char* vs200x_project_file_extension(Project prj);
-const char* vs200x_tool_guid(const char* language);
-const char* vs200x_true(void);
-
-#endif
-
diff --git a/src/actions/vs200x/vs200x_config.c b/src/actions/vs200x/vs200x_config.c
deleted file mode 100644
index a631c57..0000000
--- a/src/actions/vs200x/vs200x_config.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/**
- * \file vs200x_config.c
- * \brief Visual Studio 200x configuration generation functions.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "vs200x.h"
-#include "vs200x_config.h"
-
-
-int vs200x_config_character_set(Stream strm)
-{
- return vs200x_attribute(strm, 3, "CharacterSet", vs200x_get_target_version() > 2003 ? "1" : "2");
-}
-
-
-int vs200x_config_debug_information_format(Project prj, Stream strm)
-{
- const char* value;
- if (!project_has_flag(prj, "Symbols"))
- {
- value = "0";
- }
- else if (project_has_flag(prj, "Managed") ||
- project_has_flag(prj, "Optimize") ||
- project_has_flag(prj, "OptimizeSize") ||
- project_has_flag(prj, "OptimizeSpeed") ||
- project_has_flag(prj, "NoEditAndContinue"))
- {
- value = "3";
- }
- else
- {
- value = "4";
- }
-
- return vs200x_attribute(strm, 4, "DebugInformationFormat", value);
-}
-
-
-/**
- * Write out the list of preprocessor symbols as defined by the configuration.
- * This entry is only written if there are values to write.
- */
-int vs200x_config_defines(Project prj, Stream strm)
-{
- Strings values = project_get_config_values(prj, BlockDefines);
- if (strings_size(values) > 0)
- {
- return vs200x_list_attribute(strm, 4, "PreprocessorDefinitions", values);
- }
-
- return OKAY;
-}
-
-
-int vs200x_config_detect_64bit_portability(Stream strm)
-{
- if (vs200x_get_target_version() < 2008)
- {
- return vs200x_attribute(strm, 4, "Detect64BitPortabilityProblems", vs200x_true());
- }
- return OKAY;
-}
-
-
-int vs200x_config_generate_debug_information(Project prj, Stream strm)
-{
- int z = OKAY;
- if (project_has_flag(prj, "Symbols"))
- {
- z |= vs200x_attribute(strm, 4, "GenerateDebugInformation", vs200x_true());
- z |= vs200x_attribute(strm, 4, "ProgramDatabaseFile", "$(OutDir)/%s.pdb", project_get_name(prj));
- }
- else
- {
- z |= vs200x_attribute(strm, 4, "GenerateDebugInformation", vs200x_false());
- }
- return z;
-}
-
-
-int vs200x_config_optimization(Project prj, Stream strm)
-{
- const char* value;
- if (project_has_flag(prj, "Optimize"))
- {
- value = "3";
- }
- else if (project_has_flag(prj, "OptimizeSize"))
- {
- value= "1";
- }
- else if (project_has_flag(prj, "OptimizeSpeed"))
- {
- value = "2";
- }
- else
- {
- value = "0";
- }
- return vs200x_attribute(strm, 4, "Optimization", value);
-}
-
-
-int vs200x_config_runtime_type_info(Stream strm)
-{
- if (vs200x_get_target_version() < 2005)
- {
- return vs200x_attribute(strm, 4, "RuntimeTypeInfo", vs200x_true());
- }
- return OKAY;
-}
-
-
-int vs200x_config_use_precompiled_header(Stream strm)
-{
- return vs200x_attribute(strm, 4, "UsePrecompiledHeader", vs200x_get_target_version() > 2003 ? "0" : "2");
-}
diff --git a/src/actions/vs200x/vs200x_config.h b/src/actions/vs200x/vs200x_config.h
deleted file mode 100644
index 4f346ba..0000000
--- a/src/actions/vs200x/vs200x_config.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/**
- * \file vs200x_config.h
- * \brief Visual Studio 200x configuration generation functions.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-#if !defined(PREMAKE_VS200X_CONFIG_H)
-#define PREMAKE_VS200X_CONFIG_H
-
-int vs200x_config_character_set(Stream strm);
-int vs200x_config_debug_information_format(Project prj, Stream strm);
-int vs200x_config_defines(Project prj, Stream strm);
-int vs200x_config_detect_64bit_portability(Stream strm);
-int vs200x_config_generate_debug_information(Project prj, Stream strm);
-int vs200x_config_optimization(Project prj, Stream strm);
-int vs200x_config_runtime_type_info(Stream strm);
-int vs200x_config_use_precompiled_header(Stream strm);
-
-#endif
diff --git a/src/actions/vs200x/vs200x_project.c b/src/actions/vs200x/vs200x_project.c
deleted file mode 100644
index 4018be8..0000000
--- a/src/actions/vs200x/vs200x_project.c
+++ /dev/null
@@ -1,472 +0,0 @@
-/**
- * \file vs200x_project.c
- * \brief Visual Studio multiple-version project generation functions.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include "premake.h"
-#include "vs200x.h"
-#include "vs200x_project.h"
-#include "vs200x_config.h"
-#include "actions/support/sourcetree.h"
-#include "base/cstr.h"
-#include "base/path.h"
-
-
-/**
- * Write the opening [Configuration] element and attributes.
- */
-int vs200x_project_config_element(Project prj, Stream strm)
-{
- int z = OKAY;
- const char* cfg_name = project_get_config(prj);
-
- z |= stream_write(strm, "\t\t<Configuration");
- z |= vs200x_attribute(strm, 3, "Name", "%s|Win32", cfg_name);
- z |= vs200x_attribute(strm, 3, "OutputDirectory", "$(SolutionDir)$(ConfigurationName)");
- z |= vs200x_attribute(strm, 3, "IntermediateDirectory", "$(ConfigurationName)");
- z |= vs200x_attribute(strm, 3, "ConfigurationType", "1");
- z |= vs200x_config_character_set(strm);
- z |= vs200x_element_end(strm, 2, ">");
- return z;
-}
-
-
-/**
- * Write the closing [Configuration] element.
- */
-int vs200x_project_config_end(Project prj, Stream strm)
-{
- UNUSED(prj);
- return stream_writeline(strm, "\t\t</Configuration>");
-}
-
-
-/**
- * Create a new output stream for a project, and make it active for subsequent writes.
- */
-int vs200x_project_create(Project prj, Stream strm)
-{
- /* create the project file */
- const char* extension = vs200x_project_file_extension(prj);
- const char* filename = project_get_filename(prj, NULL, extension);
- strm = stream_create_file(filename);
- if (!strm)
- {
- return !OKAY;
- }
-
- /* make the stream active for the functions that come after */
- session_set_active_stream(project_get_session(prj), strm);
- return OKAY;
-}
-
-
-/**
- * Write the root [VisualStudioProject] element and attributes.
- */
-int vs200x_project_element(Project prj, Stream strm)
-{
- int version, z;
- const char* prj_ver;
- const char* prj_name = project_get_name(prj);
- const char* prj_guid = project_get_guid(prj);
-
- version = vs200x_get_target_version();
- switch (version)
- {
- default:
- prj_ver = "7.00"; break;
- case 2003:
- prj_ver = "7.10"; break;
- case 2005:
- prj_ver = "8.00"; break;
- case 2008:
- prj_ver = "9.00"; break;
- }
-
- z = stream_write(strm, "<VisualStudioProject");
- z |= vs200x_attribute(strm, 1, "ProjectType", "Visual C++");
- z |= vs200x_attribute(strm, 1, "Version", prj_ver);
- z |= vs200x_attribute(strm, 1, "Name", prj_name);
- z |= vs200x_attribute(strm, 1, "ProjectGUID", "{%s}", prj_guid);
- if (version > 2003)
- {
- z |= vs200x_attribute(strm, 1, "RootNamespace", cstr_to_identifier(prj_name));
- }
- z |= vs200x_attribute(strm, 1, "Keyword", "Win32Proj");
- if (version > 2005)
- {
- z |= vs200x_attribute(strm, 1, "TargetFrameworkVersion", "196613");
- }
- z |= vs200x_element_end(strm, 0, ">");
-
- return z;
-}
-
-
-/**
- * Write the file encoding at the start of the project file.
- */
-int vs200x_project_encoding(Project prj, Stream strm)
-{
- int z;
- UNUSED(prj);
-
- stream_set_newline(strm, "\r\n");
- z = stream_writeline(strm, "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>");
- return z;
-}
-
-
-/**
- * Write an individual file entry to the project file; callback for sourcetree_walk().
- * \param prj The current project; contains the file being enumerated.
- * \param strm The active output stream; for writing the file markup.
- * \param filename The name of the file to process.
- * \param state One of the ActionSourceStates, enabling file grouping.
- * \returns OKAY if successful.
- */
-int vs200x_project_file(Project prj, Stream strm, const char* filename, int state)
-{
- const char* name;
- const char* ptr;
- int depth, z = OKAY;
-
- /* figure out the grouping depth, skipping over any leading dot directories */
- depth = 2;
-
- ptr = filename;
- while (cstr_starts_with(ptr, "../"))
- {
- ptr += 3;
- }
-
- ptr = strchr(ptr, '/');
- while (ptr != NULL)
- {
- depth++;
- ptr = strchr(ptr + 1, '/');
- }
-
- /* group name is just the last bit of the path */
- name = path_filename(filename);
-
- /* use the Windows path separator */
- filename = path_translate(filename, "\\");
-
- switch (state)
- {
- case GroupStart:
- if (strlen(filename) > 0 && !cstr_eq(name, ".."))
- {
- z |= stream_write_n(strm, "\t", depth);
- z |= stream_write(strm, "<Filter");
- z |= vs200x_attribute(strm, depth + 1, "Name", name);
- z |= vs200x_attribute(strm, depth + 1, "Filter", "");
- z |= vs200x_element_end(strm, depth, ">");
- }
- break;
-
- case GroupEnd:
- if (strlen(filename) > 0 && !cstr_eq(name, ".."))
- {
- z |= stream_write_n(strm, "\t", depth);
- z |= stream_writeline(strm, "</Filter>");
- }
- break;
-
- case SourceFile:
- z |= stream_write_n(strm, "\t", depth);
- z |= stream_write(strm, "<File");
- ptr = (filename[0] == '.') ? "" : ".\\";
- z |= vs200x_attribute(strm, depth + 1, "RelativePath", "%s%s", ptr, filename);
- z |= vs200x_element_end(strm, depth, ">");
- z |= stream_write_n(strm, "\t", depth);
- z |= stream_writeline(strm, "</File>");
- break;
- }
-
- UNUSED(prj);
- return z;
-}
-
-
-/**
- * Write out the [Files] element.
- */
-int vs200x_project_files(Project prj, Stream strm)
-{
- int z = OKAY;
- z |= stream_writeline(strm, "\t<Files>");
- z |= sourcetree_walk(prj, strm, vs200x_project_file);
- z |= stream_writeline(strm, "\t</Files>");
- return z;
-}
-
-
-/**
- * Write out the [Globals] element.
- */
-int vs200x_project_globals(Project prj, Stream strm)
-{
- int z = OKAY;
- UNUSED(prj);
- z |= stream_writeline(strm, "\t<Globals>");
- z |= stream_writeline(strm, "\t</Globals>");
- z |= stream_writeline(strm, "</VisualStudioProject>");
- return z;
-}
-
-
-/**
- * Write out the platforms section of a project file.
- */
-int vs200x_project_platforms(Project prj, Stream strm)
-{
- int z = OKAY;
- UNUSED(prj);
- z |= stream_writeline(strm, "\t<Platforms>");
- z |= stream_write(strm, "\t\t<Platform");
- z |= vs200x_attribute(strm, 3, "Name", "Win32");
- z |= vs200x_element_end(strm, 2, "/>");
- z |= stream_writeline(strm, "\t</Platforms>");
- return OKAY;
-}
-
-
-/**
- * Write out the [References] element and attributes.
- */
-int vs200x_project_references(Project prj, Stream strm)
-{
- int z;
- UNUSED(prj);
-
- z = stream_writeline(strm, "\t</Configurations>");
- if (vs200x_get_target_version() > 2002)
- {
- z |= stream_writeline(strm, "\t<References>");
- z |= stream_writeline(strm, "\t</References>");
- }
- return z;
-}
-
-
-/**
- * Write out the [ToolFiles] section of a Visual Studio project.
- */
-int vs200x_project_tool_files(Project prj, Stream strm)
-{
- int z = OKAY;
- UNUSED(prj);
-
- if (vs200x_get_target_version() > 2003)
- {
- z |= stream_writeline(strm, "\t<ToolFiles>");
- z |= stream_writeline(strm, "\t</ToolFiles>");
- }
- z |= stream_writeline(strm, "\t<Configurations>");
- return z;
-}
-
-
-/**
- * Common function to write an empty [Tool] element.
- */
-static int vs200x_project_vc_empty_tool(Project prj, Stream strm, const char* name)
-{
- int z = OKAY;
- UNUSED(prj);
- z |= stream_write(strm, "\t\t\t<Tool");
- z |= vs200x_attribute(strm, 4, "Name", name);
- z |= vs200x_element_end(strm, 3, "/>");
- return z;
-}
-
-
-/**
- * Write the VCALinkTool [Tool] element and attributes.
- */
-int vs200x_project_vc_alink_tool(Project prj, Stream strm)
-{
- return vs200x_project_vc_empty_tool(prj, strm, "VCALinkTool");
-}
-
-
-/**
- * Write the VCAppVerifierTool [Tool] element and attributes.
- */
-int vs200x_project_vc_app_verifier_tool(Project prj, Stream strm)
-{
- return vs200x_project_vc_empty_tool(prj, strm, "VCAppVerifierTool");
-}
-
-
-/**
- * Write the VCBscMakeTool [Tool] element and attributes.
- */
-int vs200x_project_vc_bsc_make_tool(Project prj, Stream strm)
-{
- return vs200x_project_vc_empty_tool(prj, strm, "VCBscMakeTool");
-}
-
-
-/**
- * Write the VCCLCompilerTool [Tool] element and attributes.
- */
-int vs200x_project_vc_cl_compiler_tool(Project prj, Stream strm)
-{
- int z = OKAY;
- z |= stream_write(strm, "\t\t\t<Tool");
- z |= vs200x_attribute(strm, 4, "Name", "VCCLCompilerTool");
- z |= vs200x_config_optimization(prj, strm);
- z |= vs200x_config_defines(prj, strm);
- z |= vs200x_attribute(strm, 4, "MinimalRebuild", vs200x_true());
- z |= vs200x_attribute(strm, 4, "BasicRuntimeChecks", "3");
- z |= vs200x_attribute(strm, 4, "RuntimeLibrary", "3");
- z |= vs200x_config_runtime_type_info(strm);
- z |= vs200x_config_use_precompiled_header(strm);
- z |= vs200x_attribute(strm, 4, "WarningLevel", "3");
- z |= vs200x_config_detect_64bit_portability(strm);
- z |= vs200x_config_debug_information_format(prj, strm);
- z |= vs200x_element_end(strm, 3, "/>");
- return z;
-}
-
-
-/**
- * Write the VCCustomBuildTool [Tool] element and attributes.
- */
-int vs200x_project_vc_custom_build_tool(Project prj, Stream strm)
-{
- return vs200x_project_vc_empty_tool(prj, strm, "VCCustomBuildTool");
-}
-
-
-/**
- * Write the VCFxCopTool [Tool] element and attributes.
- */
-int vs200x_project_vc_fx_cop_tool(Project prj, Stream strm)
-{
- return vs200x_project_vc_empty_tool(prj, strm, "VCFxCopTool");
-}
-
-
-/**
- * Write the VCLinkerTool [Tool] element and attributes.
- */
-int vs200x_project_vc_linker_tool(Project prj, Stream strm)
-{
- int z = OKAY;
- z |= stream_write(strm, "\t\t\t<Tool");
- z |= vs200x_attribute(strm, 4, "Name", "VCLinkerTool");
- z |= vs200x_attribute(strm, 4, "LinkIncremental", "2");
- z |= vs200x_config_generate_debug_information(prj, strm);
- z |= vs200x_attribute(strm, 4, "SubSystem", "1");
- z |= vs200x_attribute(strm, 4, "EntryPointSymbol", "mainCRTStartup");
- z |= vs200x_attribute(strm, 4, "TargetMachine", "1");
- z |= vs200x_element_end(strm, 3, "/>");
- return z;
-}
-
-
-/**
- * Write the VCManagedResourceCompilerTool [Tool] element and attributes.
- */
-int vs200x_project_vc_managed_resource_compiler_tool(Project prj, Stream strm)
-{
- return vs200x_project_vc_empty_tool(prj, strm, "VCManagedResourceCompilerTool");
-}
-
-
-/**
- * Write the VCManifestTool [Tool] element and attributes.
- */
-int vs200x_project_vc_manifest_tool(Project prj, Stream strm)
-{
- return vs200x_project_vc_empty_tool(prj, strm, "VCManifestTool");
-}
-
-
-/**
- * Write the VCMIDLTool [Tool] element and attributes.
- */
-int vs200x_project_vc_midl_tool(Project prj, Stream strm)
-{
- return vs200x_project_vc_empty_tool(prj, strm, "VCMIDLTool");
-}
-
-
-/**
- * Write the VCPreBuildEventTool [Tool] element and attributes.
- */
-int vs200x_project_vc_pre_build_event_tool(Project prj, Stream strm)
-{
- return vs200x_project_vc_empty_tool(prj, strm, "VCPreBuildEventTool");
-}
-
-
-/**
- * Write the VCPreLinkEventTool [Tool] element and attributes.
- */
-int vs200x_project_vc_pre_link_event_tool(Project prj, Stream strm)
-{
- return vs200x_project_vc_empty_tool(prj, strm, "VCPreLinkEventTool");
-}
-
-
-/**
- * Write the VCPostBuildEventTool [Tool] element and attributes.
- */
-int vs200x_project_vc_post_build_event_tool(Project prj, Stream strm)
-{
- return vs200x_project_vc_empty_tool(prj, strm, "VCPostBuildEventTool");
-}
-
-
-/**
- * Write the VCResourceCompiler [Tool] element and attributes.
- */
-int vs200x_project_vc_resource_compiler_tool(Project prj, Stream strm)
-{
- return vs200x_project_vc_empty_tool(prj, strm, "VCResourceCompilerTool");
-}
-
-
-/**
- * Write the VCWebDeploymentTool [Tool] element and attributes.
- */
-int vs200x_project_vc_web_deployment_tool(Project prj, Stream strm)
-{
- return vs200x_project_vc_empty_tool(prj, strm, "VCWebDeploymentTool");
-}
-
-
-/**
- * Write the VCWebServiceProxyGeneratorTool [Tool] element and attributes.
- */
-int vs200x_project_vc_web_service_proxy_generator_tool(Project prj, Stream strm)
-{
- return vs200x_project_vc_empty_tool(prj, strm, "VCWebServiceProxyGeneratorTool");
-}
-
-
-/**
- * Write the VCXDCMakeTool [Tool] element and attributes.
- */
-int vs200x_project_vc_xdc_make_tool(Project prj, Stream strm)
-{
- return vs200x_project_vc_empty_tool(prj, strm, "VCXDCMakeTool");
-}
-
-
-/**
- * Write the VCXMLDataGeneratorTool [Tool] element and attributes.
- */
-int vs200x_project_vc_xml_data_generator_tool(Project prj, Stream strm)
-{
- return vs200x_project_vc_empty_tool(prj, strm, "VCXMLDataGeneratorTool");
-}
diff --git a/src/actions/vs200x/vs200x_project.h b/src/actions/vs200x/vs200x_project.h
deleted file mode 100644
index 020cdea..0000000
--- a/src/actions/vs200x/vs200x_project.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * \file vs200x_project.h
- * \brief Visual Studio 200x project generation functions.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-#if !defined(PREMAKE_VS200X_PROJECT_H)
-#define PREMAKE_VS200X_PROJECT_H
-
-int vs200x_project_config_element(Project prj, Stream strm);
-int vs200x_project_config_end(Project prj, Stream strm);
-int vs200x_project_create(Project prj, Stream strm);
-int vs200x_project_element(Project prj, Stream strm);
-int vs200x_project_encoding(Project prj, Stream strm);
-int vs200x_project_file(Project prj, Stream strm, const char* filename, int state);
-int vs200x_project_files(Project prj, Stream strm);
-int vs200x_project_globals(Project prj, Stream strm);
-int vs200x_project_platforms(Project prj, Stream strm);
-int vs200x_project_references(Project prj, Stream strm);
-int vs200x_project_tool_files(Project prj, Stream strm);
-int vs200x_project_vc_alink_tool(Project prj, Stream strm);
-int vs200x_project_vc_app_verifier_tool(Project prj, Stream strm);
-int vs200x_project_vc_bsc_make_tool(Project prj, Stream strm);
-int vs200x_project_vc_cl_compiler_tool(Project prj, Stream strm);
-int vs200x_project_vc_custom_build_tool(Project prj, Stream strm);
-int vs200x_project_vc_fx_cop_tool(Project prj, Stream strm);
-int vs200x_project_vc_midl_tool(Project prj, Stream strm);
-int vs200x_project_vc_linker_tool(Project prj, Stream strm);
-int vs200x_project_vc_managed_resource_compiler_tool(Project prj, Stream strm);
-int vs200x_project_vc_manifest_tool(Project prj, Stream strm);
-int vs200x_project_vc_pre_build_event_tool(Project prj, Stream strm);
-int vs200x_project_vc_pre_link_event_tool(Project prj, Stream strm);
-int vs200x_project_vc_post_build_event_tool(Project prj, Stream strm);
-int vs200x_project_vc_resource_compiler_tool(Project prj, Stream strm);
-int vs200x_project_vc_web_deployment_tool(Project prj, Stream strm);
-int vs200x_project_vc_web_service_proxy_generator_tool(Project prj, Stream strm);
-int vs200x_project_vc_xdc_make_tool(Project prj, Stream strm);
-int vs200x_project_vc_xml_data_generator_tool(Project prj, Stream strm);
-
-#endif
diff --git a/src/actions/vs200x/vs200x_solution.c b/src/actions/vs200x/vs200x_solution.c
deleted file mode 100644
index 23faa42..0000000
--- a/src/actions/vs200x/vs200x_solution.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * \file vs200x_solution.c
- * \brief Visual Studio multiple-version solution generation functions.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include <stdlib.h>
-#include "premake.h"
-#include "vs200x.h"
-#include "vs200x_solution.h"
-
-
-/**
- * Create a new output stream for a solution, and make it active for subsequent writes.
- */
-int vs200x_solution_create(Solution sln, Stream strm)
-{
- /* create the solution file */
- const char* filename = solution_get_filename(sln, NULL, ".sln");
- strm = stream_create_file(filename);
- if (!strm)
- {
- return !OKAY;
- }
-
- /* make the stream active for the functions that come after */
- session_set_active_stream(solution_get_session(sln), strm);
- return OKAY;
-}
diff --git a/src/actions/vs200x/vs200x_solution.h b/src/actions/vs200x/vs200x_solution.h
deleted file mode 100644
index 0917ca9..0000000
--- a/src/actions/vs200x/vs200x_solution.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * \file vs200x_solution.h
- * \brief Visual Studio 200x solution generation functions.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-#if !defined(PREMAKE_VS200X_SOLUTION_H)
-#define PREMAKE_VS200X_SOLUTION_H
-
-#include "objects/solution.h"
-
-int vs2002_solution_configuration(Solution sln, Stream strm);
-int vs2002_solution_dependencies(Solution sln, Stream strm);
-int vs2002_solution_extensibility(Solution sln, Stream strm);
-int vs2002_solution_project_configuration(Solution sln, Stream strm);
-int vs2002_solution_projects(Solution sln, Stream strm);
-int vs2002_solution_signature(Solution sln, Stream strm);
-
-int vs2003_solution_configuration(Solution sln, Stream strm);
-int vs2003_solution_signature(Solution sln, Stream strm);
-
-int vs2005_solution_platforms(Solution sln, Stream strm);
-int vs2005_solution_project_platforms(Solution sln, Stream strm);
-int vs2005_solution_properties(Solution sln, Stream strm);
-int vs2005_solution_signature(Solution sln, Stream strm);
-
-int vs2008_solution_signature(Solution sln, Stream strm);
-
-int vs200x_solution_create(Solution sln, Stream strm);
-
-#endif
diff --git a/src/actions/vstudio/_vstudio.lua b/src/actions/vstudio/_vstudio.lua
new file mode 100644
index 0000000..b698109
--- /dev/null
+++ b/src/actions/vstudio/_vstudio.lua
@@ -0,0 +1,15 @@
+--
+-- _vstudio.lua
+-- Define the Visual Studio 200x actions.
+-- Copyright (c) 2008 Jason Perkins and the Premake project
+--
+
+
+-- premake.actions["vs2002"] = {
+-- shortname = "Visual Studio 2002",
+-- description = "Microsoft Visual Studio 2002",
+--
+-- solutiontemplates = {
+-- { ".sln", _TEMPLATES.vs2002_solution },
+-- },
+-- }
diff --git a/src/actions/vstudio/vs2002_solution.tmpl b/src/actions/vstudio/vs2002_solution.tmpl
new file mode 100644
index 0000000..233e81a
--- /dev/null
+++ b/src/actions/vstudio/vs2002_solution.tmpl
@@ -0,0 +1,23 @@
+<% eol = "\r\n" %>
+
+Microsoft Visual Studio Solution File, Format Version 7.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CppExe", "CppExe/CppExe.vcproj", "{AE61726D-187C-E440-BD07-2556188A6565}"
+EndProject
+Global
+ GlobalSection(SolutionConfiguration) = preSolution
+ ConfigName.0 = Debug
+ ConfigName.1 = Release
+ EndGlobalSection
+ GlobalSection(ProjectDependencies) = postSolution
+ EndGlobalSection
+ GlobalSection(ProjectConfiguration) = postSolution
+ {AE61726D-187C-E440-BD07-2556188A6565}.Debug.ActiveCfg = Debug|Win32
+ {AE61726D-187C-E440-BD07-2556188A6565}.Debug.Build.0 = Debug|Win32
+ {AE61726D-187C-E440-BD07-2556188A6565}.Release.ActiveCfg = Release|Win32
+ {AE61726D-187C-E440-BD07-2556188A6565}.Release.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ EndGlobalSection
+ GlobalSection(ExtensibilityAddIns) = postSolution
+ EndGlobalSection
+EndGlobal
diff --git a/src/base/array.c b/src/base/array.c
deleted file mode 100644
index 1a9ed54..0000000
--- a/src/base/array.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/**
- * \file array.c
- * \brief Dynamic array object.
- * \author Copyright (c) 2007-2008 Jason Perkins and the Premake project
- */
-
-#include <assert.h>
-#include <stdlib.h>
-#include "premake.h"
-#include "base/array.h"
-
-#define ALLOCATION_SIZE (16)
-
-DEFINE_CLASS(Array)
-{
- void** contents;
- int size;
- int capacity;
-};
-
-
-/**
- * Create a new, empty array object.
- * \returns A new array object.
- */
-Array array_create()
-{
- Array arr = ALLOC_CLASS(Array);
- arr->contents = NULL;
- arr->size = 0;
- arr->capacity = 0;
- return arr;
-}
-
-
-/**
- * Destroy an array object and release the associated memory.
- * \param arr The array to destroy.
- */
-void array_destroy(Array arr)
-{
- assert(arr);
- if (arr->contents != NULL)
- {
- free(arr->contents);
- }
- free(arr);
-}
-
-
-/**
- * Get the number of item in the array.
- * \param arr The array to query.
- * \returns The number elements currently in the array.
- */
-int array_size(Array arr)
-{
- assert(arr);
- return arr->size;
-}
-
-
-/**
- * Add a new item to the end of the array, growing the array if necessary.
- * \param arr The array object.
- * \param item The item to add.
- */
-void array_add(Array arr, void* item)
-{
- assert(arr);
- assert(item);
- if (arr->size == arr->capacity)
- {
- arr->capacity += ALLOCATION_SIZE;
- arr->contents = (void**)realloc(arr->contents, sizeof(void*) * arr->capacity);
- }
-
- arr->contents[arr->size] = item;
- arr->size++;
-}
-
-
-/**
- * Retrieve the item at the specified index in the array.
- * \param arr The array to query.
- * \param index The index of the item to retrieve.
- * \returns A pointer to the item.
- */
-void* array_item(Array arr, int index)
-{
- assert(arr);
- assert((index >= 0 && index < arr->size) || (index == 0 && arr->size == 0));
- return arr->contents[index];
-}
-
-
-/**
- * Store an item at a particular index in the array, overwriting any existing value.
- * \param arr The array.
- * \param index The index at which to store the item
- * \param item The new item.
- */
-void array_set(Array arr, int index, void* item)
-{
- assert(arr);
- assert(index >= 0 && index < arr->size);
- arr->contents[index] = item;
-}
-
-
-/**
- * Append the contents of one array to another.
- * \param dest The destination array.
- * \param src The source array.
- */
-void array_append(Array dest, Array src)
-{
- int i;
-
- assert(dest);
- assert(src);
-
- for (i = 0; i < src->size; ++i)
- {
- array_add(dest, src->contents[i]);
- }
-}
diff --git a/src/base/array.h b/src/base/array.h
deleted file mode 100644
index e4deea2..0000000
--- a/src/base/array.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * \file array.h
- * \brief Dynamic array object.
- * \author Copyright (c) 2007-2008 Jason Perkins and the Premake project
- *
- * \defgroup array Array
- * \ingroup base
- *
- * A dynamic array class.
- *
- * @{
- */
-#if !defined(PREMAKE_ARRAY_H)
-#define PREMAKE_ARRAY_H
-
-DECLARE_CLASS(Array);
-
-Array array_create(void);
-void array_destroy(Array arr);
-int array_size(Array arr);
-void array_add(Array arr, void* item);
-void* array_item(Array arr, int index);
-void array_set(Array arr, int index, void* item);
-void array_append(Array dest, Array src);
-
-#endif
-/** @} */
diff --git a/src/base/base.h b/src/base/base.h
deleted file mode 100644
index bed7f27..0000000
--- a/src/base/base.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/**
- * \file base.h
- * \brief Premake base library API.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- *
- * \defgroup base Base
- *
- * This component defines all of the base classes required by the higher-level
- * functions of Premake.
- */
-
-int base_tests();
diff --git a/src/base/buffers.c b/src/base/buffers.c
deleted file mode 100644
index 2e3304b..0000000
--- a/src/base/buffers.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/**
- * \file buffers.c
- * \brief Shared working buffer system.
- * \author Copyright (c) 2007-2007 Jason Perkins and the Premake project
- *
- * \note I need to do a lot of string building operations in Premake. Rather than
- * constantly creating, resizing, and releasing (and forgetting to release)
- * dynamic string buffers, I use this shared buffer pool instead. Each request
- * to buffer_next() returns the next buffer in the list. Pointers to the buffers
- * can be safely passed around, and I don't need to remember to release anything
- * when I'm done. The buffers should only be used for transient values, obviously.
- * If you need to keep a value around for any length of time copy it to a string.
- *
- * \note The size and number of the buffers is arbitrary; I just picked some numbers
- * that seemed big enough.
- */
-
-#include <stdlib.h>
-#include "premake.h"
-#include "base/buffers.h"
-
-/** The size of an individual buffer, in bytes. */
-const int BUFFER_SIZE = 0x4000;
-
-/** The number of buffers stored in the pool */
-static const int NUM_BUFFERS = 128;
-
-/** The pool of buffers */
-static char** buffers = NULL;
-
-/** The index of the next available buffer */
-static int next = 0;
-
-
-/**
- * Clean up after the buffer system. Called by atexit().
- */
-static void buffers_destroy(void)
-{
- if (buffers != NULL)
- {
- int i;
- for (i = 0; i < NUM_BUFFERS; ++i)
- {
- free(buffers[i]);
- }
- free(buffers);
- }
-}
-
-
-/**
- * Initialize the buffer system.
- */
-static void buffers_create(void)
-{
- int i;
- buffers = (char**)malloc(sizeof(char*) * NUM_BUFFERS);
- for (i = 0; i < NUM_BUFFERS; ++i)
- {
- buffers[i] = (char*)malloc(BUFFER_SIZE);
- }
- next = 0;
- atexit(buffers_destroy);
-}
-
-
-/**
- * Get a clean buffer.
- * \returns An empty buffer.
- */
-char * buffers_next()
-{
- /* if this is the first call, initialize the buffer system */
- if (buffers == NULL)
- buffers_create();
-
- next++;
- if (next == NUM_BUFFERS)
- next = 0;
-
- /* initialize new buffers to empty string */
- buffers[next][0] = '\0';
- return buffers[next];
-}
diff --git a/src/base/buffers.h b/src/base/buffers.h
deleted file mode 100644
index 5bb058c..0000000
--- a/src/base/buffers.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * \file buffers.h
- * \brief Shared working buffer system.
- * \author Copyright (c) 2007-2008 Jason Perkins and the Premake project
- *
- * \defgroup buffers Buffers
- * \ingroup base
- *
- * A shared working buffer collection. A buffer can be requested from the system, filled,
- * and passed around for a short period of time. This system allows transient string values
- * to be returned from functions and immediately used without having to resort to
- * full-blown string objects, and the ownership issues that would entail.
- *
- * @{
- */
-#if !defined(PREMAKE_BUFFER_H)
-#define PREMAKE_BUFFER_H
-
-extern const int BUFFER_SIZE;
-
-char* buffers_next(void);
-
-#endif
-/** @} */
-
diff --git a/src/base/cstr.c b/src/base/cstr.c
deleted file mode 100644
index 4fa588d..0000000
--- a/src/base/cstr.c
+++ /dev/null
@@ -1,235 +0,0 @@
-/**
- * \file cstr.c
- * \brief C string handling.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include <assert.h>
-#include <ctype.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <string.h>
-#include "premake.h"
-#include "base/buffers.h"
-#include "base/cstr.h"
-#include "base/luastate.h"
-
-
-/**
- * Determines if the sequence appears anywhere in the target string.
- * \param str The string to test.
- * \param expected The sequence to search for.
- * \returns True if the sequence is contained in the string.
- */
-int cstr_contains(const char* str, const char* expected)
-{
- assert(str);
- assert(expected);
- return (strstr(str, expected) != NULL);
-}
-
-
-/**
- * Determines if the string ends with a particular sequence.
- * \param str The string to test.
- * \param expected The sequence for which to look.
- * \returns True if the string ends with the sequence, false otherwise.
- */
-int cstr_ends_with(const char* str, const char* expected)
-{
- if (str != NULL && expected != NULL)
- {
- int str_len = strlen(str);
- int exp_len = strlen(expected);
- if (str_len >= exp_len)
- {
- const char* start = str + str_len - exp_len;
- return (strcmp(start, expected) == 0);
- }
- }
- return 0;
-}
-
-
-/**
- * Compares two C strings for equality.
- * \param str The string to compare.
- * \param expected The value to compare against.
- * \returns True if the strings match, zero otherwise.
- */
-int cstr_eq(const char* str, const char* expected)
-{
- if (str != NULL && expected != NULL)
- {
- return (strcmp(str, expected) == 0);
- }
- return 0;
-}
-
-
-/**
- * Performs a case-insensitive comparasion on two C strings for equality.
- * \param str The string to compare.
- * \param expected The value to compare against.
- * \returns True if the strings match, zero otherwise.
- */
-int cstr_eqi(const char* str, const char* expected)
-{
- if (str != NULL && expected != NULL)
- {
- while (*str && *expected)
- {
- if (tolower(*str) != tolower(*expected))
- {
- return 0;
- }
-
- str++;
- expected++;
- }
-
- return (*str == *expected);
- }
- return 0;
-}
-
-
-/**
- * Builds a string using printf-style formatting codes.
- * \param format The format string, which may contain printf-style formatting codes.
- * \returns The formatted string.
- */
-char* cstr_format(const char* format, ...)
-{
- va_list args;
- char* buffer = buffers_next();
-
- va_start(args, format);
- vsprintf(buffer, format, args);
- va_end(args);
-
- return buffer;
-}
-
-
-/**
- * Compares a string value with a pattern, using the Lua pattern syntax, and
- * returns true if there is a match.
- */
-int cstr_matches_pattern(const char* str, const char* pattern)
-{
- lua_State* L;
- char* buffer;
- int i, escaped, top, result, is_my_state = 0;
-
- assert(str);
- assert(pattern);
-
- /* convert pattern to match any case, each non-escaped letter A becomes [Aa] */
- buffer = buffers_next();
- i = 0;
- escaped = 0;
- while (*pattern != '\0')
- {
- if (isalpha(*pattern) && !escaped)
- {
- buffer[i++] = '[';
- buffer[i++] = (char)toupper(*pattern);
- buffer[i++] = (char)tolower(*pattern);
- buffer[i++] = ']';
- }
- else
- {
- escaped = (*pattern == '%');
- buffer[i++] = *pattern;
- }
-
- pattern++;
- }
- buffer[i] = '\0';
-
- /* connect to Lua so I can call the match() function */
- L = luastate_get_current();
- is_my_state = (L == NULL);
- if (is_my_state)
- {
- L = luastate_create();
- }
- top = lua_gettop(L);
-
- /* retrieve the match() function and call it */
- lua_getglobal(L, "string");
- lua_getfield(L, -1, "match");
- lua_pushstring(L, str);
- lua_pushstring(L, buffer);
- lua_call(L, 2, 1);
- result = cstr_eq(str, lua_tostring(L,-1));
-
- /* clean up and return the result */
- lua_settop(L, top);
- if (is_my_state)
- {
- luastate_destroy(L);
- }
-
- return result;
-}
-
-
-/**
- * Determines if the given C string starts with a particular sequence.
- * \param str The string to test.
- * \param expected The sequence for which to look.
- * \returns True if the string starts with the sequence, false otherwise.
- */
-int cstr_starts_with(const char* str, const char* expected)
-{
- if (str != NULL && expected != NULL)
- {
- return (strncmp(str, expected, strlen(expected)) == 0);
- }
- return 0;
-}
-
-
-/**
- * Removes spaces any other special characters from a string, converting it
- * into a C/C++/C# safe identifier.
- * \param str The string to process.
- * \returns An identifier-safe string.
- */
-char* cstr_to_identifier(const char* str)
-{
- char* buffer = buffers_next();
- char* dst = buffer;
-
- while (*str != '\0')
- {
- if (isalnum(*str) || *str == '_')
- {
- *(dst++) = *str;
- }
- str++;
- }
-
- *dst = '\0';
- return buffer;
-}
-
-
-/**
- * Remove a character from the end of a string, if present.
- * \param str The string to trim.
- * \param ch The character to trim.
- */
-void cstr_trim(char* str, char ch)
-{
- int i;
- assert(str);
- i = strlen(str) - 1;
- while (i >= 0 && str[i] == ch)
- {
- str[i] = '\0';
- i--;
- }
-}
diff --git a/src/base/cstr.h b/src/base/cstr.h
deleted file mode 100644
index fdf7e00..0000000
--- a/src/base/cstr.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * \file cstr.h
- * \brief C string handling.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- *
- * \defgroup cstr C Strings
- * \ingroup base
- *
- * Functions to handle C strings (zero-terminated byte arrays).
- *
- * @{
- */
-#if !defined(PREMAKE_CSTR_H)
-#define PREMAKE_CSTR_H
-
-int cstr_contains(const char* str, const char* expected);
-int cstr_ends_with(const char* str, const char* expected);
-int cstr_eq(const char* str, const char* expected);
-int cstr_eqi(const char* str, const char* expected);
-char* cstr_format(const char* format, ...);
-int cstr_matches_pattern(const char* str, const char* pattern);
-int cstr_starts_with(const char* str, const char* expected);
-char* cstr_to_identifier(const char* str);
-void cstr_trim(char* str, char ch);
-
-#endif
-/** @} */
diff --git a/src/base/dir.c b/src/base/dir.c
deleted file mode 100644
index dba85f0..0000000
--- a/src/base/dir.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/**
- * \file dir.c
- * \brief Directory handling.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include <assert.h>
-#include <string.h>
-#include <sys/stat.h>
-#include "premake.h"
-#include "base/buffers.h"
-#include "base/dir.h"
-#include "base/error.h"
-#include "base/path.h"
-#include "platform/platform.h"
-
-
-/**
- * Create a directory, if it doesn't exist already.
- * \returns OKAY if successful.
- */
-int dir_create(const char* path)
-{
- char* parent;
-
- assert(path);
-
- if (dir_exists(path))
- return OKAY;
-
- /* make sure the parent directory exists */
- parent = path_directory(path);
- if (strlen(parent) > 0)
- {
- if (dir_create(parent) != OKAY)
- return !OKAY;
- }
-
- if (platform_create_dir(path) != OKAY)
- {
- error_set("Unable to create directory %s", path);
- return !OKAY;
- }
-
- return OKAY;
-}
-
-
-/**
- * Determine if a particular directory exists on the filesystem.
- * \returns True if the directory exists.
- */
-int dir_exists(const char* path)
-{
- struct stat buf;
-
- assert(path);
-
- /* empty path is equivalent to ".", must be true */
- if (strlen(path) == 0)
- {
- return 1;
- }
-
- if (stat(path, &buf) == 0)
- {
- return (buf.st_mode & S_IFDIR);
- }
- else
- {
- return 0;
- }
-}
-
-
-/**
- * Get the current working directory.
- * \returns The current working directory, or NULL on error. Path separators
- * are converted to forward slashes, regardless of platform.
- */
-char* dir_get_current()
-{
- char* buffer = buffers_next();
-
- int result = platform_dir_get_current(buffer, BUFFER_SIZE);
- if (result == OKAY)
- {
- return path_translate(buffer, "/");
- }
- else
- {
- return NULL;
- }
-}
-
-
-/**
- * Set the current working directory.
- * \param path The new working directory.
- * \returns OKAY if successful.
- */
-int dir_set_current(const char* path)
-{
- assert(path);
- return platform_dir_set_current(path);
-}
diff --git a/src/base/dir.h b/src/base/dir.h
deleted file mode 100644
index 856a414..0000000
--- a/src/base/dir.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * \file dir.h
- * \brief Directory handling.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- *
- * \defgroup dir Directory Management
- * \ingroup base
- *
- * Directory management functions.
- *
- * @{
- */
-#if !defined(PREMAKE_DIR_H)
-#define PREMAKE_DIR_H
-
-int dir_create(const char* path);
-int dir_exists(const char* path);
-char* dir_get_current(void);
-int dir_set_current(const char* path);
-
-#endif
-/** @} */
diff --git a/src/base/env.c b/src/base/env.c
deleted file mode 100644
index 1774c98..0000000
--- a/src/base/env.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/**
- * \file env.c
- * \brief Manage the runtime environment state.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include <assert.h>
-#include <stdlib.h>
-#include "premake.h"
-#include "env.h"
-#include "platform/platform.h"
-
-
-static enum OS CurrentOS = UnknownOS;
-static const char* Action = NULL;
-
-
-/**
- * Retrieve the current action being targeted. Will return NULL if no action
- * has been set.
- */
-const char* env_get_action(void)
-{
- return Action;
-}
-
-
-/**
- * Identify the target OS. This value will be set to the current OS by default,
- * but can be overridden by calling env_set_os_by_name().
- */
-enum OS env_get_os(void)
-{
- if (CurrentOS == UnknownOS)
- {
-#if defined(PLATFORM_BSD)
- CurrentOS = BSD;
-#elif defined(PLATFORM_LINUX)
- CurrentOS = Linux;
-#elif defined(PLATFORM_MACOSX)
- CurrentOS = MacOSX;
-#else
- CurrentOS = Windows;
-#endif
- }
- return CurrentOS;
-}
-
-
-/**
- * Identify the target OS with a string name. This value will be set to the current
- * OS by default, but can be overridden by calling env_set_os_by_name().
- */
-const char* env_get_os_name(void)
-{
- switch (env_get_os())
- {
- case BSD:
- return "BSD";
- case Linux:
- return "Linux";
- case MacOSX:
- return "MacOSX";
- case Windows:
- return "Windows";
- default:
- assert(0);
- return 0;
- }
-}
-
-
-/**
- * Returns true if the current OS matches the one provided.
- */
-int env_is_os(enum OS id)
-{
- return (env_get_os() == id);
-}
-
-
-/**
- * Set the action being targeted in this run.
- */
-void env_set_action(const char* action)
-{
- Action = action;
-}
-
-
-/**
- * Override the default OS identification, allowing generation of project files
- * targeted for other platforms (like cross-compiling).
- */
-void env_set_os(enum OS id)
-{
- CurrentOS = id;
-}
diff --git a/src/base/env.h b/src/base/env.h
deleted file mode 100644
index 09d1b46..0000000
--- a/src/base/env.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * \file env.h
- * \brief Manage the runtime environment state.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- *
- * \defgroup env Runtime Environment
- * \ingroup base
- *
- * Manage the runtime environment state, getting and setting such values as
- * the target action and the operating system.
- *
- * @{
- */
-#if !defined(PREMAKE_ENV_H)
-#define PREMAKE_ENV_H
-
-/**
- * The currently supported operating systems.
- * \note If you add to this list, be sure to also update the detection
- * and string translation logic.
- */
-enum OS
-{
- UnknownOS,
- BSD,
- Linux,
- MacOSX,
- Windows
-};
-
-
-const char* env_get_action(void);
-enum OS env_get_os(void);
-const char* env_get_os_name(void);
-int env_is_os(enum OS id);
-void env_set_action(const char* action);
-void env_set_os(enum OS id);
-
-
-#endif
-/** @} */
diff --git a/src/base/error.c b/src/base/error.c
deleted file mode 100644
index a53eff2..0000000
--- a/src/base/error.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * \file error.c
- * \brief Application-wide error reporting.
- * \author Copyright (c) 2007-2008 Jason Perkins and the Premake project
- */
-
-#include <assert.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <string.h>
-#include "premake.h"
-#include "error.h"
-
-static char error_message[8192] = { 0 };
-
-
-/**
- * Clear any existing error state.
- */
-void error_clear(void)
-{
- error_message[0] = 0;
-}
-
-
-/**
- * Returns the most recent error message set by error_set().
- * \returns The error message, or NULL if no error message has been set.
- */
-const char* error_get(void)
-{
- return (strlen(error_message) > 0) ? error_message : NULL;
-}
-
-
-/**
- * Set the description of an error condition, which may be retrieved with session_get_error().
- * The session uses a fixed length (around 8K) buffer for storing the error message, so make
- * sure the final size of the formatted message will fall under that limit.
- * \param message A description of the error condition.
- */
-void error_set(const char* message, ...)
-{
- va_list args;
-
- assert(message);
-
- va_start(args, message);
- vsprintf(error_message, message, args);
- va_end(args);
-}
diff --git a/src/base/error.h b/src/base/error.h
deleted file mode 100644
index dbccda0..0000000
--- a/src/base/error.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/**
- * \file error.h
- * \brief Application-wide error reporting.
- * \author Copyright (c) 2007-2008 Jason Perkins and the Premake project
- *
- * \defgroup array Array
- * \ingroup base
- *
- * Application-wide error reporting.
- *
- * @{
- */
-#if !defined(PREMAKE_ERROR_H)
-#define PREMAKE_ERROR_H
-
-void error_clear(void);
-const char* error_get(void);
-void error_set(const char* message, ...);
-
-#endif
-/** @} */
diff --git a/src/base/file.c b/src/base/file.c
deleted file mode 100644
index 5156a4f..0000000
--- a/src/base/file.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * \file file.c
- * \brief File handling.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include <assert.h>
-#include <sys/stat.h>
-#include "premake.h"
-#include "base.h"
-
-
-/**
- * Determine if a particular file exists on the filesystem.
- * \returns True if the file exists.
- */
-int file_exists(const char* path)
-{
- struct stat buf;
-
- assert(path);
-
- if (stat(path, &buf) == 0)
- {
- return ((buf.st_mode & S_IFDIR) == 0);
- }
- else
- {
- return 0;
- }
-}
diff --git a/src/base/file.h b/src/base/file.h
deleted file mode 100644
index daf567c..0000000
--- a/src/base/file.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * \file file.h
- * \brief File handling.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- *
- * \defgroup file File Management
- * \ingroup base
- *
- * File management functions.
- *
- * @{
- */
-#if !defined(PREMAKE_DIR_H)
-#define PREMAKE_DIR_H
-
-int file_exists(const char* path);
-
-#endif
-/** @} */
diff --git a/src/base/functions.lua b/src/base/functions.lua
new file mode 100644
index 0000000..f4703bc
--- /dev/null
+++ b/src/base/functions.lua
@@ -0,0 +1,319 @@
+--
+-- functions.lua
+-- Implementations of the solution, project, and configuration APIs.
+-- Copyright (c) 2002-2008 Jason Perkins and the Premake project
+--
+
+
+--
+-- Validation lists for fields with constrained value sets.
+--
+
+ local valid_flags =
+ {
+ "Dylib",
+ "ExtraWarnings",
+ "FatalWarnings",
+ "No64BitChecks",
+ "NoExceptions",
+ "NoFramePointer",
+ "NoImportLib",
+ "NoRTTI",
+ "Optimize",
+ "OptimizeSize",
+ "OptimizeSpeed",
+ "Symbols"
+ }
+
+ local valid_kinds =
+ {
+ "ConsoleExe",
+ "WindowedExe",
+ "StaticLib",
+ "SharedLib"
+ }
+
+ local valid_languages =
+ {
+ "C",
+ "C++",
+ }
+
+
+--
+-- These list fields should be initialized to an empty table.
+--
+
+ premake.project.listfields =
+ {
+ "buildoptions",
+ "defines",
+ "excludes",
+ "files",
+ "flags",
+ "incdirs",
+ "libdirs",
+ "linkoptions",
+ "links",
+ "resoptions",
+ }
+
+
+--
+-- These fields should *not* be copied into configurations.
+--
+
+ premake.project.nocopy =
+ {
+ "blocks",
+ "keywords",
+ "projects"
+ }
+
+
+--
+-- These fields should be converted from absolute paths into project
+-- location relative before being returned in a configuration.
+--
+
+ premake.project.locationrelative =
+ {
+ "basedir",
+ "excludes",
+ "files",
+ "incdirs",
+ "libdirs",
+ "objdir",
+ "targetdir",
+ }
+
+
+
+
+--
+-- Project API functions
+--
+
+ function buildoptions(value)
+ return premake.project.setarray("config", "buildoptions", value)
+ end
+
+
+ function configuration(keywords)
+ local container, err = premake.project.getobject("container")
+ if (not container) then
+ error(err, 2)
+ end
+
+ local cfg = { }
+ table.insert(container.blocks, cfg)
+ premake.CurrentConfiguration = cfg
+
+ if (type(keywords) == "table") then
+ cfg.keywords = keywords
+ else
+ cfg.keywords = { keywords }
+ end
+
+ for _, name in ipairs(premake.project.listfields) do
+ cfg[name] = { }
+ end
+
+ return cfg
+ end
+
+
+ function configurations(value)
+ return premake.project.setarray("solution", "configurations", value)
+ end
+
+
+ function defines(value)
+ return premake.project.setarray("config", "defines", value)
+ end
+
+
+ function excludes(value)
+ return premake.project.setfilearray("container", "excludes", value)
+ end
+
+
+ function files(value)
+ return premake.project.setfilearray("container", "files", value)
+ end
+
+
+ function flags(value)
+ return premake.project.setarray("config", "flags", value, valid_flags)
+ end
+
+
+ function implibname(value)
+ return premake.project.setstring("config", "implibname", value)
+ end
+
+
+ function implibdir(value)
+ return premake.project.setstring("config", "implibdir", path.getabsolute(value))
+ end
+
+
+ function implibextension(value)
+ return premake.project.setstring("config", "implibextension", value)
+ end
+
+
+ function implibprefix(value)
+ return premake.project.setstring("config", "implibprefix", value)
+ end
+
+
+ function includedirs(value)
+ return premake.project.setdirarray("config", "incdirs", value)
+ end
+
+
+ function kind(value)
+ return premake.project.setstring("config", "kind", value, valid_kinds)
+ end
+
+
+ function language(value)
+ return premake.project.setstring("container", "language", value, valid_languages)
+ end
+
+
+ function libdirs(value)
+ return premake.project.setdirarray("config", "libdirs", value)
+ end
+
+
+ function linkoptions(value)
+ return premake.project.setarray("config", "linkoptions", value)
+ end
+
+
+ function links(value)
+ return premake.project.setarray("config", "links", value)
+ end
+
+
+ function location(value)
+ return premake.project.setstring("container", "location", path.getabsolute(value))
+ end
+
+
+ function objdir(value)
+ return premake.project.setstring("config", "objdir", path.getabsolute(value))
+ end
+
+
+ function project(name)
+ if (name) then
+ -- identify the parent solution
+ local sln
+ if (type(premake.CurrentContainer) == "project") then
+ sln = premake.CurrentContainer.solution
+ else
+ sln = premake.CurrentContainer
+ end
+ if (type(sln) ~= "solution") then
+ error("no active solution", 2)
+ end
+
+ -- see if this project has already been created
+ premake.CurrentContainer = sln.projects[name]
+ if (not premake.CurrentContainer) then
+ local prj = { }
+ premake.CurrentContainer = prj
+
+ -- add to master list keyed by both name and index
+ table.insert(sln.projects, prj)
+ sln.projects[name] = prj
+
+ -- attach a type
+ setmetatable(prj, {
+ __type = "project",
+ __cfgcache = { }
+ })
+
+ prj.solution = sln
+ prj.name = name
+ prj.basedir = os.getcwd()
+ prj.location = prj.basedir
+ prj.filter = { }
+ prj.blocks = { }
+ end
+ end
+
+ if (type(premake.CurrentContainer) == "project") then
+ -- add an empty, global configuration to the project
+ configuration { }
+ return premake.CurrentContainer
+ else
+ return nil
+ end
+ end
+
+
+ function resoptions(value)
+ return premake.project.setarray("config", "resoptions", value)
+ end
+
+
+ function solution(name)
+ if (name) then
+ premake.CurrentContainer = _SOLUTIONS[name]
+ if (not premake.CurrentContainer) then
+ local sln = { }
+ premake.CurrentContainer = sln
+
+ -- add to master list keyed by both name and index
+ table.insert(_SOLUTIONS, sln)
+ _SOLUTIONS[name] = sln
+
+ -- attach a type
+ setmetatable(sln, {
+ __type="solution"
+ })
+
+ sln.name = name
+ sln.location = os.getcwd()
+ sln.projects = { }
+ sln.blocks = { }
+ sln.configurations = { }
+ end
+ end
+
+ -- make the solution active and return it
+ if (type(premake.CurrentContainer) == "project") then
+ premake.CurrentContainer = premake.CurrentContainer.solution
+ end
+
+ if (premake.CurrentContainer) then
+ -- add an empty, global configuration
+ configuration { }
+ end
+
+ return premake.CurrentContainer
+ end
+
+
+ function targetname(value)
+ return premake.project.setstring("config", "targetname", value)
+ end
+
+
+ function targetdir(value)
+ return premake.project.setstring("config", "targetdir", path.getabsolute(value))
+ end
+
+
+ function targetextension(value)
+ return premake.project.setstring("config", "targetextension", value)
+ end
+
+
+ function targetprefix(value)
+ return premake.project.setstring("config", "targetprefix", value)
+ end
diff --git a/src/base/gcc.lua b/src/base/gcc.lua
new file mode 100644
index 0000000..c7114fb
--- /dev/null
+++ b/src/base/gcc.lua
@@ -0,0 +1,124 @@
+--
+-- gcc.lua
+-- Provides GCC-specific configuration strings.
+-- Copyright (c) 2002-2008 Jason Perkins and the Premake project
+--
+
+--
+-- I don't know if this is the right breakdown or API to individual compilers
+-- yet so treat it all as experimental. I won't know until I get the change
+-- to implement a few different compilers across different toolset actions.
+--
+
+
+ premake.tools.gcc = { }
+
+ premake.tools.gcc.cflags =
+ {
+ ExtraWarnings = "-Wall",
+ FatalWarning = "-Werror",
+ NoFramePointer = "-fomit-frame-pointer",
+ Optimize = "-O2",
+ OptimizeSize = "-Os",
+ OptimizeSpeed = "-O3",
+ Symbols = "-g",
+ }
+
+ premake.tools.gcc.cxxflags =
+ {
+ NoExceptions = "--no-exceptions",
+ NoRTTI = "--no-rtti",
+ }
+
+
+ function premake.tools.gcc.make_defines(cfg)
+ return table.implode(cfg.defines, '-D "', '"', ' ')
+ end
+
+
+ function premake.tools.gcc.make_includes(cfg)
+ return table.implode(cfg.incdirs, '-I "', '"', ' ')
+ end
+
+
+ function premake.tools.gcc.make_cppflags(cfg)
+ -- if $(ARCH) contains multiple targets, then disable the incompatible automatic
+ -- dependency generation. This allows building universal binaries on MacOSX, sorta.
+ return "$(if $(word 2, $(ARCH)), , -MMD)"
+ end
+
+
+ function premake.tools.gcc.make_cflags(cfg)
+ local flags = table.translate(cfg.flags, premake.tools.gcc.cflags)
+
+ if (cfg.kind == "SharedLib" and not os.is("windows")) then
+ table.insert(flags, "-fPIC")
+ end
+
+ return table.concat(flags, " ")
+ end
+
+
+ function premake.tools.gcc.make_cxxflags(cfg)
+ local flags = table.translate(cfg.flags, premake.tools.gcc.cxxflags)
+ return table.concat(flags, " ")
+ end
+
+
+ function premake.tools.gcc.make_ldflags(cfg)
+ local flags = { }
+
+ if (cfg.kind == "SharedLib") then
+ if (not os.is("macosx")) then
+ table.insert(flags, "-shared")
+ end
+
+ -- create import library for DLLs under Windows
+ if (os.is("windows") and not table.contains(cfg.flags, "NoImportLib")) then
+ table.insert(flags, '-Wl,--out-implib="' .. premake.project.gettargetfile(cfg, "implib", "StaticLib", "linux") .. '"')
+ end
+ end
+
+ if (os.is("windows") and cfg.kind == "WindowedExe") then
+ table.insert(flags, "-mwindows")
+ end
+
+ -- OS X has a bug, see http://lists.apple.com/archives/Darwin-dev/2006/Sep/msg00084.html
+ if (not table.contains(cfg.flags, "Symbols")) then
+ if (os.is("macosx")) then
+ table.insert(flags, "-Wl,-x")
+ else
+ table.insert(flags, "-s")
+ end
+ end
+
+ if (os.is("macosx") and table.contains(flags, "Dylib")) then
+ table.insert(flags, "-dynamiclib -flat_namespace")
+ end
+
+ -- need to split path from libraries to avoid runtime errors (see bug #1729227)
+ local dirs = { }
+ local names = { }
+ for _, link in ipairs(premake.project.getlibraries(cfg, cfg.links)) do
+ local dir = path.getdirectory(link)
+ local name = path.getbasename(link)
+
+ if (dir ~= "" and not table.contains(cfg.libdirs, dir) and not table.contains(dirs, dir)) then
+ table.insert(dirs, dir)
+ end
+
+ table.insert(names, name)
+ end
+
+ return table.concat(flags, " ") .. table.implode(cfg.libdirs, ' -L "', '"').. table.implode(dirs, ' -L "', '"') .. table.implode(names, ' -l "', '"')
+ end
+
+
+ function premake.tools.gcc.make_file_rule(file)
+ if (path.iscfile(file)) then
+ return "$(CC) $(CFLAGS) -o $@ -c $<"
+ else
+ return "$(CXX) $(CXXFLAGS) -o $@ -c $<"
+ end
+ end
+
diff --git a/src/base/globals.lua b/src/base/globals.lua
new file mode 100644
index 0000000..9b686a8
--- /dev/null
+++ b/src/base/globals.lua
@@ -0,0 +1,126 @@
+--
+-- globals.lua
+-- Global tables and variables, replacements and extensions to Lua's global functions.
+-- Copyright (c) 2002-2008 Jason Perkins and the Premake project
+--
+
+
+-- The list of defined solutions (which contain projects, etc.)
+
+ _SOLUTIONS = { }
+
+
+-- The list of built-in output templates
+
+ _TEMPLATES = { }
+
+
+-- A top-level namespace for support functions
+
+ premake = { }
+
+
+-- The list of registered actions
+
+ premake.actions = { }
+
+
+-- The list of tool interfaces
+
+ premake.tools = { }
+
+
+--
+-- A replacement for Lua's built-in dofile() function, this one sets the
+-- current working directory to the script's location, enabling script-relative
+-- referencing of other files and resources.
+--
+
+ local builtin_dofile = dofile
+ function dofile(fname)
+ -- remember the current working directory; I'll restore it shortly
+ local oldcwd = os.getcwd()
+
+ -- if the file doesn't exist, check the search path
+ if (not os.isfile(fname)) then
+ local path = os.pathsearch(fname, _OPTIONS["scripts"], os.getenv("PREMAKE_PATH"))
+ if (path) then
+ fname = path.."/"..fname
+ end
+ end
+
+ -- use the absolute path to the script file, to avoid any file name
+ -- ambiguity if an error should arise
+ fname = path.getabsolute(fname)
+
+ -- switch the working directory to the new script location
+ local newcwd = path.getdirectory(fname)
+ os.chdir(newcwd)
+
+ -- run the chunk. How can I catch variable return values?
+ local a, b, c, d, e, f = builtin_dofile(fname)
+
+ -- restore the previous working directory when done
+ os.chdir(oldcwd)
+ return a, b, c, d, e, f
+ end
+
+
+
+--
+-- A shortcut for including another "premake4.lua" file, often used for projects.
+--
+
+ function include(fname)
+ return dofile(fname .. "/premake4.lua")
+ end
+
+
+
+--
+-- Open an overload of the io.open() function, which will create any missing
+-- subdirectories in the filename if "mode" is set to writeable.
+--
+
+ local builtin_open = io.open
+ function io.open(fname, mode)
+ if (mode) then
+ if (mode:find("w")) then
+ local dir = path.getdirectory(fname)
+ ok, err = os.mkdir(dir)
+ if (not ok) then
+ error(err, 0)
+ end
+ end
+ end
+ return builtin_open(fname, mode)
+ end
+
+
+
+--
+-- A shortcut for printing formatted output.
+--
+
+ function printf(msg, ...)
+ print(string.format(msg, unpack(arg)))
+ end
+
+
+
+--
+-- An extension to type() to identify project object types by reading the
+-- "__type" field from the metatable.
+--
+
+ local builtin_type = type
+ function type(t)
+ local mt = getmetatable(t)
+ if (mt) then
+ if (mt.__type) then
+ return mt.__type
+ end
+ end
+ return builtin_type(t)
+ end
+ \ No newline at end of file
diff --git a/src/base/guid.c b/src/base/guid.c
deleted file mode 100644
index f6da2e6..0000000
--- a/src/base/guid.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/**
- * \file guid.c
- * \brief GUID creation and validation.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include <stdio.h>
-#include <string.h>
-#include "premake.h"
-#include "guid.h"
-#include "platform/platform.h"
-#include "base/buffers.h"
-
-
-static void stringify(char* src, char* dst, int count);
-
-
-/**
- * Create a new GUID, with the format "4E67EBCE-BC8B-4058-9AA9-48EE5E003683".
- * \returns The new GUID.
- */
-const char* guid_create()
-{
- char guid[16];
- char* result = buffers_next();
-
- /* get a GUID as an array of 16 bytes */
- platform_create_guid(guid);
-
- /* convert that array to a string in the usual format */
- stringify(guid, result, 4);
- result[8] = '-';
- stringify(guid + 4, result + 9, 2);
- result[13] = '-';
- stringify(guid + 6, result + 14, 2);
- result[18] = '-';
- stringify(guid + 8, result + 19, 2);
- result[23] = '-';
- stringify(guid + 10, result + 24, 6);
- result[36] = '\0';
- return result;
-}
-
-
-/**
- * Validate the format of a GUID, which should use the form "4E67EBCE-BC8B-4058-9AA9-48EE5E003683".
- * \param value The guid to validate.
- * \returns True if valid, zero otherwise.
- */
-int guid_is_valid(const char* value)
-{
- int i, n;
-
- /* make sure it is the right size */
- if (strlen(value) != 36)
- return 0;
-
- /* check for dashes in the right places */
- if (value[8] != '-' ||
- value[13] != '-' ||
- value[18] != '-' ||
- value[23] != '-')
- {
- return 0;
- }
-
- /* make sure only [0-9A-F-] are present; count the number of dashes on the way */
- n = 0;
- for (i = 0; i < 36; ++i)
- {
- if (value[i] == '-')
- {
- ++n;
- }
- else if ((value[i] < '0' || value[i] > '9') &&
- (value[i] < 'A' || value[i] > 'F') &&
- (value[i] < 'a' || value[i] > 'f'))
- {
- return 0;
- }
- }
-
- /* make sure I've got the right number of dashes */
- if (n != 4)
- {
- return 0;
- }
-
- return 1;
-}
-
-
-/**
- * Convert an array of bytes to a string.
- * \param src The source array of bytes.
- * \param dst The destination string buffer.
- * \param count The number of bytes to convert.
- */
-static void stringify(char* src, char* dst, int count)
-{
- int i;
- for (i = 0; i < count; ++i)
- {
- unsigned value = (unsigned char)src[i];
- sprintf(dst, "%02X", value);
- dst += 2;
- }
-}
-
diff --git a/src/base/guid.h b/src/base/guid.h
deleted file mode 100644
index c6e6753..0000000
--- a/src/base/guid.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/**
- * \file guid.h
- * \brief GUID creation and validation.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- *
- * \defgroup guid GUIDs
- * \ingroup base
- *
- * GUID creation and validation functions.
- *
- * @{
- */
-#if !defined(PREMAKE_GUID_H)
-#define PREMAKE_GUID_H
-
-const char* guid_create();
-int guid_is_valid(const char* value);
-
-#endif
-/** @} */
diff --git a/src/base/luastate.c b/src/base/luastate.c
deleted file mode 100644
index 981ca9e..0000000
--- a/src/base/luastate.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * \file luastate.c
- * \brief An accessor for a Lua runtime state object.
- * \author Copyright (c) 2008 Jason Perkins and the Premake project
- */
-
-#include <assert.h>
-#include "luastate.h"
-
-static lua_State* Current = NULL;
-
-
-/**
- * Create a new Lua state object and set the current global state.
- */
-lua_State* luastate_create(void)
-{
- Current = lua_open();
- luaL_openlibs(Current);
- return Current;
-}
-
-
-/**
- * Destroy a Lua state object and clear the current global state.
- */
-void luastate_destroy(lua_State* L)
-{
- assert(L);
- lua_close(L);
- if (Current == L) Current = NULL;
-}
-
-
-/**
- * Return the current global Lua state, or NULL if there is no currently active state.
- */
-lua_State* luastate_get_current(void)
-{
- return Current;
-}
-
-
-
diff --git a/src/base/luastate.h b/src/base/luastate.h
deleted file mode 100644
index acd879b..0000000
--- a/src/base/luastate.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * \file luastate.h
- * \brief An accessor for a Lua runtime state object.
- * \author Copyright (c) 2008 Jason Perkins and the Premake project
- *
- * \defgroup luastate Lua State
- * \ingroup base
- *
- * A wrapper around a global Lua state object, allowing the state to be
- * shared between the main scripting engine object and the cstr_matches_pattern()
- * function (which is in turn used by the project object).
- *
- * @{
- */
-#if !defined(PREMAKE_LUASTATE_H)
-#define PREMAKE_LUASTATE_H
-
-#define lua_c
-#include "lua.h"
-#include "lauxlib.h"
-#include "lualib.h"
-
-
-lua_State* luastate_create(void);
-void luastate_destroy(lua_State* L);
-lua_State* luastate_get_current(void);
-
-
-#endif
-/** @} */
-
diff --git a/src/base/os.lua b/src/base/os.lua
new file mode 100644
index 0000000..7ec2c62
--- /dev/null
+++ b/src/base/os.lua
@@ -0,0 +1,91 @@
+--
+-- os.lua
+-- Additions to the OS namespace.
+-- Copyright (c) 2002-2008 Jason Perkins and the Premake project
+--
+
+
+--
+-- Check the current operating system; may be set with the /os command line flag.
+--
+
+ function os.is(id)
+ local current = _OPTIONS["os"] or _OS
+ return (current:lower() == id:lower())
+ end
+
+
+--
+-- The os.matchdirs() and os.matchfiles() functions
+--
+
+ local function domatch(result, mask, wantfiles)
+ local basedir = path.getdirectory(mask)
+ if (basedir == ".") then basedir = "" end
+
+ local m = os.matchstart(mask)
+ while (os.matchnext(m)) do
+ local fname = os.matchname(m)
+ local isfile = os.matchisfile(m)
+ if ((wantfiles and isfile) or (not wantfiles and not isfile)) then
+ table.insert(result, path.join(basedir, fname))
+ end
+ end
+ os.matchdone(m)
+
+ -- if the mask uses "**", recurse subdirectories
+ if (mask:find("**")) then
+ mask = path.getname(mask)
+ m = os.matchstart(path.join(basedir, "*"))
+ while (os.matchnext(m)) do
+ local dirname = os.matchname(m)
+ local submask = path.join(path.join(basedir, dirname), mask)
+ domatch(result, submask, wantfiles)
+ end
+ os.matchdone(m)
+ end
+ end
+
+ function os.matchdirs(...)
+ local result = { }
+ for _, mask in ipairs(arg) do
+ domatch(result, mask, false)
+ end
+ return result
+ end
+
+ function os.matchfiles(...)
+ local result = { }
+ for _, mask in ipairs(arg) do
+ domatch(result, mask, true)
+ end
+ return result
+ end
+
+
+--
+-- An overload of the os.mkdir() function, which will create any missing
+-- subdirectories along the path.
+--
+
+ local builtin_mkdir = os.mkdir
+ function os.mkdir(p)
+ local dir = ""
+ for part in p:gmatch("[^/]+") do
+ dir = dir .. part
+
+ if (part ~= "" and not path.isabsolute(part) and not os.isdir(dir)) then
+ local ok, err = builtin_mkdir(dir)
+ if (not ok) then
+ return nil, err
+ end
+ end
+
+ dir = dir .. "/"
+ end
+
+ return true
+ end
+
+
+
diff --git a/src/base/path.c b/src/base/path.c
deleted file mode 100644
index 001b500..0000000
--- a/src/base/path.c
+++ /dev/null
@@ -1,353 +0,0 @@
-/**
- * \file path.c
- * \brief Path handling.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-#include "premake.h"
-#include "base/path.h"
-#include "platform/platform.h"
-#include "base/buffers.h"
-#include "base/cstr.h"
-#include "base/dir.h"
-
-static char* CppFileExtensions[] = { ".cc", ".cpp", ".cxx", ".c", ".s", NULL };
-
-
-/**
- * Create an absolute path from a relative one.
- * \param path The relative path to convert.
- * \returns An absolute version of the relative path.
- */
-char* path_absolute(const char* path)
-{
- char* source;
- char* result;
-
- assert(path);
-
- /* normalize the target path */
- source = path_translate(path, "/");
- if (strlen(source) == 0)
- strcpy(source, ".");
-
- /* If the directory is already absolute I don't have to do anything */
- if (path_is_absolute(source))
- return source;
-
- /* start from the current location */
- result = dir_get_current();
-
- /* split up the supplied relative path and tackle it bit by bit */
- while (source)
- {
- char* end = strchr(source, '/');
- if (end)
- *end = 0;
-
- if (cstr_eq(source, ".."))
- {
- char* up = strrchr(result, '/');
- if (up)
- *up = 0;
- }
- else if (!cstr_eq(source, "."))
- {
- strcat(result, "/");
- strcat(result, source);
- }
-
- source = end ? end + 1 : NULL;
- }
-
- return result;
-}
-
-
-/**
- * Assemble a complete file path from its component parts.
- * \param dir The directory portion of the path.
- * \param filename The file name portion of the path.
- * \param ext The extension portion of the path.
- * \returns The assembled file path.
- */
-char* path_assemble(const char* dir, const char* filename, const char* ext)
-{
- char* buffer;
-
- assert(dir);
- assert(filename);
- assert(ext);
-
- buffer = path_join(dir, filename);
- if (ext)
- {
- strcat(buffer, ext);
- }
- return buffer;
-}
-
-
-/**
- * Returns the base name in a path: the filename, without the directory or
- * file extension.
- * \param path The path to split.
- * \returns The base name part of the path.
- */
-char* path_basename(const char* path)
-{
- char* buffer = path_filename(path);
- char* ptr = strrchr(buffer, '.');
- if (ptr)
- {
- *ptr = '\0';
- }
- return buffer;
-}
-
-
-/**
- * Retrieve the directory portion of a path.
- * \param path The path to split.
- * \returns The directory portion of the path. Returns an empty string ("") if
- * the path does not contain any directory information.
- */
-char* path_directory(const char* path)
-{
- char* ptr;
- char* buffer = buffers_next();
-
- assert(path);
- strcpy(buffer, path);
-
- ptr = strrchr(buffer, '/');
- if (ptr)
- *ptr = '\0';
- else
- *buffer = '\0';
-
- return buffer;
-}
-
-
-/**
- * Retrieve the file extension portion of a path. If the path has multiple
- * dots in the filename (ie. filename.my.ext) only the last bit (.ext) will
- * be returned. The dot is included in the extension.
- * \param path The path to split.
- * \returns The extension portion of the path, or an empty string if no extension is present.
- */
-char* path_extension(const char* path)
-{
- char* ptr;
- char* buffer = buffers_next();
-
- assert(path);
- strcpy(buffer, path);
- ptr = strrchr(buffer, '.');
- return (ptr) ? ptr : "";
-}
-
-
-/**
- * Retrieve the fileame (filename.ext) portion of a path.
- * \param path The path to split.
- * \returns The filename portion of the path. Returns an empty string ("") if
- * the path is empty.
- */
-char* path_filename(const char* path)
-{
- char* ptr;
- char* buffer = buffers_next();
-
- assert(path);
-
- ptr = strrchr(path, '/');
- if (ptr)
- {
- strcpy(buffer, ptr + 1);
- }
- else
- {
- strcpy(buffer, path);
- }
-
- return buffer;
-}
-
-
-/**
- * Determine is a path is absolute (rooted at base of filesystem).
- * \param path The path to check.
- * \returns True if the path is absolute.
- */
-int path_is_absolute(const char* path)
-{
- assert(path);
-
- if (path[0] == '/' || path[0] == '\\')
- return 1;
- if (path[1] == ':')
- return 1;
- return 0;
-}
-
-
-/**
- * Returns true if the path represents a C++ source code file; by checking
- * the file extension.
- * \param path The path to check.
- * \returns True if the path uses a known C++ file extension.
- */
-int path_is_cpp_source(const char* path)
-{
- int i;
-
- char* ext = path_extension(path);
- if (cstr_eq(ext, ""))
- {
- return 0;
- }
-
- for (i = 0; CppFileExtensions[i] != NULL; ++i)
- {
- if (cstr_eqi(CppFileExtensions[i], ext))
- return 1;
- }
-
- return 0;
-}
-
-
-/**
- * Join two paths togethers.
- * \param leading The leading path.
- * \param trailing The trailing path.
- * \returns A unified path.
- * \note If the trailing path is absolute, that will be the return value.
- * A join is only performed if the trailing path is relative.
- */
-char* path_join(const char* leading, const char* trailing)
-{
- char* buffer = buffers_next();
-
- /* treat nulls like empty paths */
- leading = (leading != NULL) ? leading : "";
-
- if (!trailing)
- {
- strcpy(buffer, leading);
- return buffer;
- }
-
- if (!leading || path_is_absolute(trailing))
- {
- strcpy(buffer, trailing);
- return buffer;
- }
-
- if (leading)
- {
- strcat(buffer, leading);
- }
-
- if (strlen(buffer) > 0 && !cstr_ends_with(buffer, "/"))
- {
- strcat(buffer, "/");
- }
-
- strcat(buffer, trailing);
- return buffer;
-}
-
-
-/**
- * \brief Compute the relative path between two locations.
- * \param base The base path.
- * \param target The target path.
- * \returns A relative path from the base to the target.
- */
-char* path_relative(const char* base, const char* target)
-{
- int start, i;
- char* result;
-
- /* normalize the two paths */
- char* full_base = path_absolute(base);
- char* full_targ = path_absolute(target);
-
- strcat(full_base, "/");
- strcat(full_targ, "/");
-
- /* trim off the common directories from the start */
- for (start = 0, i = 0; full_base[i] && full_targ[i] && full_base[i] == full_targ[i]; ++i)
- {
- if (full_base[i] == '/')
- start = i + 1;
- }
-
- /* same directory? */
- if (full_base[i] == 0 && full_targ[i] == 0)
- return ".";
-
- /* build a connecting path */
- result = buffers_next();
- if (strlen(full_base) - start > 0)
- {
- strcpy(result, "../");
- for (i = start; full_base[i]; ++i)
- {
- if (full_base[i] == '/' && full_base[i + 1])
- strcat(result, "../");
- }
- }
-
- if (strlen(full_targ) - start > 0)
- {
- strcat(result, full_targ + start);
- }
-
- /* remove the trailing slash */
- result[strlen(result) - 1] = 0;
-
- if (strlen(result) == 0)
- strcpy(result, ".");
- return result;
-}
-
-
-/**
- * Replace all path separator characters in a path.
- * \param path The path to translate.
- * \param sep The desired separator, or NULL for the platform's native separator.
- * \returns The translated path.
- */
-char* path_translate(const char* path, const char* sep)
-{
- char* ptr;
- char* buffer;
-
- assert(path);
-
- buffer = buffers_next();
- if (sep == NULL)
- {
-#if defined(PLATFORM_WINDOWS)
- sep = "\\";
-#else
- sep = "/";
-#endif
- }
-
- strcpy(buffer, path);
- for (ptr = buffer; *ptr; ++ptr)
- {
- if (*ptr == '/' || *ptr == '\\')
- *ptr = *sep;
- }
-
- return buffer;
-}
diff --git a/src/base/path.h b/src/base/path.h
deleted file mode 100644
index caf8b3c..0000000
--- a/src/base/path.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * \file path.h
- * \brief Path handling.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- *
- * \defgroup path Path
- * \ingroup base
- *
- * Path manipulation functions.
- *
- * @{
- */
-#if !defined(PREMAKE_PATH_H)
-#define PREMAKE_PATH_H
-
-char* path_absolute(const char* path);
-char* path_assemble(const char* dir, const char* filename, const char* ext);
-char* path_basename(const char* path);
-char* path_directory(const char* path);
-char* path_extension(const char* path);
-char* path_filename(const char* path);
-int path_is_absolute(const char* path);
-int path_is_cpp_source(const char* path);
-char* path_join(const char* leading, const char* trailing);
-char* path_relative(const char* base, const char* target);
-char* path_translate(const char* path, const char* sep);
-
-#endif
-/** @} */
diff --git a/src/base/path.lua b/src/base/path.lua
new file mode 100644
index 0000000..76a963d
--- /dev/null
+++ b/src/base/path.lua
@@ -0,0 +1,229 @@
+--
+-- path.lua
+-- Path manipulation functions.
+-- Copyright (c) 2002-2008 Jason Perkins and the Premake project
+--
+
+
+ path = { }
+
+
+--
+-- Get the absolute file path from a relative path. The requested
+-- file path doesn't actually need to exist.
+--
+
+ function path.getabsolute(p)
+ -- normalize the target path
+ p = path.translate(p, "/")
+ if (p == "") then p = "." end
+
+ -- if the directory is already absolute I don't need to do anything
+ if (path.isabsolute(p)) then
+ return p
+ end
+
+ -- split up the supplied relative path and tackle it bit by bit
+ local result = os.getcwd()
+ for _,part in ipairs(p:explode("/", true)) do
+ if (part == "..") then
+ result = path.getdirectory(result)
+ elseif (part ~= ".") then
+ result = result .. "/" .. part
+ end
+ end
+
+ return result
+ end
+
+
+--
+-- Retrieve the filename portion of a path, without any extension.
+--
+
+ function path.getbasename(p)
+ local name = path.getname(p)
+ local i = name:findlast(".", true)
+ if (i) then
+ return name:sub(1, i - 1)
+ else
+ return name
+ end
+ end
+
+
+--
+-- Retrieve the directory portion of a path, or an empty string if
+-- the path does not include a directory.
+--
+
+ function path.getdirectory(p)
+ local i = p:findlast("/", true)
+ if (i) then
+ if i > 1 then i = i - 1 end
+ return p:sub(1, i)
+ else
+ return "."
+ end
+ end
+
+
+--
+-- Retrieve the file extension.
+--
+
+ function path.getextension(p)
+ local i = p:findlast(".", true)
+ if (i) then
+ return p:sub(i)
+ else
+ return ""
+ end
+ end
+
+
+
+--
+-- Retrieve the filename portion of a path.
+--
+
+ function path.getname(p)
+ local i = p:findlast("/", true)
+ if (i) then
+ return p:sub(i + 1)
+ else
+ return p
+ end
+ end
+
+
+--
+-- Returns the relative path from src to dest.
+--
+
+ function path.getrelative(src, dst)
+ local result = ""
+
+ -- normalize the two paths
+ src = path.getabsolute(src) .. "/"
+ dst = path.getabsolute(dst) .. "/"
+
+ -- same directory?
+ if (src == dst) then
+ return "."
+ end
+
+ -- trim off the common directories from the front
+ local i = src:find("/")
+ while (i) do
+ if (src:sub(1,i) == dst:sub(1,i)) then
+ src = src:sub(i + 1)
+ dst = dst:sub(i + 1)
+ else
+ break
+ end
+ i = src:find("/")
+ end
+
+ -- back up from dst to get to this common parent
+ i = src:find("/")
+ while (i) do
+ result = result .. "../"
+ i = src:find("/", i + 1)
+ end
+
+ -- tack on the path down to the dst from here
+ result = result .. dst
+
+ -- remove the trailing slash
+ return result:sub(1, -2)
+ end
+
+
+--
+-- Returns true if the path is absolute.
+--
+
+ function path.isabsolute(p)
+ local ch1 = p:sub(1,1)
+ local ch2 = p:sub(2,2)
+ return (ch1 == "/" or ch1 == "\\" or ch2 == ":")
+ end
+
+
+--
+-- Returns true if the filename represents a C/C++ source code file. This check
+-- is used to prevent passing non-code files to the compiler in makefiles. It is
+-- not foolproof, but it has held up well. I'm open to better suggestions.
+--
+
+ function path.iscfile(fname)
+ local extensions = { ".c", ".s" }
+ local ext = path.getextension(fname):lower()
+ return table.contains(extensions, ext)
+ end
+
+ function path.iscppfile(fname)
+ local extensions = { ".cc", ".cpp", ".cxx", ".c", ".s" }
+ local ext = path.getextension(fname):lower()
+ return table.contains(extensions, ext)
+ end
+
+
+--
+-- Returns true if the filename represents a Windows resource file. This check
+-- is used to prevent passing non-resources to the compiler in makefiles.
+--
+
+ function path.isresourcefile(fname)
+ local extensions = { ".rc" }
+ local ext = path.getextension(fname):lower()
+ return table.contains(extensions, ext)
+ end
+
+
+
+--
+-- Join two pieces of a path together into a single path.
+--
+
+ function path.join(leading, trailing)
+ if (not leading) then
+ leading = ""
+ end
+
+ if (not trailing) then
+ return leading
+ end
+
+ if (path.isabsolute(trailing)) then
+ return trailing
+ end
+
+ if (leading == ".") then
+ leading = ""
+ end
+
+ if (leading:len() > 0 and not leading:endswith("/")) then
+ leading = leading .. "/"
+ end
+
+ return leading .. trailing
+ end
+
+
+--
+-- Convert the separators in a path from one form to another. If `sep`
+-- is nil, then a platform-specific separator is used.
+--
+
+ function path.translate(p, sep)
+ if (not sep) then
+ if (os.windows) then
+ sep = "\\"
+ else
+ sep = "/"
+ end
+ end
+ return p:gsub("[/\\]", sep)
+ end
diff --git a/src/base/premake.lua b/src/base/premake.lua
new file mode 100644
index 0000000..d9cfb38
--- /dev/null
+++ b/src/base/premake.lua
@@ -0,0 +1,121 @@
+--
+-- premake.lua
+-- Main (top level) application logic for Premake.
+-- Copyright (c) 2002-2008 Jason Perkins and the Premake project
+--
+
+
+--
+-- Check the specified tools (/cc, /csc, etc.) against the current action
+-- to make sure they are compatible and supported.
+--
+
+ function premake.checktools()
+ local action = premake.actions[_ACTION]
+
+ if (not action.valid_tools) then
+ return true
+ end
+
+ for tool, values in pairs(action.valid_tools) do
+ if (_OPTIONS[tool]) then
+ if (not table.contains(values, _OPTIONS[tool])) then
+ return nil, "the " .. action.shortname .. " action does not support /" .. tool .. "=" .. _OPTIONS[tool]
+ end
+ else
+ _OPTIONS[tool] = values[1]
+ end
+ end
+
+ return true
+ end
+
+
+--
+-- Check to see if the value exists in a list of values, using a
+-- case-insensitive match. If the value does exist, the canonical
+-- version contained in the list is returned, so future tests can
+-- use case-sensitive comparisions.
+--
+
+ function premake.checkvalue(value, allowed)
+ if (allowed) then
+ for _,v in ipairs(allowed) do
+ if (value:lower() == v:lower()) then
+ return v
+ end
+ end
+ else
+ return value
+ end
+ end
+
+
+
+--
+-- Fire a particular action. Generates the output files from the templates
+-- listed in the action descriptor, and calls any registered handler functions.
+--
+
+ function premake.doaction(name)
+ local action = premake.actions[name]
+
+ -- walk the session objects and generate files from the templates
+ local function generatefiles(this, templates)
+ if (templates) then
+ for _,tmpl in ipairs(templates) do
+ local fname = premake.getoutputname(this, tmpl[1])
+ premake.template.generate(tmpl[2], fname, this)
+ end
+ end
+ end
+
+ for _,sln in ipairs(_SOLUTIONS) do
+ generatefiles(sln, action.solutiontemplates)
+ for prj in premake.project.projects(sln) do
+ generatefiles(prj, action.projecttemplates)
+ end
+ end
+
+ if (action.execute) then
+ action.execute()
+ end
+ end
+
+
+--
+-- Returns a list of all of the active terms from the current environment.
+--
+
+ local _terms
+ function premake.getactiveterms()
+ if (not _terms) then
+ _terms = { }
+ table.insert(_terms, _ACTION)
+ table.insert(_terms, _OS)
+ for k,_ in pairs(_OPTIONS) do
+ table.insert(_terms, k)
+ end
+ end
+ return _terms
+ end
+
+
+--
+-- Converts a project object and a template filespec (the first value in an
+-- action's template reference) into a filename for that template's output.
+-- The filespec may be either a file extension, or a function.
+--
+
+ function premake.getoutputname(this, namespec)
+ local fname
+ if (type(namespec) == "function") then
+ fname = namespec(this)
+ else
+ fname = this.name .. namespec
+ end
+ return path.join(this.location, fname)
+ end
+
+
+
diff --git a/src/base/project.lua b/src/base/project.lua
new file mode 100644
index 0000000..cf11ee1
--- /dev/null
+++ b/src/base/project.lua
@@ -0,0 +1,540 @@
+--
+-- projects.lua
+-- Implementations of the solution() and project() functions.
+-- Copyright (c) 2002-2008 Jason Perkins and the Premake project
+--
+
+
+ premake.project = { }
+
+
+--
+-- Performs a sanity check all all of the solutions and projects
+-- in the session to be sure they meet some minimum requirements.
+--
+
+ function premake.project.checkall()
+ local action = premake.actions[_ACTION]
+
+ for _,sln in ipairs(_SOLUTIONS) do
+ -- every solution must have at least one project
+ if (#sln.projects == 0) then
+ return nil, "solution '" .. sln.name .. "' needs at least one project"
+ end
+
+ -- every solution must list configurations
+ if (not sln.configurations or #sln.configurations == 0) then
+ return nil, "solution '" .. sln.name .. "' needs configurations"
+ end
+
+ for _,prj in ipairs(sln.projects) do
+ local cfg = premake.project.getconfig(prj)
+
+ -- every project must have a language
+ if (not cfg.language) then
+ return nil, "project '" ..prj.name .. "' needs a language"
+ end
+
+ -- and the action must support it
+ if (action.valid_languages) then
+ if (not table.contains(action.valid_languages, cfg.language)) then
+ return nil, "the " .. action.shortname .. " action does not support " .. cfg.language .. " projects"
+ end
+ end
+
+ for _,cfgname in ipairs(sln.configurations) do
+ cfg = premake.project.getconfig(prj, cfgname)
+
+ -- every config must have a kind
+ if (not cfg.kind) then
+ return nil, "project '" ..prj.name .. "' needs a kind in configuration '" .. cfgname .. "'"
+ end
+
+ -- and the action must support it
+ if (action.valid_kinds) then
+ if (not table.contains(action.valid_kinds, cfg.kind)) then
+ return nil, "the " .. action.shortname .. " action does not support " .. cfg.kind .. " projects"
+ end
+ end
+ end
+
+ end
+ end
+
+ return true
+ end
+
+
+
+--
+-- Checks an active set of "terms" against a keyword set. Keywords may use
+-- Lua's pattern matching syntax. Comparisions are case-insensitve. Returns
+-- true if every keyword matches at least one term, false otherwise. This
+-- feature is used to filter the list of configuration blocks to a
+-- particular build or platform.
+--
+
+ function premake.project.checkterms(terms, keywords)
+ local function test(kw)
+ for _,term in pairs(terms) do
+ if (term:match(kw)) then return true end
+ end
+ end
+
+ for _,kw in ipairs(keywords) do
+ -- make keyword pattern case insensitive
+ kw = kw:gsub("(%%*)(%a)",
+ function (p,a)
+ if (p:len() % 2 == 1) then
+ return p..a
+ else
+ return p.."["..a:upper()..a:lower().."]"
+ end
+ end)
+
+ -- match it to a term
+ if (not test(kw)) then
+ return false
+ end
+ end
+
+ return true
+ end
+
+
+
+--
+-- Returns an iterator for a project's configurations.
+--
+
+ function premake.project.configs(prj)
+ local i = 0
+ local t = prj.solution.configurations
+ return function ()
+ i = i + 1
+ if (i <= #t) then
+ prj.filter.config = t[i]
+ return premake.project.getconfig(prj, t[i])
+ else
+ prj.filter.config = nil
+ end
+ end
+ end
+
+
+
+--
+-- Locate a project by name; case insensitive.
+--
+
+ function premake.project.find(name)
+ name = name:lower()
+ for _, sln in ipairs(_SOLUTIONS) do
+ for _, prj in ipairs(sln.projects) do
+ if (prj.name:lower() == name) then
+ return prj
+ end
+ end
+ end
+ end
+
+
+
+--
+-- Build a configuration object holding all of the settings that
+-- match the specified filters.
+--
+
+ function premake.project.getconfig(prj, cfgname)
+ -- see if this configuration has already been built and cached
+ local cachekey = cfgname or ""
+
+ local meta = getmetatable(prj)
+ local cfg = meta.__cfgcache[cachekey]
+ if (cfg) then
+ return cfg
+ end
+
+ -- prepare the list of active terms
+ local terms = premake.getactiveterms()
+ terms.config = cfgname
+
+ local function copyfields(cfg, this)
+ for field,value in pairs(this) do
+ if (not table.contains(premake.project.nocopy, field)) then
+ if (type(value) == "table") then
+ if (not cfg[field]) then cfg[field] = { } end
+ table.append(cfg[field], value)
+ else
+ cfg[field] = value
+ end
+ end
+ end
+ end
+
+ -- fields are copied first from the solution, then the solution's configs,
+ -- then from the project, then the project's configs. Each can overwrite
+ -- or add to the values set previously. The objdir field gets special
+ -- treatment, in order to provide a project-level default and still enable
+ -- solution-level overrides
+
+ local cfg = { }
+
+ copyfields(cfg, prj.solution)
+ for _,blk in ipairs(prj.solution.blocks) do
+ if (premake.project.checkterms(terms, blk.keywords)) then
+ copyfields(cfg, blk)
+ end
+ end
+
+ copyfields(cfg, prj)
+ if (not cfg.objdir) then cfg.objdir = path.join(prj.basedir, "obj") end
+ for _,blk in ipairs(prj.blocks) do
+ if (premake.project.checkterms(terms, blk.keywords)) then
+ copyfields(cfg, blk)
+ end
+ end
+
+ -- remove excluded files
+ local files = { }
+ for _, fname in ipairs(cfg.files) do
+ local excluded = false
+ for _, exclude in ipairs(cfg.excludes) do
+ excluded = (fname == exclude)
+ if (excluded) then break end
+ end
+
+ if (not excluded) then
+ table.insert(files, fname)
+ end
+ end
+ cfg.files = files
+
+ -- fix up paths, making them relative to project location where needed
+ for _,key in ipairs(premake.project.locationrelative) do
+ if (type(cfg[key]) == "table") then
+ for i,p in ipairs(cfg[key]) do
+ cfg[key][i] = path.getrelative(prj.location, p)
+ end
+ else
+ if (cfg[key]) then
+ cfg[key] = path.getrelative(prj.location, cfg[key])
+ end
+ end
+ end
+
+ cfg.name = cfgname
+ cfg.project = prj
+
+ -- precompute common calculated values
+ cfg.target = premake.project.gettargetfile(cfg, "target", cfg.kind)
+
+ meta.__cfgcache[cachekey] = cfg
+ return cfg
+ end
+
+
+
+--
+-- Returns the list of targets, matching the current configuration,
+-- for any dependent sibling projects.
+--
+
+ function premake.project.getdependencies(cfg)
+ local siblings = { }
+ for _, link in ipairs(cfg.links) do
+ -- is ths a sibling project?
+ local prj = premake.project.find(link)
+ if (prj) then
+ table.insert(siblings, link)
+ end
+ end
+ return siblings
+ end
+
+
+
+--
+-- Converts the values in a configuration "links" field into a list
+-- library files to be linked. Converts project names to the correct
+-- target for the current configuration.
+--
+
+ function premake.project.getlibraries(cfg, list)
+ local libs = { }
+
+ for _, link in ipairs(list) do
+ -- is ths a sibling project?
+ local prj = premake.project.find(link)
+ if (prj) then
+ local target
+
+ -- figure out the target name
+ local prjcfg = premake.project.getconfig(prj, cfg.name)
+ if (prjcfg.kind == "SharedLib" and os.is("windows")) then
+ target = premake.project.gettargetfile(prjcfg, "implib", prjcfg.kind)
+ else
+ target = prjcfg.target
+ end
+
+ -- target is currently relative to its project location, make
+ -- it relative to my location instead
+ target = path.getabsolute(path.join(prjcfg.location, target))
+ target = path.getrelative(cfg.location, target)
+
+ table.insert(libs, target)
+ else
+ table.insert(libs, link)
+ end
+ end
+
+ return libs
+ end
+
+
+
+--
+-- Return an object directory that is unique across the entire session.
+--
+
+ function premake.project.getobjdir(cfg)
+ if (premake.project.isuniquevalue("objdir", cfg.objdir)) then
+ return cfg.objdir
+ end
+
+ local fn = function (cfg) return path.join(cfg.objdir, cfg.name) end
+ local objdir = fn(cfg)
+ if (premake.project.isuniquevalue("objdir", objdir, fn)) then
+ return objdir
+ end
+
+ return path.join(cfg.objdir, cfg.project.name .. "/" .. cfg.name)
+ end
+
+
+
+--
+-- Retrieve the current object of the a particular type from the session.
+-- The type may be "solution", "container" (the last activated solution or
+-- project), or "config" (the last activated configuration). Returns the
+-- requested container, or nil and an error message.
+--
+
+ function premake.project.getobject(t)
+ local container
+
+ if (t == "container" or t == "solution") then
+ container = premake.CurrentContainer
+ else
+ container = premake.CurrentConfiguration
+ end
+
+ if (t == "solution" and type(container) ~= "solution") then
+ container = nil
+ end
+
+ local msg
+ if (not container) then
+ if (t == "container") then
+ msg = "no active solution or project"
+ elseif (t == "solution") then
+ msg = "no active solution"
+ else
+ msg = "no active solution, project, or configuration"
+ end
+ end
+
+ return container, msg
+ end
+
+
+
+--
+-- Builds a platform specific target (executable, library) file name of a
+-- specific type, using the information from a project configuration.
+--
+
+ function premake.project.gettargetfile(cfg, field, kind, os)
+ if (not os) then os = _OPTIONS.os or _OS end
+
+ local name = cfg[field.."name"] or cfg.targetname or cfg.project.name
+ local dir = cfg[field.."dir"] or cfg.targetdir or cfg.basedir
+
+ local prefix = ""
+ local extension = ""
+
+ if (os == "windows") then
+ if (kind == "ConsoleExe" or kind == "WindowedExe") then
+ extension = ".exe"
+ elseif (kind == "SharedLib") then
+ extension = ".dll"
+ elseif (kind == "StaticLib") then
+ extension = ".lib"
+ end
+ elseif (os == "macosx" and kind == "WindowedExe") then
+ name = name .. ".app/Contents/MacOS/" .. name
+ else
+ if (kind == "SharedLib") then
+ prefix = "lib"
+ extension = ".so"
+ elseif (kind == "StaticLib") then
+ prefix = "lib"
+ extension = ".a"
+ end
+ end
+
+ prefix = cfg[field.."prefix"] or prefix
+ extension = cfg[field.."extension"] or extension
+
+ return path.join(dir, prefix .. name .. extension)
+ end
+
+
+--
+-- Determines if a field value is unique across all configurations of
+-- all projects in the session. Used to create unique output targets.
+--
+
+ function premake.project.isuniquevalue(fieldname, value, fn)
+ local count = 0
+ for _, sln in ipairs(_SOLUTIONS) do
+ for _, prj in ipairs(sln.projects) do
+ for _, cfgname in ipairs(sln.configurations) do
+ local cfg = premake.project.getconfig(prj, cfgname)
+
+ local tst
+ if (fn) then
+ tst = fn(cfg)
+ else
+ tst = cfg[fieldname]
+ end
+
+ if (tst == value) then
+ count = count + 1
+ if (count > 1) then return false end
+ end
+ end
+ end
+ end
+ return true
+ end
+
+
+
+--
+-- Returns an iterator for a solution's projects.
+--
+
+ function premake.project.projects(sln)
+ local i = 0
+ return function ()
+ i = i + 1
+ if (i <= #sln.projects) then
+ local prj = sln.projects[i]
+
+ -- merge solution and project values
+ local merged = premake.project.getconfig(prj)
+ setmetatable(merged, getmetatable(prj))
+ merged.name = prj.name
+ merged.blocks = prj.blocks
+ return merged
+ end
+ end
+ end
+
+
+
+--
+-- Adds values to an array field of a solution/project/configuration. `ctype`
+-- specifies the container type (see premake.getobject) for the field.
+--
+
+ function premake.project.setarray(ctype, fieldname, value, allowed)
+ local container, err = premake.project.getobject(ctype)
+ if (not container) then
+ error(err, 3)
+ end
+
+ if (not container[fieldname]) then
+ container[fieldname] = { }
+ end
+
+ local function doinsert(value)
+ if (type(value) == "table") then
+ for _,v in ipairs(value) do
+ doinsert(v)
+ end
+ else
+ local v = premake.checkvalue(value, allowed)
+ if (not v) then error("invalid value '" .. value .. "'", 3) end
+ table.insert(container[fieldname], v)
+ end
+ end
+
+ if (value) then
+ doinsert(value)
+ end
+
+ return container[fieldname]
+ end
+
+
+
+--
+-- Adds values to an array-of-directories field of a solution/project/configuration.
+-- `ctype` specifies the container type (see premake.getobject) for the field. All
+-- values are converted to absolute paths before being stored.
+--
+
+ local function domatchedarray(ctype, fieldname, value, matchfunc)
+ local result = { }
+
+ function makeabsolute(arr)
+ for i,value in ipairs(arr) do
+ if (type(value) == "table") then
+ makeabsolute(value)
+ else
+ if value:find("*") then
+ makeabsolute(matchfunc(value))
+ else
+ table.insert(result, path.getabsolute(value))
+ end
+ end
+ end
+ end
+
+ makeabsolute(value)
+ return premake.project.setarray(ctype, fieldname, result)
+ end
+
+ function premake.project.setdirarray(ctype, fieldname, value)
+ return domatchedarray(ctype, fieldname, value, os.matchdirs)
+ end
+
+ function premake.project.setfilearray(ctype, fieldname, value)
+ return domatchedarray(ctype, fieldname, value, os.matchfiles)
+ end
+
+
+--
+-- Set a new value for a string field of a solution/project/configuration. `ctype`
+-- specifies the container type (see premake.project.getobject) for the field.
+--
+
+ function premake.project.setstring(ctype, fieldname, value, allowed)
+ -- find the container for this value
+ local container, err = premake.project.getobject(ctype)
+ if (not container) then
+ error(err, 3)
+ end
+
+ -- if a value was provided, set it
+ if (value) then
+ local v = premake.checkvalue(value, allowed)
+ if (not v) then error("invalid value '" .. value .. "'", 3) end
+ container[fieldname] = v
+ end
+
+ return container[fieldname]
+ end
+ \ No newline at end of file
diff --git a/src/base/stream.c b/src/base/stream.c
deleted file mode 100644
index 42c512a..0000000
--- a/src/base/stream.c
+++ /dev/null
@@ -1,330 +0,0 @@
-/**
- * \file stream.c
- * \brief Output stream handling.
- * \author Copyright (c) 2007-2008 Jason Perkins and the Premake project
- */
-
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "premake.h"
-#include "base/error.h"
-#include "base/dir.h"
-#include "base/path.h"
-#include "base/stream.h"
-
-
-DEFINE_CLASS(Stream)
-{
- FILE* file;
- const char* newline;
- char* buffer;
-};
-
-
-static struct Stream_impl Console_impl = { NULL, "\n", NULL };
-
-
-/**
- * The console output stream.
- * Use the stream_write() functions and this stream object instead
- * of the usual C functions like printf(). The stream functions have
- * more features -- such as setting the line ending sequence -- and
- * can be captured for automated testing.
- */
-Stream Console = &Console_impl;
-
-
-/**
- * Create a new file output stream, overwriting any existing file.
- * \param filename The name of the file to create.
- * \returns A new file stream.
- */
-Stream stream_create_file(const char* filename)
-{
- Stream strm;
- const char* dirname;
- FILE* file;
-
- /* make sure the directory exists before writing to it */
- dirname = path_directory(filename);
- if (dir_create(dirname) != OKAY)
- {
- return NULL;
- }
-
- /* create the file */
- file = fopen(filename, "wb");
- if (file == NULL)
- {
- error_set("Unable to open file %s", filename);
- return NULL;
- }
-
- /* build the stream object */
- strm = stream_create_null();
- strm->file = file;
- return strm;
-}
-
-
-/**
- * Create a "null" stream, which discards any writes; intended for automated testing.
- * \returns A new stream object.
- */
-Stream stream_create_null()
-{
- Stream strm = ALLOC_CLASS(Stream);
- strm->file = NULL;
- strm->newline = "\n";
- strm->buffer = NULL;
- return strm;
-}
-
-
-/**
- * Close a stream and release the associated memory.
- * \param strm The stream to close.
- */
-void stream_destroy(Stream strm)
-{
- assert(strm);
- if (strm != Console)
- {
- if (strm->file != NULL)
- {
- fclose(strm->file);
- }
- free(strm);
- }
-}
-
-
-/**
- * Capture the text written to a stream into a buffer.
- * When a stream is captured all text is written to the buffer, and
- * output to the associated file is blocked.
- * \param strm The stream to capture.
- * \param buffer The buffer to contain the captured text. No checks are made
- * on the size of the buffer while writing, so use carefully.
- * May be NULL to disable buffering.
- */
-void stream_set_buffer(Stream strm, char* buffer)
-{
- assert(strm);
- strm->buffer = buffer;
- strm->buffer[0] = '\0';
-}
-
-
-/**
- * Set the newline character sequence.
- * \param strm The stream to set.
- * \param newline The EOL sequence.
- */
-void stream_set_newline(Stream strm, const char* newline)
-{
- assert(strm);
- strm->newline = newline;
-}
-
-
-/**
- * Write a formatted list of strings.
- * \param strm The stream to which to write.
- * \param strs The list of strings to write.
- * \param start The start string, always written first, even if there are no items in the list.
- * \param prefix A prefix string, to be written before each item.
- * \param postfix A postfix string, to be written after each item.
- * \param infix An infix strings, to write between items, after the
- * previous postfix string and before the next prefix.
- * \param end The end string, always written last, even if there are no items in the list.
- * \param writer A callback function to handle output of each list item.
- * \returns OKAY if successful.
- */
-int stream_write_strings(Stream strm, Strings strs, const char* start, const char* prefix, const char* postfix, const char* infix, const char* end, StreamWriterFunc writer)
-{
- int i, n, z;
-
- z = stream_write(strm, start);
-
- n = strings_size(strs);
- for (i = 0; i < n; ++i)
- {
- const char* value = strings_item(strs, i);
- if (i > 0) z |= stream_write(strm, infix);
- z |= stream_write(strm, prefix);
- if (writer != NULL)
- {
- z |= writer(strm, value);
- }
- else
- {
- z |= stream_write(strm, value);
- }
- z |= stream_write(strm, postfix);
- }
-
- z |= stream_write(strm, end);
- return z;
-}
-
-
-/**
- * Write a formatted list of strings, followed by a newline.
- * \param strm The stream to which to write.
- * \param strs The list of strings to write.
- * \param start The start string, always written first, even if there are no items in the list.
- * \param prefix A prefix string, to be written before each item.
- * \param postfix A postfix string, to be written after each item.
- * \param infix An infix strings, to write between items, after the
- * previous postfix string and before the next prefix.
- * \param end The end string, always written last, even if there are no items in the list.
- * \param writer A callback function to handle output of each list item.
- * \returns OKAY if successful.
- */
-int stream_writeline_strings(Stream strm, Strings strs, const char* start, const char* prefix, const char* postfix, const char* infix, const char* end, StreamWriterFunc writer)
-{
- int z = OKAY;
- z |= stream_write_strings(strm, strs, start, prefix, postfix, infix, end, writer);
- z |= stream_writeline(strm, "");
- return z;
-}
-
-
-/**
- * Format and print a string using printf-style codes and a variable argument list.
- * \param strm The stream to which to write.
- * \param value The value to print; may contain printf-style formatting codes.
- * \param args A variable argument list to populate the printf-style codes in `value`.
- * \returns OKAY if successful.
- */
-int stream_vprintf(Stream strm, const char* value, va_list args)
-{
- if (strm->buffer)
- {
- /* write to the end of the current contents of the buffer */
- char* start = strm->buffer + strlen(strm->buffer);
- vsprintf(start, value, args);
- }
- else if (strm == Console)
- {
- vfprintf(stdout, value, args);
- }
- else if (strm->file)
- {
- vfprintf(strm->file, value, args);
- }
- return OKAY;
-}
-
-
-/**
- * Write a string value to a stream.
- * \param strm The stream.
- * \param value The value to append to the stream.
- * \returns OKAY is successful.
- */
-int stream_write(Stream strm, const char* value, ...)
-{
- int status;
- va_list args;
-
- va_start(args, value);
- status = stream_vprintf(strm, value, args);
- va_end(args);
-
- return status;
-}
-
-
-/**
- * Write a string value to a stream, applying XML escape codes in the process.
- * \param strm The stream to which to write.
- * \param value The string to write.
- * \returns OKAY if successful.
- */
-int stream_write_escaped(Stream strm, const char* value)
-{
- const char* ptr;
- char buffer[2];
- int z = OKAY;
-
- buffer[1] = '\0';
-
- for (ptr = value; *ptr != '\0'; ++ptr)
- {
- switch (*ptr)
- {
- case '\"':
- z |= stream_write(strm, "&quot;");
- break;
- case '&':
- z |= stream_write(strm, "&amp;");
- break;
- case '\'':
- z |= stream_write(strm, "&apos;");
- break;
- case '<':
- z |= stream_write(strm, "&lt;");
- break;
- case '>':
- z |= stream_write(strm, "&gt;");
- break;
- default:
- z |= stream_write(strm, "%c", *ptr);
- break;
- }
- }
-
- return z;
-}
-
-
-/**
- * Write N copies of a string to a stream.
- * \param strm The stream to which to write.
- * \param value The string to write.
- * \param n The number of copies to write.
- * \returns OKAY if successful.
- */
-int stream_write_n(Stream strm, const char* value, int n)
-{
- int i, z = OKAY;
- for (i = 0; i < n; ++i)
- {
- z |= stream_write(strm, value);
- }
- return z;
-}
-
-
-/**
- * Writes the Unicode encoding marker sequence into the stream.
- * \param strm The stream to which to write.
- */
-int stream_write_unicode_marker(Stream strm)
-{
- return stream_write(strm, "\357\273\277");
-}
-
-
-/**
- * Write a string value, followed by a newline, to a stream.
- * \param strm The stream.
- * \param value The value to append to the stream.
- * \returns OKAY if successful.
- */
-int stream_writeline(Stream strm, const char* value, ...)
-{
- int status;
- va_list args;
-
- va_start(args, value);
- status = stream_vprintf(strm, value, args);
- status |= stream_write(strm, strm->newline);
- va_end(args);
-
- return status;
-}
diff --git a/src/base/stream.h b/src/base/stream.h
deleted file mode 100644
index fdc1058..0000000
--- a/src/base/stream.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * \file stream.h
- * \brief Output stream handling.
- * \author Copyright (c) 2007-2008 Jason Perkins and the Premake project
- *
- * \defgroup stream Streams
- * \ingroup base
- *
- * An output stream class.
- *
- * @{
- */
-#if !defined(PREMAKE_STREAM_H)
-#define PREMAKE_STREAM_H
-
-#include <stdarg.h>
-#include "strings.h"
-
-DECLARE_CLASS(Stream);
-
-extern Stream Console;
-
-typedef int (*StreamWriterFunc)(Stream strm, const char *value);
-
-Stream stream_create_file(const char* filename);
-Stream stream_create_null(void);
-void stream_destroy(Stream stream);
-void stream_set_buffer(Stream strm, char* buffer);
-void stream_set_newline(Stream strm, const char* newline);
-int stream_vprintf(Stream strm, const char* value, va_list args);
-int stream_write(Stream strm, const char* value, ...);
-int stream_write_escaped(Stream strm, const char* value);
-int stream_write_n(Stream strm, const char* value, int n);
-int stream_write_strings(Stream strm, Strings strs, const char* start, const char* prefix, const char* postfix, const char* infix, const char* end, StreamWriterFunc writer);
-int stream_write_unicode_marker(Stream strm);
-int stream_writeline(Stream strm, const char* value, ...);
-int stream_writeline_strings(Stream strm, Strings strs, const char* start, const char* prefix, const char* postfix, const char* infix, const char* end, StreamWriterFunc writer);
-
-#endif
-/** @} */
diff --git a/src/base/string.c b/src/base/string.c
deleted file mode 100644
index 09db9c9..0000000
--- a/src/base/string.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/**
- * \file string.c
- * \brief Dynamic string handling.
- * \author Copyright (c) 2007-2008 Jason Perkins and the Premake project
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include "premake.h"
-#include "base/string.h"
-
-
-DEFINE_CLASS(String)
-{
- char* contents;
- int capacity;
-};
-
-
-/**
- * Create a new dynamic string object from an existing C string.
- * \param value The C string value.
- * \returns A new dynamic string object containing a copy of the string.
- */
-String string_create(const char* value)
-{
- if (value != NULL)
- {
- String str = ALLOC_CLASS(String);
- str->capacity = strlen(value) + 1;
- str->contents = (char*)malloc(str->capacity);
- strcpy(str->contents, value);
- return str;
- }
- else
- {
- return NULL;
- }
-}
-
-
-/**
- * Destroy a dynamic string object and free the associated memory.
- * \param str The string to destroy.
- */
-void string_destroy(String str)
-{
- if (str != NULL)
- {
- free(str->contents);
- free(str);
- }
-}
-
-
-/**
- * Return the contents of a dynamic string as a C string.
- * \param str The string to query.
- * \returns The C string value.
- */
-const char* string_cstr(String str)
-{
- if (str != NULL)
- return str->contents;
- else
- return NULL;
-}
diff --git a/src/base/string.h b/src/base/string.h
deleted file mode 100644
index 47c6281..0000000
--- a/src/base/string.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * \file string.h
- * \brief Dynamic string handling.
- * \author Copyright (c) 2007-2008 Jason Perkins and the Premake project
- *
- * \defgroup string Strings
- * \ingroup base
- *
- * A dynamic string class.
- *
- * @{
- */
-#if !defined(PREMAKE_STRING_H)
-#define PREMAKE_STRING_H
-
-DECLARE_CLASS(String);
-
-String string_create(const char* value);
-void string_destroy(String str);
-const char* string_cstr(String str);
-
-#endif
-/** @} */
diff --git a/src/base/string.lua b/src/base/string.lua
new file mode 100644
index 0000000..2e5843a
--- /dev/null
+++ b/src/base/string.lua
@@ -0,0 +1,56 @@
+--
+-- string.lua
+-- Additions to Lua's built-in string functions.
+-- Copyright (c) 2002-2008 Jason Perkins and the Premake project
+--
+
+
+--
+-- Returns true if `haystack` ends with the sequence `needle`.
+--
+
+ function string.endswith(haystack, needle)
+ if (haystack and needle) then
+ local hlen = haystack:len()
+ local nlen = needle:len()
+ if (hlen >= nlen) then
+ return (haystack:sub(-nlen) == needle)
+ end
+ end
+
+ return false
+ end
+
+
+--
+-- Returns an array of strings, each of which is a substring of s
+-- formed by splitting on boundaries formed by `pattern`.
+--
+
+ function string.explode(s, pattern, plain)
+ if (pattern == '') then return false end
+ local pos = 0
+ local arr = { }
+ for st,sp in function() return s:find(pattern, pos, plain) end do
+ table.insert(arr, s:sub(pos, st-1))
+ pos = sp + 1
+ end
+ table.insert(arr, s:sub(pos))
+ return arr
+ end
+
+
+--
+-- Find the last instance of a pattern in a string.
+--
+
+ function string.findlast(s, pattern, plain)
+ local curr = 0
+ repeat
+ local next = s:find(pattern, curr + 1, plain)
+ if (next) then curr = next end
+ until (not next)
+ if (curr > 0) then
+ return curr
+ end
+ end
diff --git a/src/base/strings.c b/src/base/strings.c
deleted file mode 100644
index fc53401..0000000
--- a/src/base/strings.c
+++ /dev/null
@@ -1,158 +0,0 @@
-/**
- * \file strings.c
- * \brief A dynamic array of C strings.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include <stdlib.h>
-#include "premake.h"
-#include "strings.h"
-#include "base/array.h"
-#include "base/cstr.h"
-#include "base/string.h"
-
-
-DEFINE_CLASS(Strings)
-{
- Array contents;
-};
-
-
-
-/**
- * Create a new dynamic array of C strings.
- * \returns A new string array.
- */
-Strings strings_create()
-{
- Strings strs = ALLOC_CLASS(Strings);
- strs->contents = array_create();
- return strs;
-}
-
-
-/**
- * Create a dynamic array of C strings, initialized from an existing array.
- * \param items The initial list of items for the strings collection.
- * \returns A new string array.
- */
-Strings strings_create_from_array(const char* items[])
-{
- Strings strs = strings_create();
- for ( ; *items != NULL; ++items)
- {
- strings_add(strs, *items);
- }
- return strs;
-}
-
-
-/**
- * Destroy a strings array and free the associated memory.
- * \param strs The string array to destroy.
- */
-void strings_destroy(Strings strs)
-{
- int i, n;
- n = strings_size(strs);
- for (i = 0; i < n; ++i)
- {
- String item = (String)array_item(strs->contents, i);
- if (item != NULL)
- {
- string_destroy(item);
- }
- }
- array_destroy(strs->contents);
- free(strs);
-}
-
-
-/**
- * Add a new item to the end of an array of strings.
- * \param strs The array of strings.
- * \param item The C string item to add.
- */
-void strings_add(Strings strs, const char* item)
-{
- String str = (item != NULL) ? string_create(item) : NULL;
- array_add(strs->contents, (void*)str);
-}
-
-
-/**
- * Append the contents of one string vector to another.
- * \param dest The destination vector.
- * \param src The source vector.
- */
-void strings_append(Strings dest, Strings src)
-{
- int i, n;
- n = strings_size(src);
- for (i = 0; i < n; ++i)
- {
- const char* item = strings_item(src, i);
- strings_add(dest, item);
- }
-}
-
-
-/**
- * Returns true if the collection contains the specified value.
- */
-int strings_contains(Strings strs, const char* item)
-{
- int i, n;
- n = strings_size(strs);
- for (i = 0; i < n; ++i)
- {
- const char* str = strings_item(strs, i);
- if (cstr_eqi(str, item))
- return 1;
- }
- return 0;
-}
-
-
-/**
- * Retrieve an C string item from an array of strings.
- * \param strs The string array to query.
- * \param index The index of the item to retrieve.
- * \returns A pointer to the C string item.
- */
-const char* strings_item(Strings strs, int index)
-{
- String item = (String)array_item(strs->contents, index);
- return (item != NULL) ? string_cstr(item) : NULL;
-}
-
-
-/**
- * Set the value at a particular index of the array.
- * \param strs The string array.
- * \param index The index of the item to set.
- * \param item The new item.
- */
-void strings_set(Strings strs, int index, const char* item)
-{
- String str = (String)array_item(strs->contents, index);
- if (str != NULL)
- {
- string_destroy(str);
- }
-
- str = (item != NULL) ? string_create(item) : NULL;
- array_set(strs->contents, index, (void*)str);
-}
-
-
-/**
- * Get the number of items in the string array.
- * \param strs The string array to query.
- * \returns The number elements currently in the array.
- */
-int strings_size(Strings strs)
-{
- return array_size(strs->contents);
-}
-
diff --git a/src/base/strings.h b/src/base/strings.h
deleted file mode 100644
index 5a871e5..0000000
--- a/src/base/strings.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * \file strings.h
- * \brief A dynamic array of C strings.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- *
- * \defgroup strings String Collection
- * \ingroup base
- *
- * A dynamic array of C strings.
- *
- * @{
- */
-#if !defined(PREMAKE_STRINGS_H)
-#define PREMAKE_STRINGS_H
-
-DECLARE_CLASS(Strings);
-
-Strings strings_create(void);
-Strings strings_create_from_array(const char** items);
-void strings_destroy(Strings strs);
-
-void strings_add(Strings strs, const char* item);
-void strings_append(Strings dest, Strings src);
-int strings_contains(Strings strs, const char* item);
-const char* strings_item(Strings strs, int index);
-void strings_set(Strings strs, int index, const char* item);
-int strings_size(Strings strs);
-
-#endif
-/** @} */
diff --git a/src/base/table.lua b/src/base/table.lua
new file mode 100644
index 0000000..4038859
--- /dev/null
+++ b/src/base/table.lua
@@ -0,0 +1,77 @@
+--
+-- table.lua
+-- Additions to Lua's built-in table functions.
+-- Copyright (c) 2002-2008 Jason Perkins and the Premake project
+--
+
+
+--
+-- Adds the values from one array to the end of another.
+--
+
+ function table.append(dst, src)
+ for _,v in ipairs(src) do
+ table.insert(dst, v)
+ end
+ end
+
+
+--
+-- Returns true if the table contains the specified value.
+--
+
+ function table.contains(t, value)
+ for _,v in pairs(t) do
+ if (v == value) then
+ return true
+ end
+ end
+ return false
+ end
+
+
+--
+-- Enumerates an array of objects and returns a new table containing
+-- only the value of one particular field.
+--
+
+ function table.extract(arr, fname)
+ local result = { }
+ for _,v in ipairs(arr) do
+ table.insert(result, v[fname])
+ end
+ return result
+ end
+
+
+
+--
+-- Merges an array of items into a string.
+--
+
+ function table.implode(arr, before, after, between)
+ local result = ""
+ for _,v in ipairs(arr) do
+ if (result ~= "" and between) then
+ result = result .. between
+ end
+ result = result .. before .. v .. after
+ end
+ return result
+ end
+
+
+--
+-- Translates the values contained in array, using the specified
+-- translation table, and returns the results in a new array.
+--
+
+ function table.translate(arr, translation)
+ local result = { }
+ for _, value in ipairs(arr) do
+ table.insert(result, translation[value])
+ end
+ return result
+ end
+
+ \ No newline at end of file
diff --git a/src/base/template.lua b/src/base/template.lua
new file mode 100644
index 0000000..6d1075f
--- /dev/null
+++ b/src/base/template.lua
@@ -0,0 +1,131 @@
+--
+-- template.lua
+-- The templating system.
+-- Copyright (c) 2008 Jason Perkins and the Premake project
+--
+
+
+ premake.template = { }
+
+
+--
+-- Process a literal string, splitting up newlines so that the generated
+-- code will match the original template line for line, so error messages
+-- can refer to the correct line in the template. Lua's [[ ]] string syntax
+-- messes with newlines, making this more complicated than it needs to be.
+--
+
+ local function literal(str)
+ local code = ""
+
+ for line in str:gmatch("[^\n]*") do
+ if (line:len() > 0) then
+ code = code .. "io.write[=[" .. line .. "]=]"
+ else
+ code = code .. "io.write(eol)\n"
+ end
+ end
+
+ return code:sub(1, -15)
+ end
+
+
+--
+-- Convert a template to Lua script code.
+--
+
+ function premake.template.encode(tmpl)
+ code = ""
+
+ -- normalize line endings
+ tmpl = tmpl:gsub("\r\n", "\n")
+
+ while (true) do
+ -- find an escaped block
+ start, finish = tmpl:find("<%%.-%%>")
+ if (not start) then break end
+
+ local before = tmpl:sub(1, start - 1)
+ local after = tmpl:sub(finish + 1)
+
+ -- get the block type and contents
+ local block
+ local isexpr = (tmpl:sub(start + 2, start + 2) == "=")
+ if (isexpr) then
+ block = tmpl:sub(start + 3, finish - 2)
+ else
+ block = tmpl:sub(start + 2, finish - 2)
+ end
+
+ -- if a statement block, strip out everything else on that line
+ if (not isexpr) then
+ finish = before:findlast("\n", true)
+ if (finish) then before = before:sub(1, finish) end
+
+ start = after:find("\n", 1, true)
+ if (start) then after = after:sub(start + 1) end
+ end
+
+ -- output everything before the block
+ code = code .. literal(before)
+
+ -- output the block itself
+ if (isexpr) then
+ code = code .. "io.write(" .. block .. ")"
+ else
+ code = code .. block .. "\n"
+ end
+
+ -- do it again, with everything after the block
+ tmpl = after
+ end
+
+ -- tack on everything after the last block
+ code = code .. literal(tmpl)
+ return code
+ end
+
+
+--
+-- Generate output from a template, provided a filename and an object.
+--
+
+ function premake.template.generate(tmpl, fname, this)
+ premake.template.newline = "\\n"
+
+ local f, err = io.open(fname, "wb")
+ if (not f) then
+ error(err, 0)
+ end
+
+ io.output(f)
+ tmpl(this)
+ io.output():close()
+ end
+
+
+--
+-- Load a template from a string and convert to a template function.
+--
+
+ function premake.template.loadstring(name, str)
+ local code = premake.template.encode(str)
+ local fn, msg = loadstring("return function (this) eol='\\n';" .. code .. " end", name)
+ if (not fn) then
+ error(msg, 0)
+ end
+ return fn()
+ end
+
+
+--
+-- Load a template from a file and convert it to a template function.
+--
+
+ function premake.template.loadfile(fname)
+ local f = io.open(fname, "rb")
+ local tmpl = f:read("*a")
+ f:close()
+ return premake.template.loadstring(path.getname(fname), tmpl)
+ end
+
diff --git a/src/base/tests/base_tests.cpp b/src/base/tests/base_tests.cpp
deleted file mode 100644
index 58368ec..0000000
--- a/src/base/tests/base_tests.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * \file base_tests.cpp
- * \brief Automated tests for Premake base library.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "testing/testing.h"
-extern "C" {
-#include "base/base.h"
-}
-
-
-/**
- * \brief Run the base library automated tests.
- * \returns OKAY if all tests completed successfully.
- */
-int base_tests()
-{
- int status = tests_run_suite("cstr");
- if (status == OKAY) status = tests_run_suite("base");
- return status;
-}
diff --git a/src/base/tests/cstr_tests.cpp b/src/base/tests/cstr_tests.cpp
deleted file mode 100644
index 5a82fdb..0000000
--- a/src/base/tests/cstr_tests.cpp
+++ /dev/null
@@ -1,190 +0,0 @@
-/**
- * \file cstr_tests.cpp
- * \brief C string automated tests.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "testing/testing.h"
-extern "C" {
-#include "base/cstr.h"
-}
-
-SUITE(cstr)
-{
- /**************************************************************************
- * cstr_contains() tests
- **************************************************************************/
-
- TEST(CStrContains_ReturnsTrue_OnMatch)
- {
- CHECK(cstr_contains("Abcdef", "cd"));
- }
-
- TEST(CStrContains_ReturnsFalse_OnMismatch)
- {
- CHECK(!cstr_contains("Abcdef", "xy"));
- }
-
-
- /**************************************************************************
- * cstr_ends_with() tests
- **************************************************************************/
-
- TEST(CStrEndsWith_ReturnsTrue_OnMatch)
- {
- CHECK(cstr_ends_with("Abcdef", "def"));
- }
-
- TEST(CStrEndsWith_ReturnsFalse_OnMismatch)
- {
- CHECK(!cstr_ends_with("Abcdef", "ghi"));
- }
-
- TEST(CStrEndsWith_ReturnsFalse_OnLongerNeedle)
- {
- CHECK(!cstr_ends_with("Abc", "Abcdef"));
- }
-
- TEST(CStrEndsWith_ReturnsFalse_OnNullHaystack)
- {
- CHECK(!cstr_ends_with(NULL, "ghi"));
- }
-
- TEST(CStrEndsWith_ReturnsFalse_OnNullNeedle)
- {
- CHECK(!cstr_ends_with("Abc", NULL));
- }
-
-
- /**************************************************************************
- * cstr_eq() tests
- **************************************************************************/
-
- TEST(CStrEq_ReturnsTrue_OnMatch)
- {
- CHECK(cstr_eq("A string", "A string"));
- }
-
- TEST(CStrEq_ReturnsFalse_OnMismatch)
- {
- CHECK(!cstr_eq("A string", "A different string"));
- }
-
- TEST(CStrEq_ReturnsFalse_OnNullTarget)
- {
- CHECK(!cstr_eq(NULL, "something"));
- }
-
- TEST(CStrEq_ReturnsFalse_OnNullPattern)
- {
- CHECK(!cstr_eq("something", NULL));
- }
-
-
- /**************************************************************************
- * cstr_eqi() tests
- **************************************************************************/
-
- TEST(CStrEqi_ReturnsTrue_OnMatch)
- {
- CHECK(cstr_eqi("A string", "a String"));
- }
-
- TEST(CStrEqi_ReturnsFalse_OnMismatch)
- {
- CHECK(!cstr_eqi("A string", "a different string"));
- }
-
- TEST(CStrEqi_ReturnsFalse_OnNullTarget)
- {
- CHECK(!cstr_eqi(NULL, "something"));
- }
-
- TEST(CStrEqi_ReturnsFalse_OnNullPattern)
- {
- CHECK(!cstr_eqi("something", NULL));
- }
-
-
- /**************************************************************************
- * cstr_format() tests
- **************************************************************************/
-
- TEST(CstrFormat_ReturnsFormatted)
- {
- char* result = cstr_format("$(OBJDIR)/%s.o", "hello");
- CHECK_EQUAL("$(OBJDIR)/hello.o", result);
- }
-
-
- /**************************************************************************
- * cstr_matches_pattern() tests
- **************************************************************************/
-
- TEST(CStrMatchesPattern_ReturnsTrue_OnMatch)
- {
- CHECK(cstr_matches_pattern("01234", "%d*"));
- }
-
- TEST(CStrMatchesPattern_ReturnsFalse_OnNonMatch)
- {
- CHECK(!cstr_matches_pattern("01234", "%a*"));
- }
-
- TEST(CStrMatchesPattern_ReturnsTrue_OnCaseMismatch)
- {
- CHECK(cstr_matches_pattern("Debug", "debug"));
- }
-
-
- /**************************************************************************
- * cstr_starts_with() tests
- **************************************************************************/
-
- TEST(CStrStartsWith_ReturnsTrue_OnMatch)
- {
- CHECK(cstr_starts_with("Abcdef", "Abc"));
- }
-
- TEST(CStrStartsWith_ReturnsFalse_OnMismatch)
- {
- CHECK(!cstr_starts_with("Abcdef", "ghi"));
- }
-
- TEST(CStrStartsWith_ReturnsFalse_OnLongerNeedle)
- {
- CHECK(!cstr_starts_with("Abc", "Abcdef"));
- }
-
- TEST(CStrStartsWith_ReturnsFalse_OnNullHaystack)
- {
- CHECK(!cstr_starts_with(NULL, "ghi"));
- }
-
- TEST(CStrStartsWith_ReturnsFalse_OnNullNeedle)
- {
- CHECK(!cstr_starts_with("Abc", NULL));
- }
-
-
- /**********************************************************************
- * cstr_trim() tests
- **********************************************************************/
-
- TEST(CStrTrim_DoesNothing_OnNoMatch)
- {
- char buffer[32];
- strcpy(buffer, "Msg");
- cstr_trim(buffer, '/');
- CHECK_EQUAL("Msg", buffer);
- }
-
- TEST(CStrTrim_DoesTrim_OnMatch)
- {
- char buffer[32];
- strcpy(buffer, "Msg///");
- cstr_trim(buffer, '/');
- CHECK_EQUAL("Msg", buffer);
- }
-}
diff --git a/src/base/tests/dir_tests.cpp b/src/base/tests/dir_tests.cpp
deleted file mode 100644
index baf3ce3..0000000
--- a/src/base/tests/dir_tests.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * \file dir_tests.cpp
- * \brief Directory handling automated tests.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "testing/testing.h"
-extern "C" {
-#include "base/dir.h"
-#include "base/cstr.h"
-}
-
-SUITE(base)
-{
- TEST(DirExists_ReturnsOkay_OnEmptyPath)
- {
- int result = dir_exists("");
- CHECK(result);
- }
-
- TEST(DirGetCurrent_ReturnsCurrent_WithSlashes)
- {
- const char* result = dir_get_current();
- CHECK(cstr_ends_with(result, "/src"));
- }
-}
diff --git a/src/base/tests/env_tests.cpp b/src/base/tests/env_tests.cpp
deleted file mode 100644
index 8d6fb55..0000000
--- a/src/base/tests/env_tests.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- * \file env_tests.cpp
- * \brief Automated tests from runtime environment state.
- * \author Copyright (c) 2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "testing/testing.h"
-extern "C" {
-#include "base/env.h"
-}
-
-
-SUITE(base)
-{
- TEST(EnvGetOs_IsNotUnknown)
- {
- enum OS os = env_get_os();
- CHECK(os != UnknownOS);
- }
-
- TEST(EnvGetOsName_DoesNotExplode)
- {
- const char* name = env_get_os_name();
- CHECK(name != NULL);
- }
-}
-
diff --git a/src/base/tests/guid_tests.cpp b/src/base/tests/guid_tests.cpp
deleted file mode 100644
index 4d89b17..0000000
--- a/src/base/tests/guid_tests.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * \file guid_tests.cpp
- * \brief Automated tests for GUID generation and validation.
- * \author Copyright (c) 2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "testing/testing.h"
-extern "C" {
-#include "base/guid.h"
-}
-
-
-SUITE(base)
-{
- TEST(GuidCreate_ReturnsCorrectSize)
- {
- const char* guid = guid_create();
- CHECK(guid != NULL && strlen(guid) == 36);
- }
-
- TEST(GuidCreate_CorrectDashes)
- {
- const char* guid = guid_create();
- CHECK(guid[8]=='-' && guid[13]=='-' && guid[18]=='-' && guid[23]=='-');
- }
-
- TEST(GuidCreate_CorrectSymbols)
- {
- for (const char* guid = guid_create(); *guid; ++guid)
- {
- const char ch = *guid;
- CHECK((ch>='0' && ch<='9') || (ch>='A' && ch<='F') || (ch=='-'));
- }
- }
-
- TEST(GuidCreate_CorrectNumOfDashes)
- {
- int num = 0;
- for (const char* guid = guid_create(); *guid; ++guid)
- {
- if (*guid=='-') ++num;
- }
- CHECK(num == 4);
- }
-
- TEST(GuidIsValid_ReturnsTrue_OnNoBraces)
- {
- CHECK(guid_is_valid("4E67EBCE-BC8B-4058-9AA9-48EE5E003683"));
- }
-
- TEST(GuidIsValid_ReturnsFalse_OnTooShort)
- {
- CHECK(!guid_is_valid("4E67EBCE-BC8B-4058-9AA9-48EE"));
- }
-
- TEST(GuidIsValid_ReturnsFalse_OnMissingFirstDash)
- {
- CHECK(!guid_is_valid("4E67EBCE BC8B-4058-9AA9-48EE5E003683"));
- }
-
- TEST(GuidIsValid_ReturnsFalse_OnMissingSecondDash)
- {
- CHECK(!guid_is_valid("4E67EBCE-BC8B 4058-9AA9-48EE5E003683"));
- }
-
- TEST(GuidIsValid_ReturnsFalse_OnMissingThirdDash)
- {
- CHECK(!guid_is_valid("4E67EBCE-BC8B-4058 9AA9-48EE5E003683"));
- }
-
- TEST(GuidIsValid_ReturnsFalse_OnMissingLastDash)
- {
- CHECK(!guid_is_valid("4E67EBCE-BC8B-4058-9AA9 48EE5E003683"));
- }
-
- TEST(GuidIsValid_ReturnsFalse_OnTooManyDashes)
- {
- CHECK(!guid_is_valid("4E67EBCE-BC8B-4058-9AA9-48EE5-003683"));
- }
-
- TEST(GuidIsValid_ReturnsFalse_OnInvalidChar)
- {
- CHECK(!guid_is_valid("XE67EBCE-BC8B-4058-9AA9-48EE5X003683"));
- }
-}
diff --git a/src/base/tests/path_tests.cpp b/src/base/tests/path_tests.cpp
deleted file mode 100644
index 0a9fe1e..0000000
--- a/src/base/tests/path_tests.cpp
+++ /dev/null
@@ -1,266 +0,0 @@
-/**
- * \file path_tests.cpp
- * \brief Path handling automated tests.
- * \author Copyright (c) 2007-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "testing/testing.h"
-extern "C" {
-#include "base/path.h"
-#include "base/cstr.h"
-#include "base/dir.h"
-#include "platform/platform.h"
-}
-
-SUITE(base)
-{
- /**************************************************************************
- * path_absolute() tests
- **************************************************************************/
-
- TEST(PathAbsolute_ReturnsCorrectPath_OnMissingSubdir)
- {
- char* cwd = dir_get_current();
- strcat(cwd, "/a/b/c");
- char* result = path_absolute("a/b/c");
- CHECK_EQUAL(cwd, result);
- }
-
-
- /**************************************************************************
- * path_assemble() tests
- **************************************************************************/
-
- TEST(PathAssemble_ReturnsAssembledPath_OnValidParts)
- {
- char* result = path_assemble("directory", "filename", ".ext");
- CHECK_EQUAL("directory/filename.ext", result);
- }
-
- TEST(PathAssemble_ReturnsAssembledPath_OnNoDirectory)
- {
- char* result = path_assemble("", "filename", ".ext");
- CHECK_EQUAL("filename.ext", result);
- }
-
-
- /**************************************************************************
- * path_basename() tests
- **************************************************************************/
-
- TEST(PathBaseName_ReturnsBase_OnDirAndExt)
- {
- char* result = path_basename("folder/filename.ext");
- CHECK_EQUAL("filename", result);
- }
-
-
- /**************************************************************************
- * path_directory() tests
- **************************************************************************/
-
- TEST(PathDirectory_ReturnsEmptyString_OnNoDirectory)
- {
- char* result = path_directory("filename.ext");
- CHECK_EQUAL("", result);
- }
-
-
- TEST(PathDirectory_ReturnsDirectory_OnSingleLevelPath)
- {
- char* result = path_directory("dir0/filename.ext");
- CHECK_EQUAL("dir0", result);
- }
-
-
- TEST(PathDirectory_ReturnsDirectory_OnMultiLeveLPath)
- {
- char* result = path_directory("dir0/dir1/dir2/filename.ext");
- CHECK_EQUAL("dir0/dir1/dir2", result);
- }
-
-
- /**************************************************************************
- * path_extension() tests
- **************************************************************************/
-
- TEST(PathExt_ReturnsEmptyString_OnNoExtension)
- {
- char* result = path_extension("filename");
- CHECK_EQUAL("", result);
- }
-
- TEST(PathExt_ReturnsExtension)
- {
- char* result = path_extension("filename.txt");
- CHECK_EQUAL(".txt", result);
- }
-
- TEST(PathExt_ReturnsLastExtension_OnMultipleDots)
- {
- char* result = path_extension("filename.mod.txt");
- CHECK_EQUAL(".txt", result);
- }
-
-
- /**************************************************************************
- * path_filename() tests
- **************************************************************************/
-
- TEST(PathFileName_ReturnsAll_OnNoDirectory)
- {
- char* result = path_filename("filename.ext");
- CHECK_EQUAL("filename.ext", result);
- }
-
- TEST(PathFileName_ReturnsEmptyString_OnNoName)
- {
- char* result = path_filename("dir0/dir1/");
- CHECK_EQUAL("", result);
- }
-
- TEST(PathFileName_ReturnsOnlyName_OnFullPath)
- {
- char* result = path_filename("dir0/dir1/filename.ext");
- CHECK_EQUAL("filename.ext", result);
- }
-
-
- /**************************************************************************
- * path_is_absolute() tests
- **************************************************************************/
-
- TEST(PathIsAbsolute_ReturnsTrue_OnAbsolutePosixPath)
- {
- CHECK(path_is_absolute("/a/b/c"));
- }
-
-
- TEST(PathIsAbsolute_ReturnsTrue_OnAbsoluteWindowsPathWithDrive)
- {
- CHECK(path_is_absolute("c:/a/b/c"));
- }
-
-
- TEST(PathIsAbsolute_ReturnsFalse_OnRelativePath)
- {
- CHECK(!path_is_absolute("a/b/c"));
- }
-
-
- /**************************************************************************
- * path_is_absolute() tests
- **************************************************************************/
-
- TEST(PathIsCpp_ReturnsFalse_OnNotCpp)
- {
- CHECK(!path_is_cpp_source("filename.XXX"));
- }
-
- TEST(PathIsCpp_ReturnsTrue_OnC)
- {
- CHECK(path_is_cpp_source("filename.c"));
- }
-
- TEST(PathIsCpp_ReturnsTrue_OnCC)
- {
- CHECK(path_is_cpp_source("filename.cc"));
- }
-
- TEST(PathIsCpp_ReturnsTrue_OnCpp)
- {
- CHECK(path_is_cpp_source("filename.cpp"));
- }
-
- TEST(PathIsCpp_ReturnsTrue_OnCxx)
- {
- CHECK(path_is_cpp_source("filename.cxx"));
- }
-
- TEST(PathIsCpp_ReturnsTrue_OnS)
- {
- CHECK(path_is_cpp_source("filename.s"));
- }
-
- TEST(PathIsCpp_ReturnsTrue_OnUpperCase)
- {
- CHECK(path_is_cpp_source("filename.C"));
- }
-
-
- /**************************************************************************
- * path_join() tests
- **************************************************************************/
-
- TEST(PathJoin_ReturnsJoinedPath_OnValidParts)
- {
- char* result = path_join("leading", "trailing");
- CHECK_EQUAL("leading/trailing", result);
- }
-
- TEST(PathJoin_ReturnsAbsPath_OnAbsUnixPath)
- {
- char* result = path_join("leading", "/trailing");
- CHECK_EQUAL("/trailing", result);
- }
-
- TEST(PathJoin_ReturnsAbsPath_OnAbsWindowsPath)
- {
- char* result = path_join("leading", "C:/trailing");
- CHECK_EQUAL("C:/trailing", result);
- }
-
-
- /**************************************************************************
- * path_relative() tests
- **************************************************************************/
-
- TEST(PathRelative_ReturnsDot_OnMatchingPaths)
- {
- char* result = path_relative("/a/b/c", "/a/b/c");
- CHECK_EQUAL(".", result);
- }
-
-
- TEST(PathRelative_ReturnsDoubleDot_OnChildToParent)
- {
- char* result = path_relative("/a/b/c", "/a/b");
- CHECK_EQUAL("..", result);
- }
-
-
- TEST(PathRelative_ReturnsDoubleDotPath_OnSiblingToSibling)
- {
- char* result = path_relative("/a/b/c", "/a/b/d");
- CHECK_EQUAL("../d", result);
- }
-
-
- TEST(PathRelative_ReturnsChildPath_OnParentToChild)
- {
- char* result = path_relative("/a/b/c", "/a/b/c/d");
- CHECK_EQUAL("d", result);
- }
-
-
- /**************************************************************************
- * path_translate() tests
- **************************************************************************/
-
- TEST(PathTranslate_ReturnsTranslatedPath_OnValidPath)
- {
- char* result = path_translate("dir\\dir\\file", "/");
- CHECK_EQUAL("dir/dir/file", result);
- }
-
- TEST(PathTranslate_ReturnsCorrectSeparator_OnMixedPath)
- {
- char* result = path_translate("dir\\dir/file", NULL);
- #if defined(PLATFORM_WINDOWS)
- CHECK_EQUAL("dir\\dir\\file", result);
- #else
- CHECK_EQUAL("dir/dir/file", result);
- #endif
- }
-}
diff --git a/src/base/tests/stream_tests.cpp b/src/base/tests/stream_tests.cpp
deleted file mode 100644
index 2fb74e4..0000000
--- a/src/base/tests/stream_tests.cpp
+++ /dev/null
@@ -1,117 +0,0 @@
-/**
- * \file stream_tests.cpp
- * \brief Output stream automated tests.
- * \author Copyright (c) 2007-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "testing/testing.h"
-extern "C" {
-#include "base/stream.h"
-}
-
-struct FxStream
-{
- Stream strm;
- char buffer[1024];
-
- FxStream()
- {
- strm = stream_create_null();
- stream_set_buffer(strm, buffer);
- }
-
- ~FxStream()
- {
- stream_destroy(strm);
- }
-};
-
-struct FxStreamStrings : FxStream
-{
- Strings strs;
-
- FxStreamStrings()
- {
- strs = strings_create();
- }
-
- ~FxStreamStrings()
- {
- strings_destroy(strs);
- }
-};
-
-
-
-SUITE(base)
-{
- TEST_FIXTURE(FxStream, Write_WritesValue_OnSimpleValue)
- {
- stream_write(strm, "Hi there!");
- CHECK_EQUAL("Hi there!", buffer);
- }
-
- TEST_FIXTURE(FxStream, Write_WritesValue_OnFormattedValue)
- {
- stream_write(strm, "Hi there, %s!", "Mr. Bill");
- CHECK_EQUAL("Hi there, Mr. Bill!", buffer);
- }
-
- TEST_FIXTURE(FxStream, WriteLine_AppendsNewLine_OnSimpleValue)
- {
- stream_writeline(strm, "Hi there!");
- CHECK_EQUAL("Hi there!\n", buffer);
- }
-
- TEST_FIXTURE(FxStream, WriteLine_AppendsNewLine_OnFormattedValue)
- {
- stream_writeline(strm, "Hi there, %s!", "Mr. Bill");
- CHECK_EQUAL("Hi there, Mr. Bill!\n", buffer);
- }
-
- TEST_FIXTURE(FxStream, WriteLine_AppendsNewLine_OnModifiedNewline)
- {
- stream_set_newline(strm, "\r\n");
- stream_writeline(strm, "Hi there!");
- CHECK_EQUAL("Hi there!\r\n", buffer);
- }
-
-
- /**********************************************************************
- * stream_write_strings() tests
- **********************************************************************/
-
- TEST_FIXTURE(FxStreamStrings, WriteStrings_WritesStartEnd_OnEmptyList)
- {
- stream_write_strings(strm, strs, "^", "<", ">", ",", "$", NULL);
- CHECK_EQUAL("^$", buffer);
- }
-
- TEST_FIXTURE(FxStreamStrings, WriteStrings_WriteSingleItem_OnSingleItem)
- {
- strings_add(strs, "AAA");
- stream_write_strings(strm, strs, "^", "<", ">", ",", "$", NULL);
- CHECK_EQUAL("^<AAA>$", buffer);
- }
-
- TEST_FIXTURE(FxStreamStrings, WriteStrings_WriteMultipleItems_OnMultipleItems)
- {
- strings_add(strs, "AAA");
- strings_add(strs, "BBB");
- strings_add(strs, "CCC");
- stream_write_strings(strm, strs, "^", "<", ">", ",", "$", NULL);
- CHECK_EQUAL("^<AAA>,<BBB>,<CCC>$", buffer);
- }
-
-
- /**********************************************************************
- * stream_write_escaped() tests
- **********************************************************************/
-
- TEST_FIXTURE(FxStream, WriteEscaped_EscapesSpecialCharacters)
- {
- stream_write_escaped(strm, "Specials: \" & \' < >");
- CHECK_EQUAL("Specials: &quot; &amp; &apos; &lt; &gt;", buffer);
- }
-}
diff --git a/src/base/tests/string_tests.cpp b/src/base/tests/string_tests.cpp
deleted file mode 100644
index ad6fd8a..0000000
--- a/src/base/tests/string_tests.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * \file string_tests.cpp
- * \brief Dynamic string automated tests.
- * \author Copyright (c) 2007-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "testing/testing.h"
-extern "C" {
-#include "base/string.h"
-}
-
-SUITE(base)
-{
- /**************************************************************************
- * string_create() tests
- **************************************************************************/
-
- TEST(StringCreate_ReturnsNull_OnNull)
- {
- String str = string_create(NULL);
- CHECK(str == NULL);
- }
-
-
- /**************************************************************************
- * string_destroy() tests
- **************************************************************************/
-
- TEST(StringDestroy_DoesNoOp_OnNull)
- {
- string_destroy(NULL);
- CHECK(1);
- }
-
-
- /**************************************************************************
- * string_cstr() tests
- **************************************************************************/
-
- TEST(StringCStr_ReturnsNull_OnNullString)
- {
- CHECK(string_cstr(NULL) == NULL);
- }
-}
-
diff --git a/src/host/bytecode.c b/src/host/bytecode.c
new file mode 100644
index 0000000..c7fdded
--- /dev/null
+++ b/src/host/bytecode.c
@@ -0,0 +1,43 @@
+/* Precompiled bytecodes for built-in Premake scripts */
+/* To regenerate this file, run `premake --compile` (Premake 3.x) */
+
+const char* builtin_bytecode[] = {
+ "\033\114\165\141\121\000\001\004\004\004\010\000\023\000\000\000\100\163\162\143\057\142\141\163\145\057\160\141\164\150\056\154\165\141\000\000\000\000\000\000\000\000\000\000\000\002\002\047\000\000\000\012\000\000\000\007\000\000\000\005\000\000\000\144\000\000\000\011\100\200\200\005\000\000\000\144\100\000\000\011\100\000\201\005\000\000\000\144\200\000\000\011\100\200\201\005\000\000\000\144\300\000\000\011\100\000\202\005\000\000\000\144\000\001\000\011\100\200\202\005\000\000\000\144\100\001\000\011\100\000\203\005\000\000\000\144\200\001\000\011\100\200\203\005\000\000\000\144\300\001\000\011\100\000\204\005\000\000\000\144\000\002\000\011\100\200\204\005\000\000\000\144\100\002\000\011\100\000\205\005\000\000\000\144\200\002\000\011\100\200\205\005\000\000\000\144\300\002\000\011\100\000\206\036\000\200\000\015\000\000\000\004\005\000\000\000\160\141\164\150\000\004\014\000\000\000\147\145\164\141\142\163\157\154\165\164\145\000\004\014\000\000\000\147\145\164\142\141\163\145\156\141\155\145\000\004\015\000\000\000\147\145\164\144\151\162\145\143\164\157\162\171\000\004\015\000\000\000\147\145\164\145\170\164\145\156\163\151\157\156\000\004\010\000\000\000\147\145\164\156\141\155\145\000\004\014\000\000\000\147\145\164\162\145\154\141\164\151\166\145\000\004\013\000\000\000\151\163\141\142\163\157\154\165\164\145\000\004\010\000\000\000\151\163\143\146\151\154\145\000\004\012\000\000\000\151\163\143\160\160\146\151\154\145\000\004\017\000\000\000\151\163\162\145\163\157\165\162\143\145\146\151\154\145\000\004\005\000\000\000\152\157\151\156\000\004\012\000\000\000\164\162\141\156\163\154\141\164\145\000\014\000\000\000\000\000\000\000\020\000\000\000\045\000\000\000\000\001\000\012\054\000\000\000\105\000\000\000\106\100\300\000\200\000\000\000\301\200\000\000\134\200\200\001\000\000\200\000\027\300\100\000\026\000\000\200\001\000\001\000\105\000\000\000\106\100\301\000\200\000\000\000\134\200\000\001\132\000\000\000\026\000\000\200\036\000\000\001\105\200\001\000\106\300\301\000\134\200\200\000\205\000\002\000\313\100\102\000\101\201\000\000\202\001\200\000\334\000\000\002\234\000\001\000\026\100\003\200\027\200\102\003\026\100\001\200\305\001\000\000\306\301\302\003\000\002\200\000\334\201\000\001\100\000\200\003\026\100\001\200\127\000\101\003\026\300\000\200\300\001\200\000\001\202\000\000\100\002\000\003\125\100\202\003\241\200\000\000\026\300\373\177\136\000\000\001\036\000\200\000\014\000\000\000\004\005\000\000\000\160\141\164\150\000\004\012\000\000\000\164\162\141\156\163\154\141\164\145\000\004\002\000\000\000\057\000\004\001\000\000\000\000\004\002\000\000\000\056\000\004\013\000\000\000\151\163\141\142\163\157\154\165\164\145\000\004\003\000\000\000\157\163\000\004\007\000\000\000\147\145\164\143\167\144\000\004\007\000\000\000\151\160\141\151\162\163\000\004\010\000\000\000\145\170\160\154\157\144\145\000\004\003\000\000\000\056\056\000\004\015\000\000\000\147\145\164\144\151\162\145\143\164\157\162\171\000\000\000\000\000\054\000\000\000\022\000\000\000\022\000\000\000\022\000\000\000\022\000\000\000\022\000\000\000\022\000\000\000\023\000\000\000\023\000\000\000\023\000\000\000\026\000\000\000\026\000\000\000\026\000\000\000\026\000\000\000\026\000\000\000\026\000\000\000\027\000\000\000\033\000\000\000\033\000\000\000\033\000\000\000\034\000\000\000\034\000\000\000\034\000\000\000\034\000\000\000\034\000\000\000\034\000\000\000\034\000\000\000\035\000\000\000\035\000\000\000\036\000\000\000\036\000\000\000\036\000\000\000\036\000\000\000\036\000\000\000\036\000\000\000\037\000\000\000\037\000\000\000\040\000\000\000\040\000\000\000\040\000\000\000\040\000\000\000\034\000\000\000\041\000\000\000\044\000\000\000\045\000\000\000\007\000\000\000\002\000\000\000\160\000\000\000\000\000\053\000\000\000\007\000\000\000\162\145\163\165\154\164\000\023\000\000\000\053\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\031\000\000\000\052\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\031\000\000\000\052\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\031\000\000\000\052\000\000\000\002\000\000\000\137\000\032\000\000\000\050\000\000\000\005\000\000\000\160\141\162\164\000\032\000\000\000\050\000\000\000\000\000\000\000\000\000\000\000\054\000\000\000\064\000\000\000\000\001\000\007\022\000\000\000\105\000\000\000\106\100\300\000\200\000\000\000\134\200\000\001\213\200\300\000\001\301\000\000\102\001\200\000\234\200\000\002\232\000\000\000\026\100\001\200\313\000\301\000\101\101\001\000\215\101\101\001\335\000\000\002\336\000\000\000\026\000\000\200\136\000\000\001\036\000\200\000\006\000\000\000\004\005\000\000\000\160\141\164\150\000\004\010\000\000\000\147\145\164\156\141\155\145\000\004\011\000\000\000\146\151\156\144\154\141\163\164\000\004\002\000\000\000\056\000\004\004\000\000\000\163\165\142\000\003\000\000\000\000\000\000\360\077\000\000\000\000\022\000\000\000\055\000\000\000\055\000\000\000\055\000\000\000\055\000\000\000\056\000\000\000\056\000\000\000\056\000\000\000\056\000\000\000\057\000\000\000\057\000\000\000\060\000\000\000\060\000\000\000\060\000\000\000\060\000\000\000\060\000\000\000\060\000\000\000\062\000\000\000\064\000\000\000\003\000\000\000\002\000\000\000\160\000\000\000\000\000\021\000\000\000\005\000\000\000\156\141\155\145\000\004\000\000\000\021\000\000\000\002\000\000\000\151\000\010\000\000\000\021\000\000\000\000\000\000\000\000\000\000\000\074\000\000\000\104\000\000\000\000\001\000\006\022\000\000\000\113\000\100\000\301\100\000\000\002\001\200\000\134\200\000\002\132\000\000\000\026\000\002\200\030\100\000\201\026\000\000\200\115\200\300\000\213\300\100\000\001\201\000\000\100\001\200\000\235\000\000\002\236\000\000\000\026\100\000\200\201\000\001\000\236\000\000\001\036\000\200\000\005\000\000\000\004\011\000\000\000\146\151\156\144\154\141\163\164\000\004\002\000\000\000\057\000\003\000\000\000\000\000\000\360\077\004\004\000\000\000\163\165\142\000\004\002\000\000\000\056\000\000\000\000\000\022\000\000\000\075\000\000\000\075\000\000\000\075\000\000\000\075\000\000\000\076\000\000\000\076\000\000\000\077\000\000\000\077\000\000\000\077\000\000\000\100\000\000\000\100\000\000\000\100\000\000\000\100\000\000\000\100\000\000\000\100\000\000\000\102\000\000\000\102\000\000\000\104\000\000\000\002\000\000\000\002\000\000\000\160\000\000\000\000\000\021\000\000\000\002\000\000\000\151\000\004\000\000\000\021\000\000\000\000\000\000\000\000\000\000\000\113\000\000\000\122\000\000\000\000\001\000\005\016\000\000\000\113\000\100\000\301\100\000\000\002\001\200\000\134\200\000\002\132\000\000\000\026\000\001\200\213\200\100\000\000\001\200\000\235\000\200\001\236\000\000\000\026\100\000\200\201\300\000\000\236\000\000\001\036\000\200\000\004\000\000\000\004\011\000\000\000\146\151\156\144\154\141\163\164\000\004\002\000\000\000\056\000\004\004\000\000\000\163\165\142\000\004\001\000\000\000\000\000\000\000\000\016\000\000\000\114\000\000\000\114\000\000\000\114\000\000\000\114\000\000\000\115\000\000\000\115\000\000\000\116\000\000\000\116\000\000\000\116\000\000\000\116\000\000\000\116\000\000\000\120\000\000\000\120\000\000\000\122\000\000\000\002\000\000\000\002\000\000\000\160\000\000\000\000\000\015\000\000\000\002\000\000\000\151\000\004\000\000\000\015\000\000\000\000\000\000\000\000\000\000\000\132\000\000\000\141\000\000\000\000\001\000\005\015\000\000\000\113\000\100\000\301\100\000\000\002\001\200\000\134\200\000\002\132\000\000\000\026\000\001\200\213\200\100\000\014\301\300\000\235\000\200\001\236\000\000\000\026\000\000\200\036\000\000\001\036\000\200\000\004\000\000\000\004\011\000\000\000\146\151\156\144\154\141\163\164\000\004\002\000\000\000\057\000\004\004\000\000\000\163\165\142\000\003\000\000\000\000\000\000\360\077\000\000\000\000\015\000\000\000\133\000\000\000\133\000\000\000\133\000\000\000\133\000\000\000\134\000\000\000\134\000\000\000\135\000\000\000\135\000\000\000\135\000\000\000\135\000\000\000\135\000\000\000\137\000\000\000\141\000\000\000\002\000\000\000\002\000\000\000\160\000\000\000\000\000\014\000\000\000\002\000\000\000\151\000\004\000\000\000\014\000\000\000\000\000\000\000\000\000\000\000\150\000\000\000\214\000\000\000\000\002\000\011\107\000\000\000\201\000\000\000\305\100\000\000\306\200\300\001\000\001\000\000\334\200\000\001\001\301\000\000\025\000\201\001\305\100\000\000\306\200\300\001\000\001\200\000\334\200\000\001\001\301\000\000\125\000\201\001\027\100\000\000\026\100\000\200\301\000\001\000\336\000\000\001\313\100\101\000\101\301\000\000\334\200\200\001\332\000\000\000\026\000\006\200\013\201\101\000\201\301\001\000\300\001\200\001\034\201\000\002\113\201\301\000\301\301\001\000\000\002\200\001\134\201\000\002\027\100\001\002\026\200\003\200\013\201\101\000\214\301\301\001\034\201\200\001\000\000\000\002\013\201\301\000\214\301\301\001\034\201\200\001\100\000\000\002\026\000\000\200\026\000\001\200\013\101\101\000\201\301\000\000\034\201\200\001\300\000\000\002\026\000\371\177\013\101\101\000\201\301\000\000\034\201\200\001\300\000\000\002\332\000\000\000\026\000\002\200\000\001\000\001\101\001\002\000\225\100\001\002\013\101\101\000\201\301\000\000\314\301\301\001\034\201\000\002\300\000\000\002\026\000\375\177\000\001\000\001\100\001\200\000\225\100\001\002\013\201\101\001\201\301\001\000\301\101\002\000\035\001\000\002\036\001\000\000\036\000\200\000\012\000\000\000\004\001\000\000\000\000\004\005\000\000\000\160\141\164\150\000\004\014\000\000\000\147\145\164\141\142\163\157\154\165\164\145\000\004\002\000\000\000\057\000\004\002\000\000\000\056\000\004\005\000\000\000\146\151\156\144\000\004\004\000\000\000\163\165\142\000\003\000\000\000\000\000\000\360\077\004\004\000\000\000\056\056\057\000\003\000\000\000\000\000\000\000\300\000\000\000\000\107\000\000\000\151\000\000\000\154\000\000\000\154\000\000\000\154\000\000\000\154\000\000\000\154\000\000\000\154\000\000\000\155\000\000\000\155\000\000\000\155\000\000\000\155\000\000\000\155\000\000\000\155\000\000\000\160\000\000\000\160\000\000\000\161\000\000\000\161\000\000\000\165\000\000\000\165\000\000\000\165\000\000\000\166\000\000\000\166\000\000\000\167\000\000\000\167\000\000\000\167\000\000\000\167\000\000\000\167\000\000\000\167\000\000\000\167\000\000\000\167\000\000\000\167\000\000\000\167\000\000\000\170\000\000\000\170\000\000\000\170\000\000\000\170\000\000\000\171\000\000\000\171\000\000\000\171\000\000\000\171\000\000\000\171\000\000\000\173\000\000\000\175\000\000\000\175\000\000\000\175\000\000\000\175\000\000\000\175\000\000\000\201\000\000\000\201\000\000\000\201\000\000\000\201\000\000\000\202\000\000\000\202\000\000\000\203\000\000\000\203\000\000\000\203\000\000\000\204\000\000\000\204\000\000\000\204\000\000\000\204\000\000\000\204\000\000\000\204\000\000\000\210\000\000\000\210\000\000\000\210\000\000\000\213\000\000\000\213\000\000\000\213\000\000\000\213\000\000\000\213\000\000\000\214\000\000\000\004\000\000\000\004\000\000\000\163\162\143\000\000\000\000\000\106\000\000\000\004\000\000\000\144\163\164\000\000\000\000\000\106\000\000\000\007\000\000\000\162\145\163\165\154\164\000\001\000\000\000\106\000\000\000\002\000\000\000\151\000\024\000\000\000\106\000\000\000\000\000\000\000\000\000\000\000\223\000\000\000\227\000\000\000\000\001\000\006\022\000\000\000\113\000\100\000\301\100\000\000\001\101\000\000\134\200\000\002\213\000\100\000\001\201\000\000\101\201\000\000\234\200\000\002\127\300\300\000\026\000\001\200\127\000\301\000\026\200\000\200\127\100\101\001\026\000\000\200\302\100\000\000\302\000\200\000\336\000\000\001\036\000\200\000\006\000\000\000\004\004\000\000\000\163\165\142\000\003\000\000\000\000\000\000\360\077\003\000\000\000\000\000\000\000\100\004\002\000\000\000\057\000\004\002\000\000\000\134\000\004\002\000\000\000\072\000\000\000\000\000\022\000\000\000\224\000\000\000\224\000\000\000\224\000\000\000\224\000\000\000\225\000\000\000\225\000\000\000\225\000\000\000\225\000\000\000\226\000\000\000\226\000\000\000\226\000\000\000\226\000\000\000\226\000\000\000\226\000\000\000\226\000\000\000\226\000\000\000\226\000\000\000\227\000\000\000\003\000\000\000\002\000\000\000\160\000\000\000\000\000\021\000\000\000\004\000\000\000\143\150\061\000\004\000\000\000\021\000\000\000\004\000\000\000\143\150\062\000\010\000\000\000\021\000\000\000\000\000\000\000\000\000\000\000\240\000\000\000\244\000\000\000\000\001\000\006\021\000\000\000\112\000\000\001\201\000\000\000\301\100\000\000\142\100\000\001\205\200\000\000\206\300\100\001\300\000\000\000\234\200\000\001\213\000\101\001\234\200\000\001\305\100\001\000\306\200\301\001\000\001\200\000\100\001\000\001\335\000\200\001\336\000\000\000\036\000\200\000\007\000\000\000\004\003\000\000\000\056\143\000\004\003\000\000\000\056\163\000\004\005\000\000\000\160\141\164\150\000\004\015\000\000\000\147\145\164\145\170\164\145\156\163\151\157\156\000\004\006\000\000\000\154\157\167\145\162\000\004\006\000\000\000\164\141\142\154\145\000\004\011\000\000\000\143\157\156\164\141\151\156\163\000\000\000\000\000\021\000\000\000\241\000\000\000\241\000\000\000\241\000\000\000\241\000\000\000\242\000\000\000\242\000\000\000\242\000\000\000\242\000\000\000\242\000\000\000\242\000\000\000\243\000\000\000\243\000\000\000\243\000\000\000\243\000\000\000\243\000\000\000\243\000\000\000\244\000\000\000\003\000\000\000\006\000\000\000\146\156\141\155\145\000\000\000\000\000\020\000\000\000\013\000\000\000\145\170\164\145\156\163\151\157\156\163\000\004\000\000\000\020\000\000\000\004\000\000\000\145\170\164\000\012\000\000\000\020\000\000\000\000\000\000\000\000\000\000\000\246\000\000\000\252\000\000\000\000\001\000\007\024\000\000\000\112\000\200\002\201\000\000\000\301\100\000\000\001\201\000\000\101\301\000\000\201\001\001\000\142\100\200\002\205\100\001\000\206\200\101\001\300\000\000\000\234\200\000\001\213\300\101\001\234\200\000\001\305\000\002\000\306\100\302\001\000\001\200\000\100\001\000\001\335\000\200\001\336\000\000\000\036\000\200\000\012\000\000\000\004\004\000\000\000\056\143\143\000\004\005\000\000\000\056\143\160\160\000\004\005\000\000\000\056\143\170\170\000\004\003\000\000\000\056\143\000\004\003\000\000\000\056\163\000\004\005\000\000\000\160\141\164\150\000\004\015\000\000\000\147\145\164\145\170\164\145\156\163\151\157\156\000\004\006\000\000\000\154\157\167\145\162\000\004\006\000\000\000\164\141\142\154\145\000\004\011\000\000\000\143\157\156\164\141\151\156\163\000\000\000\000\000\024\000\000\000\247\000\000\000\247\000\000\000\247\000\000\000\247\000\000\000\247\000\000\000\247\000\000\000\247\000\000\000\250\000\000\000\250\000\000\000\250\000\000\000\250\000\000\000\250\000\000\000\250\000\000\000\251\000\000\000\251\000\000\000\251\000\000\000\251\000\000\000\251\000\000\000\251\000\000\000\252\000\000\000\003\000\000\000\006\000\000\000\146\156\141\155\145\000\000\000\000\000\023\000\000\000\013\000\000\000\145\170\164\145\156\163\151\157\156\163\000\007\000\000\000\023\000\000\000\004\000\000\000\145\170\164\000\015\000\000\000\023\000\000\000\000\000\000\000\000\000\000\000\262\000\000\000\266\000\000\000\000\001\000\006\020\000\000\000\112\000\200\000\201\000\000\000\142\100\200\000\205\100\000\000\206\200\100\001\300\000\000\000\234\200\000\001\213\300\100\001\234\200\000\001\305\000\001\000\306\100\301\001\000\001\200\000\100\001\000\001\335\000\200\001\336\000\000\000\036\000\200\000\006\000\000\000\004\004\000\000\000\056\162\143\000\004\005\000\000\000\160\141\164\150\000\004\015\000\000\000\147\145\164\145\170\164\145\156\163\151\157\156\000\004\006\000\000\000\154\157\167\145\162\000\004\006\000\000\000\164\141\142\154\145\000\004\011\000\000\000\143\157\156\164\141\151\156\163\000\000\000\000\000\020\000\000\000\263\000\000\000\263\000\000\000\263\000\000\000\264\000\000\000\264\000\000\000\264\000\000\000\264\000\000\000\264\000\000\000\264\000\000\000\265\000\000\000\265\000\000\000\265\000\000\000\265\000\000\000\265\000\000\000\265\000\000\000\266\000\000\000\003\000\000\000\006\000\000\000\146\156\141\155\145\000\000\000\000\000\017\000\000\000\013\000\000\000\145\170\164\145\156\163\151\157\156\163\000\003\000\000\000\017\000\000\000\004\000\000\000\145\170\164\000\011\000\000\000\017\000\000\000\000\000\000\000\000\000\000\000\276\000\000\000\324\000\000\000\000\002\000\005\041\000\000\000\032\100\000\000\026\000\000\200\001\000\000\000\132\100\000\000\026\000\000\200\036\000\000\001\205\100\000\000\206\200\100\001\300\000\200\000\234\200\000\001\232\000\000\000\026\000\000\200\136\000\000\001\027\300\100\000\026\000\000\200\001\000\000\000\213\000\101\000\234\200\000\001\030\200\200\202\026\300\001\200\213\200\101\000\001\301\001\000\234\200\200\001\232\100\000\000\026\200\000\200\200\000\000\000\301\300\001\000\025\300\000\001\200\000\000\000\300\000\200\000\225\300\000\001\236\000\000\001\036\000\200\000\010\000\000\000\004\001\000\000\000\000\004\005\000\000\000\160\141\164\150\000\004\013\000\000\000\151\163\141\142\163\157\154\165\164\145\000\004\002\000\000\000\056\000\004\004\000\000\000\154\145\156\000\003\000\000\000\000\000\000\000\000\004\011\000\000\000\145\156\144\163\167\151\164\150\000\004\002\000\000\000\057\000\000\000\000\000\041\000\000\000\277\000\000\000\277\000\000\000\300\000\000\000\303\000\000\000\303\000\000\000\304\000\000\000\307\000\000\000\307\000\000\000\307\000\000\000\307\000\000\000\307\000\000\000\307\000\000\000\310\000\000\000\313\000\000\000\313\000\000\000\314\000\000\000\317\000\000\000\317\000\000\000\317\000\000\000\317\000\000\000\317\000\000\000\317\000\000\000\317\000\000\000\317\000\000\000\317\000\000\000\320\000\000\000\320\000\000\000\320\000\000\000\323\000\000\000\323\000\000\000\323\000\000\000\323\000\000\000\324\000\000\000\002\000\000\000\010\000\000\000\154\145\141\144\151\156\147\000\000\000\000\000\040\000\000\000\011\000\000\000\164\162\141\151\154\151\156\147\000\000\000\000\000\040\000\000\000\000\000\000\000\000\000\000\000\334\000\000\000\345\000\000\000\000\002\000\006\017\000\000\000\132\100\000\000\026\200\001\200\205\000\000\000\206\100\100\001\232\000\000\000\026\100\000\200\101\200\000\000\026\000\000\200\101\300\000\000\213\000\101\000\001\101\001\000\100\001\200\000\235\000\000\002\236\000\000\000\036\000\200\000\006\000\000\000\004\003\000\000\000\157\163\000\004\010\000\000\000\167\151\156\144\157\167\163\000\004\002\000\000\000\134\000\004\002\000\000\000\057\000\004\005\000\000\000\147\163\165\142\000\004\005\000\000\000\133\057\134\135\000\000\000\000\000\017\000\000\000\335\000\000\000\335\000\000\000\336\000\000\000\336\000\000\000\336\000\000\000\336\000\000\000\337\000\000\000\337\000\000\000\341\000\000\000\344\000\000\000\344\000\000\000\344\000\000\000\344\000\000\000\344\000\000\000\345\000\000\000\002\000\000\000\002\000\000\000\160\000\000\000\000\000\016\000\000\000\004\000\000\000\163\145\160\000\000\000\000\000\016\000\000\000\000\000\000\000\047\000\000\000\010\000\000\000\010\000\000\000\020\000\000\000\045\000\000\000\020\000\000\000\054\000\000\000\064\000\000\000\054\000\000\000\074\000\000\000\104\000\000\000\074\000\000\000\113\000\000\000\122\000\000\000\113\000\000\000\132\000\000\000\141\000\000\000\132\000\000\000\150\000\000\000\214\000\000\000\150\000\000\000\223\000\000\000\227\000\000\000\223\000\000\000\240\000\000\000\244\000\000\000\240\000\000\000\246\000\000\000\252\000\000\000\246\000\000\000\262\000\000\000\266\000\000\000\262\000\000\000\276\000\000\000\324\000\000\000\276\000\000\000\334\000\000\000\345\000\000\000\334\000\000\000\345\000\000\000\000\000\000\000\000\000\000\000",
+ "\033\114\165\141\121\000\001\004\004\004\010\000\025\000\000\000\100\163\162\143\057\142\141\163\145\057\163\164\162\151\156\147\056\154\165\141\000\000\000\000\000\000\000\000\000\000\000\002\002\012\000\000\000\005\000\000\000\144\000\000\000\011\100\200\200\005\000\000\000\144\100\000\000\011\100\000\201\005\000\000\000\144\200\000\000\011\100\200\201\036\000\200\000\004\000\000\000\004\007\000\000\000\163\164\162\151\156\147\000\004\011\000\000\000\145\156\144\163\167\151\164\150\000\004\010\000\000\000\145\170\160\154\157\144\145\000\004\011\000\000\000\146\151\156\144\154\141\163\164\000\003\000\000\000\000\000\000\000\014\000\000\000\026\000\000\000\000\002\000\007\025\000\000\000\032\000\000\000\026\300\003\200\132\000\000\000\026\100\003\200\213\000\100\000\234\200\000\001\313\000\300\000\334\200\000\001\031\200\200\001\026\300\001\200\013\101\100\000\222\001\200\001\034\201\200\001\127\100\000\002\026\000\000\200\002\101\000\000\002\001\200\000\036\001\000\001\202\000\000\000\236\000\000\001\036\000\200\000\002\000\000\000\004\004\000\000\000\154\145\156\000\004\004\000\000\000\163\165\142\000\000\000\000\000\025\000\000\000\015\000\000\000\015\000\000\000\015\000\000\000\015\000\000\000\016\000\000\000\016\000\000\000\017\000\000\000\017\000\000\000\020\000\000\000\020\000\000\000\021\000\000\000\021\000\000\000\021\000\000\000\021\000\000\000\021\000\000\000\021\000\000\000\021\000\000\000\021\000\000\000\025\000\000\000\025\000\000\000\026\000\000\000\004\000\000\000\011\000\000\000\150\141\171\163\164\141\143\153\000\000\000\000\000\024\000\000\000\007\000\000\000\156\145\145\144\154\145\000\000\000\000\000\024\000\000\000\005\000\000\000\150\154\145\156\000\006\000\000\000\022\000\000\000\005\000\000\000\156\154\145\156\000\010\000\000\000\022\000\000\000\000\000\000\000\000\000\000\000\036\000\000\000\050\000\000\000\000\003\000\020\041\000\000\000\027\000\300\000\026\100\000\200\302\000\000\000\336\000\000\001\301\100\000\000\012\001\000\000\144\001\000\000\000\000\000\000\000\000\200\000\000\000\200\001\000\000\000\001\203\001\200\003\026\000\002\200\205\202\000\000\206\302\100\005\300\002\000\002\013\003\101\000\200\003\200\001\315\103\101\004\034\003\000\002\234\102\000\000\314\100\301\004\141\201\000\000\026\000\375\177\105\201\000\000\106\301\300\002\200\001\000\002\313\001\101\000\100\002\200\001\334\001\200\001\134\101\000\000\036\001\000\001\036\000\200\000\006\000\000\000\004\001\000\000\000\000\003\000\000\000\000\000\000\000\000\004\006\000\000\000\164\141\142\154\145\000\004\007\000\000\000\151\156\163\145\162\164\000\004\004\000\000\000\163\165\142\000\003\000\000\000\000\000\000\360\077\001\000\000\000\000\000\000\000\042\000\000\000\042\000\000\000\004\000\000\005\010\000\000\000\004\000\000\000\013\000\100\000\204\000\200\000\304\000\000\001\004\001\200\001\035\000\200\002\036\000\000\000\036\000\200\000\001\000\000\000\004\005\000\000\000\146\151\156\144\000\000\000\000\000\010\000\000\000\042\000\000\000\042\000\000\000\042\000\000\000\042\000\000\000\042\000\000\000\042\000\000\000\042\000\000\000\042\000\000\000\000\000\000\000\004\000\000\000\002\000\000\000\163\000\010\000\000\000\160\141\164\164\145\162\156\000\004\000\000\000\160\157\163\000\006\000\000\000\160\154\141\151\156\000\041\000\000\000\037\000\000\000\037\000\000\000\037\000\000\000\037\000\000\000\040\000\000\000\041\000\000\000\042\000\000\000\042\000\000\000\042\000\000\000\042\000\000\000\042\000\000\000\042\000\000\000\042\000\000\000\043\000\000\000\043\000\000\000\043\000\000\000\043\000\000\000\043\000\000\000\043\000\000\000\043\000\000\000\043\000\000\000\044\000\000\000\042\000\000\000\044\000\000\000\046\000\000\000\046\000\000\000\046\000\000\000\046\000\000\000\046\000\000\000\046\000\000\000\046\000\000\000\047\000\000\000\050\000\000\000\012\000\000\000\002\000\000\000\163\000\000\000\000\000\040\000\000\000\010\000\000\000\160\141\164\164\145\162\156\000\000\000\000\000\040\000\000\000\006\000\000\000\160\154\141\151\156\000\000\000\000\000\040\000\000\000\004\000\000\000\160\157\163\000\005\000\000\000\040\000\000\000\004\000\000\000\141\162\162\000\006\000\000\000\040\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\014\000\000\000\030\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\014\000\000\000\030\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\014\000\000\000\030\000\000\000\003\000\000\000\163\164\000\015\000\000\000\026\000\000\000\003\000\000\000\163\160\000\015\000\000\000\026\000\000\000\000\000\000\000\000\000\000\000\057\000\000\000\070\000\000\000\000\003\000\011\017\000\000\000\301\000\000\000\013\101\100\000\200\001\200\000\314\201\300\001\000\002\000\001\034\201\200\002\032\001\000\000\026\000\000\200\300\000\000\002\032\101\000\000\026\100\375\177\030\300\000\200\026\000\000\200\336\000\000\001\036\000\200\000\003\000\000\000\003\000\000\000\000\000\000\000\000\004\005\000\000\000\146\151\156\144\000\003\000\000\000\000\000\000\360\077\000\000\000\000\017\000\000\000\060\000\000\000\062\000\000\000\062\000\000\000\062\000\000\000\062\000\000\000\062\000\000\000\063\000\000\000\063\000\000\000\063\000\000\000\064\000\000\000\064\000\000\000\065\000\000\000\065\000\000\000\066\000\000\000\070\000\000\000\005\000\000\000\002\000\000\000\163\000\000\000\000\000\016\000\000\000\010\000\000\000\160\141\164\164\145\162\156\000\000\000\000\000\016\000\000\000\006\000\000\000\160\154\141\151\156\000\000\000\000\000\016\000\000\000\005\000\000\000\143\165\162\162\000\001\000\000\000\016\000\000\000\005\000\000\000\156\145\170\164\000\006\000\000\000\013\000\000\000\000\000\000\000\012\000\000\000\014\000\000\000\026\000\000\000\014\000\000\000\036\000\000\000\050\000\000\000\036\000\000\000\057\000\000\000\070\000\000\000\057\000\000\000\070\000\000\000\000\000\000\000\000\000\000\000",
+ "\033\114\165\141\121\000\001\004\004\004\010\000\024\000\000\000\100\163\162\143\057\142\141\163\145\057\164\141\142\154\145\056\154\165\141\000\000\000\000\000\000\000\000\000\000\000\002\002\020\000\000\000\005\000\000\000\144\000\000\000\011\100\200\200\005\000\000\000\144\100\000\000\011\100\000\201\005\000\000\000\144\200\000\000\011\100\200\201\005\000\000\000\144\300\000\000\011\100\000\202\005\000\000\000\144\000\001\000\011\100\200\202\036\000\200\000\006\000\000\000\004\006\000\000\000\164\141\142\154\145\000\004\007\000\000\000\141\160\160\145\156\144\000\004\011\000\000\000\143\157\156\164\141\151\156\163\000\004\010\000\000\000\145\170\164\162\141\143\164\000\004\010\000\000\000\151\155\160\154\157\144\145\000\004\012\000\000\000\164\162\141\156\163\154\141\164\145\000\005\000\000\000\000\000\000\000\014\000\000\000\020\000\000\000\000\002\000\012\014\000\000\000\205\000\000\000\300\000\200\000\234\000\001\001\026\000\001\200\305\101\000\000\306\201\300\003\000\002\000\000\100\002\000\003\334\101\200\001\241\200\000\000\026\000\376\177\036\000\200\000\003\000\000\000\004\007\000\000\000\151\160\141\151\162\163\000\004\006\000\000\000\164\141\142\154\145\000\004\007\000\000\000\151\156\163\145\162\164\000\000\000\000\000\014\000\000\000\015\000\000\000\015\000\000\000\015\000\000\000\015\000\000\000\016\000\000\000\016\000\000\000\016\000\000\000\016\000\000\000\016\000\000\000\015\000\000\000\016\000\000\000\020\000\000\000\007\000\000\000\004\000\000\000\144\163\164\000\000\000\000\000\013\000\000\000\004\000\000\000\163\162\143\000\000\000\000\000\013\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\003\000\000\000\013\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\003\000\000\000\013\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\003\000\000\000\013\000\000\000\002\000\000\000\137\000\004\000\000\000\011\000\000\000\002\000\000\000\166\000\004\000\000\000\011\000\000\000\000\000\000\000\000\000\000\000\027\000\000\000\036\000\000\000\000\002\000\010\015\000\000\000\205\000\000\000\300\000\000\000\234\000\001\001\026\300\000\200\027\100\000\003\026\100\000\200\302\001\200\000\336\001\000\001\241\200\000\000\026\100\376\177\202\000\000\000\236\000\000\001\036\000\200\000\001\000\000\000\004\006\000\000\000\160\141\151\162\163\000\000\000\000\000\015\000\000\000\030\000\000\000\030\000\000\000\030\000\000\000\030\000\000\000\031\000\000\000\031\000\000\000\032\000\000\000\032\000\000\000\030\000\000\000\033\000\000\000\035\000\000\000\035\000\000\000\036\000\000\000\007\000\000\000\002\000\000\000\164\000\000\000\000\000\014\000\000\000\006\000\000\000\166\141\154\165\145\000\000\000\000\000\014\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\003\000\000\000\012\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\003\000\000\000\012\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\003\000\000\000\012\000\000\000\002\000\000\000\137\000\004\000\000\000\010\000\000\000\002\000\000\000\166\000\004\000\000\000\010\000\000\000\000\000\000\000\000\000\000\000\046\000\000\000\054\000\000\000\000\002\000\013\016\000\000\000\212\000\000\000\305\000\000\000\000\001\000\000\334\000\001\001\026\000\001\200\005\102\000\000\006\202\100\004\100\002\000\001\206\102\200\003\034\102\200\001\341\200\000\000\026\000\376\177\236\000\000\001\036\000\200\000\003\000\000\000\004\007\000\000\000\151\160\141\151\162\163\000\004\006\000\000\000\164\141\142\154\145\000\004\007\000\000\000\151\156\163\145\162\164\000\000\000\000\000\016\000\000\000\047\000\000\000\050\000\000\000\050\000\000\000\050\000\000\000\050\000\000\000\051\000\000\000\051\000\000\000\051\000\000\000\051\000\000\000\051\000\000\000\050\000\000\000\051\000\000\000\053\000\000\000\054\000\000\000\010\000\000\000\004\000\000\000\141\162\162\000\000\000\000\000\015\000\000\000\006\000\000\000\146\156\141\155\145\000\000\000\000\000\015\000\000\000\007\000\000\000\162\145\163\165\154\164\000\001\000\000\000\015\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\004\000\000\000\014\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\004\000\000\000\014\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\004\000\000\000\014\000\000\000\002\000\000\000\137\000\005\000\000\000\012\000\000\000\002\000\000\000\166\000\005\000\000\000\012\000\000\000\000\000\000\000\000\000\000\000\064\000\000\000\075\000\000\000\000\004\000\016\025\000\000\000\001\001\000\000\105\101\000\000\200\001\000\000\134\001\001\001\026\300\002\200\127\000\100\002\026\000\001\200\332\000\000\000\026\200\000\200\200\002\000\002\300\002\200\001\025\301\002\005\200\002\000\002\300\002\200\000\000\003\200\004\100\003\000\001\025\101\003\005\141\201\000\000\026\100\374\177\036\001\000\001\036\000\200\000\002\000\000\000\004\001\000\000\000\000\004\007\000\000\000\151\160\141\151\162\163\000\000\000\000\000\025\000\000\000\065\000\000\000\066\000\000\000\066\000\000\000\066\000\000\000\066\000\000\000\067\000\000\000\067\000\000\000\067\000\000\000\067\000\000\000\070\000\000\000\070\000\000\000\070\000\000\000\072\000\000\000\072\000\000\000\072\000\000\000\072\000\000\000\072\000\000\000\066\000\000\000\072\000\000\000\074\000\000\000\075\000\000\000\012\000\000\000\004\000\000\000\141\162\162\000\000\000\000\000\024\000\000\000\007\000\000\000\142\145\146\157\162\145\000\000\000\000\000\024\000\000\000\006\000\000\000\141\146\164\145\162\000\000\000\000\000\024\000\000\000\010\000\000\000\142\145\164\167\145\145\156\000\000\000\000\000\024\000\000\000\007\000\000\000\162\145\163\165\154\164\000\001\000\000\000\024\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\004\000\000\000\023\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\004\000\000\000\023\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\004\000\000\000\023\000\000\000\002\000\000\000\137\000\005\000\000\000\021\000\000\000\002\000\000\000\166\000\005\000\000\000\021\000\000\000\000\000\000\000\000\000\000\000\105\000\000\000\113\000\000\000\000\002\000\013\016\000\000\000\212\000\000\000\305\000\000\000\000\001\000\000\334\000\001\001\026\000\001\200\005\102\000\000\006\202\100\004\100\002\000\001\206\302\201\000\034\102\200\001\341\200\000\000\026\000\376\177\236\000\000\001\036\000\200\000\003\000\000\000\004\007\000\000\000\151\160\141\151\162\163\000\004\006\000\000\000\164\141\142\154\145\000\004\007\000\000\000\151\156\163\145\162\164\000\000\000\000\000\016\000\000\000\106\000\000\000\107\000\000\000\107\000\000\000\107\000\000\000\107\000\000\000\110\000\000\000\110\000\000\000\110\000\000\000\110\000\000\000\110\000\000\000\107\000\000\000\110\000\000\000\112\000\000\000\113\000\000\000\010\000\000\000\004\000\000\000\141\162\162\000\000\000\000\000\015\000\000\000\014\000\000\000\164\162\141\156\163\154\141\164\151\157\156\000\000\000\000\000\015\000\000\000\007\000\000\000\162\145\163\165\154\164\000\001\000\000\000\015\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\004\000\000\000\014\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\004\000\000\000\014\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\004\000\000\000\014\000\000\000\002\000\000\000\137\000\005\000\000\000\012\000\000\000\006\000\000\000\166\141\154\165\145\000\005\000\000\000\012\000\000\000\000\000\000\000\020\000\000\000\014\000\000\000\020\000\000\000\014\000\000\000\027\000\000\000\036\000\000\000\027\000\000\000\046\000\000\000\054\000\000\000\046\000\000\000\064\000\000\000\075\000\000\000\064\000\000\000\105\000\000\000\113\000\000\000\105\000\000\000\113\000\000\000\000\000\000\000\000\000\000\000",
+ "\033\114\165\141\121\000\001\004\004\004\010\000\021\000\000\000\100\163\162\143\057\142\141\163\145\057\157\163\056\154\165\141\000\000\000\000\000\000\000\000\000\000\000\002\004\024\000\000\000\005\000\000\000\144\000\000\000\011\100\200\200\044\100\000\000\000\000\000\000\105\000\000\000\244\200\000\000\000\000\000\000\111\200\000\201\105\000\000\000\244\300\000\000\000\000\000\000\111\200\200\201\105\000\000\000\106\000\301\000\205\000\000\000\344\000\001\000\000\000\200\000\211\300\000\202\036\000\200\000\005\000\000\000\004\003\000\000\000\157\163\000\004\003\000\000\000\151\163\000\004\012\000\000\000\155\141\164\143\150\144\151\162\163\000\004\013\000\000\000\155\141\164\143\150\146\151\154\145\163\000\004\006\000\000\000\155\153\144\151\162\000\005\000\000\000\000\000\000\000\014\000\000\000\017\000\000\000\000\001\000\005\017\000\000\000\105\000\000\000\106\100\300\000\132\100\000\000\026\000\000\200\105\200\000\000\213\300\300\000\234\200\000\001\313\300\100\000\334\200\000\001\127\300\000\001\026\000\000\200\202\100\000\000\202\000\200\000\236\000\000\001\036\000\200\000\004\000\000\000\004\011\000\000\000\137\117\120\124\111\117\116\123\000\004\003\000\000\000\157\163\000\004\004\000\000\000\137\117\123\000\004\006\000\000\000\154\157\167\145\162\000\000\000\000\000\017\000\000\000\015\000\000\000\015\000\000\000\015\000\000\000\015\000\000\000\015\000\000\000\016\000\000\000\016\000\000\000\016\000\000\000\016\000\000\000\016\000\000\000\016\000\000\000\016\000\000\000\016\000\000\000\016\000\000\000\017\000\000\000\002\000\000\000\003\000\000\000\151\144\000\000\000\000\000\016\000\000\000\010\000\000\000\143\165\162\162\145\156\164\000\005\000\000\000\016\000\000\000\000\000\000\000\000\000\000\000\026\000\000\000\057\000\000\000\001\003\000\014\140\000\000\000\305\000\000\000\306\100\300\001\000\001\200\000\334\200\000\001\027\200\300\001\026\000\000\200\301\300\000\000\005\001\001\000\006\101\101\002\100\001\200\000\034\201\000\001\105\001\001\000\106\201\301\002\200\001\000\002\134\201\000\001\132\001\000\000\026\100\006\200\105\001\001\000\106\301\301\002\200\001\000\002\134\201\000\001\205\001\001\000\206\001\102\003\300\001\000\002\234\201\000\001\232\000\000\000\026\100\000\200\232\101\000\000\026\300\000\200\232\100\000\000\026\300\372\177\232\101\000\000\026\100\372\177\305\101\002\000\306\201\302\003\000\002\000\000\105\002\000\000\106\302\302\004\200\002\200\001\300\002\200\002\134\002\200\001\334\101\000\000\026\300\367\177\105\001\001\000\106\001\303\002\200\001\000\002\134\101\000\001\113\101\303\000\301\201\003\000\134\201\200\001\132\001\000\000\026\200\012\200\105\001\000\000\106\301\303\002\200\001\200\000\134\201\000\001\100\000\200\002\105\001\001\000\106\101\301\002\205\001\000\000\206\301\102\003\300\001\200\001\001\002\004\000\234\001\200\001\134\201\000\000\000\001\200\002\105\001\001\000\106\201\301\002\200\001\000\002\134\201\000\001\132\001\000\000\026\200\004\200\105\001\001\000\106\301\301\002\200\001\000\002\134\201\000\001\205\001\000\000\206\301\102\003\305\001\000\000\306\301\302\003\000\002\200\001\100\002\200\002\334\201\200\001\000\002\200\000\234\201\200\001\304\001\000\000\000\002\000\000\100\002\000\003\200\002\000\001\334\101\000\002\026\200\371\177\105\001\001\000\106\001\303\002\200\001\000\002\134\101\000\001\036\000\200\000\021\000\000\000\004\005\000\000\000\160\141\164\150\000\004\015\000\000\000\147\145\164\144\151\162\145\143\164\157\162\171\000\004\002\000\000\000\056\000\004\001\000\000\000\000\004\003\000\000\000\157\163\000\004\013\000\000\000\155\141\164\143\150\163\164\141\162\164\000\004\012\000\000\000\155\141\164\143\150\156\145\170\164\000\004\012\000\000\000\155\141\164\143\150\156\141\155\145\000\004\014\000\000\000\155\141\164\143\150\151\163\146\151\154\145\000\004\006\000\000\000\164\141\142\154\145\000\004\007\000\000\000\151\156\163\145\162\164\000\004\005\000\000\000\152\157\151\156\000\004\012\000\000\000\155\141\164\143\150\144\157\156\145\000\004\005\000\000\000\146\151\156\144\000\004\003\000\000\000\052\052\000\004\010\000\000\000\147\145\164\156\141\155\145\000\004\002\000\000\000\052\000\000\000\000\000\140\000\000\000\027\000\000\000\027\000\000\000\027\000\000\000\027\000\000\000\030\000\000\000\030\000\000\000\030\000\000\000\032\000\000\000\032\000\000\000\032\000\000\000\032\000\000\000\033\000\000\000\033\000\000\000\033\000\000\000\033\000\000\000\033\000\000\000\033\000\000\000\034\000\000\000\034\000\000\000\034\000\000\000\034\000\000\000\035\000\000\000\035\000\000\000\035\000\000\000\035\000\000\000\036\000\000\000\036\000\000\000\036\000\000\000\036\000\000\000\036\000\000\000\036\000\000\000\036\000\000\000\036\000\000\000\037\000\000\000\037\000\000\000\037\000\000\000\037\000\000\000\037\000\000\000\037\000\000\000\037\000\000\000\037\000\000\000\037\000\000\000\040\000\000\000\042\000\000\000\042\000\000\000\042\000\000\000\042\000\000\000\045\000\000\000\045\000\000\000\045\000\000\000\045\000\000\000\045\000\000\000\046\000\000\000\046\000\000\000\046\000\000\000\046\000\000\000\046\000\000\000\047\000\000\000\047\000\000\000\047\000\000\000\047\000\000\000\047\000\000\000\047\000\000\000\047\000\000\000\047\000\000\000\047\000\000\000\050\000\000\000\050\000\000\000\050\000\000\000\050\000\000\000\050\000\000\000\050\000\000\000\051\000\000\000\051\000\000\000\051\000\000\000\051\000\000\000\052\000\000\000\052\000\000\000\052\000\000\000\052\000\000\000\052\000\000\000\052\000\000\000\052\000\000\000\052\000\000\000\052\000\000\000\053\000\000\000\053\000\000\000\053\000\000\000\053\000\000\000\053\000\000\000\053\000\000\000\055\000\000\000\055\000\000\000\055\000\000\000\055\000\000\000\057\000\000\000\011\000\000\000\007\000\000\000\162\145\163\165\154\164\000\000\000\000\000\137\000\000\000\005\000\000\000\155\141\163\153\000\000\000\000\000\137\000\000\000\012\000\000\000\167\141\156\164\146\151\154\145\163\000\000\000\000\000\137\000\000\000\010\000\000\000\142\141\163\145\144\151\162\000\004\000\000\000\137\000\000\000\002\000\000\000\155\000\013\000\000\000\137\000\000\000\006\000\000\000\146\156\141\155\145\000\025\000\000\000\052\000\000\000\007\000\000\000\151\163\146\151\154\145\000\031\000\000\000\052\000\000\000\010\000\000\000\144\151\162\156\141\155\145\000\114\000\000\000\132\000\000\000\010\000\000\000\163\165\142\155\141\163\153\000\125\000\000\000\132\000\000\000\001\000\000\000\010\000\000\000\144\157\155\141\164\143\150\000\000\000\000\000\061\000\000\000\067\000\000\000\001\000\007\013\016\000\000\000\112\000\000\000\205\000\000\000\300\000\000\000\234\000\001\001\026\000\001\200\304\001\000\000\000\002\200\000\100\002\000\003\202\002\000\000\334\101\000\002\241\200\000\000\026\000\376\177\136\000\000\001\036\000\200\000\001\000\000\000\004\007\000\000\000\151\160\141\151\162\163\000\000\000\000\000\016\000\000\000\062\000\000\000\063\000\000\000\063\000\000\000\063\000\000\000\063\000\000\000\064\000\000\000\064\000\000\000\064\000\000\000\064\000\000\000\064\000\000\000\063\000\000\000\064\000\000\000\066\000\000\000\067\000\000\000\007\000\000\000\004\000\000\000\141\162\147\000\000\000\000\000\015\000\000\000\007\000\000\000\162\145\163\165\154\164\000\001\000\000\000\015\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\004\000\000\000\014\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\004\000\000\000\014\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\004\000\000\000\014\000\000\000\002\000\000\000\137\000\005\000\000\000\012\000\000\000\005\000\000\000\155\141\163\153\000\005\000\000\000\012\000\000\000\001\000\000\000\010\000\000\000\144\157\155\141\164\143\150\000\000\000\000\000\071\000\000\000\077\000\000\000\001\000\007\013\016\000\000\000\112\000\000\000\205\000\000\000\300\000\000\000\234\000\001\001\026\000\001\200\304\001\000\000\000\002\200\000\100\002\000\003\202\002\200\000\334\101\000\002\241\200\000\000\026\000\376\177\136\000\000\001\036\000\200\000\001\000\000\000\004\007\000\000\000\151\160\141\151\162\163\000\000\000\000\000\016\000\000\000\072\000\000\000\073\000\000\000\073\000\000\000\073\000\000\000\073\000\000\000\074\000\000\000\074\000\000\000\074\000\000\000\074\000\000\000\074\000\000\000\073\000\000\000\074\000\000\000\076\000\000\000\077\000\000\000\007\000\000\000\004\000\000\000\141\162\147\000\000\000\000\000\015\000\000\000\007\000\000\000\162\145\163\165\154\164\000\001\000\000\000\015\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\004\000\000\000\014\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\004\000\000\000\014\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\004\000\000\000\014\000\000\000\002\000\000\000\137\000\005\000\000\000\012\000\000\000\005\000\000\000\155\141\163\153\000\005\000\000\000\012\000\000\000\001\000\000\000\010\000\000\000\144\157\155\141\164\143\150\000\000\000\000\000\110\000\000\000\130\000\000\000\001\001\000\012\046\000\000\000\101\000\000\000\213\100\100\000\001\201\000\000\234\000\201\001\026\300\006\200\200\001\200\000\300\001\200\002\125\300\001\003\127\000\300\002\026\300\004\200\205\301\000\000\206\001\101\003\300\001\200\002\234\201\000\001\232\101\000\000\026\100\003\200\205\101\001\000\206\201\101\003\300\001\200\000\234\201\000\001\232\101\000\000\026\300\001\200\204\001\000\000\300\001\200\000\234\301\000\001\232\101\000\000\026\200\000\200\003\002\000\004\100\002\200\003\036\002\200\001\200\001\200\000\301\301\001\000\125\300\001\003\241\100\000\000\026\100\370\177\202\000\200\000\236\000\000\001\036\000\200\000\010\000\000\000\004\001\000\000\000\000\004\007\000\000\000\147\155\141\164\143\150\000\004\006\000\000\000\133\136\057\135\053\000\004\005\000\000\000\160\141\164\150\000\004\013\000\000\000\151\163\141\142\163\157\154\165\164\145\000\004\003\000\000\000\157\163\000\004\006\000\000\000\151\163\144\151\162\000\004\002\000\000\000\057\000\000\000\000\000\046\000\000\000\111\000\000\000\112\000\000\000\112\000\000\000\112\000\000\000\112\000\000\000\113\000\000\000\113\000\000\000\113\000\000\000\115\000\000\000\115\000\000\000\115\000\000\000\115\000\000\000\115\000\000\000\115\000\000\000\115\000\000\000\115\000\000\000\115\000\000\000\115\000\000\000\115\000\000\000\115\000\000\000\115\000\000\000\115\000\000\000\116\000\000\000\116\000\000\000\116\000\000\000\117\000\000\000\117\000\000\000\120\000\000\000\120\000\000\000\120\000\000\000\124\000\000\000\124\000\000\000\124\000\000\000\112\000\000\000\124\000\000\000\127\000\000\000\127\000\000\000\130\000\000\000\010\000\000\000\002\000\000\000\160\000\000\000\000\000\045\000\000\000\004\000\000\000\144\151\162\000\001\000\000\000\045\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\004\000\000\000\043\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\004\000\000\000\043\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\004\000\000\000\043\000\000\000\005\000\000\000\160\141\162\164\000\005\000\000\000\041\000\000\000\003\000\000\000\157\153\000\031\000\000\000\036\000\000\000\004\000\000\000\145\162\162\000\031\000\000\000\036\000\000\000\001\000\000\000\016\000\000\000\142\165\151\154\164\151\156\137\155\153\144\151\162\000\024\000\000\000\014\000\000\000\017\000\000\000\014\000\000\000\057\000\000\000\057\000\000\000\061\000\000\000\067\000\000\000\067\000\000\000\061\000\000\000\071\000\000\000\077\000\000\000\077\000\000\000\071\000\000\000\107\000\000\000\107\000\000\000\110\000\000\000\130\000\000\000\130\000\000\000\110\000\000\000\130\000\000\000\002\000\000\000\010\000\000\000\144\157\155\141\164\143\150\000\005\000\000\000\023\000\000\000\016\000\000\000\142\165\151\154\164\151\156\137\155\153\144\151\162\000\017\000\000\000\023\000\000\000\000\000\000\000",
+ "\033\114\165\141\121\000\001\004\004\004\010\000\026\000\000\000\100\163\162\143\057\142\141\163\145\057\147\154\157\142\141\154\163\056\154\165\141\000\000\000\000\000\000\000\000\000\000\000\002\004\037\000\000\000\012\000\000\000\007\000\000\000\012\000\000\000\007\100\000\000\012\000\000\000\007\200\000\000\005\200\000\000\112\000\000\000\011\100\200\201\005\200\000\000\112\000\000\000\011\100\000\202\005\100\001\000\144\000\000\000\000\000\000\000\107\100\001\000\144\100\000\000\107\200\001\000\105\300\001\000\106\000\302\000\205\300\001\000\344\200\000\000\000\000\200\000\211\300\000\204\244\300\000\000\207\100\002\000\205\200\002\000\344\000\001\000\000\000\000\001\307\200\002\000\036\000\200\000\013\000\000\000\004\013\000\000\000\137\123\117\114\125\124\111\117\116\123\000\004\013\000\000\000\137\124\105\115\120\114\101\124\105\123\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\141\143\164\151\157\156\163\000\004\006\000\000\000\164\157\157\154\163\000\004\007\000\000\000\144\157\146\151\154\145\000\004\010\000\000\000\151\156\143\154\165\144\145\000\004\003\000\000\000\151\157\000\004\005\000\000\000\157\160\145\156\000\004\007\000\000\000\160\162\151\156\164\146\000\004\005\000\000\000\164\171\160\145\000\005\000\000\000\000\000\000\000\050\000\000\000\102\000\000\000\001\001\000\017\065\000\000\000\105\000\000\000\106\100\300\000\134\200\200\000\205\000\000\000\206\200\100\001\300\000\000\000\234\200\000\001\232\100\000\000\026\300\003\200\205\000\000\000\206\300\100\001\300\000\000\000\005\001\001\000\006\101\101\002\105\001\000\000\106\201\301\002\201\301\001\000\134\001\000\001\234\200\000\000\232\000\000\000\026\300\000\200\300\000\000\001\001\001\002\000\100\001\000\000\025\100\201\001\205\100\002\000\206\200\102\001\300\000\000\000\234\200\000\001\000\000\000\001\205\100\002\000\206\300\102\001\300\000\000\000\234\200\000\001\305\000\000\000\306\000\303\001\000\001\000\001\334\100\000\001\304\000\000\000\000\001\000\000\334\300\001\001\105\002\000\000\106\002\303\004\200\002\200\000\134\102\000\001\100\002\200\001\200\002\000\002\300\002\200\002\000\003\000\003\100\003\200\003\200\003\000\004\136\002\200\003\036\000\200\000\015\000\000\000\004\003\000\000\000\157\163\000\004\007\000\000\000\147\145\164\143\167\144\000\004\007\000\000\000\151\163\146\151\154\145\000\004\013\000\000\000\160\141\164\150\163\145\141\162\143\150\000\004\011\000\000\000\137\117\120\124\111\117\116\123\000\004\010\000\000\000\163\143\162\151\160\164\163\000\004\007\000\000\000\147\145\164\145\156\166\000\004\015\000\000\000\120\122\105\115\101\113\105\137\120\101\124\110\000\004\002\000\000\000\057\000\004\005\000\000\000\160\141\164\150\000\004\014\000\000\000\147\145\164\141\142\163\157\154\165\164\145\000\004\015\000\000\000\147\145\164\144\151\162\145\143\164\157\162\171\000\004\006\000\000\000\143\150\144\151\162\000\000\000\000\000\065\000\000\000\052\000\000\000\052\000\000\000\052\000\000\000\055\000\000\000\055\000\000\000\055\000\000\000\055\000\000\000\055\000\000\000\055\000\000\000\056\000\000\000\056\000\000\000\056\000\000\000\056\000\000\000\056\000\000\000\056\000\000\000\056\000\000\000\056\000\000\000\056\000\000\000\056\000\000\000\057\000\000\000\057\000\000\000\060\000\000\000\060\000\000\000\060\000\000\000\060\000\000\000\066\000\000\000\066\000\000\000\066\000\000\000\066\000\000\000\066\000\000\000\071\000\000\000\071\000\000\000\071\000\000\000\071\000\000\000\072\000\000\000\072\000\000\000\072\000\000\000\072\000\000\000\075\000\000\000\075\000\000\000\075\000\000\000\100\000\000\000\100\000\000\000\100\000\000\000\100\000\000\000\101\000\000\000\101\000\000\000\101\000\000\000\101\000\000\000\101\000\000\000\101\000\000\000\101\000\000\000\102\000\000\000\012\000\000\000\006\000\000\000\146\156\141\155\145\000\000\000\000\000\064\000\000\000\007\000\000\000\157\154\144\143\167\144\000\003\000\000\000\064\000\000\000\005\000\000\000\160\141\164\150\000\023\000\000\000\031\000\000\000\007\000\000\000\156\145\167\143\167\144\000\042\000\000\000\064\000\000\000\002\000\000\000\141\000\051\000\000\000\064\000\000\000\002\000\000\000\142\000\051\000\000\000\064\000\000\000\002\000\000\000\143\000\051\000\000\000\064\000\000\000\002\000\000\000\144\000\051\000\000\000\064\000\000\000\002\000\000\000\145\000\051\000\000\000\064\000\000\000\002\000\000\000\146\000\051\000\000\000\064\000\000\000\001\000\000\000\017\000\000\000\142\165\151\154\164\151\156\137\144\157\146\151\154\145\000\000\000\000\000\112\000\000\000\114\000\000\000\000\001\000\004\007\000\000\000\105\000\000\000\200\000\000\000\301\100\000\000\225\300\000\001\135\000\000\001\136\000\000\000\036\000\200\000\002\000\000\000\004\007\000\000\000\144\157\146\151\154\145\000\004\016\000\000\000\057\160\162\145\155\141\153\145\064\056\154\165\141\000\000\000\000\000\007\000\000\000\113\000\000\000\113\000\000\000\113\000\000\000\113\000\000\000\113\000\000\000\113\000\000\000\114\000\000\000\001\000\000\000\006\000\000\000\146\156\141\155\145\000\000\000\000\000\006\000\000\000\000\000\000\000\000\000\000\000\126\000\000\000\141\000\000\000\001\002\000\006\036\000\000\000\132\000\000\000\026\100\005\200\213\000\300\000\001\101\000\000\234\200\200\001\232\000\000\000\026\000\004\200\205\200\000\000\206\300\100\001\300\000\000\000\234\200\000\001\305\200\001\000\306\300\301\001\000\001\000\001\334\300\000\001\007\101\001\000\307\000\001\000\305\000\001\000\332\100\000\000\026\300\000\200\305\000\002\000\005\101\001\000\101\101\002\000\334\100\200\001\204\000\000\000\300\000\000\000\000\001\200\000\235\000\200\001\236\000\000\000\036\000\200\000\012\000\000\000\004\005\000\000\000\146\151\156\144\000\004\002\000\000\000\167\000\004\005\000\000\000\160\141\164\150\000\004\015\000\000\000\147\145\164\144\151\162\145\143\164\157\162\171\000\004\003\000\000\000\157\153\000\004\004\000\000\000\145\162\162\000\004\003\000\000\000\157\163\000\004\006\000\000\000\155\153\144\151\162\000\004\006\000\000\000\145\162\162\157\162\000\003\000\000\000\000\000\000\000\000\000\000\000\000\036\000\000\000\127\000\000\000\127\000\000\000\130\000\000\000\130\000\000\000\130\000\000\000\130\000\000\000\130\000\000\000\131\000\000\000\131\000\000\000\131\000\000\000\131\000\000\000\132\000\000\000\132\000\000\000\132\000\000\000\132\000\000\000\132\000\000\000\132\000\000\000\133\000\000\000\133\000\000\000\133\000\000\000\134\000\000\000\134\000\000\000\134\000\000\000\134\000\000\000\140\000\000\000\140\000\000\000\140\000\000\000\140\000\000\000\140\000\000\000\141\000\000\000\003\000\000\000\006\000\000\000\146\156\141\155\145\000\000\000\000\000\035\000\000\000\005\000\000\000\155\157\144\145\000\000\000\000\000\035\000\000\000\004\000\000\000\144\151\162\000\013\000\000\000\030\000\000\000\001\000\000\000\015\000\000\000\142\165\151\154\164\151\156\137\157\160\145\156\000\000\000\000\000\151\000\000\000\153\000\000\000\000\001\007\007\012\000\000\000\205\000\000\000\305\100\000\000\306\200\300\001\000\001\000\000\105\301\000\000\200\001\200\000\134\001\000\001\334\000\000\000\234\100\000\000\036\000\200\000\004\000\000\000\004\006\000\000\000\160\162\151\156\164\000\004\007\000\000\000\163\164\162\151\156\147\000\004\007\000\000\000\146\157\162\155\141\164\000\004\007\000\000\000\165\156\160\141\143\153\000\000\000\000\000\012\000\000\000\152\000\000\000\152\000\000\000\152\000\000\000\152\000\000\000\152\000\000\000\152\000\000\000\152\000\000\000\152\000\000\000\152\000\000\000\153\000\000\000\002\000\000\000\004\000\000\000\155\163\147\000\000\000\000\000\011\000\000\000\004\000\000\000\141\162\147\000\000\000\000\000\011\000\000\000\000\000\000\000\000\000\000\000\165\000\000\000\175\000\000\000\001\001\000\004\017\000\000\000\105\000\000\000\200\000\000\000\134\200\000\001\132\000\000\000\026\000\001\200\206\100\300\000\232\000\000\000\026\100\000\200\206\100\300\000\236\000\000\001\204\000\000\000\300\000\000\000\235\000\000\001\236\000\000\000\036\000\200\000\002\000\000\000\004\015\000\000\000\147\145\164\155\145\164\141\164\141\142\154\145\000\004\007\000\000\000\137\137\164\171\160\145\000\000\000\000\000\017\000\000\000\166\000\000\000\166\000\000\000\166\000\000\000\167\000\000\000\167\000\000\000\170\000\000\000\170\000\000\000\170\000\000\000\171\000\000\000\171\000\000\000\174\000\000\000\174\000\000\000\174\000\000\000\174\000\000\000\175\000\000\000\002\000\000\000\002\000\000\000\164\000\000\000\000\000\016\000\000\000\003\000\000\000\155\164\000\003\000\000\000\016\000\000\000\001\000\000\000\015\000\000\000\142\165\151\154\164\151\156\137\164\171\160\145\000\037\000\000\000\012\000\000\000\012\000\000\000\017\000\000\000\017\000\000\000\024\000\000\000\024\000\000\000\031\000\000\000\031\000\000\000\031\000\000\000\036\000\000\000\036\000\000\000\036\000\000\000\047\000\000\000\102\000\000\000\102\000\000\000\050\000\000\000\114\000\000\000\112\000\000\000\125\000\000\000\125\000\000\000\126\000\000\000\141\000\000\000\141\000\000\000\126\000\000\000\153\000\000\000\151\000\000\000\164\000\000\000\175\000\000\000\175\000\000\000\165\000\000\000\175\000\000\000\003\000\000\000\017\000\000\000\142\165\151\154\164\151\156\137\144\157\146\151\154\145\000\015\000\000\000\036\000\000\000\015\000\000\000\142\165\151\154\164\151\156\137\157\160\145\156\000\024\000\000\000\036\000\000\000\015\000\000\000\142\165\151\154\164\151\156\137\164\171\160\145\000\033\000\000\000\036\000\000\000\000\000\000\000",
+ "\033\114\165\141\121\000\001\004\004\004\010\000\026\000\000\000\100\163\162\143\057\142\141\163\145\057\160\162\145\155\141\153\145\056\154\165\141\000\000\000\000\000\000\000\000\000\000\000\002\003\022\000\000\000\005\000\000\000\144\000\000\000\011\100\200\200\005\000\000\000\144\100\000\000\011\100\000\201\005\000\000\000\144\200\000\000\011\100\200\201\003\000\000\000\105\000\000\000\244\300\000\000\000\000\000\000\111\200\000\202\105\000\000\000\244\000\001\000\111\200\200\202\036\000\200\000\006\000\000\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\013\000\000\000\143\150\145\143\153\164\157\157\154\163\000\004\013\000\000\000\143\150\145\143\153\166\141\154\165\145\000\004\011\000\000\000\144\157\141\143\164\151\157\156\000\004\017\000\000\000\147\145\164\141\143\164\151\166\145\164\145\162\155\163\000\004\016\000\000\000\147\145\164\157\165\164\160\165\164\156\141\155\145\000\005\000\000\000\000\000\000\000\015\000\000\000\037\000\000\000\000\000\000\015\054\000\000\000\005\000\000\000\006\100\100\000\105\200\000\000\006\100\000\000\106\300\100\000\132\100\000\000\026\100\000\200\102\000\200\000\136\000\000\001\105\000\001\000\206\300\100\000\134\000\001\001\026\100\006\200\205\101\001\000\206\001\001\003\232\001\000\000\026\200\004\200\205\201\001\000\206\301\101\003\300\001\200\002\005\102\001\000\006\002\001\004\234\201\200\001\232\101\000\000\026\100\003\200\203\001\000\003\301\001\002\000\006\102\102\000\101\202\002\000\200\002\000\002\301\302\002\000\005\103\001\000\006\003\001\006\325\001\203\003\236\001\200\001\026\200\000\200\205\101\001\000\306\001\303\002\211\301\001\002\141\200\000\000\026\300\370\177\102\000\200\000\136\000\000\001\036\000\200\000\015\000\000\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\141\143\164\151\157\156\163\000\004\010\000\000\000\137\101\103\124\111\117\116\000\004\014\000\000\000\166\141\154\151\144\137\164\157\157\154\163\000\004\006\000\000\000\160\141\151\162\163\000\004\011\000\000\000\137\117\120\124\111\117\116\123\000\004\006\000\000\000\164\141\142\154\145\000\004\011\000\000\000\143\157\156\164\141\151\156\163\000\004\005\000\000\000\164\150\145\040\000\004\012\000\000\000\163\150\157\162\164\156\141\155\145\000\004\033\000\000\000\040\141\143\164\151\157\156\040\144\157\145\163\040\156\157\164\040\163\165\160\160\157\162\164\040\057\000\004\002\000\000\000\075\000\003\000\000\000\000\000\000\360\077\000\000\000\000\054\000\000\000\016\000\000\000\016\000\000\000\016\000\000\000\016\000\000\000\020\000\000\000\020\000\000\000\020\000\000\000\021\000\000\000\021\000\000\000\024\000\000\000\024\000\000\000\024\000\000\000\024\000\000\000\025\000\000\000\025\000\000\000\025\000\000\000\025\000\000\000\026\000\000\000\026\000\000\000\026\000\000\000\026\000\000\000\026\000\000\000\026\000\000\000\026\000\000\000\026\000\000\000\027\000\000\000\027\000\000\000\027\000\000\000\027\000\000\000\027\000\000\000\027\000\000\000\027\000\000\000\027\000\000\000\027\000\000\000\027\000\000\000\030\000\000\000\032\000\000\000\032\000\000\000\032\000\000\000\024\000\000\000\033\000\000\000\036\000\000\000\036\000\000\000\037\000\000\000\006\000\000\000\007\000\000\000\141\143\164\151\157\156\000\004\000\000\000\053\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\014\000\000\000\051\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\014\000\000\000\051\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\014\000\000\000\051\000\000\000\005\000\000\000\164\157\157\154\000\015\000\000\000\047\000\000\000\007\000\000\000\166\141\154\165\145\163\000\015\000\000\000\047\000\000\000\000\000\000\000\000\000\000\000\051\000\000\000\063\000\000\000\000\002\000\012\022\000\000\000\132\000\000\000\026\100\003\200\205\000\000\000\300\000\200\000\234\000\001\001\026\200\001\200\313\101\100\000\334\201\000\001\013\102\100\003\034\202\000\001\027\000\202\003\026\000\000\200\236\001\000\001\241\200\000\000\026\200\375\177\026\000\000\200\036\000\000\001\036\000\200\000\002\000\000\000\004\007\000\000\000\151\160\141\151\162\163\000\004\006\000\000\000\154\157\167\145\162\000\000\000\000\000\022\000\000\000\052\000\000\000\052\000\000\000\053\000\000\000\053\000\000\000\053\000\000\000\053\000\000\000\054\000\000\000\054\000\000\000\054\000\000\000\054\000\000\000\054\000\000\000\054\000\000\000\055\000\000\000\053\000\000\000\056\000\000\000\057\000\000\000\061\000\000\000\063\000\000\000\007\000\000\000\006\000\000\000\166\141\154\165\145\000\000\000\000\000\021\000\000\000\010\000\000\000\141\154\154\157\167\145\144\000\000\000\000\000\021\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\005\000\000\000\017\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\005\000\000\000\017\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\005\000\000\000\017\000\000\000\002\000\000\000\137\000\006\000\000\000\015\000\000\000\002\000\000\000\166\000\006\000\000\000\015\000\000\000\000\000\000\000\000\000\000\000\074\000\000\000\123\000\000\000\000\001\000\017\040\000\000\000\105\000\000\000\106\100\300\000\106\000\200\000\244\000\000\000\305\200\000\000\005\301\000\000\334\000\001\001\026\300\003\200\000\002\000\001\100\002\200\003\206\002\301\000\034\102\200\001\005\002\000\000\006\102\101\004\006\202\101\004\100\002\200\003\034\002\001\001\026\300\000\200\000\003\000\001\100\003\200\005\206\303\301\000\034\103\200\001\041\102\000\000\026\100\376\177\341\200\000\000\026\100\373\177\306\000\302\000\332\000\000\000\026\100\000\200\306\000\302\000\334\100\200\000\036\000\200\000\011\000\000\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\141\143\164\151\157\156\163\000\004\007\000\000\000\151\160\141\151\162\163\000\004\013\000\000\000\137\123\117\114\125\124\111\117\116\123\000\004\022\000\000\000\163\157\154\165\164\151\157\156\164\145\155\160\154\141\164\145\163\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\011\000\000\000\160\162\157\152\145\143\164\163\000\004\021\000\000\000\160\162\157\152\145\143\164\164\145\155\160\154\141\164\145\163\000\004\010\000\000\000\145\170\145\143\165\164\145\000\001\000\000\000\000\000\000\000\100\000\000\000\107\000\000\000\000\002\000\014\025\000\000\000\132\000\000\000\026\100\004\200\205\000\000\000\300\000\200\000\234\000\001\001\026\300\002\200\305\101\000\000\306\201\300\003\000\002\000\000\106\302\100\003\334\201\200\001\005\102\000\000\006\002\101\004\006\102\101\004\106\202\101\003\200\002\200\003\300\002\000\000\034\102\000\002\241\200\000\000\026\100\374\177\036\000\200\000\007\000\000\000\004\007\000\000\000\151\160\141\151\162\163\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\016\000\000\000\147\145\164\157\165\164\160\165\164\156\141\155\145\000\003\000\000\000\000\000\000\360\077\004\011\000\000\000\164\145\155\160\154\141\164\145\000\004\011\000\000\000\147\145\156\145\162\141\164\145\000\003\000\000\000\000\000\000\000\100\000\000\000\000\025\000\000\000\101\000\000\000\101\000\000\000\102\000\000\000\102\000\000\000\102\000\000\000\102\000\000\000\103\000\000\000\103\000\000\000\103\000\000\000\103\000\000\000\103\000\000\000\104\000\000\000\104\000\000\000\104\000\000\000\104\000\000\000\104\000\000\000\104\000\000\000\104\000\000\000\102\000\000\000\104\000\000\000\107\000\000\000\010\000\000\000\005\000\000\000\164\150\151\163\000\000\000\000\000\024\000\000\000\012\000\000\000\164\145\155\160\154\141\164\145\163\000\000\000\000\000\024\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\005\000\000\000\024\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\005\000\000\000\024\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\005\000\000\000\024\000\000\000\002\000\000\000\137\000\006\000\000\000\022\000\000\000\005\000\000\000\164\155\160\154\000\006\000\000\000\022\000\000\000\006\000\000\000\146\156\141\155\145\000\013\000\000\000\022\000\000\000\000\000\000\000\040\000\000\000\075\000\000\000\075\000\000\000\075\000\000\000\107\000\000\000\111\000\000\000\111\000\000\000\111\000\000\000\111\000\000\000\112\000\000\000\112\000\000\000\112\000\000\000\112\000\000\000\113\000\000\000\113\000\000\000\113\000\000\000\113\000\000\000\113\000\000\000\113\000\000\000\114\000\000\000\114\000\000\000\114\000\000\000\114\000\000\000\113\000\000\000\114\000\000\000\111\000\000\000\115\000\000\000\120\000\000\000\120\000\000\000\120\000\000\000\121\000\000\000\121\000\000\000\123\000\000\000\014\000\000\000\005\000\000\000\156\141\155\145\000\000\000\000\000\037\000\000\000\007\000\000\000\141\143\164\151\157\156\000\003\000\000\000\037\000\000\000\016\000\000\000\147\145\156\145\162\141\164\145\146\151\154\145\163\000\004\000\000\000\037\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\007\000\000\000\032\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\007\000\000\000\032\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\007\000\000\000\032\000\000\000\002\000\000\000\137\000\010\000\000\000\030\000\000\000\004\000\000\000\163\154\156\000\010\000\000\000\030\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\021\000\000\000\030\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\021\000\000\000\030\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\021\000\000\000\030\000\000\000\004\000\000\000\160\162\152\000\022\000\000\000\026\000\000\000\000\000\000\000\000\000\000\000\133\000\000\000\145\000\000\000\001\000\000\010\035\000\000\000\004\000\000\000\032\100\000\000\026\200\005\200\012\000\000\000\010\000\000\000\005\000\000\000\006\100\100\000\104\000\000\000\205\200\000\000\034\100\200\001\005\000\000\000\006\100\100\000\104\000\000\000\205\300\000\000\034\100\200\001\005\000\001\000\105\100\001\000\034\000\001\001\026\000\001\200\105\001\000\000\106\101\300\002\204\001\000\000\300\001\200\001\134\101\200\001\041\200\000\000\026\000\376\177\004\000\000\000\036\000\000\001\036\000\200\000\006\000\000\000\004\006\000\000\000\164\141\142\154\145\000\004\007\000\000\000\151\156\163\145\162\164\000\004\010\000\000\000\137\101\103\124\111\117\116\000\004\004\000\000\000\137\117\123\000\004\006\000\000\000\160\141\151\162\163\000\004\011\000\000\000\137\117\120\124\111\117\116\123\000\000\000\000\000\035\000\000\000\134\000\000\000\134\000\000\000\134\000\000\000\135\000\000\000\135\000\000\000\136\000\000\000\136\000\000\000\136\000\000\000\136\000\000\000\136\000\000\000\137\000\000\000\137\000\000\000\137\000\000\000\137\000\000\000\137\000\000\000\140\000\000\000\140\000\000\000\140\000\000\000\140\000\000\000\141\000\000\000\141\000\000\000\141\000\000\000\141\000\000\000\141\000\000\000\140\000\000\000\141\000\000\000\144\000\000\000\144\000\000\000\145\000\000\000\005\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\022\000\000\000\032\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\022\000\000\000\032\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\022\000\000\000\032\000\000\000\002\000\000\000\153\000\023\000\000\000\030\000\000\000\002\000\000\000\137\000\023\000\000\000\030\000\000\000\001\000\000\000\007\000\000\000\137\164\145\162\155\163\000\000\000\000\000\156\000\000\000\166\000\000\000\000\002\000\006\024\000\000\000\305\000\000\000\000\001\200\000\334\200\000\001\027\100\300\001\026\000\001\200\300\000\200\000\000\001\000\000\334\200\000\001\200\000\200\001\026\200\000\200\306\200\100\000\000\001\200\000\225\000\201\001\305\300\000\000\306\000\301\001\006\101\101\000\100\001\000\001\335\000\200\001\336\000\000\000\036\000\200\000\006\000\000\000\004\005\000\000\000\164\171\160\145\000\004\011\000\000\000\146\165\156\143\164\151\157\156\000\004\005\000\000\000\156\141\155\145\000\004\005\000\000\000\160\141\164\150\000\004\005\000\000\000\152\157\151\156\000\004\011\000\000\000\154\157\143\141\164\151\157\156\000\000\000\000\000\024\000\000\000\160\000\000\000\160\000\000\000\160\000\000\000\160\000\000\000\160\000\000\000\161\000\000\000\161\000\000\000\161\000\000\000\161\000\000\000\161\000\000\000\163\000\000\000\163\000\000\000\163\000\000\000\165\000\000\000\165\000\000\000\165\000\000\000\165\000\000\000\165\000\000\000\165\000\000\000\166\000\000\000\003\000\000\000\005\000\000\000\164\150\151\163\000\000\000\000\000\023\000\000\000\011\000\000\000\156\141\155\145\163\160\145\143\000\000\000\000\000\023\000\000\000\006\000\000\000\146\156\141\155\145\000\000\000\000\000\023\000\000\000\000\000\000\000\022\000\000\000\015\000\000\000\037\000\000\000\015\000\000\000\051\000\000\000\063\000\000\000\051\000\000\000\074\000\000\000\123\000\000\000\074\000\000\000\132\000\000\000\133\000\000\000\145\000\000\000\145\000\000\000\133\000\000\000\156\000\000\000\166\000\000\000\156\000\000\000\166\000\000\000\001\000\000\000\007\000\000\000\137\164\145\162\155\163\000\012\000\000\000\021\000\000\000\000\000\000\000",
+ "\033\114\165\141\121\000\001\004\004\004\010\000\027\000\000\000\100\163\162\143\057\142\141\163\145\057\164\145\155\160\154\141\164\145\056\154\165\141\000\000\000\000\000\000\000\000\000\000\000\002\003\026\000\000\000\005\000\000\000\112\000\000\000\011\100\200\200\044\000\000\000\105\000\000\000\106\100\300\000\244\100\000\000\000\000\000\000\111\200\000\201\105\000\000\000\106\100\300\000\244\200\000\000\111\200\200\201\105\000\000\000\106\100\300\000\244\300\000\000\111\200\000\202\105\000\000\000\106\100\300\000\244\000\001\000\111\200\200\202\036\000\200\000\006\000\000\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\011\000\000\000\164\145\155\160\154\141\164\145\000\004\007\000\000\000\145\156\143\157\144\145\000\004\011\000\000\000\147\145\156\145\162\141\164\145\000\004\013\000\000\000\154\157\141\144\163\164\162\151\156\147\000\004\011\000\000\000\154\157\141\144\146\151\154\145\000\005\000\000\000\000\000\000\000\022\000\000\000\036\000\000\000\000\001\000\012\032\000\000\000\101\000\000\000\213\100\100\000\001\201\000\000\234\000\201\001\026\000\003\200\213\301\300\002\234\201\000\001\030\200\001\202\026\100\001\200\200\001\200\000\301\101\001\000\000\002\200\002\101\202\001\000\125\100\002\003\026\200\000\200\200\001\200\000\301\301\001\000\125\300\001\003\241\100\000\000\026\000\374\177\213\000\302\000\001\101\002\000\101\201\002\000\235\000\000\002\236\000\000\000\036\000\200\000\013\000\000\000\004\001\000\000\000\000\004\007\000\000\000\147\155\141\164\143\150\000\004\006\000\000\000\133\136\012\135\052\000\004\004\000\000\000\154\145\156\000\003\000\000\000\000\000\000\000\000\004\014\000\000\000\151\157\056\167\162\151\164\145\133\075\133\000\004\004\000\000\000\135\075\135\000\004\017\000\000\000\151\157\056\167\162\151\164\145\050\145\157\154\051\012\000\004\004\000\000\000\163\165\142\000\003\000\000\000\000\000\000\360\077\003\000\000\000\000\000\000\056\300\000\000\000\000\032\000\000\000\023\000\000\000\025\000\000\000\025\000\000\000\025\000\000\000\025\000\000\000\026\000\000\000\026\000\000\000\026\000\000\000\026\000\000\000\027\000\000\000\027\000\000\000\027\000\000\000\027\000\000\000\027\000\000\000\027\000\000\000\031\000\000\000\031\000\000\000\031\000\000\000\025\000\000\000\032\000\000\000\035\000\000\000\035\000\000\000\035\000\000\000\035\000\000\000\035\000\000\000\036\000\000\000\006\000\000\000\004\000\000\000\163\164\162\000\000\000\000\000\031\000\000\000\005\000\000\000\143\157\144\145\000\001\000\000\000\031\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\004\000\000\000\024\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\004\000\000\000\024\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\004\000\000\000\024\000\000\000\005\000\000\000\154\151\156\145\000\005\000\000\000\022\000\000\000\000\000\000\000\000\000\000\000\045\000\000\000\126\000\000\000\001\001\000\012\161\000\000\000\101\100\000\000\107\000\000\000\113\200\100\000\301\300\000\000\001\001\001\000\134\200\000\002\000\000\200\000\113\300\101\000\301\000\002\000\134\300\200\001\207\200\001\000\107\100\001\000\105\100\001\000\132\100\000\000\026\000\000\200\026\300\025\200\113\100\102\000\301\200\002\000\005\101\001\000\015\201\102\002\134\200\000\002\213\100\102\000\005\201\001\000\014\201\102\002\234\200\200\001\303\000\200\001\013\101\102\000\205\101\001\000\214\301\102\003\305\101\001\000\314\301\302\003\034\201\000\002\127\000\103\002\026\000\000\200\002\101\000\000\002\001\200\000\032\001\000\000\026\300\001\200\113\101\102\000\305\101\001\000\314\101\303\003\005\202\001\000\015\302\102\004\134\201\000\002\300\000\200\002\026\200\001\200\113\101\102\000\305\101\001\000\314\301\302\003\005\202\001\000\015\302\102\004\134\201\000\002\300\000\200\002\032\101\000\000\026\200\006\200\113\201\303\000\301\001\001\000\002\002\200\000\134\201\000\002\107\201\001\000\105\201\001\000\132\001\000\000\026\000\001\200\113\101\302\000\301\201\002\000\005\202\001\000\134\201\000\002\100\000\200\002\113\301\101\001\301\001\001\000\001\202\002\000\102\002\200\000\134\201\200\002\107\101\001\000\105\101\001\000\132\001\000\000\026\000\001\200\113\101\102\001\305\101\001\000\314\201\302\003\134\201\200\001\200\000\200\002\105\001\000\000\204\001\000\000\300\001\200\000\234\201\000\001\125\201\201\002\107\001\000\000\032\001\000\000\026\200\001\200\105\001\000\000\201\301\003\000\300\001\200\001\001\002\004\000\125\001\202\002\107\001\000\000\026\000\001\200\105\001\000\000\200\001\200\001\301\001\001\000\125\301\201\002\107\001\000\000\000\000\000\001\026\200\347\177\105\000\000\000\204\000\000\000\300\000\000\000\234\200\000\001\125\200\200\000\107\000\000\000\105\000\000\000\136\000\000\001\036\000\200\000\021\000\000\000\004\005\000\000\000\143\157\144\145\000\004\001\000\000\000\000\004\005\000\000\000\147\163\165\142\000\004\003\000\000\000\015\012\000\004\002\000\000\000\012\000\004\006\000\000\000\163\164\141\162\164\000\004\007\000\000\000\146\151\156\151\163\150\000\004\005\000\000\000\146\151\156\144\000\004\011\000\000\000\074\045\045\056\055\045\045\076\000\004\004\000\000\000\163\165\142\000\003\000\000\000\000\000\000\360\077\003\000\000\000\000\000\000\000\100\004\002\000\000\000\075\000\003\000\000\000\000\000\000\010\100\004\011\000\000\000\146\151\156\144\154\141\163\164\000\004\012\000\000\000\151\157\056\167\162\151\164\145\050\000\004\002\000\000\000\051\000\000\000\000\000\161\000\000\000\046\000\000\000\046\000\000\000\051\000\000\000\051\000\000\000\051\000\000\000\051\000\000\000\051\000\000\000\055\000\000\000\055\000\000\000\055\000\000\000\055\000\000\000\055\000\000\000\056\000\000\000\056\000\000\000\056\000\000\000\056\000\000\000\060\000\000\000\060\000\000\000\060\000\000\000\060\000\000\000\060\000\000\000\061\000\000\000\061\000\000\000\061\000\000\000\061\000\000\000\064\000\000\000\065\000\000\000\065\000\000\000\065\000\000\000\065\000\000\000\065\000\000\000\065\000\000\000\065\000\000\000\065\000\000\000\065\000\000\000\065\000\000\000\066\000\000\000\066\000\000\000\067\000\000\000\067\000\000\000\067\000\000\000\067\000\000\000\067\000\000\000\067\000\000\000\067\000\000\000\067\000\000\000\071\000\000\000\071\000\000\000\071\000\000\000\071\000\000\000\071\000\000\000\071\000\000\000\071\000\000\000\075\000\000\000\075\000\000\000\076\000\000\000\076\000\000\000\076\000\000\000\076\000\000\000\076\000\000\000\077\000\000\000\077\000\000\000\077\000\000\000\077\000\000\000\077\000\000\000\077\000\000\000\077\000\000\000\077\000\000\000\101\000\000\000\101\000\000\000\101\000\000\000\101\000\000\000\101\000\000\000\101\000\000\000\102\000\000\000\102\000\000\000\102\000\000\000\102\000\000\000\102\000\000\000\102\000\000\000\102\000\000\000\102\000\000\000\106\000\000\000\106\000\000\000\106\000\000\000\106\000\000\000\106\000\000\000\106\000\000\000\111\000\000\000\111\000\000\000\112\000\000\000\112\000\000\000\112\000\000\000\112\000\000\000\112\000\000\000\112\000\000\000\112\000\000\000\114\000\000\000\114\000\000\000\114\000\000\000\114\000\000\000\114\000\000\000\120\000\000\000\120\000\000\000\124\000\000\000\124\000\000\000\124\000\000\000\124\000\000\000\124\000\000\000\124\000\000\000\125\000\000\000\125\000\000\000\126\000\000\000\005\000\000\000\005\000\000\000\164\155\160\154\000\000\000\000\000\160\000\000\000\007\000\000\000\142\145\146\157\162\145\000\025\000\000\000\147\000\000\000\006\000\000\000\141\146\164\145\162\000\031\000\000\000\147\000\000\000\006\000\000\000\142\154\157\143\153\000\032\000\000\000\147\000\000\000\007\000\000\000\151\163\145\170\160\162\000\044\000\000\000\147\000\000\000\001\000\000\000\010\000\000\000\154\151\164\145\162\141\154\000\000\000\000\000\135\000\000\000\150\000\000\000\000\003\000\010\033\000\000\000\305\000\000\000\306\100\300\001\311\300\100\201\305\000\001\000\306\100\301\001\000\001\200\000\101\201\001\000\334\300\200\001\332\100\000\000\026\300\000\200\105\301\001\000\200\001\000\002\301\001\002\000\134\101\200\001\105\001\001\000\106\101\302\002\200\001\200\001\134\101\000\001\100\001\000\000\200\001\000\001\134\101\000\001\105\001\001\000\106\101\302\002\134\201\200\000\113\201\302\002\134\101\000\001\036\000\200\000\013\000\000\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\011\000\000\000\164\145\155\160\154\141\164\145\000\004\010\000\000\000\156\145\167\154\151\156\145\000\004\003\000\000\000\134\156\000\004\003\000\000\000\151\157\000\004\005\000\000\000\157\160\145\156\000\004\003\000\000\000\167\142\000\004\006\000\000\000\145\162\162\157\162\000\003\000\000\000\000\000\000\000\000\004\007\000\000\000\157\165\164\160\165\164\000\004\006\000\000\000\143\154\157\163\145\000\000\000\000\000\033\000\000\000\136\000\000\000\136\000\000\000\136\000\000\000\140\000\000\000\140\000\000\000\140\000\000\000\140\000\000\000\140\000\000\000\141\000\000\000\141\000\000\000\142\000\000\000\142\000\000\000\142\000\000\000\142\000\000\000\145\000\000\000\145\000\000\000\145\000\000\000\145\000\000\000\146\000\000\000\146\000\000\000\146\000\000\000\147\000\000\000\147\000\000\000\147\000\000\000\147\000\000\000\147\000\000\000\150\000\000\000\005\000\000\000\005\000\000\000\164\155\160\154\000\000\000\000\000\032\000\000\000\006\000\000\000\146\156\141\155\145\000\000\000\000\000\032\000\000\000\005\000\000\000\164\150\151\163\000\000\000\000\000\032\000\000\000\002\000\000\000\146\000\010\000\000\000\032\000\000\000\004\000\000\000\145\162\162\000\010\000\000\000\032\000\000\000\000\000\000\000\000\000\000\000\157\000\000\000\166\000\000\000\000\002\000\010\026\000\000\000\205\000\000\000\206\100\100\001\206\200\100\001\300\000\200\000\234\200\000\001\305\300\000\000\001\001\001\000\100\001\000\001\201\101\001\000\025\201\001\002\100\001\000\000\334\300\200\001\332\100\000\000\026\300\000\200\105\201\001\000\200\001\000\002\301\301\001\000\134\101\200\001\100\001\200\001\135\001\200\000\136\001\000\000\036\000\200\000\010\000\000\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\011\000\000\000\164\145\155\160\154\141\164\145\000\004\007\000\000\000\145\156\143\157\144\145\000\004\013\000\000\000\154\157\141\144\163\164\162\151\156\147\000\004\041\000\000\000\162\145\164\165\162\156\040\146\165\156\143\164\151\157\156\040\050\164\150\151\163\051\040\145\157\154\075\047\134\156\047\073\000\004\005\000\000\000\040\145\156\144\000\004\006\000\000\000\145\162\162\157\162\000\003\000\000\000\000\000\000\000\000\000\000\000\000\026\000\000\000\160\000\000\000\160\000\000\000\160\000\000\000\160\000\000\000\160\000\000\000\161\000\000\000\161\000\000\000\161\000\000\000\161\000\000\000\161\000\000\000\161\000\000\000\161\000\000\000\162\000\000\000\162\000\000\000\163\000\000\000\163\000\000\000\163\000\000\000\163\000\000\000\165\000\000\000\165\000\000\000\165\000\000\000\166\000\000\000\005\000\000\000\005\000\000\000\156\141\155\145\000\000\000\000\000\025\000\000\000\004\000\000\000\163\164\162\000\000\000\000\000\025\000\000\000\005\000\000\000\143\157\144\145\000\005\000\000\000\025\000\000\000\003\000\000\000\146\156\000\014\000\000\000\025\000\000\000\004\000\000\000\155\163\147\000\014\000\000\000\025\000\000\000\000\000\000\000\000\000\000\000\175\000\000\000\202\000\000\000\000\001\000\006\025\000\000\000\105\000\000\000\106\100\300\000\200\000\000\000\301\200\000\000\134\200\200\001\213\300\300\000\001\001\001\000\234\200\200\001\313\100\301\000\334\100\000\001\305\200\001\000\306\300\301\001\306\000\302\001\005\101\002\000\006\201\102\002\100\001\000\000\034\201\000\001\100\001\000\001\335\000\200\001\336\000\000\000\036\000\200\000\013\000\000\000\004\003\000\000\000\151\157\000\004\005\000\000\000\157\160\145\156\000\004\003\000\000\000\162\142\000\004\005\000\000\000\162\145\141\144\000\004\003\000\000\000\052\141\000\004\006\000\000\000\143\154\157\163\145\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\011\000\000\000\164\145\155\160\154\141\164\145\000\004\013\000\000\000\154\157\141\144\163\164\162\151\156\147\000\004\005\000\000\000\160\141\164\150\000\004\010\000\000\000\147\145\164\156\141\155\145\000\000\000\000\000\025\000\000\000\176\000\000\000\176\000\000\000\176\000\000\000\176\000\000\000\176\000\000\000\177\000\000\000\177\000\000\000\177\000\000\000\200\000\000\000\200\000\000\000\201\000\000\000\201\000\000\000\201\000\000\000\201\000\000\000\201\000\000\000\201\000\000\000\201\000\000\000\201\000\000\000\201\000\000\000\201\000\000\000\202\000\000\000\003\000\000\000\006\000\000\000\146\156\141\155\145\000\000\000\000\000\024\000\000\000\002\000\000\000\146\000\005\000\000\000\024\000\000\000\005\000\000\000\164\155\160\154\000\010\000\000\000\024\000\000\000\000\000\000\000\026\000\000\000\010\000\000\000\010\000\000\000\010\000\000\000\036\000\000\000\045\000\000\000\045\000\000\000\126\000\000\000\126\000\000\000\045\000\000\000\135\000\000\000\135\000\000\000\150\000\000\000\135\000\000\000\157\000\000\000\157\000\000\000\166\000\000\000\157\000\000\000\175\000\000\000\175\000\000\000\202\000\000\000\175\000\000\000\202\000\000\000\001\000\000\000\010\000\000\000\154\151\164\145\162\141\154\000\004\000\000\000\025\000\000\000\000\000\000\000",
+ "\033\114\165\141\121\000\001\004\004\004\010\000\026\000\000\000\100\163\162\143\057\142\141\163\145\057\160\162\157\152\145\143\164\056\154\165\141\000\000\000\000\000\000\000\000\000\000\000\002\003\107\000\000\000\005\000\000\000\112\000\000\000\011\100\200\200\005\000\000\000\006\100\100\000\144\000\000\000\011\100\000\201\005\000\000\000\006\100\100\000\144\100\000\000\011\100\200\201\005\000\000\000\006\100\100\000\144\200\000\000\011\100\000\202\005\000\000\000\006\100\100\000\144\300\000\000\011\100\200\202\005\000\000\000\006\100\100\000\144\000\001\000\011\100\000\203\005\000\000\000\006\100\100\000\144\100\001\000\011\100\200\203\005\000\000\000\006\100\100\000\144\200\001\000\011\100\000\204\005\000\000\000\006\100\100\000\144\300\001\000\011\100\200\204\005\000\000\000\006\100\100\000\144\000\002\000\011\100\000\205\005\000\000\000\006\100\100\000\144\100\002\000\011\100\200\205\005\000\000\000\006\100\100\000\144\200\002\000\011\100\000\206\005\000\000\000\006\100\100\000\144\300\002\000\011\100\200\206\005\000\000\000\006\100\100\000\144\000\003\000\011\100\000\207\044\100\003\000\105\000\000\000\106\100\300\000\244\200\003\000\000\000\000\000\111\200\200\207\105\000\000\000\106\100\300\000\244\300\003\000\000\000\000\000\111\200\000\210\105\000\000\000\106\100\300\000\244\000\004\000\111\200\200\210\036\000\200\000\022\000\000\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\011\000\000\000\143\150\145\143\153\141\154\154\000\004\013\000\000\000\143\150\145\143\153\164\145\162\155\163\000\004\010\000\000\000\143\157\156\146\151\147\163\000\004\005\000\000\000\146\151\156\144\000\004\012\000\000\000\147\145\164\143\157\156\146\151\147\000\004\020\000\000\000\147\145\164\144\145\160\145\156\144\145\156\143\151\145\163\000\004\015\000\000\000\147\145\164\154\151\142\162\141\162\151\145\163\000\004\012\000\000\000\147\145\164\157\142\152\144\151\162\000\004\012\000\000\000\147\145\164\157\142\152\145\143\164\000\004\016\000\000\000\147\145\164\164\141\162\147\145\164\146\151\154\145\000\004\016\000\000\000\151\163\165\156\151\161\165\145\166\141\154\165\145\000\004\011\000\000\000\160\162\157\152\145\143\164\163\000\004\011\000\000\000\163\145\164\141\162\162\141\171\000\004\014\000\000\000\163\145\164\144\151\162\141\162\162\141\171\000\004\015\000\000\000\163\145\164\146\151\154\145\141\162\162\141\171\000\004\012\000\000\000\163\145\164\163\164\162\151\156\147\000\021\000\000\000\000\000\000\000\020\000\000\000\101\000\000\000\000\000\000\027\164\000\000\000\005\000\000\000\006\100\100\000\105\200\000\000\006\100\000\000\105\300\000\000\205\000\001\000\134\000\001\001\026\200\031\200\206\101\301\002\224\001\000\003\027\200\101\003\026\100\001\200\203\001\000\003\301\301\001\000\006\002\302\002\101\102\002\000\325\101\202\003\236\001\200\001\206\201\302\002\232\001\000\000\026\300\000\200\206\201\302\002\224\001\000\003\027\200\101\003\026\100\001\200\203\001\000\003\301\301\001\000\006\002\302\002\101\302\002\000\325\101\202\003\236\001\200\001\205\301\000\000\306\101\301\002\234\001\001\001\026\100\022\200\305\002\000\000\306\002\303\005\306\102\303\005\000\003\000\005\334\202\000\001\006\203\303\005\032\103\000\000\026\100\001\200\003\003\000\006\101\303\003\000\206\003\102\005\301\003\004\000\125\303\203\006\036\003\200\001\006\103\104\000\032\003\000\000\026\200\003\200\005\203\004\000\006\303\104\006\106\103\104\000\206\203\303\005\034\203\200\001\032\103\000\000\026\300\001\200\003\003\000\006\101\003\005\000\206\103\105\000\301\203\005\000\006\204\303\005\101\304\005\000\125\103\204\006\036\003\200\001\005\303\000\000\106\203\302\002\034\003\001\001\026\300\010\200\105\004\000\000\106\004\303\010\106\104\303\010\200\004\000\005\300\004\000\010\134\204\200\001\300\002\200\010\106\004\306\005\132\104\000\000\026\300\001\200\103\004\200\010\201\304\003\000\306\004\102\005\001\105\006\000\100\005\000\010\201\205\006\000\225\204\005\011\136\004\200\001\106\304\106\000\132\004\000\000\026\200\003\200\105\204\004\000\106\304\304\010\206\304\106\000\306\004\306\005\134\204\200\001\132\104\000\000\026\300\001\200\103\004\200\010\201\004\005\000\306\104\105\000\001\205\005\000\106\005\306\005\201\305\005\000\225\204\005\011\136\004\200\001\041\203\000\000\026\100\366\177\241\201\000\000\026\300\354\177\141\200\000\000\026\200\345\177\102\000\200\000\136\000\000\001\036\000\200\000\034\000\000\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\141\143\164\151\157\156\163\000\004\010\000\000\000\137\101\103\124\111\117\116\000\004\007\000\000\000\151\160\141\151\162\163\000\004\013\000\000\000\137\123\117\114\125\124\111\117\116\123\000\004\011\000\000\000\160\162\157\152\145\143\164\163\000\003\000\000\000\000\000\000\000\000\004\013\000\000\000\163\157\154\165\164\151\157\156\040\047\000\004\005\000\000\000\156\141\155\145\000\004\035\000\000\000\047\040\156\145\145\144\163\040\141\164\040\154\145\141\163\164\040\157\156\145\040\160\162\157\152\145\143\164\000\004\017\000\000\000\143\157\156\146\151\147\165\162\141\164\151\157\156\163\000\004\027\000\000\000\047\040\156\145\145\144\163\040\143\157\156\146\151\147\165\162\141\164\151\157\156\163\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\012\000\000\000\147\145\164\143\157\156\146\151\147\000\004\011\000\000\000\154\141\156\147\165\141\147\145\000\004\012\000\000\000\160\162\157\152\145\143\164\040\047\000\004\023\000\000\000\047\040\156\145\145\144\163\040\141\040\154\141\156\147\165\141\147\145\000\004\020\000\000\000\166\141\154\151\144\137\154\141\156\147\165\141\147\145\163\000\004\006\000\000\000\164\141\142\154\145\000\004\011\000\000\000\143\157\156\164\141\151\156\163\000\004\005\000\000\000\164\150\145\040\000\004\012\000\000\000\163\150\157\162\164\156\141\155\145\000\004\032\000\000\000\040\141\143\164\151\157\156\040\144\157\145\163\040\156\157\164\040\163\165\160\160\157\162\164\040\000\004\012\000\000\000\040\160\162\157\152\145\143\164\163\000\004\005\000\000\000\153\151\156\144\000\004\042\000\000\000\047\040\156\145\145\144\163\040\141\040\153\151\156\144\040\151\156\040\143\157\156\146\151\147\165\162\141\164\151\157\156\040\047\000\004\002\000\000\000\047\000\004\014\000\000\000\166\141\154\151\144\137\153\151\156\144\163\000\000\000\000\000\164\000\000\000\021\000\000\000\021\000\000\000\021\000\000\000\021\000\000\000\023\000\000\000\023\000\000\000\023\000\000\000\023\000\000\000\025\000\000\000\025\000\000\000\025\000\000\000\025\000\000\000\026\000\000\000\026\000\000\000\026\000\000\000\026\000\000\000\026\000\000\000\026\000\000\000\032\000\000\000\032\000\000\000\032\000\000\000\032\000\000\000\032\000\000\000\032\000\000\000\032\000\000\000\033\000\000\000\033\000\000\000\033\000\000\000\033\000\000\000\033\000\000\000\033\000\000\000\036\000\000\000\036\000\000\000\036\000\000\000\036\000\000\000\037\000\000\000\037\000\000\000\037\000\000\000\037\000\000\000\037\000\000\000\042\000\000\000\042\000\000\000\042\000\000\000\043\000\000\000\043\000\000\000\043\000\000\000\043\000\000\000\043\000\000\000\043\000\000\000\047\000\000\000\047\000\000\000\047\000\000\000\050\000\000\000\050\000\000\000\050\000\000\000\050\000\000\000\050\000\000\000\050\000\000\000\050\000\000\000\051\000\000\000\051\000\000\000\051\000\000\000\051\000\000\000\051\000\000\000\051\000\000\000\051\000\000\000\051\000\000\000\055\000\000\000\055\000\000\000\055\000\000\000\055\000\000\000\056\000\000\000\056\000\000\000\056\000\000\000\056\000\000\000\056\000\000\000\056\000\000\000\056\000\000\000\061\000\000\000\061\000\000\000\061\000\000\000\062\000\000\000\062\000\000\000\062\000\000\000\062\000\000\000\062\000\000\000\062\000\000\000\062\000\000\000\062\000\000\000\066\000\000\000\066\000\000\000\066\000\000\000\067\000\000\000\067\000\000\000\067\000\000\000\067\000\000\000\067\000\000\000\067\000\000\000\067\000\000\000\070\000\000\000\070\000\000\000\070\000\000\000\070\000\000\000\070\000\000\000\070\000\000\000\070\000\000\000\070\000\000\000\055\000\000\000\072\000\000\000\036\000\000\000\073\000\000\000\023\000\000\000\075\000\000\000\100\000\000\000\100\000\000\000\101\000\000\000\021\000\000\000\007\000\000\000\141\143\164\151\157\156\000\004\000\000\000\163\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\007\000\000\000\161\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\007\000\000\000\161\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\007\000\000\000\161\000\000\000\002\000\000\000\137\000\010\000\000\000\157\000\000\000\004\000\000\000\163\154\156\000\010\000\000\000\157\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\042\000\000\000\157\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\042\000\000\000\157\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\042\000\000\000\157\000\000\000\002\000\000\000\137\000\043\000\000\000\155\000\000\000\004\000\000\000\160\162\152\000\043\000\000\000\155\000\000\000\004\000\000\000\143\146\147\000\050\000\000\000\155\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\106\000\000\000\155\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\106\000\000\000\155\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\106\000\000\000\155\000\000\000\002\000\000\000\137\000\107\000\000\000\153\000\000\000\010\000\000\000\143\146\147\156\141\155\145\000\107\000\000\000\153\000\000\000\000\000\000\000\000\000\000\000\115\000\000\000\146\000\000\000\000\002\000\014\027\000\000\000\244\000\000\000\000\000\000\000\305\000\000\000\000\001\200\000\334\000\001\001\026\300\002\200\013\102\300\003\201\202\000\000\344\102\000\000\034\202\000\002\300\001\000\004\000\002\000\001\100\002\200\003\034\202\000\001\032\102\000\000\026\100\000\200\002\002\000\000\036\002\000\001\341\200\000\000\026\100\374\177\302\000\200\000\336\000\000\001\036\000\200\000\003\000\000\000\004\007\000\000\000\151\160\141\151\162\163\000\004\005\000\000\000\147\163\165\142\000\004\012\000\000\000\050\045\045\052\051\050\045\141\051\000\002\000\000\000\000\000\000\000\116\000\000\000\122\000\000\000\001\001\000\011\016\000\000\000\105\000\000\000\204\000\000\000\134\000\001\001\026\200\001\200\213\101\300\002\000\002\000\000\234\201\200\001\232\001\000\000\026\100\000\200\202\001\200\000\236\001\000\001\141\200\000\000\026\200\375\177\036\000\200\000\002\000\000\000\004\006\000\000\000\160\141\151\162\163\000\004\006\000\000\000\155\141\164\143\150\000\000\000\000\000\016\000\000\000\117\000\000\000\117\000\000\000\117\000\000\000\117\000\000\000\120\000\000\000\120\000\000\000\120\000\000\000\120\000\000\000\120\000\000\000\120\000\000\000\120\000\000\000\117\000\000\000\120\000\000\000\122\000\000\000\006\000\000\000\003\000\000\000\153\167\000\000\000\000\000\015\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\003\000\000\000\015\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\003\000\000\000\015\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\003\000\000\000\015\000\000\000\002\000\000\000\137\000\004\000\000\000\013\000\000\000\005\000\000\000\164\145\162\155\000\004\000\000\000\013\000\000\000\001\000\000\000\006\000\000\000\164\145\162\155\163\000\000\000\000\000\127\000\000\000\135\000\000\000\000\002\000\007\024\000\000\000\213\000\100\000\234\200\000\001\220\100\100\001\027\200\100\001\026\000\001\200\200\000\000\000\300\000\200\000\225\300\000\001\236\000\000\001\026\000\002\200\200\000\000\000\301\300\000\000\013\001\301\000\034\201\000\001\113\101\301\000\134\201\000\001\201\201\001\000\225\200\001\001\236\000\000\001\036\000\200\000\007\000\000\000\004\004\000\000\000\154\145\156\000\003\000\000\000\000\000\000\000\100\003\000\000\000\000\000\000\360\077\004\002\000\000\000\133\000\004\006\000\000\000\165\160\160\145\162\000\004\006\000\000\000\154\157\167\145\162\000\004\002\000\000\000\135\000\000\000\000\000\024\000\000\000\130\000\000\000\130\000\000\000\130\000\000\000\130\000\000\000\130\000\000\000\131\000\000\000\131\000\000\000\131\000\000\000\131\000\000\000\131\000\000\000\133\000\000\000\133\000\000\000\133\000\000\000\133\000\000\000\133\000\000\000\133\000\000\000\133\000\000\000\133\000\000\000\133\000\000\000\135\000\000\000\002\000\000\000\002\000\000\000\160\000\000\000\000\000\023\000\000\000\002\000\000\000\141\000\000\000\000\000\023\000\000\000\000\000\000\000\027\000\000\000\122\000\000\000\122\000\000\000\124\000\000\000\124\000\000\000\124\000\000\000\124\000\000\000\126\000\000\000\126\000\000\000\135\000\000\000\126\000\000\000\135\000\000\000\140\000\000\000\140\000\000\000\140\000\000\000\140\000\000\000\140\000\000\000\141\000\000\000\141\000\000\000\124\000\000\000\142\000\000\000\145\000\000\000\145\000\000\000\146\000\000\000\010\000\000\000\006\000\000\000\164\145\162\155\163\000\000\000\000\000\026\000\000\000\011\000\000\000\153\145\171\167\157\162\144\163\000\000\000\000\000\026\000\000\000\005\000\000\000\164\145\163\164\000\002\000\000\000\026\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\005\000\000\000\024\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\005\000\000\000\024\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\005\000\000\000\024\000\000\000\002\000\000\000\137\000\006\000\000\000\022\000\000\000\003\000\000\000\153\167\000\006\000\000\000\022\000\000\000\000\000\000\000\000\000\000\000\156\000\000\000\172\000\000\000\000\001\000\004\011\000\000\000\101\000\000\000\206\100\100\000\206\200\100\001\344\000\000\000\000\000\200\000\000\000\000\001\000\000\000\000\336\000\000\001\036\000\200\000\003\000\000\000\003\000\000\000\000\000\000\000\000\004\011\000\000\000\163\157\154\165\164\151\157\156\000\004\017\000\000\000\143\157\156\146\151\147\165\162\141\164\151\157\156\163\000\001\000\000\000\000\000\000\000\161\000\000\000\171\000\000\000\003\000\000\004\034\000\000\000\004\000\000\000\014\000\100\000\010\000\000\000\004\000\000\000\104\000\200\000\124\000\200\000\031\100\000\000\026\300\003\200\004\000\000\001\006\100\100\000\104\000\200\000\204\000\000\000\106\200\200\000\011\100\000\201\005\300\000\000\006\000\101\000\006\100\101\000\104\000\000\001\204\000\200\000\304\000\000\000\206\300\000\001\035\000\200\001\036\000\000\000\026\200\000\200\004\000\000\001\006\100\100\000\011\200\101\201\036\000\200\000\007\000\000\000\003\000\000\000\000\000\000\360\077\004\007\000\000\000\146\151\154\164\145\162\000\004\007\000\000\000\143\157\156\146\151\147\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\012\000\000\000\147\145\164\143\157\156\146\151\147\000\000\000\000\000\000\034\000\000\000\162\000\000\000\162\000\000\000\162\000\000\000\163\000\000\000\163\000\000\000\163\000\000\000\163\000\000\000\163\000\000\000\164\000\000\000\164\000\000\000\164\000\000\000\164\000\000\000\164\000\000\000\164\000\000\000\165\000\000\000\165\000\000\000\165\000\000\000\165\000\000\000\165\000\000\000\165\000\000\000\165\000\000\000\165\000\000\000\165\000\000\000\165\000\000\000\167\000\000\000\167\000\000\000\167\000\000\000\171\000\000\000\000\000\000\000\003\000\000\000\002\000\000\000\151\000\002\000\000\000\164\000\004\000\000\000\160\162\152\000\011\000\000\000\157\000\000\000\160\000\000\000\160\000\000\000\171\000\000\000\171\000\000\000\171\000\000\000\171\000\000\000\171\000\000\000\172\000\000\000\003\000\000\000\004\000\000\000\160\162\152\000\000\000\000\000\010\000\000\000\002\000\000\000\151\000\001\000\000\000\010\000\000\000\002\000\000\000\164\000\003\000\000\000\010\000\000\000\000\000\000\000\000\000\000\000\202\000\000\000\213\000\000\000\000\001\000\015\026\000\000\000\113\000\100\000\134\200\000\001\000\000\200\000\105\100\000\000\205\200\000\000\134\000\001\001\026\300\002\200\205\101\000\000\306\301\300\002\234\001\001\001\026\100\001\200\306\002\101\005\313\002\300\005\334\202\000\001\027\000\200\005\026\000\000\200\236\002\000\001\241\201\000\000\026\300\375\177\141\200\000\000\026\100\374\177\036\000\200\000\005\000\000\000\004\006\000\000\000\154\157\167\145\162\000\004\007\000\000\000\151\160\141\151\162\163\000\004\013\000\000\000\137\123\117\114\125\124\111\117\116\123\000\004\011\000\000\000\160\162\157\152\145\143\164\163\000\004\005\000\000\000\156\141\155\145\000\000\000\000\000\026\000\000\000\203\000\000\000\203\000\000\000\203\000\000\000\204\000\000\000\204\000\000\000\204\000\000\000\204\000\000\000\205\000\000\000\205\000\000\000\205\000\000\000\205\000\000\000\206\000\000\000\206\000\000\000\206\000\000\000\206\000\000\000\206\000\000\000\207\000\000\000\205\000\000\000\210\000\000\000\204\000\000\000\211\000\000\000\213\000\000\000\013\000\000\000\005\000\000\000\156\141\155\145\000\000\000\000\000\025\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\006\000\000\000\025\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\006\000\000\000\025\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\006\000\000\000\025\000\000\000\002\000\000\000\137\000\007\000\000\000\023\000\000\000\004\000\000\000\163\154\156\000\007\000\000\000\023\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\012\000\000\000\023\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\012\000\000\000\023\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\012\000\000\000\023\000\000\000\002\000\000\000\137\000\013\000\000\000\021\000\000\000\004\000\000\000\160\162\152\000\013\000\000\000\021\000\000\000\000\000\000\000\000\000\000\000\224\000\000\000\352\000\000\000\000\002\000\027\226\000\000\000\233\100\200\000\026\000\000\200\201\000\000\000\305\100\000\000\000\001\000\000\334\200\000\001\006\201\300\001\006\201\000\002\032\001\000\000\026\000\000\200\036\001\000\001\105\301\000\000\106\001\301\002\134\201\200\000\111\101\200\202\244\001\000\000\312\001\000\000\000\002\000\003\100\002\200\003\206\202\101\000\034\102\200\001\005\302\001\000\106\202\101\000\106\002\302\004\034\002\001\001\026\300\002\200\105\303\000\000\106\103\302\006\106\203\302\006\200\003\200\002\306\303\102\006\134\203\200\001\132\003\000\000\026\300\000\200\100\003\000\003\200\003\200\003\300\003\000\006\134\103\200\001\041\202\000\000\026\100\374\177\000\002\000\003\100\002\200\003\200\002\000\000\034\102\200\001\006\002\303\003\032\102\000\000\026\100\001\200\005\102\003\000\006\202\103\004\106\302\103\000\201\002\004\000\034\202\200\001\311\001\002\206\005\302\001\000\106\002\102\000\034\002\001\001\026\300\002\200\105\303\000\000\106\103\302\006\106\203\302\006\200\003\200\002\306\303\102\006\134\203\200\001\132\003\000\000\026\300\000\200\100\003\000\003\200\003\200\003\300\003\000\006\134\103\200\001\041\202\000\000\026\100\374\177\012\002\000\000\105\302\001\000\206\102\304\003\134\002\001\001\026\000\005\200\202\003\000\000\305\303\001\000\006\204\304\003\334\003\001\001\026\200\001\200\127\300\204\006\026\000\000\200\202\103\000\000\202\003\200\000\232\003\000\000\026\000\000\200\026\100\000\200\341\203\000\000\026\200\375\177\232\103\000\000\026\000\001\200\305\303\004\000\306\003\305\007\000\004\000\004\100\004\200\006\334\103\200\001\141\202\000\000\026\000\372\177\311\001\202\210\105\302\001\000\205\302\000\000\206\102\102\005\206\102\105\005\134\002\001\001\026\300\006\200\205\203\005\000\306\103\203\003\234\203\000\001\027\300\104\007\026\100\003\200\205\303\001\000\306\103\203\003\234\003\001\001\026\200\001\200\306\104\203\003\005\105\003\000\006\305\105\012\106\005\106\000\200\005\000\011\034\205\200\001\311\004\205\010\241\203\000\000\026\200\375\177\026\000\002\200\206\103\203\003\232\003\000\000\026\100\001\200\205\103\003\000\206\303\105\007\306\003\106\000\006\104\203\003\234\203\200\001\311\201\203\006\141\202\000\000\026\100\370\177\311\101\200\214\311\001\200\204\105\302\000\000\106\102\302\004\106\302\306\004\200\002\200\003\301\202\006\000\006\003\307\003\134\202\000\002\311\101\002\215\106\202\300\001\111\302\001\001\336\001\000\001\036\000\200\000\035\000\000\000\004\001\000\000\000\000\004\015\000\000\000\147\145\164\155\145\164\141\164\141\142\154\145\000\004\013\000\000\000\137\137\143\146\147\143\141\143\150\145\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\017\000\000\000\147\145\164\141\143\164\151\166\145\164\145\162\155\163\000\004\007\000\000\000\143\157\156\146\151\147\000\004\011\000\000\000\163\157\154\165\164\151\157\156\000\004\007\000\000\000\151\160\141\151\162\163\000\004\007\000\000\000\142\154\157\143\153\163\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\013\000\000\000\143\150\145\143\153\164\145\162\155\163\000\004\011\000\000\000\153\145\171\167\157\162\144\163\000\004\007\000\000\000\157\142\152\144\151\162\000\004\005\000\000\000\160\141\164\150\000\004\005\000\000\000\152\157\151\156\000\004\010\000\000\000\142\141\163\145\144\151\162\000\004\004\000\000\000\157\142\152\000\004\006\000\000\000\146\151\154\145\163\000\004\011\000\000\000\145\170\143\154\165\144\145\163\000\004\006\000\000\000\164\141\142\154\145\000\004\007\000\000\000\151\156\163\145\162\164\000\004\021\000\000\000\154\157\143\141\164\151\157\156\162\145\154\141\164\151\166\145\000\004\005\000\000\000\164\171\160\145\000\004\014\000\000\000\147\145\164\162\145\154\141\164\151\166\145\000\004\011\000\000\000\154\157\143\141\164\151\157\156\000\004\005\000\000\000\156\141\155\145\000\004\007\000\000\000\164\141\162\147\145\164\000\004\016\000\000\000\147\145\164\164\141\162\147\145\164\146\151\154\145\000\004\005\000\000\000\153\151\156\144\000\001\000\000\000\000\000\000\000\242\000\000\000\255\000\000\000\000\002\000\012\041\000\000\000\205\000\000\000\300\000\200\000\234\000\001\001\026\100\006\200\305\101\000\000\306\201\300\003\005\302\000\000\006\002\101\004\006\102\101\004\100\002\200\002\334\201\200\001\332\101\000\000\026\000\004\200\305\201\001\000\000\002\000\003\334\201\000\001\027\100\300\003\026\200\002\200\306\101\001\000\332\101\000\000\026\100\000\200\312\001\000\000\011\300\201\002\305\101\000\000\306\301\301\003\006\102\001\000\100\002\000\003\334\101\200\001\026\000\000\200\011\200\201\002\241\200\000\000\026\300\370\177\036\000\200\000\010\000\000\000\004\006\000\000\000\160\141\151\162\163\000\004\006\000\000\000\164\141\142\154\145\000\004\011\000\000\000\143\157\156\164\141\151\156\163\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\007\000\000\000\156\157\143\157\160\171\000\004\005\000\000\000\164\171\160\145\000\004\007\000\000\000\141\160\160\145\156\144\000\000\000\000\000\041\000\000\000\243\000\000\000\243\000\000\000\243\000\000\000\243\000\000\000\244\000\000\000\244\000\000\000\244\000\000\000\244\000\000\000\244\000\000\000\244\000\000\000\244\000\000\000\244\000\000\000\244\000\000\000\245\000\000\000\245\000\000\000\245\000\000\000\245\000\000\000\245\000\000\000\246\000\000\000\246\000\000\000\246\000\000\000\246\000\000\000\246\000\000\000\247\000\000\000\247\000\000\000\247\000\000\000\247\000\000\000\247\000\000\000\247\000\000\000\251\000\000\000\243\000\000\000\253\000\000\000\255\000\000\000\007\000\000\000\004\000\000\000\143\146\147\000\000\000\000\000\040\000\000\000\005\000\000\000\164\150\151\163\000\000\000\000\000\040\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\003\000\000\000\040\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\003\000\000\000\040\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\003\000\000\000\040\000\000\000\006\000\000\000\146\151\145\154\144\000\004\000\000\000\036\000\000\000\006\000\000\000\166\141\154\165\145\000\004\000\000\000\036\000\000\000\000\000\000\000\226\000\000\000\226\000\000\000\226\000\000\000\226\000\000\000\230\000\000\000\230\000\000\000\230\000\000\000\231\000\000\000\231\000\000\000\232\000\000\000\232\000\000\000\233\000\000\000\237\000\000\000\237\000\000\000\237\000\000\000\240\000\000\000\255\000\000\000\265\000\000\000\267\000\000\000\267\000\000\000\267\000\000\000\267\000\000\000\270\000\000\000\270\000\000\000\270\000\000\000\270\000\000\000\270\000\000\000\271\000\000\000\271\000\000\000\271\000\000\000\271\000\000\000\271\000\000\000\271\000\000\000\271\000\000\000\271\000\000\000\272\000\000\000\272\000\000\000\272\000\000\000\272\000\000\000\270\000\000\000\273\000\000\000\276\000\000\000\276\000\000\000\276\000\000\000\276\000\000\000\277\000\000\000\277\000\000\000\277\000\000\000\277\000\000\000\277\000\000\000\277\000\000\000\277\000\000\000\277\000\000\000\277\000\000\000\300\000\000\000\300\000\000\000\300\000\000\000\300\000\000\000\301\000\000\000\301\000\000\000\301\000\000\000\301\000\000\000\301\000\000\000\301\000\000\000\301\000\000\000\301\000\000\000\302\000\000\000\302\000\000\000\302\000\000\000\302\000\000\000\300\000\000\000\303\000\000\000\307\000\000\000\310\000\000\000\310\000\000\000\310\000\000\000\310\000\000\000\311\000\000\000\312\000\000\000\312\000\000\000\312\000\000\000\312\000\000\000\313\000\000\000\313\000\000\000\313\000\000\000\313\000\000\000\314\000\000\000\314\000\000\000\314\000\000\000\312\000\000\000\314\000\000\000\317\000\000\000\317\000\000\000\320\000\000\000\320\000\000\000\320\000\000\000\320\000\000\000\320\000\000\000\310\000\000\000\321\000\000\000\323\000\000\000\326\000\000\000\326\000\000\000\326\000\000\000\326\000\000\000\326\000\000\000\326\000\000\000\327\000\000\000\327\000\000\000\327\000\000\000\327\000\000\000\327\000\000\000\330\000\000\000\330\000\000\000\330\000\000\000\330\000\000\000\331\000\000\000\331\000\000\000\331\000\000\000\331\000\000\000\331\000\000\000\331\000\000\000\331\000\000\000\330\000\000\000\331\000\000\000\332\000\000\000\334\000\000\000\334\000\000\000\334\000\000\000\335\000\000\000\335\000\000\000\335\000\000\000\335\000\000\000\335\000\000\000\335\000\000\000\326\000\000\000\337\000\000\000\342\000\000\000\343\000\000\000\346\000\000\000\346\000\000\000\346\000\000\000\346\000\000\000\346\000\000\000\346\000\000\000\346\000\000\000\346\000\000\000\350\000\000\000\350\000\000\000\351\000\000\000\352\000\000\000\050\000\000\000\004\000\000\000\160\162\152\000\000\000\000\000\225\000\000\000\010\000\000\000\143\146\147\156\141\155\145\000\000\000\000\000\225\000\000\000\011\000\000\000\143\141\143\150\145\153\145\171\000\003\000\000\000\225\000\000\000\005\000\000\000\155\145\164\141\000\006\000\000\000\225\000\000\000\004\000\000\000\143\146\147\000\010\000\000\000\225\000\000\000\006\000\000\000\164\145\162\155\163\000\016\000\000\000\225\000\000\000\013\000\000\000\143\157\160\171\146\151\145\154\144\163\000\020\000\000\000\225\000\000\000\004\000\000\000\143\146\147\000\021\000\000\000\225\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\031\000\000\000\050\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\031\000\000\000\050\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\031\000\000\000\050\000\000\000\002\000\000\000\137\000\032\000\000\000\046\000\000\000\004\000\000\000\142\154\153\000\032\000\000\000\046\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\070\000\000\000\107\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\070\000\000\000\107\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\070\000\000\000\107\000\000\000\002\000\000\000\137\000\071\000\000\000\105\000\000\000\004\000\000\000\142\154\153\000\071\000\000\000\105\000\000\000\006\000\000\000\146\151\154\145\163\000\110\000\000\000\225\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\113\000\000\000\143\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\113\000\000\000\143\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\113\000\000\000\143\000\000\000\002\000\000\000\137\000\114\000\000\000\141\000\000\000\006\000\000\000\146\156\141\155\145\000\114\000\000\000\141\000\000\000\011\000\000\000\145\170\143\154\165\144\145\144\000\115\000\000\000\141\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\120\000\000\000\132\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\120\000\000\000\132\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\120\000\000\000\132\000\000\000\002\000\000\000\137\000\121\000\000\000\130\000\000\000\010\000\000\000\145\170\143\154\165\144\145\000\121\000\000\000\130\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\151\000\000\000\210\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\151\000\000\000\210\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\151\000\000\000\210\000\000\000\002\000\000\000\137\000\152\000\000\000\206\000\000\000\004\000\000\000\153\145\171\000\152\000\000\000\206\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\162\000\000\000\174\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\162\000\000\000\174\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\162\000\000\000\174\000\000\000\002\000\000\000\151\000\163\000\000\000\172\000\000\000\002\000\000\000\160\000\163\000\000\000\172\000\000\000\000\000\000\000\000\000\000\000\363\000\000\000\375\000\000\000\000\001\000\013\025\000\000\000\112\000\000\000\205\000\000\000\306\100\100\000\234\000\001\001\026\300\002\200\305\201\000\000\306\301\300\003\306\001\301\003\000\002\000\003\334\201\000\001\332\001\000\000\026\000\001\200\005\102\001\000\006\202\101\004\100\002\200\000\200\002\000\003\034\102\200\001\241\200\000\000\026\100\374\177\136\000\000\001\036\000\200\000\007\000\000\000\004\007\000\000\000\151\160\141\151\162\163\000\004\006\000\000\000\154\151\156\153\163\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\005\000\000\000\146\151\156\144\000\004\006\000\000\000\164\141\142\154\145\000\004\007\000\000\000\151\156\163\145\162\164\000\000\000\000\000\025\000\000\000\364\000\000\000\365\000\000\000\365\000\000\000\365\000\000\000\365\000\000\000\367\000\000\000\367\000\000\000\367\000\000\000\367\000\000\000\367\000\000\000\370\000\000\000\370\000\000\000\371\000\000\000\371\000\000\000\371\000\000\000\371\000\000\000\371\000\000\000\365\000\000\000\372\000\000\000\374\000\000\000\375\000\000\000\010\000\000\000\004\000\000\000\143\146\147\000\000\000\000\000\024\000\000\000\011\000\000\000\163\151\142\154\151\156\147\163\000\001\000\000\000\024\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\004\000\000\000\023\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\004\000\000\000\023\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\004\000\000\000\023\000\000\000\002\000\000\000\137\000\005\000\000\000\021\000\000\000\005\000\000\000\154\151\156\153\000\005\000\000\000\021\000\000\000\004\000\000\000\160\162\152\000\012\000\000\000\021\000\000\000\000\000\000\000\000\000\000\000\007\001\000\000\044\001\000\000\000\002\000\017\104\000\000\000\212\000\000\000\305\000\000\000\000\001\200\000\334\000\001\001\026\200\016\200\005\102\000\000\006\202\100\004\006\302\100\004\100\002\200\003\034\202\000\001\032\002\000\000\026\200\013\200\103\002\200\004\205\102\000\000\206\202\100\005\206\002\101\005\300\002\000\004\006\103\101\000\234\202\200\001\306\202\101\005\027\300\301\005\026\200\003\200\305\002\002\000\306\102\302\005\001\203\002\000\334\202\000\001\332\002\000\000\026\000\002\200\305\102\000\000\306\202\300\005\306\302\302\005\000\003\000\005\101\003\003\000\206\203\101\005\334\202\000\002\100\002\200\005\026\000\000\200\106\102\103\005\305\202\003\000\306\302\303\005\005\203\003\000\006\003\104\006\106\103\104\005\200\003\200\004\034\003\200\001\334\202\000\000\100\002\200\005\305\202\003\000\306\202\304\005\006\103\104\000\100\003\200\004\334\202\200\001\100\002\200\005\305\302\004\000\306\002\305\005\000\003\000\001\100\003\200\004\334\102\200\001\026\000\001\200\105\302\004\000\106\002\305\004\200\002\000\001\300\002\200\003\134\102\200\001\341\200\000\000\026\200\360\177\236\000\000\001\036\000\200\000\025\000\000\000\004\007\000\000\000\151\160\141\151\162\163\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\005\000\000\000\146\151\156\144\000\004\012\000\000\000\147\145\164\143\157\156\146\151\147\000\004\005\000\000\000\156\141\155\145\000\004\005\000\000\000\153\151\156\144\000\004\012\000\000\000\123\150\141\162\145\144\114\151\142\000\004\003\000\000\000\157\163\000\004\003\000\000\000\151\163\000\004\010\000\000\000\167\151\156\144\157\167\163\000\004\016\000\000\000\147\145\164\164\141\162\147\145\164\146\151\154\145\000\004\007\000\000\000\151\155\160\154\151\142\000\004\007\000\000\000\164\141\162\147\145\164\000\004\005\000\000\000\160\141\164\150\000\004\014\000\000\000\147\145\164\141\142\163\157\154\165\164\145\000\004\005\000\000\000\152\157\151\156\000\004\011\000\000\000\154\157\143\141\164\151\157\156\000\004\014\000\000\000\147\145\164\162\145\154\141\164\151\166\145\000\004\006\000\000\000\164\141\142\154\145\000\004\007\000\000\000\151\156\163\145\162\164\000\000\000\000\000\104\000\000\000\010\001\000\000\012\001\000\000\012\001\000\000\012\001\000\000\012\001\000\000\014\001\000\000\014\001\000\000\014\001\000\000\014\001\000\000\014\001\000\000\015\001\000\000\015\001\000\000\016\001\000\000\021\001\000\000\021\001\000\000\021\001\000\000\021\001\000\000\021\001\000\000\021\001\000\000\022\001\000\000\022\001\000\000\022\001\000\000\022\001\000\000\022\001\000\000\022\001\000\000\022\001\000\000\022\001\000\000\022\001\000\000\023\001\000\000\023\001\000\000\023\001\000\000\023\001\000\000\023\001\000\000\023\001\000\000\023\001\000\000\023\001\000\000\023\001\000\000\025\001\000\000\032\001\000\000\032\001\000\000\032\001\000\000\032\001\000\000\032\001\000\000\032\001\000\000\032\001\000\000\032\001\000\000\032\001\000\000\033\001\000\000\033\001\000\000\033\001\000\000\033\001\000\000\033\001\000\000\033\001\000\000\035\001\000\000\035\001\000\000\035\001\000\000\035\001\000\000\035\001\000\000\035\001\000\000\037\001\000\000\037\001\000\000\037\001\000\000\037\001\000\000\037\001\000\000\012\001\000\000\040\001\000\000\043\001\000\000\044\001\000\000\013\000\000\000\004\000\000\000\143\146\147\000\000\000\000\000\103\000\000\000\005\000\000\000\154\151\163\164\000\000\000\000\000\103\000\000\000\005\000\000\000\154\151\142\163\000\001\000\000\000\103\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\004\000\000\000\102\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\004\000\000\000\102\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\004\000\000\000\102\000\000\000\002\000\000\000\137\000\005\000\000\000\100\000\000\000\005\000\000\000\154\151\156\153\000\005\000\000\000\100\000\000\000\004\000\000\000\160\162\152\000\012\000\000\000\100\000\000\000\007\000\000\000\164\141\162\147\145\164\000\015\000\000\000\072\000\000\000\007\000\000\000\160\162\152\143\146\147\000\023\000\000\000\072\000\000\000\000\000\000\000\000\000\000\000\054\001\000\000\070\001\000\000\000\001\000\010\043\000\000\000\105\000\000\000\106\100\300\000\106\200\300\000\201\300\000\000\306\300\100\000\134\200\200\001\132\000\000\000\026\100\000\200\106\300\100\000\136\000\000\001\144\000\000\000\200\000\200\000\300\000\000\000\234\200\000\001\305\000\000\000\306\100\300\001\306\200\300\001\001\301\000\000\100\001\000\001\200\001\200\000\334\200\000\002\332\000\000\000\026\000\000\200\236\000\000\001\305\000\001\000\306\100\301\001\006\301\100\000\106\101\100\000\106\201\301\002\201\301\001\000\306\201\101\000\125\301\201\002\335\000\200\001\336\000\000\000\036\000\200\000\010\000\000\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\016\000\000\000\151\163\165\156\151\161\165\145\166\141\154\165\145\000\004\007\000\000\000\157\142\152\144\151\162\000\004\005\000\000\000\160\141\164\150\000\004\005\000\000\000\152\157\151\156\000\004\005\000\000\000\156\141\155\145\000\004\002\000\000\000\057\000\001\000\000\000\000\000\000\000\061\001\000\000\061\001\000\000\000\001\000\004\007\000\000\000\105\000\000\000\106\100\300\000\206\200\100\000\306\300\100\000\135\000\200\001\136\000\000\000\036\000\200\000\004\000\000\000\004\005\000\000\000\160\141\164\150\000\004\005\000\000\000\152\157\151\156\000\004\007\000\000\000\157\142\152\144\151\162\000\004\005\000\000\000\156\141\155\145\000\000\000\000\000\007\000\000\000\061\001\000\000\061\001\000\000\061\001\000\000\061\001\000\000\061\001\000\000\061\001\000\000\061\001\000\000\001\000\000\000\004\000\000\000\143\146\147\000\000\000\000\000\006\000\000\000\000\000\000\000\043\000\000\000\055\001\000\000\055\001\000\000\055\001\000\000\055\001\000\000\055\001\000\000\055\001\000\000\055\001\000\000\055\001\000\000\056\001\000\000\056\001\000\000\061\001\000\000\062\001\000\000\062\001\000\000\062\001\000\000\063\001\000\000\063\001\000\000\063\001\000\000\063\001\000\000\063\001\000\000\063\001\000\000\063\001\000\000\063\001\000\000\063\001\000\000\064\001\000\000\067\001\000\000\067\001\000\000\067\001\000\000\067\001\000\000\067\001\000\000\067\001\000\000\067\001\000\000\067\001\000\000\067\001\000\000\067\001\000\000\070\001\000\000\003\000\000\000\004\000\000\000\143\146\147\000\000\000\000\000\042\000\000\000\003\000\000\000\146\156\000\013\000\000\000\042\000\000\000\007\000\000\000\157\142\152\144\151\162\000\016\000\000\000\042\000\000\000\000\000\000\000\000\000\000\000\103\001\000\000\134\001\000\000\000\001\000\005\041\000\000\000\127\000\100\000\026\100\000\200\027\100\100\000\026\200\000\200\205\200\000\000\106\300\100\001\026\100\000\200\205\200\000\000\106\000\101\001\027\100\100\000\026\100\001\200\205\100\001\000\300\000\200\000\234\200\000\001\127\100\100\001\026\000\000\200\103\000\200\000\203\000\000\001\132\100\000\000\026\000\002\200\027\000\100\000\026\100\000\200\201\200\001\000\026\000\001\200\027\100\100\000\026\100\000\200\201\300\001\000\026\000\000\200\201\000\002\000\300\000\200\000\000\001\000\001\336\000\200\001\036\000\200\000\011\000\000\000\004\012\000\000\000\143\157\156\164\141\151\156\145\162\000\004\011\000\000\000\163\157\154\165\164\151\157\156\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\021\000\000\000\103\165\162\162\145\156\164\103\157\156\164\141\151\156\145\162\000\004\025\000\000\000\103\165\162\162\145\156\164\103\157\156\146\151\147\165\162\141\164\151\157\156\000\004\005\000\000\000\164\171\160\145\000\004\036\000\000\000\156\157\040\141\143\164\151\166\145\040\163\157\154\165\164\151\157\156\040\157\162\040\160\162\157\152\145\143\164\000\004\023\000\000\000\156\157\040\141\143\164\151\166\145\040\163\157\154\165\164\151\157\156\000\004\056\000\000\000\156\157\040\141\143\164\151\166\145\040\163\157\154\165\164\151\157\156\054\040\160\162\157\152\145\143\164\054\040\157\162\040\143\157\156\146\151\147\165\162\141\164\151\157\156\000\000\000\000\000\041\000\000\000\106\001\000\000\106\001\000\000\106\001\000\000\106\001\000\000\107\001\000\000\107\001\000\000\107\001\000\000\111\001\000\000\111\001\000\000\114\001\000\000\114\001\000\000\114\001\000\000\114\001\000\000\114\001\000\000\114\001\000\000\114\001\000\000\115\001\000\000\120\001\000\000\121\001\000\000\121\001\000\000\122\001\000\000\122\001\000\000\123\001\000\000\123\001\000\000\124\001\000\000\124\001\000\000\125\001\000\000\125\001\000\000\127\001\000\000\133\001\000\000\133\001\000\000\133\001\000\000\134\001\000\000\003\000\000\000\002\000\000\000\164\000\000\000\000\000\040\000\000\000\012\000\000\000\143\157\156\164\141\151\156\145\162\000\000\000\000\000\040\000\000\000\004\000\000\000\155\163\147\000\022\000\000\000\040\000\000\000\000\000\000\000\000\000\000\000\145\001\000\000\206\001\000\000\000\004\000\015\126\000\000\000\332\100\000\000\026\000\001\200\005\001\000\000\006\101\100\002\333\100\000\002\026\000\000\200\305\200\000\000\000\001\200\000\101\301\000\000\025\101\001\002\006\001\001\000\032\101\000\000\026\000\001\200\006\001\101\000\032\101\000\000\026\100\000\200\006\101\101\000\006\301\100\002\100\001\200\000\201\201\001\000\125\201\201\002\106\101\001\000\132\101\000\000\026\300\000\200\106\301\101\000\132\101\000\000\026\000\000\200\106\001\102\000\201\101\002\000\301\101\002\000\027\200\302\001\026\100\003\200\127\300\102\001\026\100\000\200\027\000\103\001\026\100\000\200\301\101\003\000\026\100\006\200\027\200\103\001\026\100\000\200\301\301\003\000\026\100\005\200\027\000\104\001\026\300\004\200\301\101\004\000\026\100\004\200\027\200\304\001\026\200\001\200\027\000\103\001\026\000\001\200\000\002\000\002\101\302\004\000\200\002\000\002\025\201\002\004\026\000\002\200\027\200\103\001\026\200\000\200\201\001\005\000\301\101\005\000\026\300\000\200\027\000\104\001\026\100\000\200\201\001\005\000\301\201\005\000\000\002\200\000\101\302\005\000\025\102\002\004\006\002\002\000\233\101\000\004\026\300\377\177\000\002\200\000\101\002\006\000\025\102\002\004\006\002\002\000\333\101\000\004\026\300\377\177\005\102\006\000\006\202\106\004\100\002\200\002\200\002\000\003\300\002\000\002\000\003\200\003\225\002\003\005\035\002\200\001\036\002\000\000\036\000\200\000\033\000\000\000\004\011\000\000\000\137\117\120\124\111\117\116\123\000\004\003\000\000\000\157\163\000\004\004\000\000\000\137\117\123\000\004\005\000\000\000\156\141\155\145\000\004\013\000\000\000\164\141\162\147\145\164\156\141\155\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\004\000\000\000\144\151\162\000\004\012\000\000\000\164\141\162\147\145\164\144\151\162\000\004\010\000\000\000\142\141\163\145\144\151\162\000\004\001\000\000\000\000\004\010\000\000\000\167\151\156\144\157\167\163\000\004\013\000\000\000\103\157\156\163\157\154\145\105\170\145\000\004\014\000\000\000\127\151\156\144\157\167\145\144\105\170\145\000\004\005\000\000\000\056\145\170\145\000\004\012\000\000\000\123\150\141\162\145\144\114\151\142\000\004\005\000\000\000\056\144\154\154\000\004\012\000\000\000\123\164\141\164\151\143\114\151\142\000\004\005\000\000\000\056\154\151\142\000\004\007\000\000\000\155\141\143\157\163\170\000\004\025\000\000\000\056\141\160\160\057\103\157\156\164\145\156\164\163\057\115\141\143\117\123\057\000\004\004\000\000\000\154\151\142\000\004\004\000\000\000\056\163\157\000\004\003\000\000\000\056\141\000\004\007\000\000\000\160\162\145\146\151\170\000\004\012\000\000\000\145\170\164\145\156\163\151\157\156\000\004\005\000\000\000\160\141\164\150\000\004\005\000\000\000\152\157\151\156\000\000\000\000\000\126\000\000\000\146\001\000\000\146\001\000\000\146\001\000\000\146\001\000\000\146\001\000\000\146\001\000\000\146\001\000\000\150\001\000\000\150\001\000\000\150\001\000\000\150\001\000\000\150\001\000\000\150\001\000\000\150\001\000\000\150\001\000\000\150\001\000\000\150\001\000\000\150\001\000\000\151\001\000\000\151\001\000\000\151\001\000\000\151\001\000\000\151\001\000\000\151\001\000\000\151\001\000\000\151\001\000\000\151\001\000\000\151\001\000\000\153\001\000\000\154\001\000\000\156\001\000\000\156\001\000\000\157\001\000\000\157\001\000\000\157\001\000\000\157\001\000\000\160\001\000\000\160\001\000\000\161\001\000\000\161\001\000\000\162\001\000\000\162\001\000\000\163\001\000\000\163\001\000\000\164\001\000\000\165\001\000\000\166\001\000\000\166\001\000\000\166\001\000\000\166\001\000\000\167\001\000\000\167\001\000\000\167\001\000\000\167\001\000\000\167\001\000\000\171\001\000\000\171\001\000\000\172\001\000\000\173\001\000\000\173\001\000\000\174\001\000\000\174\001\000\000\175\001\000\000\176\001\000\000\202\001\000\000\202\001\000\000\202\001\000\000\202\001\000\000\202\001\000\000\202\001\000\000\203\001\000\000\203\001\000\000\203\001\000\000\203\001\000\000\203\001\000\000\203\001\000\000\205\001\000\000\205\001\000\000\205\001\000\000\205\001\000\000\205\001\000\000\205\001\000\000\205\001\000\000\205\001\000\000\205\001\000\000\206\001\000\000\010\000\000\000\004\000\000\000\143\146\147\000\000\000\000\000\125\000\000\000\006\000\000\000\146\151\145\154\144\000\000\000\000\000\125\000\000\000\005\000\000\000\153\151\156\144\000\000\000\000\000\125\000\000\000\003\000\000\000\157\163\000\000\000\000\000\125\000\000\000\005\000\000\000\156\141\155\145\000\022\000\000\000\125\000\000\000\004\000\000\000\144\151\162\000\034\000\000\000\125\000\000\000\007\000\000\000\160\162\145\146\151\170\000\035\000\000\000\125\000\000\000\012\000\000\000\145\170\164\145\156\163\151\157\156\000\036\000\000\000\125\000\000\000\000\000\000\000\000\000\000\000\216\001\000\000\244\001\000\000\000\003\000\027\054\000\000\000\301\000\000\000\005\101\000\000\105\201\000\000\034\001\001\001\026\100\010\200\105\102\000\000\206\302\100\004\134\002\001\001\026\300\006\200\205\103\000\000\306\003\101\004\234\003\001\001\026\100\005\200\305\104\001\000\306\204\301\011\306\304\301\011\000\005\200\006\100\005\000\011\334\204\200\001\003\005\000\012\232\000\000\000\026\000\001\200\100\005\000\001\200\005\200\011\134\205\000\001\000\005\200\012\026\000\000\200\006\005\200\011\027\100\000\012\026\000\001\200\314\000\302\001\030\300\000\204\026\100\000\200\102\005\000\000\136\005\000\001\241\203\000\000\026\300\371\177\141\202\000\000\026\100\370\177\041\201\000\000\026\300\366\177\002\001\200\000\036\001\000\001\036\000\200\000\011\000\000\000\003\000\000\000\000\000\000\000\000\004\007\000\000\000\151\160\141\151\162\163\000\004\013\000\000\000\137\123\117\114\125\124\111\117\116\123\000\004\011\000\000\000\160\162\157\152\145\143\164\163\000\004\017\000\000\000\143\157\156\146\151\147\165\162\141\164\151\157\156\163\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\012\000\000\000\147\145\164\143\157\156\146\151\147\000\003\000\000\000\000\000\000\360\077\000\000\000\000\054\000\000\000\217\001\000\000\220\001\000\000\220\001\000\000\220\001\000\000\220\001\000\000\221\001\000\000\221\001\000\000\221\001\000\000\221\001\000\000\222\001\000\000\222\001\000\000\222\001\000\000\222\001\000\000\223\001\000\000\223\001\000\000\223\001\000\000\223\001\000\000\223\001\000\000\223\001\000\000\225\001\000\000\226\001\000\000\226\001\000\000\227\001\000\000\227\001\000\000\227\001\000\000\227\001\000\000\227\001\000\000\231\001\000\000\234\001\000\000\234\001\000\000\235\001\000\000\236\001\000\000\236\001\000\000\236\001\000\000\236\001\000\000\222\001\000\000\237\001\000\000\221\001\000\000\240\001\000\000\220\001\000\000\241\001\000\000\243\001\000\000\243\001\000\000\244\001\000\000\025\000\000\000\012\000\000\000\146\151\145\154\144\156\141\155\145\000\000\000\000\000\053\000\000\000\006\000\000\000\166\141\154\165\145\000\000\000\000\000\053\000\000\000\003\000\000\000\146\156\000\000\000\000\000\053\000\000\000\006\000\000\000\143\157\165\156\164\000\001\000\000\000\053\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\004\000\000\000\051\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\004\000\000\000\051\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\004\000\000\000\051\000\000\000\002\000\000\000\137\000\005\000\000\000\047\000\000\000\004\000\000\000\163\154\156\000\005\000\000\000\047\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\010\000\000\000\047\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\010\000\000\000\047\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\010\000\000\000\047\000\000\000\002\000\000\000\137\000\011\000\000\000\045\000\000\000\004\000\000\000\160\162\152\000\011\000\000\000\045\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\014\000\000\000\045\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\014\000\000\000\045\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\014\000\000\000\045\000\000\000\002\000\000\000\137\000\015\000\000\000\043\000\000\000\010\000\000\000\143\146\147\156\141\155\145\000\015\000\000\000\043\000\000\000\004\000\000\000\143\146\147\000\023\000\000\000\043\000\000\000\004\000\000\000\164\163\164\000\024\000\000\000\043\000\000\000\000\000\000\000\000\000\000\000\254\001\000\000\273\001\000\000\000\001\000\003\006\000\000\000\101\000\000\000\244\000\000\000\000\000\200\000\000\000\000\000\236\000\000\001\036\000\200\000\001\000\000\000\003\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\256\001\000\000\272\001\000\000\002\000\000\006\036\000\000\000\004\000\000\000\014\000\100\000\010\000\000\000\004\000\000\000\104\000\200\000\106\100\300\000\124\000\200\000\031\100\000\000\026\300\004\200\004\000\200\000\006\100\100\000\104\000\000\000\006\100\000\000\105\200\000\000\106\300\300\000\106\000\301\000\200\000\000\000\134\200\000\001\205\100\001\000\300\000\200\000\005\201\001\000\100\001\000\000\034\001\000\001\234\100\000\000\206\300\101\000\111\200\200\203\206\000\102\000\111\200\000\204\136\000\000\001\036\000\200\000\011\000\000\000\003\000\000\000\000\000\000\360\077\004\011\000\000\000\160\162\157\152\145\143\164\163\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\012\000\000\000\147\145\164\143\157\156\146\151\147\000\004\015\000\000\000\163\145\164\155\145\164\141\164\141\142\154\145\000\004\015\000\000\000\147\145\164\155\145\164\141\164\141\142\154\145\000\004\005\000\000\000\156\141\155\145\000\004\007\000\000\000\142\154\157\143\153\163\000\000\000\000\000\036\000\000\000\257\001\000\000\257\001\000\000\257\001\000\000\260\001\000\000\260\001\000\000\260\001\000\000\260\001\000\000\260\001\000\000\260\001\000\000\261\001\000\000\261\001\000\000\261\001\000\000\261\001\000\000\264\001\000\000\264\001\000\000\264\001\000\000\264\001\000\000\264\001\000\000\265\001\000\000\265\001\000\000\265\001\000\000\265\001\000\000\265\001\000\000\265\001\000\000\266\001\000\000\266\001\000\000\267\001\000\000\267\001\000\000\270\001\000\000\272\001\000\000\002\000\000\000\004\000\000\000\160\162\152\000\015\000\000\000\035\000\000\000\007\000\000\000\155\145\162\147\145\144\000\022\000\000\000\035\000\000\000\002\000\000\000\002\000\000\000\151\000\004\000\000\000\163\154\156\000\006\000\000\000\255\001\000\000\272\001\000\000\272\001\000\000\272\001\000\000\272\001\000\000\273\001\000\000\002\000\000\000\004\000\000\000\163\154\156\000\000\000\000\000\005\000\000\000\002\000\000\000\151\000\001\000\000\000\005\000\000\000\000\000\000\000\000\000\000\000\304\001\000\000\337\001\000\000\000\004\000\011\035\000\000\000\005\001\000\000\006\101\100\002\006\201\100\002\100\001\000\000\034\301\000\001\032\101\000\000\026\300\000\200\205\301\000\000\300\001\200\002\001\002\001\000\234\101\200\001\206\101\000\002\232\101\000\000\026\100\000\200\212\001\000\000\011\201\201\000\244\001\000\000\000\000\000\003\000\000\200\001\000\000\000\002\000\000\200\000\232\000\000\000\026\200\000\200\300\001\000\003\000\002\000\001\334\101\000\001\306\101\000\002\336\001\000\001\036\000\200\000\005\000\000\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\012\000\000\000\147\145\164\157\142\152\145\143\164\000\004\006\000\000\000\145\162\162\157\162\000\003\000\000\000\000\000\000\010\100\001\000\000\000\000\000\000\000\316\001\000\000\330\001\000\000\004\001\000\010\045\000\000\000\105\000\000\000\200\000\000\000\134\200\000\001\027\100\300\000\026\100\002\200\105\200\000\000\200\000\000\000\134\000\001\001\026\200\000\200\204\001\000\000\300\001\200\002\234\101\000\001\141\200\000\000\026\200\376\177\026\000\005\200\105\300\000\000\106\000\301\000\200\000\000\000\304\000\200\000\134\200\200\001\132\100\000\000\026\200\001\200\205\100\001\000\301\200\001\000\000\001\000\000\101\301\001\000\325\100\201\001\001\001\002\000\234\100\200\001\205\100\000\000\206\100\102\001\304\000\000\001\004\001\200\001\306\000\201\001\000\001\200\000\234\100\200\001\036\000\200\000\012\000\000\000\004\005\000\000\000\164\171\160\145\000\004\006\000\000\000\164\141\142\154\145\000\004\007\000\000\000\151\160\141\151\162\163\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\013\000\000\000\143\150\145\143\153\166\141\154\165\145\000\004\006\000\000\000\145\162\162\157\162\000\004\020\000\000\000\151\156\166\141\154\151\144\040\166\141\154\165\145\040\047\000\004\002\000\000\000\047\000\003\000\000\000\000\000\000\010\100\004\007\000\000\000\151\156\163\145\162\164\000\000\000\000\000\045\000\000\000\317\001\000\000\317\001\000\000\317\001\000\000\317\001\000\000\317\001\000\000\320\001\000\000\320\001\000\000\320\001\000\000\320\001\000\000\321\001\000\000\321\001\000\000\321\001\000\000\320\001\000\000\321\001\000\000\322\001\000\000\324\001\000\000\324\001\000\000\324\001\000\000\324\001\000\000\324\001\000\000\325\001\000\000\325\001\000\000\325\001\000\000\325\001\000\000\325\001\000\000\325\001\000\000\325\001\000\000\325\001\000\000\325\001\000\000\326\001\000\000\326\001\000\000\326\001\000\000\326\001\000\000\326\001\000\000\326\001\000\000\326\001\000\000\330\001\000\000\007\000\000\000\006\000\000\000\166\141\154\165\145\000\000\000\000\000\044\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\010\000\000\000\016\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\010\000\000\000\016\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\010\000\000\000\016\000\000\000\002\000\000\000\137\000\011\000\000\000\014\000\000\000\002\000\000\000\166\000\011\000\000\000\014\000\000\000\002\000\000\000\166\000\024\000\000\000\044\000\000\000\004\000\000\000\011\000\000\000\144\157\151\156\163\145\162\164\000\010\000\000\000\141\154\154\157\167\145\144\000\012\000\000\000\143\157\156\164\141\151\156\145\162\000\012\000\000\000\146\151\145\154\144\156\141\155\145\000\035\000\000\000\305\001\000\000\305\001\000\000\305\001\000\000\305\001\000\000\305\001\000\000\306\001\000\000\306\001\000\000\307\001\000\000\307\001\000\000\307\001\000\000\307\001\000\000\312\001\000\000\312\001\000\000\312\001\000\000\313\001\000\000\313\001\000\000\330\001\000\000\330\001\000\000\330\001\000\000\330\001\000\000\330\001\000\000\332\001\000\000\332\001\000\000\333\001\000\000\333\001\000\000\333\001\000\000\336\001\000\000\336\001\000\000\337\001\000\000\007\000\000\000\006\000\000\000\143\164\171\160\145\000\000\000\000\000\034\000\000\000\012\000\000\000\146\151\145\154\144\156\141\155\145\000\000\000\000\000\034\000\000\000\006\000\000\000\166\141\154\165\145\000\000\000\000\000\034\000\000\000\010\000\000\000\141\154\154\157\167\145\144\000\000\000\000\000\034\000\000\000\012\000\000\000\143\157\156\164\141\151\156\145\162\000\005\000\000\000\034\000\000\000\004\000\000\000\145\162\162\000\005\000\000\000\034\000\000\000\011\000\000\000\144\157\151\156\163\145\162\164\000\025\000\000\000\034\000\000\000\000\000\000\000\000\000\000\000\351\001\000\000\374\001\000\000\000\004\000\011\021\000\000\000\012\001\000\000\144\001\000\000\000\000\200\001\000\000\000\002\107\001\000\000\105\001\000\000\200\001\000\001\134\101\000\001\105\101\000\000\106\201\300\002\106\301\300\002\200\001\000\000\300\001\200\000\000\002\000\002\135\001\000\002\136\001\000\000\036\000\200\000\004\000\000\000\004\015\000\000\000\155\141\153\145\141\142\163\157\154\165\164\145\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\011\000\000\000\163\145\164\141\162\162\141\171\000\001\000\000\000\000\000\000\000\354\001\000\000\370\001\000\000\002\001\000\012\043\000\000\000\105\000\000\000\200\000\000\000\134\000\001\001\026\300\006\200\205\101\000\000\300\001\200\002\234\201\000\001\027\200\100\003\026\300\000\200\205\301\000\000\300\001\200\002\234\101\000\001\026\200\004\200\213\001\301\002\001\102\001\000\234\201\200\001\232\001\000\000\026\100\001\200\205\301\000\000\304\001\000\000\000\002\200\002\334\001\000\001\234\101\000\000\026\300\001\200\205\201\000\000\206\201\101\003\304\001\200\000\005\302\001\000\006\002\102\004\100\002\200\002\034\002\000\001\234\101\000\000\141\200\000\000\026\100\370\177\036\000\200\000\011\000\000\000\004\007\000\000\000\151\160\141\151\162\163\000\004\005\000\000\000\164\171\160\145\000\004\006\000\000\000\164\141\142\154\145\000\004\015\000\000\000\155\141\153\145\141\142\163\157\154\165\164\145\000\004\005\000\000\000\146\151\156\144\000\004\002\000\000\000\052\000\004\007\000\000\000\151\156\163\145\162\164\000\004\005\000\000\000\160\141\164\150\000\004\014\000\000\000\147\145\164\141\142\163\157\154\165\164\145\000\000\000\000\000\043\000\000\000\355\001\000\000\355\001\000\000\355\001\000\000\355\001\000\000\356\001\000\000\356\001\000\000\356\001\000\000\356\001\000\000\356\001\000\000\357\001\000\000\357\001\000\000\357\001\000\000\357\001\000\000\361\001\000\000\361\001\000\000\361\001\000\000\361\001\000\000\361\001\000\000\362\001\000\000\362\001\000\000\362\001\000\000\362\001\000\000\362\001\000\000\362\001\000\000\364\001\000\000\364\001\000\000\364\001\000\000\364\001\000\000\364\001\000\000\364\001\000\000\364\001\000\000\364\001\000\000\355\001\000\000\366\001\000\000\370\001\000\000\006\000\000\000\004\000\000\000\141\162\162\000\000\000\000\000\042\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\003\000\000\000\042\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\003\000\000\000\042\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\003\000\000\000\042\000\000\000\002\000\000\000\151\000\004\000\000\000\040\000\000\000\006\000\000\000\166\141\154\165\145\000\004\000\000\000\040\000\000\000\002\000\000\000\012\000\000\000\155\141\164\143\150\146\165\156\143\000\007\000\000\000\162\145\163\165\154\164\000\021\000\000\000\352\001\000\000\370\001\000\000\370\001\000\000\370\001\000\000\354\001\000\000\372\001\000\000\372\001\000\000\372\001\000\000\373\001\000\000\373\001\000\000\373\001\000\000\373\001\000\000\373\001\000\000\373\001\000\000\373\001\000\000\373\001\000\000\374\001\000\000\005\000\000\000\006\000\000\000\143\164\171\160\145\000\000\000\000\000\020\000\000\000\012\000\000\000\146\151\145\154\144\156\141\155\145\000\000\000\000\000\020\000\000\000\006\000\000\000\166\141\154\165\145\000\000\000\000\000\020\000\000\000\012\000\000\000\155\141\164\143\150\146\165\156\143\000\000\000\000\000\020\000\000\000\007\000\000\000\162\145\163\165\154\164\000\001\000\000\000\020\000\000\000\000\000\000\000\000\000\000\000\376\001\000\000\000\002\000\000\001\003\000\010\011\000\000\000\304\000\000\000\000\001\000\000\100\001\200\000\200\001\000\001\305\001\000\000\306\101\300\003\335\000\200\002\336\000\000\000\036\000\200\000\002\000\000\000\004\003\000\000\000\157\163\000\004\012\000\000\000\155\141\164\143\150\144\151\162\163\000\000\000\000\000\011\000\000\000\377\001\000\000\377\001\000\000\377\001\000\000\377\001\000\000\377\001\000\000\377\001\000\000\377\001\000\000\377\001\000\000\000\002\000\000\003\000\000\000\006\000\000\000\143\164\171\160\145\000\000\000\000\000\010\000\000\000\012\000\000\000\146\151\145\154\144\156\141\155\145\000\000\000\000\000\010\000\000\000\006\000\000\000\166\141\154\165\145\000\000\000\000\000\010\000\000\000\001\000\000\000\017\000\000\000\144\157\155\141\164\143\150\145\144\141\162\162\141\171\000\000\000\000\000\002\002\000\000\004\002\000\000\001\003\000\010\011\000\000\000\304\000\000\000\000\001\000\000\100\001\200\000\200\001\000\001\305\001\000\000\306\101\300\003\335\000\200\002\336\000\000\000\036\000\200\000\002\000\000\000\004\003\000\000\000\157\163\000\004\013\000\000\000\155\141\164\143\150\146\151\154\145\163\000\000\000\000\000\011\000\000\000\003\002\000\000\003\002\000\000\003\002\000\000\003\002\000\000\003\002\000\000\003\002\000\000\003\002\000\000\003\002\000\000\004\002\000\000\003\000\000\000\006\000\000\000\143\164\171\160\145\000\000\000\000\000\010\000\000\000\012\000\000\000\146\151\145\154\144\156\141\155\145\000\000\000\000\000\010\000\000\000\006\000\000\000\166\141\154\165\145\000\000\000\000\000\010\000\000\000\001\000\000\000\017\000\000\000\144\157\155\141\164\143\150\145\144\141\162\162\141\171\000\000\000\000\000\014\002\000\000\033\002\000\000\000\004\000\013\037\000\000\000\005\001\000\000\006\101\100\002\006\201\100\002\100\001\000\000\034\301\000\001\032\101\000\000\026\300\000\200\205\301\000\000\300\001\200\002\001\002\001\000\234\101\200\001\232\000\000\000\026\200\003\200\205\001\000\000\206\101\101\003\300\001\000\001\000\002\200\001\234\201\200\001\232\101\000\000\026\200\001\200\305\301\000\000\001\202\001\000\100\002\000\001\201\302\001\000\025\202\002\004\101\002\001\000\334\101\200\001\011\201\201\000\206\101\000\002\236\001\000\001\036\000\200\000\010\000\000\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\012\000\000\000\147\145\164\157\142\152\145\143\164\000\004\006\000\000\000\145\162\162\157\162\000\003\000\000\000\000\000\000\010\100\004\013\000\000\000\143\150\145\143\153\166\141\154\165\145\000\004\020\000\000\000\151\156\166\141\154\151\144\040\166\141\154\165\145\040\047\000\004\002\000\000\000\047\000\000\000\000\000\037\000\000\000\016\002\000\000\016\002\000\000\016\002\000\000\016\002\000\000\016\002\000\000\017\002\000\000\017\002\000\000\020\002\000\000\020\002\000\000\020\002\000\000\020\002\000\000\024\002\000\000\024\002\000\000\025\002\000\000\025\002\000\000\025\002\000\000\025\002\000\000\025\002\000\000\026\002\000\000\026\002\000\000\026\002\000\000\026\002\000\000\026\002\000\000\026\002\000\000\026\002\000\000\026\002\000\000\026\002\000\000\027\002\000\000\032\002\000\000\032\002\000\000\033\002\000\000\007\000\000\000\006\000\000\000\143\164\171\160\145\000\000\000\000\000\036\000\000\000\012\000\000\000\146\151\145\154\144\156\141\155\145\000\000\000\000\000\036\000\000\000\006\000\000\000\166\141\154\165\145\000\000\000\000\000\036\000\000\000\010\000\000\000\141\154\154\157\167\145\144\000\000\000\000\000\036\000\000\000\012\000\000\000\143\157\156\164\141\151\156\145\162\000\005\000\000\000\036\000\000\000\004\000\000\000\145\162\162\000\005\000\000\000\036\000\000\000\002\000\000\000\166\000\022\000\000\000\034\000\000\000\000\000\000\000\107\000\000\000\010\000\000\000\010\000\000\000\010\000\000\000\020\000\000\000\020\000\000\000\101\000\000\000\020\000\000\000\115\000\000\000\115\000\000\000\146\000\000\000\115\000\000\000\156\000\000\000\156\000\000\000\172\000\000\000\156\000\000\000\202\000\000\000\202\000\000\000\213\000\000\000\202\000\000\000\224\000\000\000\224\000\000\000\352\000\000\000\224\000\000\000\363\000\000\000\363\000\000\000\375\000\000\000\363\000\000\000\007\001\000\000\007\001\000\000\044\001\000\000\007\001\000\000\054\001\000\000\054\001\000\000\070\001\000\000\054\001\000\000\103\001\000\000\103\001\000\000\134\001\000\000\103\001\000\000\145\001\000\000\145\001\000\000\206\001\000\000\145\001\000\000\216\001\000\000\216\001\000\000\244\001\000\000\216\001\000\000\254\001\000\000\254\001\000\000\273\001\000\000\254\001\000\000\304\001\000\000\304\001\000\000\337\001\000\000\304\001\000\000\374\001\000\000\376\001\000\000\376\001\000\000\000\002\000\000\000\002\000\000\376\001\000\000\002\002\000\000\002\002\000\000\004\002\000\000\004\002\000\000\002\002\000\000\014\002\000\000\014\002\000\000\033\002\000\000\014\002\000\000\033\002\000\000\001\000\000\000\017\000\000\000\144\157\155\141\164\143\150\145\144\141\162\162\141\171\000\070\000\000\000\106\000\000\000\000\000\000\000",
+ "\033\114\165\141\121\000\001\004\004\004\010\000\030\000\000\000\100\163\162\143\057\142\141\163\145\057\146\165\156\143\164\151\157\156\163\056\154\165\141\000\000\000\000\000\000\000\000\000\000\000\002\017\163\000\000\000\012\000\000\006\101\000\000\000\201\100\000\000\301\200\000\000\001\301\000\000\101\001\001\000\201\101\001\000\301\201\001\000\001\302\001\000\101\002\002\000\201\102\002\000\301\202\002\000\001\303\002\000\042\100\000\006\112\000\000\002\201\000\003\000\301\100\003\000\001\201\003\000\101\301\003\000\142\100\000\002\212\000\000\001\301\000\004\000\001\101\004\000\242\100\000\001\305\200\004\000\306\300\304\001\012\001\000\005\101\101\005\000\201\201\005\000\301\301\005\000\001\002\006\000\101\102\006\000\201\202\006\000\301\302\006\000\001\003\007\000\101\103\007\000\201\203\007\000\042\101\000\005\311\000\001\212\305\200\004\000\306\300\304\001\012\001\200\001\101\001\010\000\201\101\010\000\301\201\010\000\042\101\200\001\311\000\201\217\305\200\004\000\306\300\304\001\012\001\200\003\101\001\011\000\201\301\005\000\301\001\006\000\001\202\006\000\101\302\006\000\201\102\011\000\301\202\011\000\042\101\200\003\311\000\201\221\344\000\000\000\307\100\005\000\344\100\000\000\307\300\011\000\344\200\000\000\307\000\012\000\344\300\000\000\307\200\005\000\344\000\001\000\307\300\005\000\344\100\001\000\307\000\006\000\344\200\001\000\000\000\000\000\307\100\006\000\344\300\001\000\307\100\012\000\344\000\002\000\307\200\012\000\344\100\002\000\307\300\012\000\344\200\002\000\307\000\013\000\344\300\002\000\307\100\013\000\344\000\003\000\000\000\200\000\307\200\013\000\344\100\003\000\000\000\000\001\307\300\013\000\344\200\003\000\307\300\006\000\344\300\003\000\307\000\007\000\344\000\004\000\307\100\007\000\344\100\004\000\307\000\014\000\344\200\004\000\307\100\011\000\344\300\004\000\307\300\004\000\344\000\005\000\307\200\007\000\344\100\005\000\307\100\014\000\344\200\005\000\307\200\014\000\344\300\005\000\307\200\011\000\344\000\006\000\307\300\014\000\344\100\006\000\307\000\015\000\036\000\200\000\065\000\000\000\004\006\000\000\000\104\171\154\151\142\000\004\016\000\000\000\105\170\164\162\141\127\141\162\156\151\156\147\163\000\004\016\000\000\000\106\141\164\141\154\127\141\162\156\151\156\147\163\000\004\016\000\000\000\116\157\066\064\102\151\164\103\150\145\143\153\163\000\004\015\000\000\000\116\157\105\170\143\145\160\164\151\157\156\163\000\004\017\000\000\000\116\157\106\162\141\155\145\120\157\151\156\164\145\162\000\004\014\000\000\000\116\157\111\155\160\157\162\164\114\151\142\000\004\007\000\000\000\116\157\122\124\124\111\000\004\011\000\000\000\117\160\164\151\155\151\172\145\000\004\015\000\000\000\117\160\164\151\155\151\172\145\123\151\172\145\000\004\016\000\000\000\117\160\164\151\155\151\172\145\123\160\145\145\144\000\004\010\000\000\000\123\171\155\142\157\154\163\000\004\013\000\000\000\103\157\156\163\157\154\145\105\170\145\000\004\014\000\000\000\127\151\156\144\157\167\145\144\105\170\145\000\004\012\000\000\000\123\164\141\164\151\143\114\151\142\000\004\012\000\000\000\123\150\141\162\145\144\114\151\142\000\004\002\000\000\000\103\000\004\004\000\000\000\103\053\053\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\013\000\000\000\154\151\163\164\146\151\145\154\144\163\000\004\015\000\000\000\142\165\151\154\144\157\160\164\151\157\156\163\000\004\010\000\000\000\144\145\146\151\156\145\163\000\004\011\000\000\000\145\170\143\154\165\144\145\163\000\004\006\000\000\000\146\151\154\145\163\000\004\006\000\000\000\146\154\141\147\163\000\004\010\000\000\000\151\156\143\144\151\162\163\000\004\010\000\000\000\154\151\142\144\151\162\163\000\004\014\000\000\000\154\151\156\153\157\160\164\151\157\156\163\000\004\006\000\000\000\154\151\156\153\163\000\004\013\000\000\000\162\145\163\157\160\164\151\157\156\163\000\004\007\000\000\000\156\157\143\157\160\171\000\004\007\000\000\000\142\154\157\143\153\163\000\004\011\000\000\000\153\145\171\167\157\162\144\163\000\004\011\000\000\000\160\162\157\152\145\143\164\163\000\004\021\000\000\000\154\157\143\141\164\151\157\156\162\145\154\141\164\151\166\145\000\004\010\000\000\000\142\141\163\145\144\151\162\000\004\007\000\000\000\157\142\152\144\151\162\000\004\012\000\000\000\164\141\162\147\145\164\144\151\162\000\004\016\000\000\000\143\157\156\146\151\147\165\162\141\164\151\157\156\000\004\017\000\000\000\143\157\156\146\151\147\165\162\141\164\151\157\156\163\000\004\013\000\000\000\151\155\160\154\151\142\156\141\155\145\000\004\012\000\000\000\151\155\160\154\151\142\144\151\162\000\004\020\000\000\000\151\155\160\154\151\142\145\170\164\145\156\163\151\157\156\000\004\015\000\000\000\151\155\160\154\151\142\160\162\145\146\151\170\000\004\014\000\000\000\151\156\143\154\165\144\145\144\151\162\163\000\004\005\000\000\000\153\151\156\144\000\004\011\000\000\000\154\141\156\147\165\141\147\145\000\004\011\000\000\000\154\157\143\141\164\151\157\156\000\004\011\000\000\000\163\157\154\165\164\151\157\156\000\004\013\000\000\000\164\141\162\147\145\164\156\141\155\145\000\004\020\000\000\000\164\141\162\147\145\164\145\170\164\145\156\163\151\157\156\000\004\015\000\000\000\164\141\162\147\145\164\160\162\145\146\151\170\000\032\000\000\000\000\000\000\000\141\000\000\000\143\000\000\000\000\001\000\005\011\000\000\000\105\000\000\000\106\100\300\000\106\200\300\000\201\300\000\000\301\000\001\000\000\001\000\000\135\000\000\002\136\000\000\000\036\000\200\000\005\000\000\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\011\000\000\000\163\145\164\141\162\162\141\171\000\004\007\000\000\000\143\157\156\146\151\147\000\004\015\000\000\000\142\165\151\154\144\157\160\164\151\157\156\163\000\000\000\000\000\011\000\000\000\142\000\000\000\142\000\000\000\142\000\000\000\142\000\000\000\142\000\000\000\142\000\000\000\142\000\000\000\142\000\000\000\143\000\000\000\001\000\000\000\006\000\000\000\166\141\154\165\145\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000\000\000\146\000\000\000\173\000\000\000\000\001\000\012\052\000\000\000\105\000\000\000\106\100\300\000\106\200\300\000\201\300\000\000\134\300\000\001\132\100\000\000\026\300\000\200\305\000\001\000\000\001\000\001\101\101\001\000\334\100\200\001\312\000\000\000\005\201\001\000\006\301\101\002\106\001\302\000\200\001\200\001\034\101\200\001\005\001\000\000\011\301\200\204\005\201\002\000\100\001\000\000\034\201\000\001\027\200\101\002\026\100\000\200\311\000\200\205\026\300\000\200\012\001\200\000\100\001\000\000\042\101\200\000\311\000\201\205\005\001\003\000\105\001\000\000\106\101\300\002\106\101\303\002\034\001\001\001\026\100\000\200\112\002\000\000\311\100\002\004\041\201\000\000\026\300\376\177\336\000\000\001\036\000\200\000\016\000\000\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\012\000\000\000\147\145\164\157\142\152\145\143\164\000\004\012\000\000\000\143\157\156\164\141\151\156\145\162\000\004\006\000\000\000\145\162\162\157\162\000\003\000\000\000\000\000\000\000\100\004\006\000\000\000\164\141\142\154\145\000\004\007\000\000\000\151\156\163\145\162\164\000\004\007\000\000\000\142\154\157\143\153\163\000\004\025\000\000\000\103\165\162\162\145\156\164\103\157\156\146\151\147\165\162\141\164\151\157\156\000\004\005\000\000\000\164\171\160\145\000\004\011\000\000\000\153\145\171\167\157\162\144\163\000\004\007\000\000\000\151\160\141\151\162\163\000\004\013\000\000\000\154\151\163\164\146\151\145\154\144\163\000\000\000\000\000\052\000\000\000\147\000\000\000\147\000\000\000\147\000\000\000\147\000\000\000\147\000\000\000\150\000\000\000\150\000\000\000\151\000\000\000\151\000\000\000\151\000\000\000\151\000\000\000\154\000\000\000\155\000\000\000\155\000\000\000\155\000\000\000\155\000\000\000\155\000\000\000\156\000\000\000\156\000\000\000\160\000\000\000\160\000\000\000\160\000\000\000\160\000\000\000\160\000\000\000\161\000\000\000\161\000\000\000\163\000\000\000\163\000\000\000\163\000\000\000\163\000\000\000\166\000\000\000\166\000\000\000\166\000\000\000\166\000\000\000\166\000\000\000\166\000\000\000\167\000\000\000\167\000\000\000\166\000\000\000\167\000\000\000\172\000\000\000\173\000\000\000\011\000\000\000\011\000\000\000\153\145\171\167\157\162\144\163\000\000\000\000\000\051\000\000\000\012\000\000\000\143\157\156\164\141\151\156\145\162\000\005\000\000\000\051\000\000\000\004\000\000\000\145\162\162\000\005\000\000\000\051\000\000\000\004\000\000\000\143\146\147\000\014\000\000\000\051\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\043\000\000\000\050\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\043\000\000\000\050\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\043\000\000\000\050\000\000\000\002\000\000\000\137\000\044\000\000\000\046\000\000\000\005\000\000\000\156\141\155\145\000\044\000\000\000\046\000\000\000\000\000\000\000\000\000\000\000\176\000\000\000\200\000\000\000\000\001\000\005\011\000\000\000\105\000\000\000\106\100\300\000\106\200\300\000\201\300\000\000\301\000\001\000\000\001\000\000\135\000\000\002\136\000\000\000\036\000\200\000\005\000\000\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\011\000\000\000\163\145\164\141\162\162\141\171\000\004\011\000\000\000\163\157\154\165\164\151\157\156\000\004\017\000\000\000\143\157\156\146\151\147\165\162\141\164\151\157\156\163\000\000\000\000\000\011\000\000\000\177\000\000\000\177\000\000\000\177\000\000\000\177\000\000\000\177\000\000\000\177\000\000\000\177\000\000\000\177\000\000\000\200\000\000\000\001\000\000\000\006\000\000\000\166\141\154\165\145\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000\000\000\203\000\000\000\205\000\000\000\000\001\000\005\011\000\000\000\105\000\000\000\106\100\300\000\106\200\300\000\201\300\000\000\301\000\001\000\000\001\000\000\135\000\000\002\136\000\000\000\036\000\200\000\005\000\000\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\011\000\000\000\163\145\164\141\162\162\141\171\000\004\007\000\000\000\143\157\156\146\151\147\000\004\010\000\000\000\144\145\146\151\156\145\163\000\000\000\000\000\011\000\000\000\204\000\000\000\204\000\000\000\204\000\000\000\204\000\000\000\204\000\000\000\204\000\000\000\204\000\000\000\204\000\000\000\205\000\000\000\001\000\000\000\006\000\000\000\166\141\154\165\145\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000\000\000\210\000\000\000\212\000\000\000\000\001\000\005\011\000\000\000\105\000\000\000\106\100\300\000\106\200\300\000\201\300\000\000\301\000\001\000\000\001\000\000\135\000\000\002\136\000\000\000\036\000\200\000\005\000\000\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\015\000\000\000\163\145\164\146\151\154\145\141\162\162\141\171\000\004\012\000\000\000\143\157\156\164\141\151\156\145\162\000\004\011\000\000\000\145\170\143\154\165\144\145\163\000\000\000\000\000\011\000\000\000\211\000\000\000\211\000\000\000\211\000\000\000\211\000\000\000\211\000\000\000\211\000\000\000\211\000\000\000\211\000\000\000\212\000\000\000\001\000\000\000\006\000\000\000\166\141\154\165\145\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000\000\000\215\000\000\000\217\000\000\000\000\001\000\005\011\000\000\000\105\000\000\000\106\100\300\000\106\200\300\000\201\300\000\000\301\000\001\000\000\001\000\000\135\000\000\002\136\000\000\000\036\000\200\000\005\000\000\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\015\000\000\000\163\145\164\146\151\154\145\141\162\162\141\171\000\004\012\000\000\000\143\157\156\164\141\151\156\145\162\000\004\006\000\000\000\146\151\154\145\163\000\000\000\000\000\011\000\000\000\216\000\000\000\216\000\000\000\216\000\000\000\216\000\000\000\216\000\000\000\216\000\000\000\216\000\000\000\216\000\000\000\217\000\000\000\001\000\000\000\006\000\000\000\166\141\154\165\145\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000\000\000\222\000\000\000\224\000\000\000\001\001\000\006\012\000\000\000\105\000\000\000\106\100\300\000\106\200\300\000\201\300\000\000\301\000\001\000\000\001\000\000\104\001\000\000\135\000\200\002\136\000\000\000\036\000\200\000\005\000\000\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\011\000\000\000\163\145\164\141\162\162\141\171\000\004\007\000\000\000\143\157\156\146\151\147\000\004\006\000\000\000\146\154\141\147\163\000\000\000\000\000\012\000\000\000\223\000\000\000\223\000\000\000\223\000\000\000\223\000\000\000\223\000\000\000\223\000\000\000\223\000\000\000\223\000\000\000\223\000\000\000\224\000\000\000\001\000\000\000\006\000\000\000\166\141\154\165\145\000\000\000\000\000\011\000\000\000\001\000\000\000\014\000\000\000\166\141\154\151\144\137\146\154\141\147\163\000\000\000\000\000\227\000\000\000\231\000\000\000\000\001\000\005\011\000\000\000\105\000\000\000\106\100\300\000\106\200\300\000\201\300\000\000\301\000\001\000\000\001\000\000\135\000\000\002\136\000\000\000\036\000\200\000\005\000\000\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\012\000\000\000\163\145\164\163\164\162\151\156\147\000\004\007\000\000\000\143\157\156\146\151\147\000\004\013\000\000\000\151\155\160\154\151\142\156\141\155\145\000\000\000\000\000\011\000\000\000\230\000\000\000\230\000\000\000\230\000\000\000\230\000\000\000\230\000\000\000\230\000\000\000\230\000\000\000\230\000\000\000\231\000\000\000\001\000\000\000\006\000\000\000\166\141\154\165\145\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000\000\000\234\000\000\000\236\000\000\000\000\001\000\006\014\000\000\000\105\000\000\000\106\100\300\000\106\200\300\000\201\300\000\000\301\000\001\000\005\101\001\000\006\201\101\002\100\001\000\000\034\001\000\001\135\000\000\000\136\000\000\000\036\000\200\000\007\000\000\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\012\000\000\000\163\145\164\163\164\162\151\156\147\000\004\007\000\000\000\143\157\156\146\151\147\000\004\012\000\000\000\151\155\160\154\151\142\144\151\162\000\004\005\000\000\000\160\141\164\150\000\004\014\000\000\000\147\145\164\141\142\163\157\154\165\164\145\000\000\000\000\000\014\000\000\000\235\000\000\000\235\000\000\000\235\000\000\000\235\000\000\000\235\000\000\000\235\000\000\000\235\000\000\000\235\000\000\000\235\000\000\000\235\000\000\000\235\000\000\000\236\000\000\000\001\000\000\000\006\000\000\000\166\141\154\165\145\000\000\000\000\000\013\000\000\000\000\000\000\000\000\000\000\000\241\000\000\000\243\000\000\000\000\001\000\005\011\000\000\000\105\000\000\000\106\100\300\000\106\200\300\000\201\300\000\000\301\000\001\000\000\001\000\000\135\000\000\002\136\000\000\000\036\000\200\000\005\000\000\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\012\000\000\000\163\145\164\163\164\162\151\156\147\000\004\007\000\000\000\143\157\156\146\151\147\000\004\020\000\000\000\151\155\160\154\151\142\145\170\164\145\156\163\151\157\156\000\000\000\000\000\011\000\000\000\242\000\000\000\242\000\000\000\242\000\000\000\242\000\000\000\242\000\000\000\242\000\000\000\242\000\000\000\242\000\000\000\243\000\000\000\001\000\000\000\006\000\000\000\166\141\154\165\145\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000\000\000\246\000\000\000\250\000\000\000\000\001\000\005\011\000\000\000\105\000\000\000\106\100\300\000\106\200\300\000\201\300\000\000\301\000\001\000\000\001\000\000\135\000\000\002\136\000\000\000\036\000\200\000\005\000\000\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\012\000\000\000\163\145\164\163\164\162\151\156\147\000\004\007\000\000\000\143\157\156\146\151\147\000\004\015\000\000\000\151\155\160\154\151\142\160\162\145\146\151\170\000\000\000\000\000\011\000\000\000\247\000\000\000\247\000\000\000\247\000\000\000\247\000\000\000\247\000\000\000\247\000\000\000\247\000\000\000\247\000\000\000\250\000\000\000\001\000\000\000\006\000\000\000\166\141\154\165\145\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000\000\000\253\000\000\000\255\000\000\000\000\001\000\005\011\000\000\000\105\000\000\000\106\100\300\000\106\200\300\000\201\300\000\000\301\000\001\000\000\001\000\000\135\000\000\002\136\000\000\000\036\000\200\000\005\000\000\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\014\000\000\000\163\145\164\144\151\162\141\162\162\141\171\000\004\007\000\000\000\143\157\156\146\151\147\000\004\010\000\000\000\151\156\143\144\151\162\163\000\000\000\000\000\011\000\000\000\254\000\000\000\254\000\000\000\254\000\000\000\254\000\000\000\254\000\000\000\254\000\000\000\254\000\000\000\254\000\000\000\255\000\000\000\001\000\000\000\006\000\000\000\166\141\154\165\145\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000\000\000\260\000\000\000\262\000\000\000\001\001\000\006\012\000\000\000\105\000\000\000\106\100\300\000\106\200\300\000\201\300\000\000\301\000\001\000\000\001\000\000\104\001\000\000\135\000\200\002\136\000\000\000\036\000\200\000\005\000\000\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\012\000\000\000\163\145\164\163\164\162\151\156\147\000\004\007\000\000\000\143\157\156\146\151\147\000\004\005\000\000\000\153\151\156\144\000\000\000\000\000\012\000\000\000\261\000\000\000\261\000\000\000\261\000\000\000\261\000\000\000\261\000\000\000\261\000\000\000\261\000\000\000\261\000\000\000\261\000\000\000\262\000\000\000\001\000\000\000\006\000\000\000\166\141\154\165\145\000\000\000\000\000\011\000\000\000\001\000\000\000\014\000\000\000\166\141\154\151\144\137\153\151\156\144\163\000\000\000\000\000\265\000\000\000\267\000\000\000\001\001\000\006\012\000\000\000\105\000\000\000\106\100\300\000\106\200\300\000\201\300\000\000\301\000\001\000\000\001\000\000\104\001\000\000\135\000\200\002\136\000\000\000\036\000\200\000\005\000\000\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\012\000\000\000\163\145\164\163\164\162\151\156\147\000\004\012\000\000\000\143\157\156\164\141\151\156\145\162\000\004\011\000\000\000\154\141\156\147\165\141\147\145\000\000\000\000\000\012\000\000\000\266\000\000\000\266\000\000\000\266\000\000\000\266\000\000\000\266\000\000\000\266\000\000\000\266\000\000\000\266\000\000\000\266\000\000\000\267\000\000\000\001\000\000\000\006\000\000\000\166\141\154\165\145\000\000\000\000\000\011\000\000\000\001\000\000\000\020\000\000\000\166\141\154\151\144\137\154\141\156\147\165\141\147\145\163\000\000\000\000\000\272\000\000\000\274\000\000\000\000\001\000\005\011\000\000\000\105\000\000\000\106\100\300\000\106\200\300\000\201\300\000\000\301\000\001\000\000\001\000\000\135\000\000\002\136\000\000\000\036\000\200\000\005\000\000\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\014\000\000\000\163\145\164\144\151\162\141\162\162\141\171\000\004\007\000\000\000\143\157\156\146\151\147\000\004\010\000\000\000\154\151\142\144\151\162\163\000\000\000\000\000\011\000\000\000\273\000\000\000\273\000\000\000\273\000\000\000\273\000\000\000\273\000\000\000\273\000\000\000\273\000\000\000\273\000\000\000\274\000\000\000\001\000\000\000\006\000\000\000\166\141\154\165\145\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000\000\000\277\000\000\000\301\000\000\000\000\001\000\005\011\000\000\000\105\000\000\000\106\100\300\000\106\200\300\000\201\300\000\000\301\000\001\000\000\001\000\000\135\000\000\002\136\000\000\000\036\000\200\000\005\000\000\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\011\000\000\000\163\145\164\141\162\162\141\171\000\004\007\000\000\000\143\157\156\146\151\147\000\004\014\000\000\000\154\151\156\153\157\160\164\151\157\156\163\000\000\000\000\000\011\000\000\000\300\000\000\000\300\000\000\000\300\000\000\000\300\000\000\000\300\000\000\000\300\000\000\000\300\000\000\000\300\000\000\000\301\000\000\000\001\000\000\000\006\000\000\000\166\141\154\165\145\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000\000\000\304\000\000\000\306\000\000\000\000\001\000\005\011\000\000\000\105\000\000\000\106\100\300\000\106\200\300\000\201\300\000\000\301\000\001\000\000\001\000\000\135\000\000\002\136\000\000\000\036\000\200\000\005\000\000\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\011\000\000\000\163\145\164\141\162\162\141\171\000\004\007\000\000\000\143\157\156\146\151\147\000\004\006\000\000\000\154\151\156\153\163\000\000\000\000\000\011\000\000\000\305\000\000\000\305\000\000\000\305\000\000\000\305\000\000\000\305\000\000\000\305\000\000\000\305\000\000\000\305\000\000\000\306\000\000\000\001\000\000\000\006\000\000\000\166\141\154\165\145\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000\000\000\311\000\000\000\313\000\000\000\000\001\000\006\014\000\000\000\105\000\000\000\106\100\300\000\106\200\300\000\201\300\000\000\301\000\001\000\005\101\001\000\006\201\101\002\100\001\000\000\034\001\000\001\135\000\000\000\136\000\000\000\036\000\200\000\007\000\000\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\012\000\000\000\163\145\164\163\164\162\151\156\147\000\004\012\000\000\000\143\157\156\164\141\151\156\145\162\000\004\011\000\000\000\154\157\143\141\164\151\157\156\000\004\005\000\000\000\160\141\164\150\000\004\014\000\000\000\147\145\164\141\142\163\157\154\165\164\145\000\000\000\000\000\014\000\000\000\312\000\000\000\312\000\000\000\312\000\000\000\312\000\000\000\312\000\000\000\312\000\000\000\312\000\000\000\312\000\000\000\312\000\000\000\312\000\000\000\312\000\000\000\313\000\000\000\001\000\000\000\006\000\000\000\166\141\154\165\145\000\000\000\000\000\013\000\000\000\000\000\000\000\000\000\000\000\316\000\000\000\320\000\000\000\000\001\000\006\014\000\000\000\105\000\000\000\106\100\300\000\106\200\300\000\201\300\000\000\301\000\001\000\005\101\001\000\006\201\101\002\100\001\000\000\034\001\000\001\135\000\000\000\136\000\000\000\036\000\200\000\007\000\000\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\012\000\000\000\163\145\164\163\164\162\151\156\147\000\004\007\000\000\000\143\157\156\146\151\147\000\004\007\000\000\000\157\142\152\144\151\162\000\004\005\000\000\000\160\141\164\150\000\004\014\000\000\000\147\145\164\141\142\163\157\154\165\164\145\000\000\000\000\000\014\000\000\000\317\000\000\000\317\000\000\000\317\000\000\000\317\000\000\000\317\000\000\000\317\000\000\000\317\000\000\000\317\000\000\000\317\000\000\000\317\000\000\000\317\000\000\000\320\000\000\000\001\000\000\000\006\000\000\000\166\141\154\165\145\000\000\000\000\000\013\000\000\000\000\000\000\000\000\000\000\000\323\000\000\000\000\001\000\000\000\001\000\007\115\000\000\000\032\000\000\000\026\200\016\200\103\000\200\000\205\000\000\000\305\100\000\000\306\200\300\001\234\200\000\001\027\300\100\001\026\300\000\200\205\100\000\000\206\200\100\001\106\000\101\001\026\100\000\200\205\100\000\000\106\200\100\001\205\000\000\000\300\000\200\000\234\200\000\001\127\000\101\001\026\300\000\200\205\100\001\000\301\200\001\000\001\301\001\000\234\100\200\001\205\100\000\000\306\000\302\000\306\000\200\001\211\300\000\201\205\100\000\000\206\200\100\001\232\100\000\000\026\000\007\200\212\000\000\000\305\100\000\000\311\200\000\201\305\100\002\000\306\200\302\001\006\001\302\000\100\001\000\001\334\100\200\001\306\000\302\000\311\200\000\000\305\300\002\000\000\001\000\001\112\201\000\000\111\301\100\206\212\001\000\000\111\201\201\206\334\100\200\001\211\100\000\202\211\000\000\207\305\000\004\000\306\100\304\001\334\200\200\000\211\300\200\207\306\300\103\001\211\300\000\211\312\000\000\000\211\300\200\211\312\000\000\000\211\300\000\212\105\000\000\000\205\100\000\000\206\200\100\001\134\200\000\001\027\300\300\000\026\200\001\200\105\100\005\000\212\000\000\000\134\100\000\001\105\100\000\000\106\200\300\000\136\000\000\001\026\100\000\200\103\000\200\000\136\000\000\001\036\000\200\000\026\000\000\000\004\005\000\000\000\164\171\160\145\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\021\000\000\000\103\165\162\162\145\156\164\103\157\156\164\141\151\156\145\162\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\011\000\000\000\163\157\154\165\164\151\157\156\000\004\006\000\000\000\145\162\162\157\162\000\004\023\000\000\000\156\157\040\141\143\164\151\166\145\040\163\157\154\165\164\151\157\156\000\003\000\000\000\000\000\000\000\100\004\011\000\000\000\160\162\157\152\145\143\164\163\000\004\006\000\000\000\164\141\142\154\145\000\004\007\000\000\000\151\156\163\145\162\164\000\004\015\000\000\000\163\145\164\155\145\164\141\164\141\142\154\145\000\004\007\000\000\000\137\137\164\171\160\145\000\004\013\000\000\000\137\137\143\146\147\143\141\143\150\145\000\004\005\000\000\000\156\141\155\145\000\004\010\000\000\000\142\141\163\145\144\151\162\000\004\003\000\000\000\157\163\000\004\007\000\000\000\147\145\164\143\167\144\000\004\011\000\000\000\154\157\143\141\164\151\157\156\000\004\007\000\000\000\146\151\154\164\145\162\000\004\007\000\000\000\142\154\157\143\153\163\000\004\016\000\000\000\143\157\156\146\151\147\165\162\141\164\151\157\156\000\000\000\000\000\115\000\000\000\324\000\000\000\324\000\000\000\326\000\000\000\327\000\000\000\327\000\000\000\327\000\000\000\327\000\000\000\327\000\000\000\327\000\000\000\330\000\000\000\330\000\000\000\330\000\000\000\330\000\000\000\332\000\000\000\332\000\000\000\334\000\000\000\334\000\000\000\334\000\000\000\334\000\000\000\334\000\000\000\335\000\000\000\335\000\000\000\335\000\000\000\335\000\000\000\341\000\000\000\341\000\000\000\341\000\000\000\341\000\000\000\342\000\000\000\342\000\000\000\342\000\000\000\342\000\000\000\343\000\000\000\344\000\000\000\344\000\000\000\347\000\000\000\347\000\000\000\347\000\000\000\347\000\000\000\347\000\000\000\350\000\000\000\350\000\000\000\353\000\000\000\353\000\000\000\353\000\000\000\354\000\000\000\355\000\000\000\355\000\000\000\353\000\000\000\360\000\000\000\361\000\000\000\362\000\000\000\362\000\000\000\362\000\000\000\362\000\000\000\363\000\000\000\363\000\000\000\364\000\000\000\364\000\000\000\365\000\000\000\365\000\000\000\371\000\000\000\371\000\000\000\371\000\000\000\371\000\000\000\371\000\000\000\371\000\000\000\373\000\000\000\373\000\000\000\373\000\000\000\374\000\000\000\374\000\000\000\374\000\000\000\374\000\000\000\376\000\000\000\376\000\000\000\000\001\000\000\003\000\000\000\005\000\000\000\156\141\155\145\000\000\000\000\000\114\000\000\000\004\000\000\000\163\154\156\000\003\000\000\000\075\000\000\000\004\000\000\000\160\162\152\000\041\000\000\000\075\000\000\000\000\000\000\000\000\000\000\000\003\001\000\000\005\001\000\000\000\001\000\005\011\000\000\000\105\000\000\000\106\100\300\000\106\200\300\000\201\300\000\000\301\000\001\000\000\001\000\000\135\000\000\002\136\000\000\000\036\000\200\000\005\000\000\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\011\000\000\000\163\145\164\141\162\162\141\171\000\004\007\000\000\000\143\157\156\146\151\147\000\004\013\000\000\000\162\145\163\157\160\164\151\157\156\163\000\000\000\000\000\011\000\000\000\004\001\000\000\004\001\000\000\004\001\000\000\004\001\000\000\004\001\000\000\004\001\000\000\004\001\000\000\004\001\000\000\005\001\000\000\001\000\000\000\006\000\000\000\166\141\154\165\145\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000\000\000\010\001\000\000\053\001\000\000\000\001\000\005\072\000\000\000\032\000\000\000\026\100\010\200\105\000\000\000\205\200\000\000\206\000\000\001\111\200\200\200\105\000\000\000\106\100\300\000\132\100\000\000\026\100\006\200\112\000\000\000\205\000\000\000\211\100\200\200\205\300\000\000\206\000\101\001\305\200\000\000\000\001\200\000\234\100\200\001\205\200\000\000\211\100\000\000\205\100\001\000\300\000\200\000\012\101\000\000\011\301\101\203\234\100\200\001\111\000\000\204\205\200\002\000\206\300\102\001\234\200\200\000\111\200\200\204\212\000\000\000\111\200\000\206\212\000\000\000\111\200\200\206\212\000\000\000\111\200\000\207\105\300\003\000\205\000\000\000\206\100\100\001\134\200\000\001\027\000\304\000\026\000\001\200\105\000\000\000\205\000\000\000\206\100\100\001\206\300\101\001\111\200\200\200\105\000\000\000\106\100\300\000\132\000\000\000\026\200\000\200\105\100\004\000\212\000\000\000\134\100\000\001\105\000\000\000\106\100\300\000\136\000\000\001\036\000\200\000\022\000\000\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\021\000\000\000\103\165\162\162\145\156\164\103\157\156\164\141\151\156\145\162\000\004\013\000\000\000\137\123\117\114\125\124\111\117\116\123\000\004\006\000\000\000\164\141\142\154\145\000\004\007\000\000\000\151\156\163\145\162\164\000\004\015\000\000\000\163\145\164\155\145\164\141\164\141\142\154\145\000\004\007\000\000\000\137\137\164\171\160\145\000\004\011\000\000\000\163\157\154\165\164\151\157\156\000\004\005\000\000\000\156\141\155\145\000\004\011\000\000\000\154\157\143\141\164\151\157\156\000\004\003\000\000\000\157\163\000\004\007\000\000\000\147\145\164\143\167\144\000\004\011\000\000\000\160\162\157\152\145\143\164\163\000\004\007\000\000\000\142\154\157\143\153\163\000\004\017\000\000\000\143\157\156\146\151\147\165\162\141\164\151\157\156\163\000\004\005\000\000\000\164\171\160\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\016\000\000\000\143\157\156\146\151\147\165\162\141\164\151\157\156\000\000\000\000\000\072\000\000\000\011\001\000\000\011\001\000\000\012\001\000\000\012\001\000\000\012\001\000\000\012\001\000\000\013\001\000\000\013\001\000\000\013\001\000\000\013\001\000\000\014\001\000\000\015\001\000\000\015\001\000\000\020\001\000\000\020\001\000\000\020\001\000\000\020\001\000\000\020\001\000\000\021\001\000\000\021\001\000\000\024\001\000\000\024\001\000\000\024\001\000\000\025\001\000\000\024\001\000\000\030\001\000\000\031\001\000\000\031\001\000\000\031\001\000\000\031\001\000\000\032\001\000\000\032\001\000\000\033\001\000\000\033\001\000\000\034\001\000\000\034\001\000\000\041\001\000\000\041\001\000\000\041\001\000\000\041\001\000\000\041\001\000\000\041\001\000\000\042\001\000\000\042\001\000\000\042\001\000\000\042\001\000\000\042\001\000\000\045\001\000\000\045\001\000\000\045\001\000\000\045\001\000\000\047\001\000\000\047\001\000\000\047\001\000\000\052\001\000\000\052\001\000\000\052\001\000\000\053\001\000\000\002\000\000\000\005\000\000\000\156\141\155\145\000\000\000\000\000\071\000\000\000\004\000\000\000\163\154\156\000\013\000\000\000\044\000\000\000\000\000\000\000\000\000\000\000\056\001\000\000\060\001\000\000\000\001\000\005\011\000\000\000\105\000\000\000\106\100\300\000\106\200\300\000\201\300\000\000\301\000\001\000\000\001\000\000\135\000\000\002\136\000\000\000\036\000\200\000\005\000\000\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\012\000\000\000\163\145\164\163\164\162\151\156\147\000\004\007\000\000\000\143\157\156\146\151\147\000\004\013\000\000\000\164\141\162\147\145\164\156\141\155\145\000\000\000\000\000\011\000\000\000\057\001\000\000\057\001\000\000\057\001\000\000\057\001\000\000\057\001\000\000\057\001\000\000\057\001\000\000\057\001\000\000\060\001\000\000\001\000\000\000\006\000\000\000\166\141\154\165\145\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000\000\000\063\001\000\000\065\001\000\000\000\001\000\006\014\000\000\000\105\000\000\000\106\100\300\000\106\200\300\000\201\300\000\000\301\000\001\000\005\101\001\000\006\201\101\002\100\001\000\000\034\001\000\001\135\000\000\000\136\000\000\000\036\000\200\000\007\000\000\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\012\000\000\000\163\145\164\163\164\162\151\156\147\000\004\007\000\000\000\143\157\156\146\151\147\000\004\012\000\000\000\164\141\162\147\145\164\144\151\162\000\004\005\000\000\000\160\141\164\150\000\004\014\000\000\000\147\145\164\141\142\163\157\154\165\164\145\000\000\000\000\000\014\000\000\000\064\001\000\000\064\001\000\000\064\001\000\000\064\001\000\000\064\001\000\000\064\001\000\000\064\001\000\000\064\001\000\000\064\001\000\000\064\001\000\000\064\001\000\000\065\001\000\000\001\000\000\000\006\000\000\000\166\141\154\165\145\000\000\000\000\000\013\000\000\000\000\000\000\000\000\000\000\000\070\001\000\000\072\001\000\000\000\001\000\005\011\000\000\000\105\000\000\000\106\100\300\000\106\200\300\000\201\300\000\000\301\000\001\000\000\001\000\000\135\000\000\002\136\000\000\000\036\000\200\000\005\000\000\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\012\000\000\000\163\145\164\163\164\162\151\156\147\000\004\007\000\000\000\143\157\156\146\151\147\000\004\020\000\000\000\164\141\162\147\145\164\145\170\164\145\156\163\151\157\156\000\000\000\000\000\011\000\000\000\071\001\000\000\071\001\000\000\071\001\000\000\071\001\000\000\071\001\000\000\071\001\000\000\071\001\000\000\071\001\000\000\072\001\000\000\001\000\000\000\006\000\000\000\166\141\154\165\145\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000\000\000\075\001\000\000\077\001\000\000\000\001\000\005\011\000\000\000\105\000\000\000\106\100\300\000\106\200\300\000\201\300\000\000\301\000\001\000\000\001\000\000\135\000\000\002\136\000\000\000\036\000\200\000\005\000\000\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\012\000\000\000\163\145\164\163\164\162\151\156\147\000\004\007\000\000\000\143\157\156\146\151\147\000\004\015\000\000\000\164\141\162\147\145\164\160\162\145\146\151\170\000\000\000\000\000\011\000\000\000\076\001\000\000\076\001\000\000\076\001\000\000\076\001\000\000\076\001\000\000\076\001\000\000\076\001\000\000\076\001\000\000\077\001\000\000\001\000\000\000\006\000\000\000\166\141\154\165\145\000\000\000\000\000\010\000\000\000\000\000\000\000\163\000\000\000\014\000\000\000\016\000\000\000\017\000\000\000\020\000\000\000\021\000\000\000\022\000\000\000\023\000\000\000\024\000\000\000\025\000\000\000\026\000\000\000\027\000\000\000\030\000\000\000\032\000\000\000\032\000\000\000\034\000\000\000\036\000\000\000\037\000\000\000\040\000\000\000\042\000\000\000\042\000\000\000\044\000\000\000\046\000\000\000\050\000\000\000\050\000\000\000\057\000\000\000\057\000\000\000\057\000\000\000\061\000\000\000\062\000\000\000\063\000\000\000\064\000\000\000\065\000\000\000\066\000\000\000\067\000\000\000\070\000\000\000\071\000\000\000\073\000\000\000\073\000\000\000\073\000\000\000\102\000\000\000\102\000\000\000\102\000\000\000\104\000\000\000\105\000\000\000\107\000\000\000\107\000\000\000\107\000\000\000\117\000\000\000\117\000\000\000\117\000\000\000\121\000\000\000\122\000\000\000\123\000\000\000\124\000\000\000\125\000\000\000\126\000\000\000\130\000\000\000\130\000\000\000\130\000\000\000\143\000\000\000\141\000\000\000\173\000\000\000\146\000\000\000\200\000\000\000\176\000\000\000\205\000\000\000\203\000\000\000\212\000\000\000\210\000\000\000\217\000\000\000\215\000\000\000\224\000\000\000\224\000\000\000\222\000\000\000\231\000\000\000\227\000\000\000\236\000\000\000\234\000\000\000\243\000\000\000\241\000\000\000\250\000\000\000\246\000\000\000\255\000\000\000\253\000\000\000\262\000\000\000\262\000\000\000\260\000\000\000\267\000\000\000\267\000\000\000\265\000\000\000\274\000\000\000\272\000\000\000\301\000\000\000\277\000\000\000\306\000\000\000\304\000\000\000\313\000\000\000\311\000\000\000\320\000\000\000\316\000\000\000\000\001\000\000\323\000\000\000\005\001\000\000\003\001\000\000\053\001\000\000\010\001\000\000\060\001\000\000\056\001\000\000\065\001\000\000\063\001\000\000\072\001\000\000\070\001\000\000\077\001\000\000\075\001\000\000\077\001\000\000\003\000\000\000\014\000\000\000\166\141\154\151\144\137\146\154\141\147\163\000\016\000\000\000\162\000\000\000\014\000\000\000\166\141\154\151\144\137\153\151\156\144\163\000\024\000\000\000\162\000\000\000\020\000\000\000\166\141\154\151\144\137\154\141\156\147\165\141\147\145\163\000\030\000\000\000\162\000\000\000\000\000\000\000",
+ "\033\114\165\141\121\000\001\004\004\004\010\000\022\000\000\000\100\163\162\143\057\142\141\163\145\057\147\143\143\056\154\165\141\000\000\000\000\000\000\000\000\000\000\000\002\002\073\000\000\000\005\000\000\000\006\100\100\000\112\000\000\000\011\100\000\201\005\000\000\000\006\100\100\000\006\200\100\000\112\300\001\000\111\100\101\202\111\300\101\203\111\100\102\204\111\300\102\205\111\100\103\206\111\300\103\207\111\100\104\210\011\100\200\201\005\000\000\000\006\100\100\000\006\200\100\000\112\200\000\000\111\000\305\211\111\200\305\212\011\100\000\211\005\000\000\000\006\100\100\000\006\200\100\000\144\000\000\000\011\100\200\213\005\000\000\000\006\100\100\000\006\200\100\000\144\100\000\000\011\100\000\214\005\000\000\000\006\100\100\000\006\200\100\000\144\200\000\000\011\100\200\214\005\000\000\000\006\100\100\000\006\200\100\000\144\300\000\000\011\100\000\215\005\000\000\000\006\100\100\000\006\200\100\000\144\000\001\000\011\100\200\215\005\000\000\000\006\100\100\000\006\200\100\000\144\100\001\000\011\100\000\216\005\000\000\000\006\100\100\000\006\200\100\000\144\200\001\000\011\100\200\216\036\000\200\000\036\000\000\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\006\000\000\000\164\157\157\154\163\000\004\004\000\000\000\147\143\143\000\004\007\000\000\000\143\146\154\141\147\163\000\004\016\000\000\000\105\170\164\162\141\127\141\162\156\151\156\147\163\000\004\006\000\000\000\055\127\141\154\154\000\004\015\000\000\000\106\141\164\141\154\127\141\162\156\151\156\147\000\004\010\000\000\000\055\127\145\162\162\157\162\000\004\017\000\000\000\116\157\106\162\141\155\145\120\157\151\156\164\145\162\000\004\025\000\000\000\055\146\157\155\151\164\055\146\162\141\155\145\055\160\157\151\156\164\145\162\000\004\011\000\000\000\117\160\164\151\155\151\172\145\000\004\004\000\000\000\055\117\062\000\004\015\000\000\000\117\160\164\151\155\151\172\145\123\151\172\145\000\004\004\000\000\000\055\117\163\000\004\016\000\000\000\117\160\164\151\155\151\172\145\123\160\145\145\144\000\004\004\000\000\000\055\117\063\000\004\010\000\000\000\123\171\155\142\157\154\163\000\004\003\000\000\000\055\147\000\004\011\000\000\000\143\170\170\146\154\141\147\163\000\004\015\000\000\000\116\157\105\170\143\145\160\164\151\157\156\163\000\004\020\000\000\000\055\055\156\157\055\145\170\143\145\160\164\151\157\156\163\000\004\007\000\000\000\116\157\122\124\124\111\000\004\012\000\000\000\055\055\156\157\055\162\164\164\151\000\004\015\000\000\000\155\141\153\145\137\144\145\146\151\156\145\163\000\004\016\000\000\000\155\141\153\145\137\151\156\143\154\165\144\145\163\000\004\016\000\000\000\155\141\153\145\137\143\160\160\146\154\141\147\163\000\004\014\000\000\000\155\141\153\145\137\143\146\154\141\147\163\000\004\016\000\000\000\155\141\153\145\137\143\170\170\146\154\141\147\163\000\004\015\000\000\000\155\141\153\145\137\154\144\146\154\141\147\163\000\004\017\000\000\000\155\141\153\145\137\146\151\154\145\137\162\165\154\145\000\007\000\000\000\000\000\000\000\042\000\000\000\044\000\000\000\000\001\000\006\011\000\000\000\105\000\000\000\106\100\300\000\206\200\100\000\301\300\000\000\001\001\001\000\101\101\001\000\135\000\200\002\136\000\000\000\036\000\200\000\006\000\000\000\004\006\000\000\000\164\141\142\154\145\000\004\010\000\000\000\151\155\160\154\157\144\145\000\004\010\000\000\000\144\145\146\151\156\145\163\000\004\005\000\000\000\055\104\040\042\000\004\002\000\000\000\042\000\004\002\000\000\000\040\000\000\000\000\000\011\000\000\000\043\000\000\000\043\000\000\000\043\000\000\000\043\000\000\000\043\000\000\000\043\000\000\000\043\000\000\000\043\000\000\000\044\000\000\000\001\000\000\000\004\000\000\000\143\146\147\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000\000\000\047\000\000\000\051\000\000\000\000\001\000\006\011\000\000\000\105\000\000\000\106\100\300\000\206\200\100\000\301\300\000\000\001\001\001\000\101\101\001\000\135\000\200\002\136\000\000\000\036\000\200\000\006\000\000\000\004\006\000\000\000\164\141\142\154\145\000\004\010\000\000\000\151\155\160\154\157\144\145\000\004\010\000\000\000\151\156\143\144\151\162\163\000\004\005\000\000\000\055\111\040\042\000\004\002\000\000\000\042\000\004\002\000\000\000\040\000\000\000\000\000\011\000\000\000\050\000\000\000\050\000\000\000\050\000\000\000\050\000\000\000\050\000\000\000\050\000\000\000\050\000\000\000\050\000\000\000\051\000\000\000\001\000\000\000\004\000\000\000\143\146\147\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000\000\000\054\000\000\000\060\000\000\000\000\001\000\002\003\000\000\000\101\000\000\000\136\000\000\001\036\000\200\000\001\000\000\000\004\041\000\000\000\044\050\151\146\040\044\050\167\157\162\144\040\062\054\040\044\050\101\122\103\110\051\051\054\040\054\040\055\115\115\104\051\000\000\000\000\000\003\000\000\000\057\000\000\000\057\000\000\000\060\000\000\000\001\000\000\000\004\000\000\000\143\146\147\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\063\000\000\000\073\000\000\000\000\001\000\005\035\000\000\000\105\000\000\000\106\100\300\000\206\200\100\000\305\300\000\000\306\000\301\001\306\100\301\001\306\200\301\001\134\200\200\001\206\300\101\000\027\000\102\001\026\200\002\200\205\100\002\000\206\200\102\001\301\300\002\000\234\200\000\001\232\100\000\000\026\000\001\200\205\000\000\000\206\000\103\001\300\000\200\000\001\101\003\000\234\100\200\001\205\000\000\000\206\200\103\001\300\000\200\000\001\301\003\000\235\000\200\001\236\000\000\000\036\000\200\000\020\000\000\000\004\006\000\000\000\164\141\142\154\145\000\004\012\000\000\000\164\162\141\156\163\154\141\164\145\000\004\006\000\000\000\146\154\141\147\163\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\006\000\000\000\164\157\157\154\163\000\004\004\000\000\000\147\143\143\000\004\007\000\000\000\143\146\154\141\147\163\000\004\005\000\000\000\153\151\156\144\000\004\012\000\000\000\123\150\141\162\145\144\114\151\142\000\004\003\000\000\000\157\163\000\004\003\000\000\000\151\163\000\004\010\000\000\000\167\151\156\144\157\167\163\000\004\007\000\000\000\151\156\163\145\162\164\000\004\006\000\000\000\055\146\120\111\103\000\004\007\000\000\000\143\157\156\143\141\164\000\004\002\000\000\000\040\000\000\000\000\000\035\000\000\000\064\000\000\000\064\000\000\000\064\000\000\000\064\000\000\000\064\000\000\000\064\000\000\000\064\000\000\000\064\000\000\000\066\000\000\000\066\000\000\000\066\000\000\000\066\000\000\000\066\000\000\000\066\000\000\000\066\000\000\000\066\000\000\000\066\000\000\000\067\000\000\000\067\000\000\000\067\000\000\000\067\000\000\000\067\000\000\000\072\000\000\000\072\000\000\000\072\000\000\000\072\000\000\000\072\000\000\000\072\000\000\000\073\000\000\000\002\000\000\000\004\000\000\000\143\146\147\000\000\000\000\000\034\000\000\000\006\000\000\000\146\154\141\147\163\000\010\000\000\000\034\000\000\000\000\000\000\000\000\000\000\000\076\000\000\000\101\000\000\000\000\001\000\005\017\000\000\000\105\000\000\000\106\100\300\000\206\200\100\000\305\300\000\000\306\000\301\001\306\100\301\001\306\200\301\001\134\200\200\001\205\000\000\000\206\300\101\001\300\000\200\000\001\001\002\000\235\000\200\001\236\000\000\000\036\000\200\000\011\000\000\000\004\006\000\000\000\164\141\142\154\145\000\004\012\000\000\000\164\162\141\156\163\154\141\164\145\000\004\006\000\000\000\146\154\141\147\163\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\006\000\000\000\164\157\157\154\163\000\004\004\000\000\000\147\143\143\000\004\011\000\000\000\143\170\170\146\154\141\147\163\000\004\007\000\000\000\143\157\156\143\141\164\000\004\002\000\000\000\040\000\000\000\000\000\017\000\000\000\077\000\000\000\077\000\000\000\077\000\000\000\077\000\000\000\077\000\000\000\077\000\000\000\077\000\000\000\077\000\000\000\100\000\000\000\100\000\000\000\100\000\000\000\100\000\000\000\100\000\000\000\100\000\000\000\101\000\000\000\002\000\000\000\004\000\000\000\143\146\147\000\000\000\000\000\016\000\000\000\006\000\000\000\146\154\141\147\163\000\010\000\000\000\016\000\000\000\000\000\000\000\000\000\000\000\104\000\000\000\162\000\000\000\000\001\000\016\254\000\000\000\112\000\000\000\206\000\100\000\027\100\100\001\026\200\011\200\205\200\000\000\206\300\100\001\301\000\001\000\234\200\000\001\232\100\000\000\026\000\001\200\205\100\001\000\206\200\101\001\300\000\200\000\001\301\001\000\234\100\200\001\205\200\000\000\206\300\100\001\301\000\002\000\234\200\000\001\232\000\000\000\026\100\005\200\205\100\001\000\206\100\102\001\306\200\102\000\001\301\002\000\234\200\200\001\232\100\000\000\026\200\003\200\205\100\001\000\206\200\101\001\300\000\200\000\001\001\003\000\105\101\003\000\106\201\303\002\106\301\303\002\200\001\000\000\301\001\004\000\001\102\004\000\101\202\004\000\134\201\200\002\201\301\004\000\025\201\001\002\234\100\200\001\205\200\000\000\206\300\100\001\301\000\002\000\234\200\000\001\232\000\000\000\026\300\001\200\206\000\100\000\027\000\105\001\026\000\001\200\205\100\001\000\206\200\101\001\300\000\200\000\001\101\005\000\234\100\200\001\205\100\001\000\206\100\102\001\306\200\102\000\001\201\005\000\234\200\200\001\232\100\000\000\026\000\004\200\205\200\000\000\206\300\100\001\301\000\001\000\234\200\000\001\232\000\000\000\026\100\001\200\205\100\001\000\206\200\101\001\300\000\200\000\001\301\005\000\234\100\200\001\026\000\001\200\205\100\001\000\206\200\101\001\300\000\200\000\001\001\006\000\234\100\200\001\205\200\000\000\206\300\100\001\301\000\001\000\234\200\000\001\232\000\000\000\026\300\002\200\205\100\001\000\206\100\102\001\300\000\200\000\001\101\006\000\234\200\200\001\232\000\000\000\026\000\001\200\205\100\001\000\206\200\101\001\300\000\200\000\001\201\006\000\234\100\200\001\212\000\000\000\312\000\000\000\005\301\006\000\105\101\003\000\106\201\303\002\106\001\307\002\200\001\000\000\306\101\107\000\134\001\200\001\034\001\001\000\026\100\010\200\105\202\007\000\106\302\307\004\200\002\000\004\134\202\000\001\205\202\007\000\206\002\110\005\300\002\000\004\234\202\000\001\127\100\310\004\026\200\004\200\305\102\001\000\306\102\302\005\006\203\110\000\100\003\200\004\334\202\200\001\332\102\000\000\026\300\002\200\305\102\001\000\306\102\302\005\000\003\000\001\100\003\200\004\334\202\200\001\332\102\000\000\026\000\001\200\305\102\001\000\306\202\301\005\000\003\000\001\100\003\200\004\334\102\200\001\305\102\001\000\306\202\301\005\000\003\200\001\100\003\000\005\334\102\200\001\041\201\000\000\026\300\366\177\005\101\001\000\006\301\110\002\100\001\200\000\201\001\011\000\034\201\200\001\105\101\001\000\106\101\311\002\206\201\110\000\301\201\011\000\001\302\004\000\134\201\000\002\205\101\001\000\206\101\111\003\300\001\000\001\001\202\011\000\101\302\004\000\234\201\000\002\305\101\001\000\306\101\311\003\000\002\200\001\101\302\011\000\201\302\004\000\334\201\000\002\025\301\001\002\036\001\000\001\036\000\200\000\050\000\000\000\004\005\000\000\000\153\151\156\144\000\004\012\000\000\000\123\150\141\162\145\144\114\151\142\000\004\003\000\000\000\157\163\000\004\003\000\000\000\151\163\000\004\007\000\000\000\155\141\143\157\163\170\000\004\006\000\000\000\164\141\142\154\145\000\004\007\000\000\000\151\156\163\145\162\164\000\004\010\000\000\000\055\163\150\141\162\145\144\000\004\010\000\000\000\167\151\156\144\157\167\163\000\004\011\000\000\000\143\157\156\164\141\151\156\163\000\004\006\000\000\000\146\154\141\147\163\000\004\014\000\000\000\116\157\111\155\160\157\162\164\114\151\142\000\004\023\000\000\000\055\127\154\054\055\055\157\165\164\055\151\155\160\154\151\142\075\042\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\016\000\000\000\147\145\164\164\141\162\147\145\164\146\151\154\145\000\004\007\000\000\000\151\155\160\154\151\142\000\004\012\000\000\000\123\164\141\164\151\143\114\151\142\000\004\006\000\000\000\154\151\156\165\170\000\004\002\000\000\000\042\000\004\014\000\000\000\127\151\156\144\157\167\145\144\105\170\145\000\004\012\000\000\000\055\155\167\151\156\144\157\167\163\000\004\010\000\000\000\123\171\155\142\157\154\163\000\004\007\000\000\000\055\127\154\054\055\170\000\004\003\000\000\000\055\163\000\004\006\000\000\000\104\171\154\151\142\000\004\034\000\000\000\055\144\171\156\141\155\151\143\154\151\142\040\055\146\154\141\164\137\156\141\155\145\163\160\141\143\145\000\004\007\000\000\000\151\160\141\151\162\163\000\004\015\000\000\000\147\145\164\154\151\142\162\141\162\151\145\163\000\004\006\000\000\000\154\151\156\153\163\000\004\005\000\000\000\160\141\164\150\000\004\015\000\000\000\147\145\164\144\151\162\145\143\164\157\162\171\000\004\014\000\000\000\147\145\164\142\141\163\145\156\141\155\145\000\004\001\000\000\000\000\004\010\000\000\000\154\151\142\144\151\162\163\000\004\007\000\000\000\143\157\156\143\141\164\000\004\002\000\000\000\040\000\004\010\000\000\000\151\155\160\154\157\144\145\000\004\006\000\000\000\040\055\114\040\042\000\004\006\000\000\000\040\055\154\040\042\000\000\000\000\000\254\000\000\000\105\000\000\000\107\000\000\000\107\000\000\000\107\000\000\000\110\000\000\000\110\000\000\000\110\000\000\000\110\000\000\000\110\000\000\000\110\000\000\000\111\000\000\000\111\000\000\000\111\000\000\000\111\000\000\000\111\000\000\000\115\000\000\000\115\000\000\000\115\000\000\000\115\000\000\000\115\000\000\000\115\000\000\000\115\000\000\000\115\000\000\000\115\000\000\000\115\000\000\000\115\000\000\000\115\000\000\000\115\000\000\000\116\000\000\000\116\000\000\000\116\000\000\000\116\000\000\000\116\000\000\000\116\000\000\000\116\000\000\000\116\000\000\000\116\000\000\000\116\000\000\000\116\000\000\000\116\000\000\000\116\000\000\000\116\000\000\000\116\000\000\000\122\000\000\000\122\000\000\000\122\000\000\000\122\000\000\000\122\000\000\000\122\000\000\000\122\000\000\000\122\000\000\000\122\000\000\000\123\000\000\000\123\000\000\000\123\000\000\000\123\000\000\000\123\000\000\000\127\000\000\000\127\000\000\000\127\000\000\000\127\000\000\000\127\000\000\000\127\000\000\000\127\000\000\000\130\000\000\000\130\000\000\000\130\000\000\000\130\000\000\000\130\000\000\000\130\000\000\000\131\000\000\000\131\000\000\000\131\000\000\000\131\000\000\000\131\000\000\000\131\000\000\000\133\000\000\000\133\000\000\000\133\000\000\000\133\000\000\000\133\000\000\000\137\000\000\000\137\000\000\000\137\000\000\000\137\000\000\000\137\000\000\000\137\000\000\000\137\000\000\000\137\000\000\000\137\000\000\000\137\000\000\000\137\000\000\000\137\000\000\000\137\000\000\000\140\000\000\000\140\000\000\000\140\000\000\000\140\000\000\000\140\000\000\000\144\000\000\000\145\000\000\000\146\000\000\000\146\000\000\000\146\000\000\000\146\000\000\000\146\000\000\000\146\000\000\000\146\000\000\000\146\000\000\000\146\000\000\000\147\000\000\000\147\000\000\000\147\000\000\000\147\000\000\000\150\000\000\000\150\000\000\000\150\000\000\000\150\000\000\000\152\000\000\000\152\000\000\000\152\000\000\000\152\000\000\000\152\000\000\000\152\000\000\000\152\000\000\000\152\000\000\000\152\000\000\000\152\000\000\000\152\000\000\000\152\000\000\000\152\000\000\000\152\000\000\000\152\000\000\000\152\000\000\000\153\000\000\000\153\000\000\000\153\000\000\000\153\000\000\000\153\000\000\000\156\000\000\000\156\000\000\000\156\000\000\000\156\000\000\000\156\000\000\000\146\000\000\000\156\000\000\000\161\000\000\000\161\000\000\000\161\000\000\000\161\000\000\000\161\000\000\000\161\000\000\000\161\000\000\000\161\000\000\000\161\000\000\000\161\000\000\000\161\000\000\000\161\000\000\000\161\000\000\000\161\000\000\000\161\000\000\000\161\000\000\000\161\000\000\000\161\000\000\000\161\000\000\000\161\000\000\000\161\000\000\000\161\000\000\000\161\000\000\000\161\000\000\000\161\000\000\000\162\000\000\000\013\000\000\000\004\000\000\000\143\146\147\000\000\000\000\000\253\000\000\000\006\000\000\000\146\154\141\147\163\000\001\000\000\000\253\000\000\000\005\000\000\000\144\151\162\163\000\144\000\000\000\253\000\000\000\006\000\000\000\156\141\155\145\163\000\145\000\000\000\253\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\155\000\000\000\222\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\155\000\000\000\222\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\155\000\000\000\222\000\000\000\002\000\000\000\137\000\156\000\000\000\220\000\000\000\005\000\000\000\154\151\156\153\000\156\000\000\000\220\000\000\000\004\000\000\000\144\151\162\000\162\000\000\000\220\000\000\000\005\000\000\000\156\141\155\145\000\166\000\000\000\220\000\000\000\000\000\000\000\000\000\000\000\165\000\000\000\173\000\000\000\000\001\000\003\014\000\000\000\105\000\000\000\106\100\300\000\200\000\000\000\134\200\000\001\132\000\000\000\026\200\000\200\101\200\000\000\136\000\000\001\026\100\000\200\101\300\000\000\136\000\000\001\036\000\200\000\004\000\000\000\004\005\000\000\000\160\141\164\150\000\004\010\000\000\000\151\163\143\146\151\154\145\000\004\034\000\000\000\044\050\103\103\051\040\044\050\103\106\114\101\107\123\051\040\055\157\040\044\100\040\055\143\040\044\074\000\004\037\000\000\000\044\050\103\130\130\051\040\044\050\103\130\130\106\114\101\107\123\051\040\055\157\040\044\100\040\055\143\040\044\074\000\000\000\000\000\014\000\000\000\166\000\000\000\166\000\000\000\166\000\000\000\166\000\000\000\166\000\000\000\166\000\000\000\167\000\000\000\167\000\000\000\167\000\000\000\171\000\000\000\171\000\000\000\173\000\000\000\001\000\000\000\005\000\000\000\146\151\154\145\000\000\000\000\000\013\000\000\000\000\000\000\000\073\000\000\000\016\000\000\000\016\000\000\000\016\000\000\000\016\000\000\000\020\000\000\000\020\000\000\000\020\000\000\000\020\000\000\000\022\000\000\000\023\000\000\000\024\000\000\000\025\000\000\000\026\000\000\000\027\000\000\000\030\000\000\000\031\000\000\000\033\000\000\000\033\000\000\000\033\000\000\000\033\000\000\000\035\000\000\000\036\000\000\000\037\000\000\000\042\000\000\000\042\000\000\000\042\000\000\000\044\000\000\000\042\000\000\000\047\000\000\000\047\000\000\000\047\000\000\000\051\000\000\000\047\000\000\000\054\000\000\000\054\000\000\000\054\000\000\000\060\000\000\000\054\000\000\000\063\000\000\000\063\000\000\000\063\000\000\000\073\000\000\000\063\000\000\000\076\000\000\000\076\000\000\000\076\000\000\000\101\000\000\000\076\000\000\000\104\000\000\000\104\000\000\000\104\000\000\000\162\000\000\000\104\000\000\000\165\000\000\000\165\000\000\000\165\000\000\000\173\000\000\000\165\000\000\000\173\000\000\000\000\000\000\000\000\000\000\000",
+ "\033\114\165\141\121\000\001\004\004\004\010\000\027\000\000\000\100\163\162\143\057\137\160\162\145\155\141\153\145\137\155\141\151\156\056\154\165\141\000\000\000\000\000\000\000\000\000\000\000\002\005\013\000\000\000\001\000\000\000\101\100\000\000\201\200\000\000\344\000\000\000\044\101\000\000\000\000\000\001\000\000\200\000\000\000\200\001\000\000\000\000\007\301\000\000\036\000\200\000\004\000\000\000\004\040\000\000\000\124\171\160\145\040\047\160\162\145\155\141\153\145\064\040\055\055\150\145\154\160\047\040\146\157\162\040\150\145\154\160\000\004\055\000\000\000\160\162\145\155\141\153\145\064\040\050\120\162\145\155\141\153\145\040\102\165\151\154\144\040\123\143\162\151\160\164\040\107\145\156\145\162\141\164\157\162\051\040\045\163\000\004\015\000\000\000\160\162\145\155\141\153\145\064\056\154\165\141\000\004\016\000\000\000\137\160\162\145\155\141\153\145\137\155\141\151\156\000\002\000\000\000\000\000\000\000\022\000\000\000\056\000\000\000\000\000\000\011\127\000\000\000\012\000\000\000\007\000\000\000\005\100\000\000\105\200\000\000\106\000\300\000\034\000\001\001\026\000\001\200\105\301\000\000\106\001\301\002\205\001\000\000\300\001\200\001\134\101\200\001\041\200\000\000\026\000\376\177\005\300\000\000\006\100\101\000\105\000\000\000\034\100\000\001\005\200\001\000\101\300\001\000\205\000\002\000\034\100\200\001\005\200\001\000\105\100\002\000\034\100\000\001\005\200\001\000\101\200\002\000\205\300\002\000\305\000\003\000\034\100\000\002\005\200\001\000\101\100\003\000\034\100\000\001\005\200\001\000\101\200\003\000\034\100\000\001\005\200\001\000\101\100\003\000\034\100\000\001\005\200\001\000\101\300\003\000\034\100\000\001\005\200\001\000\101\100\003\000\034\100\000\001\005\000\004\000\105\000\000\000\034\000\001\001\026\300\001\200\105\201\001\000\201\101\004\000\300\001\000\002\005\202\000\000\006\002\100\004\006\002\001\004\006\202\104\004\134\101\000\002\041\200\000\000\026\100\375\177\005\200\001\000\101\100\003\000\034\100\000\001\005\200\001\000\101\300\004\000\034\100\000\001\005\200\001\000\101\100\003\000\034\100\000\001\005\200\001\000\101\000\005\000\034\100\000\001\005\200\001\000\101\100\005\000\034\100\000\001\005\200\001\000\101\200\005\000\034\100\000\001\005\200\001\000\101\300\005\000\034\100\000\001\005\200\001\000\101\100\003\000\034\100\000\001\005\200\001\000\101\000\006\000\034\100\000\001\036\000\200\000\031\000\000\000\004\010\000\000\000\141\143\164\151\157\156\163\000\004\006\000\000\000\160\141\151\162\163\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\006\000\000\000\164\141\142\154\145\000\004\007\000\000\000\151\156\163\145\162\164\000\004\005\000\000\000\163\157\162\164\000\004\007\000\000\000\160\162\151\156\164\146\000\004\045\000\000\000\120\162\145\155\141\153\145\040\045\163\054\040\141\040\142\165\151\154\144\040\163\143\162\151\160\164\040\147\145\156\145\162\141\164\157\162\000\004\021\000\000\000\137\120\122\105\115\101\113\105\137\126\105\122\123\111\117\116\000\004\023\000\000\000\137\120\122\105\115\101\113\105\137\103\117\120\131\122\111\107\110\124\000\004\006\000\000\000\045\163\040\045\163\000\004\011\000\000\000\137\126\105\122\123\111\117\116\000\004\013\000\000\000\137\103\117\120\131\122\111\107\110\124\000\004\001\000\000\000\000\004\055\000\000\000\125\163\141\147\145\072\040\160\162\145\155\141\153\145\064\040\133\157\160\164\151\157\156\163\135\040\141\143\164\151\157\156\040\133\141\162\147\165\155\145\156\164\163\135\000\004\010\000\000\000\101\103\124\111\117\116\123\000\004\007\000\000\000\151\160\141\151\162\163\000\004\013\000\000\000\040\040\045\055\061\067\163\040\045\163\000\004\014\000\000\000\144\145\163\143\162\151\160\164\151\157\156\000\004\010\000\000\000\117\120\124\111\117\116\123\000\004\075\000\000\000\040\055\055\146\151\154\145\075\156\141\155\145\040\040\040\040\040\040\040\120\162\157\143\145\163\163\040\164\150\145\040\163\160\145\143\151\146\151\145\144\040\120\162\145\155\141\153\145\040\163\143\162\151\160\164\040\146\151\154\145\000\004\054\000\000\000\040\055\055\150\145\154\160\040\040\040\040\040\040\040\040\040\040\040\040\104\151\163\160\154\141\171\040\164\150\151\163\040\151\156\146\157\162\155\141\164\151\157\156\000\004\103\000\000\000\040\055\055\163\143\162\151\160\164\163\075\160\141\164\150\040\040\040\040\123\145\141\162\143\150\040\146\157\162\040\141\144\144\151\164\151\157\156\141\154\040\163\143\162\151\160\164\163\040\157\156\040\164\150\145\040\147\151\166\145\156\040\160\141\164\150\000\004\057\000\000\000\040\055\055\166\145\162\163\151\157\156\040\040\040\040\040\040\040\040\040\104\151\163\160\154\141\171\040\166\145\162\163\151\157\156\040\151\156\146\157\162\155\141\164\151\157\156\000\004\102\000\000\000\106\157\162\040\141\144\144\151\164\151\157\156\141\154\040\151\156\146\157\162\155\141\164\151\157\156\054\040\163\145\145\040\150\164\164\160\072\057\057\151\156\144\165\163\164\162\151\157\165\163\157\156\145\056\143\157\155\057\160\162\145\155\141\153\145\000\000\000\000\000\127\000\000\000\023\000\000\000\023\000\000\000\024\000\000\000\024\000\000\000\024\000\000\000\024\000\000\000\024\000\000\000\024\000\000\000\024\000\000\000\024\000\000\000\024\000\000\000\024\000\000\000\024\000\000\000\024\000\000\000\025\000\000\000\025\000\000\000\025\000\000\000\025\000\000\000\027\000\000\000\027\000\000\000\027\000\000\000\027\000\000\000\030\000\000\000\030\000\000\000\030\000\000\000\031\000\000\000\031\000\000\000\031\000\000\000\031\000\000\000\031\000\000\000\032\000\000\000\032\000\000\000\032\000\000\000\033\000\000\000\033\000\000\000\033\000\000\000\034\000\000\000\034\000\000\000\034\000\000\000\036\000\000\000\036\000\000\000\036\000\000\000\037\000\000\000\037\000\000\000\037\000\000\000\040\000\000\000\040\000\000\000\040\000\000\000\040\000\000\000\041\000\000\000\041\000\000\000\041\000\000\000\041\000\000\000\041\000\000\000\041\000\000\000\041\000\000\000\041\000\000\000\040\000\000\000\041\000\000\000\043\000\000\000\043\000\000\000\043\000\000\000\045\000\000\000\045\000\000\000\045\000\000\000\046\000\000\000\046\000\000\000\046\000\000\000\047\000\000\000\047\000\000\000\047\000\000\000\050\000\000\000\050\000\000\000\050\000\000\000\051\000\000\000\051\000\000\000\051\000\000\000\052\000\000\000\052\000\000\000\052\000\000\000\053\000\000\000\053\000\000\000\053\000\000\000\055\000\000\000\055\000\000\000\055\000\000\000\056\000\000\000\012\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\006\000\000\000\016\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\006\000\000\000\016\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\006\000\000\000\016\000\000\000\005\000\000\000\156\141\155\145\000\007\000\000\000\014\000\000\000\002\000\000\000\137\000\007\000\000\000\014\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\060\000\000\000\073\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\060\000\000\000\073\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\060\000\000\000\073\000\000\000\002\000\000\000\137\000\061\000\000\000\071\000\000\000\005\000\000\000\156\141\155\145\000\061\000\000\000\071\000\000\000\000\000\000\000\000\000\000\000\065\000\000\000\203\000\000\000\004\001\000\017\235\000\000\000\032\000\000\000\026\000\014\200\105\000\000\000\200\000\000\000\301\100\000\000\225\300\000\001\134\000\001\001\001\201\000\000\124\001\200\000\115\201\300\002\201\201\000\000\040\101\001\200\005\002\000\000\100\002\000\000\201\302\000\000\306\302\201\000\125\302\202\004\034\102\000\001\037\001\376\177\005\001\001\000\100\001\000\001\034\001\001\001\026\100\003\200\105\102\001\000\106\202\301\004\200\002\000\004\134\202\000\001\205\302\001\000\305\002\002\000\306\102\302\005\306\202\302\005\000\003\000\000\101\303\000\000\200\003\000\004\025\203\003\006\334\202\000\001\211\302\202\004\041\201\000\000\026\300\373\177\005\001\001\000\100\001\200\001\034\001\001\001\026\100\001\200\105\002\000\000\200\002\000\000\301\302\000\000\000\003\000\004\225\002\003\005\134\102\000\001\041\201\000\000\026\300\375\177\105\300\002\000\106\000\303\000\132\100\000\000\026\000\000\200\104\000\000\000\205\100\003\000\206\200\103\001\300\000\200\000\234\200\000\001\232\000\000\000\026\200\000\200\205\000\000\000\300\000\200\000\234\100\000\001\205\300\002\000\206\300\103\001\232\000\000\000\026\100\001\200\205\000\004\000\304\000\200\000\005\101\004\000\234\100\200\001\201\200\000\000\236\000\000\001\205\300\002\000\206\200\104\001\232\000\000\000\026\300\000\200\204\000\000\001\234\100\200\000\201\200\000\000\236\000\000\001\205\300\004\000\232\100\000\000\026\000\001\200\205\000\005\000\304\000\200\001\234\100\000\001\201\200\000\000\236\000\000\001\205\100\003\000\206\200\103\001\300\000\200\000\234\200\000\001\232\100\000\000\026\200\001\200\205\100\005\000\301\200\005\000\004\001\000\000\101\301\005\000\325\100\201\001\001\001\006\000\234\100\200\001\205\000\002\000\206\100\106\001\305\200\006\000\206\300\000\001\305\000\002\000\306\100\306\001\005\301\004\000\306\000\201\001\332\100\000\000\026\200\001\200\305\100\005\000\001\301\006\000\105\301\004\000\201\001\007\000\025\201\001\002\101\101\007\000\334\100\200\001\305\000\002\000\306\000\310\001\334\300\200\000\007\301\007\000\307\200\007\000\305\200\007\000\332\100\000\000\026\100\001\200\305\100\005\000\001\101\010\000\105\301\007\000\025\101\001\002\101\101\007\000\334\100\200\001\305\000\002\000\306\200\310\001\306\300\310\001\334\300\200\000\007\301\007\000\307\200\007\000\305\200\007\000\332\100\000\000\026\100\001\200\305\100\005\000\001\101\010\000\105\301\007\000\025\101\001\002\101\101\007\000\334\100\200\001\305\000\002\000\306\000\311\001\005\301\004\000\334\100\000\001\301\100\007\000\336\000\000\001\036\000\200\000\045\000\000\000\004\007\000\000\000\144\157\146\151\154\145\000\004\017\000\000\000\057\137\155\141\156\151\146\145\163\164\056\154\165\141\000\003\000\000\000\000\000\000\360\077\004\002\000\000\000\057\000\004\007\000\000\000\151\160\141\151\162\163\000\004\005\000\000\000\160\141\164\150\000\004\014\000\000\000\147\145\164\142\141\163\145\156\141\155\145\000\004\013\000\000\000\137\124\105\115\120\114\101\124\105\123\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\011\000\000\000\164\145\155\160\154\141\164\145\000\004\011\000\000\000\154\157\141\144\146\151\154\145\000\004\011\000\000\000\137\117\120\124\111\117\116\123\000\004\005\000\000\000\146\151\154\145\000\004\003\000\000\000\157\163\000\004\007\000\000\000\151\163\146\151\154\145\000\004\010\000\000\000\166\145\162\163\151\157\156\000\004\007\000\000\000\160\162\151\156\164\146\000\004\021\000\000\000\137\120\122\105\115\101\113\105\137\126\105\122\123\111\117\116\000\004\005\000\000\000\150\145\154\160\000\004\010\000\000\000\137\101\103\124\111\117\116\000\004\006\000\000\000\160\162\151\156\164\000\004\006\000\000\000\145\162\162\157\162\000\004\024\000\000\000\116\157\040\120\162\145\155\141\153\145\040\163\143\162\151\160\164\040\050\000\004\011\000\000\000\051\040\146\157\165\156\144\041\000\003\000\000\000\000\000\000\000\100\004\010\000\000\000\141\143\164\151\157\156\163\000\004\005\000\000\000\156\141\155\145\000\004\030\000\000\000\105\162\162\157\162\072\040\116\157\040\163\165\143\150\040\141\143\164\151\157\156\040\047\000\004\002\000\000\000\047\000\003\000\000\000\000\000\000\000\000\004\003\000\000\000\157\153\000\004\004\000\000\000\145\162\162\000\004\013\000\000\000\143\150\145\143\153\164\157\157\154\163\000\004\010\000\000\000\105\162\162\157\162\072\040\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\011\000\000\000\143\150\145\143\153\141\154\154\000\004\011\000\000\000\144\157\141\143\164\151\157\156\000\000\000\000\000\235\000\000\000\073\000\000\000\073\000\000\000\075\000\000\000\075\000\000\000\075\000\000\000\075\000\000\000\075\000\000\000\076\000\000\000\076\000\000\000\076\000\000\000\076\000\000\000\076\000\000\000\077\000\000\000\077\000\000\000\077\000\000\000\077\000\000\000\077\000\000\000\077\000\000\000\076\000\000\000\103\000\000\000\103\000\000\000\103\000\000\000\103\000\000\000\104\000\000\000\104\000\000\000\104\000\000\000\104\000\000\000\105\000\000\000\105\000\000\000\105\000\000\000\105\000\000\000\105\000\000\000\105\000\000\000\105\000\000\000\105\000\000\000\105\000\000\000\105\000\000\000\103\000\000\000\105\000\000\000\111\000\000\000\111\000\000\000\111\000\000\000\111\000\000\000\112\000\000\000\112\000\000\000\112\000\000\000\112\000\000\000\112\000\000\000\112\000\000\000\111\000\000\000\112\000\000\000\122\000\000\000\122\000\000\000\122\000\000\000\122\000\000\000\122\000\000\000\123\000\000\000\123\000\000\000\123\000\000\000\123\000\000\000\123\000\000\000\123\000\000\000\124\000\000\000\124\000\000\000\124\000\000\000\132\000\000\000\132\000\000\000\132\000\000\000\132\000\000\000\133\000\000\000\133\000\000\000\133\000\000\000\133\000\000\000\134\000\000\000\134\000\000\000\137\000\000\000\137\000\000\000\137\000\000\000\137\000\000\000\140\000\000\000\140\000\000\000\141\000\000\000\141\000\000\000\147\000\000\000\147\000\000\000\147\000\000\000\150\000\000\000\150\000\000\000\150\000\000\000\151\000\000\000\151\000\000\000\157\000\000\000\157\000\000\000\157\000\000\000\157\000\000\000\157\000\000\000\157\000\000\000\160\000\000\000\160\000\000\000\160\000\000\000\160\000\000\000\160\000\000\000\160\000\000\000\160\000\000\000\165\000\000\000\165\000\000\000\165\000\000\000\165\000\000\000\166\000\000\000\166\000\000\000\166\000\000\000\166\000\000\000\166\000\000\000\166\000\000\000\167\000\000\000\167\000\000\000\167\000\000\000\167\000\000\000\167\000\000\000\167\000\000\000\167\000\000\000\172\000\000\000\172\000\000\000\172\000\000\000\172\000\000\000\172\000\000\000\173\000\000\000\173\000\000\000\173\000\000\000\173\000\000\000\173\000\000\000\173\000\000\000\173\000\000\000\173\000\000\000\173\000\000\000\175\000\000\000\175\000\000\000\175\000\000\000\175\000\000\000\175\000\000\000\175\000\000\000\176\000\000\000\176\000\000\000\176\000\000\000\176\000\000\000\176\000\000\000\176\000\000\000\176\000\000\000\176\000\000\000\176\000\000\000\200\000\000\000\200\000\000\000\200\000\000\000\200\000\000\000\201\000\000\000\201\000\000\000\203\000\000\000\025\000\000\000\013\000\000\000\163\143\162\151\160\164\160\141\164\150\000\000\000\000\000\234\000\000\000\002\000\000\000\163\000\007\000\000\000\063\000\000\000\002\000\000\000\164\000\007\000\000\000\063\000\000\000\002\000\000\000\141\000\007\000\000\000\063\000\000\000\014\000\000\000\050\146\157\162\040\151\156\144\145\170\051\000\013\000\000\000\023\000\000\000\014\000\000\000\050\146\157\162\040\154\151\155\151\164\051\000\013\000\000\000\023\000\000\000\013\000\000\000\050\146\157\162\040\163\164\145\160\051\000\013\000\000\000\023\000\000\000\002\000\000\000\151\000\014\000\000\000\022\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\026\000\000\000\047\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\026\000\000\000\047\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\026\000\000\000\047\000\000\000\002\000\000\000\137\000\027\000\000\000\045\000\000\000\002\000\000\000\166\000\027\000\000\000\045\000\000\000\002\000\000\000\156\000\033\000\000\000\045\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\052\000\000\000\063\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\052\000\000\000\063\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\052\000\000\000\063\000\000\000\002\000\000\000\137\000\053\000\000\000\061\000\000\000\002\000\000\000\166\000\053\000\000\000\061\000\000\000\006\000\000\000\146\156\141\155\145\000\070\000\000\000\234\000\000\000\007\000\000\000\141\143\164\151\157\156\000\154\000\000\000\234\000\000\000\004\000\000\000\013\000\000\000\163\143\162\151\160\164\146\151\154\145\000\014\000\000\000\166\145\162\163\151\157\156\150\145\154\160\000\011\000\000\000\163\150\157\167\150\145\154\160\000\012\000\000\000\163\150\157\162\164\150\145\154\160\000\013\000\000\000\010\000\000\000\011\000\000\000\012\000\000\000\056\000\000\000\203\000\000\000\203\000\000\000\203\000\000\000\203\000\000\000\203\000\000\000\065\000\000\000\203\000\000\000\004\000\000\000\012\000\000\000\163\150\157\162\164\150\145\154\160\000\001\000\000\000\012\000\000\000\014\000\000\000\166\145\162\163\151\157\156\150\145\154\160\000\002\000\000\000\012\000\000\000\013\000\000\000\163\143\162\151\160\164\146\151\154\145\000\003\000\000\000\012\000\000\000\011\000\000\000\163\150\157\167\150\145\154\160\000\004\000\000\000\012\000\000\000\000\000\000\000",
+ "\137\124\105\115\120\114\101\124\105\123\056\155\141\153\145\137\163\157\154\165\164\151\157\156\075\160\162\145\155\141\153\145\056\164\145\155\160\154\141\164\145\056\154\157\141\144\163\164\162\151\156\147\050\047\155\141\153\145\137\163\157\154\165\164\151\157\156\047\054\133\133\043\040\074\045\075\040\160\162\145\155\141\153\145\056\141\143\164\151\157\156\163\133\137\101\103\124\111\117\116\135\056\163\150\157\162\164\156\141\155\145\040\045\076\040\163\157\154\165\164\151\157\156\040\155\141\153\145\146\151\154\145\040\141\165\164\157\147\145\156\145\162\141\164\145\144\040\142\171\040\120\162\145\155\141\153\145\012\043\040\125\163\141\147\145\072\040\155\141\153\145\040\133\040\103\117\116\106\111\107\075\143\157\156\146\151\147\137\156\141\155\145\040\135\012\043\040\127\150\145\162\145\040\173\143\157\156\146\151\147\137\156\141\155\145\175\040\151\163\040\157\156\145\040\157\146\072\040\074\045\075\040\164\141\142\154\145\056\151\155\160\154\157\144\145\050\164\150\151\163\056\143\157\156\146\151\147\165\162\141\164\151\157\156\163\054\040\047\042\047\054\040\047\042\047\054\040\047\054\040\047\051\040\045\076\056\012\012\151\146\156\144\145\146\040\103\117\116\106\111\107\012\040\040\103\117\116\106\111\107\075\074\045\075\040\155\141\153\145\056\145\163\143\050\164\150\151\163\056\143\157\156\146\151\147\165\162\141\164\151\157\156\163\133\061\135\051\040\045\076\012\145\156\144\151\146\012\145\170\160\157\162\164\040\103\117\116\106\111\107\012\012\120\122\117\112\105\103\124\123\040\072\075\040\074\045\075\040\164\141\142\154\145\056\143\157\156\143\141\164\050\155\141\153\145\056\145\163\143\050\164\141\142\154\145\056\145\170\164\162\141\143\164\050\164\150\151\163\056\160\162\157\152\145\143\164\163\054\040\042\156\141\155\145\042\051\051\054\040\042\040\042\051\040\045\076\012\012\056\120\110\117\116\131\072\040\141\154\154\040\143\154\145\141\156\040\044\050\120\122\117\112\105\103\124\123\051\012\012\141\154\154\072\040\044\050\120\122\117\112\105\103\124\123\051\012\012\074\045\040\146\157\162\040\137\054\160\162\152\040\151\156\040\151\160\141\151\162\163\050\164\150\151\163\056\160\162\157\152\145\143\164\163\051\040\144\157\040\045\076\012\074\045\040\040\146\157\162\040\143\146\147\040\151\156\040\160\162\145\155\141\153\145\056\160\162\157\152\145\143\164\056\143\157\156\146\151\147\163\050\160\162\152\051\040\144\157\040\045\076\012\151\146\145\161\040\050\044\050\103\117\116\106\111\107\051\054\074\045\075\040\155\141\153\145\056\145\163\143\050\143\146\147\056\156\141\155\145\051\045\076\051\012\040\040\104\105\120\105\116\104\105\116\103\111\105\123\040\072\075\040\040\074\045\075\040\164\141\142\154\145\056\143\157\156\143\141\164\050\155\141\153\145\056\145\163\143\050\160\162\145\155\141\153\145\056\160\162\157\152\145\143\164\056\147\145\164\144\145\160\145\156\144\145\156\143\151\145\163\050\143\146\147\051\051\054\040\042\040\042\051\040\045\076\012\145\156\144\151\146\012\074\045\040\040\145\156\144\040\045\076\012\012\074\045\075\040\155\141\153\145\056\145\163\143\050\160\162\152\056\156\141\155\145\051\040\045\076\072\040\044\173\104\105\120\105\116\104\105\116\103\111\105\123\175\012\011\100\145\143\150\157\040\075\075\075\075\040\102\165\151\154\144\151\156\147\040\074\045\075\040\160\162\152\056\156\141\155\145\040\045\076\040\075\075\075\075\012\011\100\044\173\115\101\113\105\175\040\055\055\156\157\055\160\162\151\156\164\055\144\151\162\145\143\164\157\162\171\040\055\103\040\074\045\075\155\141\153\145\056\145\163\143\050\160\141\164\150\056\147\145\164\162\145\154\141\164\151\166\145\050\164\150\151\163\056\154\157\143\141\164\151\157\156\054\040\160\162\152\056\154\157\143\141\164\151\157\156\051\051\045\076\040\055\146\040\074\045\075\155\141\153\145\056\145\163\143\050\155\141\153\145\056\147\145\164\155\141\153\145\146\151\154\145\156\141\155\145\050\160\162\152\054\040\164\162\165\145\051\051\045\076\012\011\012\074\045\040\145\156\144\040\045\076\012\012\143\154\145\141\156\072\012\074\045\040\146\157\162\040\137\054\160\162\152\040\151\156\040\151\160\141\151\162\163\050\164\150\151\163\056\160\162\157\152\145\143\164\163\051\040\144\157\040\045\076\012\011\100\044\173\115\101\113\105\175\040\055\055\156\157\055\160\162\151\156\164\055\144\151\162\145\143\164\157\162\171\040\055\103\040\074\045\075\155\141\153\145\056\145\163\143\050\160\141\164\150\056\147\145\164\162\145\154\141\164\151\166\145\050\164\150\151\163\056\154\157\143\141\164\151\157\156\054\040\160\162\152\056\154\157\143\141\164\151\157\156\051\051\045\076\040\055\146\040\074\045\075\155\141\153\145\056\145\163\143\050\155\141\153\145\056\147\145\164\155\141\153\145\146\151\154\145\156\141\155\145\050\160\162\152\054\040\164\162\165\145\051\051\045\076\040\143\154\145\141\156\012\074\045\040\145\156\144\040\045\076\012\135\135\051",
+ "\137\124\105\115\120\114\101\124\105\123\056\155\141\153\145\137\143\160\160\137\160\162\157\152\145\143\164\075\160\162\145\155\141\153\145\056\164\145\155\160\154\141\164\145\056\154\157\141\144\163\164\162\151\156\147\050\047\155\141\153\145\137\143\160\160\137\160\162\157\152\145\143\164\047\054\133\133\043\040\074\045\075\040\160\162\145\155\141\153\145\056\141\143\164\151\157\156\163\133\137\101\103\124\111\117\116\135\056\163\150\157\162\164\156\141\155\145\040\045\076\040\160\162\157\152\145\143\164\040\155\141\153\145\146\151\154\145\040\141\165\164\157\147\145\156\145\162\141\164\145\144\040\142\171\040\120\162\145\155\141\153\145\012\012\151\146\156\144\145\146\040\103\117\116\106\111\107\012\040\040\103\117\116\106\111\107\075\074\045\075\040\155\141\153\145\056\145\163\143\050\164\150\151\163\056\143\157\156\146\151\147\165\162\141\164\151\157\156\163\133\061\135\051\040\045\076\012\145\156\144\151\146\012\012\074\045\040\146\157\162\040\143\146\147\040\151\156\040\160\162\145\155\141\153\145\056\160\162\157\152\145\143\164\056\143\157\156\146\151\147\163\050\164\150\151\163\051\040\144\157\040\045\076\012\151\146\145\161\040\050\044\050\103\117\116\106\111\107\051\054\074\045\075\040\155\141\153\145\056\145\163\143\050\143\146\147\056\156\141\155\145\051\045\076\051\012\040\040\124\101\122\107\105\124\104\111\122\040\040\075\040\074\045\075\040\155\141\153\145\056\145\163\143\050\160\141\164\150\056\147\145\164\144\151\162\145\143\164\157\162\171\050\143\146\147\056\164\141\162\147\145\164\051\051\040\045\076\012\040\040\124\101\122\107\105\124\040\040\040\040\040\075\040\044\050\124\101\122\107\105\124\104\111\122\051\057\074\045\075\040\155\141\153\145\056\145\163\143\050\160\141\164\150\056\147\145\164\156\141\155\145\050\143\146\147\056\164\141\162\147\145\164\051\051\040\045\076\012\040\040\117\102\112\104\111\122\040\040\040\040\040\075\040\074\045\075\040\155\141\153\145\056\145\163\143\050\160\162\145\155\141\153\145\056\160\162\157\152\145\143\164\056\147\145\164\157\142\152\144\151\162\050\143\146\147\051\051\040\045\076\012\040\040\104\105\106\111\116\105\123\040\040\040\053\075\040\074\045\075\040\160\162\145\155\141\153\145\056\164\157\157\154\163\133\137\117\120\124\111\117\116\123\056\143\143\135\056\155\141\153\145\137\144\145\146\151\156\145\163\050\143\146\147\051\040\040\045\076\012\040\040\111\116\103\114\125\104\105\123\040\040\053\075\040\074\045\075\040\160\162\145\155\141\153\145\056\164\157\157\154\163\133\137\117\120\124\111\117\116\123\056\143\143\135\056\155\141\153\145\137\151\156\143\154\165\144\145\163\050\143\146\147\051\040\045\076\012\040\040\103\120\120\106\114\101\107\123\040\040\053\075\040\074\045\075\040\160\162\145\155\141\153\145\056\164\157\157\154\163\133\137\117\120\124\111\117\116\123\056\143\143\135\056\155\141\153\145\137\143\160\160\146\154\141\147\163\050\143\146\147\051\040\045\076\040\044\050\104\105\106\111\116\105\123\051\040\044\050\111\116\103\114\125\104\105\123\051\012\040\040\103\106\114\101\107\123\040\040\040\040\053\075\040\044\050\103\120\120\106\114\101\107\123\051\040\044\050\101\122\103\110\051\040\074\045\075\040\160\162\145\155\141\153\145\056\164\157\157\154\163\133\137\117\120\124\111\117\116\123\056\143\143\135\056\155\141\153\145\137\143\146\154\141\147\163\050\143\146\147\051\040\045\076\040\074\045\075\040\164\141\142\154\145\056\143\157\156\143\141\164\050\143\146\147\056\142\165\151\154\144\157\160\164\151\157\156\163\054\040\042\040\042\051\040\045\076\012\040\040\103\130\130\106\114\101\107\123\040\040\053\075\040\044\050\103\106\114\101\107\123\051\040\074\045\075\040\160\162\145\155\141\153\145\056\164\157\157\154\163\133\137\117\120\124\111\117\116\123\056\143\143\135\056\155\141\153\145\137\143\170\170\146\154\141\147\163\050\143\146\147\051\040\045\076\012\040\040\114\104\106\114\101\107\123\040\040\040\053\075\040\074\045\075\040\160\162\145\155\141\153\145\056\164\157\157\154\163\133\137\117\120\124\111\117\116\123\056\143\143\135\056\155\141\153\145\137\154\144\146\154\141\147\163\050\143\146\147\051\040\045\076\040\074\045\075\040\164\141\142\154\145\056\143\157\156\143\141\164\050\143\146\147\056\154\151\156\153\157\160\164\151\157\156\163\054\040\042\040\042\051\040\045\076\012\040\040\122\105\123\106\114\101\107\123\040\040\053\075\040\044\050\104\105\106\111\116\105\123\051\040\044\050\111\116\103\114\125\104\105\123\051\040\074\045\075\040\164\141\142\154\145\056\143\157\156\143\141\164\050\143\146\147\056\162\145\163\157\160\164\151\157\156\163\054\040\042\040\042\051\040\045\076\012\040\040\114\104\104\105\120\123\040\040\040\040\053\075\040\074\045\075\040\164\141\142\154\145\056\143\157\156\143\141\164\050\160\162\145\155\141\153\145\056\160\162\157\152\145\143\164\056\147\145\164\154\151\142\162\141\162\151\145\163\050\143\146\147\054\040\160\162\145\155\141\153\145\056\160\162\157\152\145\143\164\056\147\145\164\144\145\160\145\156\144\145\156\143\151\145\163\050\143\146\147\051\051\051\040\045\076\012\145\156\144\151\146\012\012\074\045\040\145\156\144\040\045\076\012\012\117\102\112\105\103\124\123\040\072\075\040\134\012\074\045\040\146\157\162\040\137\054\040\146\151\154\145\040\151\156\040\151\160\141\151\162\163\050\164\150\151\163\056\146\151\154\145\163\051\040\144\157\040\045\076\012\074\045\040\040\151\146\040\160\141\164\150\056\151\163\143\160\160\146\151\154\145\050\146\151\154\145\051\040\164\150\145\156\040\045\076\012\011\044\050\117\102\112\104\111\122\051\057\074\045\075\040\155\141\153\145\056\145\163\143\050\160\141\164\150\056\147\145\164\142\141\163\145\156\141\155\145\050\146\151\154\145\051\051\040\045\076\056\157\040\134\012\074\045\040\040\145\156\144\040\045\076\012\074\045\040\145\156\144\040\045\076\012\012\122\105\123\117\125\122\103\105\123\040\072\075\040\134\012\074\045\040\146\157\162\040\137\054\040\146\151\154\145\040\151\156\040\151\160\141\151\162\163\050\164\150\151\163\056\146\151\154\145\163\051\040\144\157\040\045\076\012\074\045\040\040\151\146\040\160\141\164\150\056\151\163\162\145\163\157\165\162\143\145\146\151\154\145\050\146\151\154\145\051\040\164\150\145\156\040\045\076\012\011\044\050\117\102\112\104\111\122\051\057\074\045\075\040\155\141\153\145\056\145\163\143\050\160\141\164\150\056\147\145\164\142\141\163\145\156\141\155\145\050\146\151\154\145\051\051\040\045\076\056\162\145\163\040\134\012\074\045\040\040\145\156\144\040\045\076\012\074\045\040\145\156\144\040\045\076\012\012\123\110\105\114\114\124\131\120\105\040\072\075\040\155\163\144\157\163\012\151\146\145\161\040\050\054\044\050\103\157\155\123\160\145\143\051\044\050\103\117\115\123\120\105\103\051\051\012\040\040\123\110\105\114\114\124\131\120\105\040\072\075\040\160\157\163\151\170\012\145\156\144\151\146\012\151\146\145\161\040\050\057\142\151\156\054\044\050\146\151\156\144\163\164\162\151\156\147\040\057\142\151\156\054\044\050\123\110\105\114\114\051\051\051\012\040\040\123\110\105\114\114\124\131\120\105\040\072\075\040\160\157\163\151\170\012\145\156\144\151\146\012\012\151\146\145\161\040\050\160\157\163\151\170\054\044\050\123\110\105\114\114\124\131\120\105\051\051\012\040\040\040\115\113\104\111\122\040\040\040\072\075\040\155\153\144\151\162\040\055\160\012\040\040\040\120\101\124\110\123\105\120\040\072\075\040\057\012\145\154\163\145\012\040\040\040\115\113\104\111\122\040\040\040\072\075\040\155\153\144\151\162\012\040\040\040\120\101\124\110\123\105\120\040\072\075\040\134\134\012\145\156\144\151\146\012\012\123\131\123\137\124\101\122\107\105\124\040\040\040\040\072\075\040\044\050\163\165\142\163\164\040\057\054\044\050\120\101\124\110\123\105\120\051\054\044\050\124\101\122\107\105\124\051\051\012\123\131\123\137\124\101\122\107\105\124\104\111\122\040\072\075\040\044\050\163\165\142\163\164\040\057\054\044\050\120\101\124\110\123\105\120\051\054\044\050\124\101\122\107\105\124\104\111\122\051\051\012\123\131\123\137\117\102\112\104\111\122\040\040\040\040\072\075\040\044\050\163\165\142\163\164\040\057\054\044\050\120\101\124\110\123\105\120\051\054\044\050\117\102\112\104\111\122\051\051\012\012\056\120\110\117\116\131\072\040\143\154\145\141\156\012\012\074\045\040\151\146\040\157\163\056\151\163\050\042\115\141\143\117\123\130\042\051\040\141\156\144\040\164\150\151\163\056\153\151\156\144\040\075\075\040\042\127\151\156\144\157\167\145\144\105\170\145\042\040\164\150\145\156\040\045\076\012\141\154\154\072\040\044\050\124\101\122\107\105\124\051\040\044\050\144\151\162\040\044\050\124\101\122\107\105\124\104\111\122\051\051\120\153\147\111\156\146\157\040\044\050\144\151\162\040\044\050\124\101\122\107\105\124\104\111\122\051\051\111\156\146\157\056\160\154\151\163\164\012\012\044\050\144\151\162\040\044\050\124\101\122\107\105\124\104\111\122\051\051\120\153\147\111\156\146\157\072\012\012\044\050\144\151\162\040\044\050\124\101\122\107\105\124\104\111\122\051\051\111\156\146\157\056\160\154\151\163\164\072\012\074\045\040\145\156\144\040\045\076\012\012\044\050\124\101\122\107\105\124\051\072\040\044\050\124\101\122\107\105\124\104\111\122\051\040\044\050\117\102\112\104\111\122\051\040\044\050\117\102\112\105\103\124\123\051\040\044\050\114\104\104\105\120\123\051\040\044\050\122\105\123\117\125\122\103\105\123\051\012\011\100\145\143\150\157\040\114\151\156\153\151\156\147\040\074\045\075\040\164\150\151\163\056\156\141\155\145\040\045\076\012\011\100\044\050\103\130\130\051\040\055\157\040\044\100\040\044\050\114\104\106\114\101\107\123\051\040\044\050\101\122\103\110\051\040\044\050\117\102\112\105\103\124\123\051\040\044\050\122\105\123\117\125\122\103\105\123\051\012\011\012\044\050\124\101\122\107\105\124\104\111\122\051\072\012\011\100\145\143\150\157\040\103\162\145\141\164\151\156\147\040\044\100\012\011\100\044\050\115\113\104\111\122\051\040\044\050\123\131\123\137\124\101\122\107\105\124\104\111\122\051\012\011\012\044\050\117\102\112\104\111\122\051\072\012\011\100\145\143\150\157\040\103\162\145\141\164\151\156\147\040\044\100\012\011\100\044\050\115\113\104\111\122\051\040\044\050\123\131\123\137\117\102\112\104\111\122\051\012\012\143\154\145\141\156\072\012\011\100\145\143\150\157\040\103\154\145\141\156\151\156\147\040\074\045\075\040\164\150\151\163\056\156\141\155\145\040\045\076\012\151\146\145\161\040\050\160\157\163\151\170\054\044\050\123\110\105\114\114\124\131\120\105\051\051\012\011\100\162\155\040\055\146\040\040\044\050\124\101\122\107\105\124\051\012\011\100\162\155\040\055\162\146\040\044\050\117\102\112\104\111\122\051\012\145\154\163\145\012\011\100\151\146\040\145\170\151\163\164\040\044\050\123\131\123\137\124\101\122\107\105\124\051\040\144\145\154\040\044\050\123\131\123\137\124\101\122\107\105\124\051\012\011\100\151\146\040\145\170\151\163\164\040\044\050\123\131\123\137\117\102\112\104\111\122\051\040\162\155\144\151\162\040\057\163\040\057\161\040\044\050\123\131\123\137\117\102\112\104\111\122\051\012\145\156\144\151\146\012\012\074\045\040\146\157\162\040\137\054\040\146\151\154\145\040\151\156\040\151\160\141\151\162\163\050\164\150\151\163\056\146\151\154\145\163\051\040\144\157\040\045\076\012\074\045\040\040\151\146\040\160\141\164\150\056\151\163\143\160\160\146\151\154\145\050\146\151\154\145\051\040\164\150\145\156\040\045\076\012\044\050\117\102\112\104\111\122\051\057\074\045\075\040\155\141\153\145\056\145\163\143\050\160\141\164\150\056\147\145\164\142\141\163\145\156\141\155\145\050\146\151\154\145\051\051\040\045\076\056\157\072\040\074\045\075\040\155\141\153\145\056\145\163\143\050\146\151\154\145\051\040\045\076\012\011\100\145\143\150\157\040\044\050\156\157\164\144\151\162\040\044\074\051\012\011\100\074\045\075\040\160\162\145\155\141\153\145\056\164\157\157\154\163\133\137\117\120\124\111\117\116\123\056\143\143\135\056\155\141\153\145\137\146\151\154\145\137\162\165\154\145\050\146\151\154\145\051\040\045\076\012\011\012\074\045\040\040\145\156\144\040\045\076\012\074\045\040\145\156\144\040\045\076\012\012\055\151\156\143\154\165\144\145\040\044\050\117\102\112\105\103\124\123\072\045\056\157\075\045\056\144\051\012\135\135\051",
+ "\137\124\105\115\120\114\101\124\105\123\056\166\163\062\060\060\062\137\163\157\154\165\164\151\157\156\075\160\162\145\155\141\153\145\056\164\145\155\160\154\141\164\145\056\154\157\141\144\163\164\162\151\156\147\050\047\166\163\062\060\060\062\137\163\157\154\165\164\151\157\156\047\054\133\133\074\045\040\145\157\154\040\075\040\042\134\162\134\156\042\040\045\076\012\012\115\151\143\162\157\163\157\146\164\040\126\151\163\165\141\154\040\123\164\165\144\151\157\040\123\157\154\165\164\151\157\156\040\106\151\154\145\054\040\106\157\162\155\141\164\040\126\145\162\163\151\157\156\040\067\056\060\060\012\120\162\157\152\145\143\164\050\042\173\070\102\103\071\103\105\102\070\055\070\102\064\101\055\061\061\104\060\055\070\104\061\061\055\060\060\101\060\103\071\061\102\103\071\064\062\175\042\051\040\075\040\042\103\160\160\105\170\145\042\054\040\042\103\160\160\105\170\145\057\103\160\160\105\170\145\056\166\143\160\162\157\152\042\054\040\042\173\101\105\066\061\067\062\066\104\055\061\070\067\103\055\105\064\064\060\055\102\104\060\067\055\062\065\065\066\061\070\070\101\066\065\066\065\175\042\012\105\156\144\120\162\157\152\145\143\164\012\107\154\157\142\141\154\012\011\107\154\157\142\141\154\123\145\143\164\151\157\156\050\123\157\154\165\164\151\157\156\103\157\156\146\151\147\165\162\141\164\151\157\156\051\040\075\040\160\162\145\123\157\154\165\164\151\157\156\012\011\011\103\157\156\146\151\147\116\141\155\145\056\060\040\075\040\104\145\142\165\147\012\011\011\103\157\156\146\151\147\116\141\155\145\056\061\040\075\040\122\145\154\145\141\163\145\012\011\105\156\144\107\154\157\142\141\154\123\145\143\164\151\157\156\012\011\107\154\157\142\141\154\123\145\143\164\151\157\156\050\120\162\157\152\145\143\164\104\145\160\145\156\144\145\156\143\151\145\163\051\040\075\040\160\157\163\164\123\157\154\165\164\151\157\156\012\011\105\156\144\107\154\157\142\141\154\123\145\143\164\151\157\156\012\011\107\154\157\142\141\154\123\145\143\164\151\157\156\050\120\162\157\152\145\143\164\103\157\156\146\151\147\165\162\141\164\151\157\156\051\040\075\040\160\157\163\164\123\157\154\165\164\151\157\156\012\011\011\173\101\105\066\061\067\062\066\104\055\061\070\067\103\055\105\064\064\060\055\102\104\060\067\055\062\065\065\066\061\070\070\101\066\065\066\065\175\056\104\145\142\165\147\056\101\143\164\151\166\145\103\146\147\040\075\040\104\145\142\165\147\174\127\151\156\063\062\012\011\011\173\101\105\066\061\067\062\066\104\055\061\070\067\103\055\105\064\064\060\055\102\104\060\067\055\062\065\065\066\061\070\070\101\066\065\066\065\175\056\104\145\142\165\147\056\102\165\151\154\144\056\060\040\075\040\104\145\142\165\147\174\127\151\156\063\062\012\011\011\173\101\105\066\061\067\062\066\104\055\061\070\067\103\055\105\064\064\060\055\102\104\060\067\055\062\065\065\066\061\070\070\101\066\065\066\065\175\056\122\145\154\145\141\163\145\056\101\143\164\151\166\145\103\146\147\040\075\040\122\145\154\145\141\163\145\174\127\151\156\063\062\012\011\011\173\101\105\066\061\067\062\066\104\055\061\070\067\103\055\105\064\064\060\055\102\104\060\067\055\062\065\065\066\061\070\070\101\066\065\066\065\175\056\122\145\154\145\141\163\145\056\102\165\151\154\144\056\060\040\075\040\122\145\154\145\141\163\145\174\127\151\156\063\062\012\011\105\156\144\107\154\157\142\141\154\123\145\143\164\151\157\156\012\011\107\154\157\142\141\154\123\145\143\164\151\157\156\050\105\170\164\145\156\163\151\142\151\154\151\164\171\107\154\157\142\141\154\163\051\040\075\040\160\157\163\164\123\157\154\165\164\151\157\156\012\011\105\156\144\107\154\157\142\141\154\123\145\143\164\151\157\156\012\011\107\154\157\142\141\154\123\145\143\164\151\157\156\050\105\170\164\145\156\163\151\142\151\154\151\164\171\101\144\144\111\156\163\051\040\075\040\160\157\163\164\123\157\154\165\164\151\157\156\012\011\105\156\144\107\154\157\142\141\154\123\145\143\164\151\157\156\012\105\156\144\107\154\157\142\141\154\012\135\135\051",
+ "\033\114\165\141\121\000\001\004\004\004\010\000\036\000\000\000\100\163\162\143\057\141\143\164\151\157\156\163\057\143\154\145\141\156\057\137\143\154\145\141\156\056\154\165\141\000\000\000\000\000\000\000\000\000\000\000\002\003\024\000\000\000\012\000\000\000\007\000\000\000\005\000\000\000\144\000\000\000\011\100\200\200\005\000\000\000\144\100\000\000\011\100\000\201\005\000\000\000\144\200\000\000\011\100\200\201\005\000\001\000\006\100\101\000\112\200\000\000\111\300\101\203\205\000\000\000\206\300\100\001\111\200\000\204\011\100\000\200\036\000\200\000\011\000\000\000\004\006\000\000\000\143\154\145\141\156\000\004\007\000\000\000\143\157\156\146\151\147\000\004\016\000\000\000\164\145\155\160\154\141\164\145\146\151\154\145\163\000\004\004\000\000\000\141\154\154\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\141\143\164\151\157\156\163\000\004\014\000\000\000\144\145\163\143\162\151\160\164\151\157\156\000\004\050\000\000\000\122\145\155\157\166\145\040\141\154\154\040\142\151\156\141\162\151\145\163\040\141\156\144\040\147\145\156\145\162\141\164\145\144\040\146\151\154\145\163\000\004\010\000\000\000\145\170\145\143\165\164\145\000\003\000\000\000\000\000\000\000\016\000\000\000\030\000\000\000\000\001\000\007\033\000\000\000\105\000\000\000\106\100\300\000\206\200\100\000\134\100\000\001\105\000\000\000\106\100\300\000\205\300\000\000\206\000\101\001\206\100\101\001\300\000\000\000\001\201\001\000\101\301\001\000\201\001\002\000\234\000\200\002\134\100\000\000\105\000\000\000\106\100\300\000\205\300\000\000\206\000\101\001\206\100\101\001\300\000\000\000\001\201\001\000\101\301\001\000\201\101\002\000\234\000\200\002\134\100\000\000\036\000\200\000\012\000\000\000\004\003\000\000\000\157\163\000\004\007\000\000\000\162\145\155\157\166\145\000\004\007\000\000\000\164\141\162\147\145\164\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\016\000\000\000\147\145\164\164\141\162\147\145\164\146\151\154\145\000\004\007\000\000\000\151\155\160\154\151\142\000\004\012\000\000\000\123\164\141\164\151\143\114\151\142\000\004\006\000\000\000\154\151\156\165\170\000\004\010\000\000\000\167\151\156\144\157\167\163\000\000\000\000\000\033\000\000\000\020\000\000\000\020\000\000\000\020\000\000\000\020\000\000\000\023\000\000\000\023\000\000\000\023\000\000\000\023\000\000\000\023\000\000\000\023\000\000\000\023\000\000\000\023\000\000\000\023\000\000\000\023\000\000\000\023\000\000\000\024\000\000\000\024\000\000\000\024\000\000\000\024\000\000\000\024\000\000\000\024\000\000\000\024\000\000\000\024\000\000\000\024\000\000\000\024\000\000\000\024\000\000\000\030\000\000\000\001\000\000\000\004\000\000\000\143\146\147\000\000\000\000\000\032\000\000\000\000\000\000\000\000\000\000\000\037\000\000\000\046\000\000\000\000\002\000\012\022\000\000\000\132\000\000\000\026\200\003\200\205\000\000\000\300\000\200\000\234\000\001\001\026\000\002\200\305\101\000\000\306\201\300\003\000\002\000\000\106\302\100\003\334\201\200\001\005\002\001\000\006\102\101\004\100\002\200\003\034\102\000\001\241\200\000\000\026\000\375\177\036\000\200\000\006\000\000\000\004\007\000\000\000\151\160\141\151\162\163\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\016\000\000\000\147\145\164\157\165\164\160\165\164\156\141\155\145\000\003\000\000\000\000\000\000\360\077\004\003\000\000\000\157\163\000\004\007\000\000\000\162\145\155\157\166\145\000\000\000\000\000\022\000\000\000\040\000\000\000\040\000\000\000\041\000\000\000\041\000\000\000\041\000\000\000\041\000\000\000\042\000\000\000\042\000\000\000\042\000\000\000\042\000\000\000\042\000\000\000\043\000\000\000\043\000\000\000\043\000\000\000\043\000\000\000\041\000\000\000\043\000\000\000\046\000\000\000\010\000\000\000\005\000\000\000\164\150\151\163\000\000\000\000\000\021\000\000\000\012\000\000\000\164\145\155\160\154\141\164\145\163\000\000\000\000\000\021\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\005\000\000\000\021\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\005\000\000\000\021\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\005\000\000\000\021\000\000\000\002\000\000\000\137\000\006\000\000\000\017\000\000\000\005\000\000\000\164\155\160\154\000\006\000\000\000\017\000\000\000\006\000\000\000\146\156\141\155\145\000\013\000\000\000\017\000\000\000\000\000\000\000\000\000\000\000\056\000\000\000\102\000\000\000\000\000\000\024\063\000\000\000\005\000\000\000\105\100\000\000\106\200\300\000\034\000\001\001\026\300\010\200\105\301\000\000\205\001\001\000\134\001\001\001\026\100\007\200\205\102\001\000\206\202\101\005\300\002\200\004\006\303\101\002\234\102\200\001\205\102\000\000\206\002\102\005\206\102\102\005\300\002\200\004\234\002\001\001\026\000\004\200\205\103\001\000\206\203\101\007\300\003\200\006\006\204\102\002\234\103\200\001\205\103\000\000\206\003\102\007\206\303\102\007\300\003\200\006\234\003\001\001\026\300\000\200\205\104\001\000\206\004\103\011\300\004\200\010\234\104\000\001\241\103\000\000\026\100\376\177\241\102\000\000\026\000\373\177\141\201\000\000\026\300\367\177\041\200\000\000\026\100\366\177\005\100\003\000\105\200\003\000\034\200\000\001\027\300\103\000\026\100\000\200\005\200\003\000\034\100\200\000\036\000\200\000\020\000\000\000\004\006\000\000\000\160\141\151\162\163\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\141\143\164\151\157\156\163\000\004\007\000\000\000\151\160\141\151\162\163\000\004\013\000\000\000\137\123\117\114\125\124\111\117\116\123\000\004\006\000\000\000\143\154\145\141\156\000\004\016\000\000\000\164\145\155\160\154\141\164\145\146\151\154\145\163\000\004\022\000\000\000\163\157\154\165\164\151\157\156\164\145\155\160\154\141\164\145\163\000\004\010\000\000\000\160\162\157\152\145\143\164\000\004\011\000\000\000\160\162\157\152\145\143\164\163\000\004\021\000\000\000\160\162\157\152\145\143\164\164\145\155\160\154\141\164\145\163\000\004\010\000\000\000\143\157\156\146\151\147\163\000\004\007\000\000\000\143\157\156\146\151\147\000\004\005\000\000\000\164\171\160\145\000\004\010\000\000\000\157\156\143\154\145\141\156\000\004\011\000\000\000\146\165\156\143\164\151\157\156\000\000\000\000\000\063\000\000\000\060\000\000\000\060\000\000\000\060\000\000\000\060\000\000\000\060\000\000\000\061\000\000\000\061\000\000\000\061\000\000\000\061\000\000\000\062\000\000\000\062\000\000\000\062\000\000\000\062\000\000\000\062\000\000\000\064\000\000\000\064\000\000\000\064\000\000\000\064\000\000\000\064\000\000\000\064\000\000\000\065\000\000\000\065\000\000\000\065\000\000\000\065\000\000\000\065\000\000\000\067\000\000\000\067\000\000\000\067\000\000\000\067\000\000\000\067\000\000\000\067\000\000\000\070\000\000\000\070\000\000\000\070\000\000\000\070\000\000\000\067\000\000\000\070\000\000\000\064\000\000\000\071\000\000\000\061\000\000\000\072\000\000\000\060\000\000\000\073\000\000\000\077\000\000\000\077\000\000\000\077\000\000\000\077\000\000\000\077\000\000\000\100\000\000\000\100\000\000\000\102\000\000\000\022\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\004\000\000\000\053\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\004\000\000\000\053\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\004\000\000\000\053\000\000\000\002\000\000\000\137\000\005\000\000\000\051\000\000\000\007\000\000\000\141\143\164\151\157\156\000\005\000\000\000\051\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\010\000\000\000\051\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\010\000\000\000\051\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\010\000\000\000\051\000\000\000\002\000\000\000\137\000\011\000\000\000\047\000\000\000\004\000\000\000\163\154\156\000\011\000\000\000\047\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\023\000\000\000\047\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\023\000\000\000\047\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\023\000\000\000\047\000\000\000\004\000\000\000\160\162\152\000\024\000\000\000\045\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\036\000\000\000\045\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\036\000\000\000\045\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\036\000\000\000\045\000\000\000\004\000\000\000\143\146\147\000\037\000\000\000\043\000\000\000\000\000\000\000\024\000\000\000\010\000\000\000\010\000\000\000\016\000\000\000\030\000\000\000\016\000\000\000\037\000\000\000\046\000\000\000\037\000\000\000\056\000\000\000\102\000\000\000\056\000\000\000\111\000\000\000\111\000\000\000\111\000\000\000\112\000\000\000\113\000\000\000\113\000\000\000\113\000\000\000\114\000\000\000\114\000\000\000\000\000\000\000\000\000\000\000",
+ "\033\114\165\141\121\000\001\004\004\004\010\000\034\000\000\000\100\163\162\143\057\141\143\164\151\157\156\163\057\155\141\153\145\057\137\155\141\153\145\056\154\165\141\000\000\000\000\000\000\000\000\000\000\000\002\007\070\000\000\000\012\000\000\000\007\000\000\000\005\000\000\000\144\000\000\000\011\100\200\200\005\000\000\000\144\100\000\000\011\100\000\201\005\000\000\000\144\200\000\000\011\100\200\201\005\000\001\000\006\100\101\000\112\300\001\000\111\000\302\203\111\200\302\204\212\000\000\002\301\000\003\000\001\101\003\000\101\201\003\000\201\301\003\000\242\100\000\002\111\200\200\205\212\000\000\001\301\100\004\000\001\201\004\000\242\100\000\001\111\200\000\210\212\200\000\000\312\000\200\000\001\101\005\000\342\100\200\000\211\300\000\212\312\000\200\000\001\301\005\000\342\100\200\000\211\300\000\213\111\200\200\211\212\000\200\000\312\000\000\001\044\301\000\000\105\101\006\000\106\201\306\002\342\100\000\001\242\100\200\000\111\200\000\214\212\000\200\000\312\000\000\001\044\001\001\000\105\101\006\000\106\001\307\002\342\100\000\001\242\100\200\000\111\200\200\215\011\100\000\203\036\000\200\000\035\000\000\000\004\005\000\000\000\155\141\153\145\000\004\004\000\000\000\145\163\143\000\004\020\000\000\000\147\145\164\155\141\153\145\146\151\154\145\156\141\155\145\000\004\011\000\000\000\147\145\164\156\141\155\145\163\000\004\010\000\000\000\160\162\145\155\141\153\145\000\004\010\000\000\000\141\143\164\151\157\156\163\000\004\006\000\000\000\147\155\141\153\145\000\004\012\000\000\000\163\150\157\162\164\156\141\155\145\000\004\011\000\000\000\107\116\125\040\115\141\153\145\000\004\014\000\000\000\144\145\163\143\162\151\160\164\151\157\156\000\004\053\000\000\000\107\116\125\040\155\141\153\145\146\151\154\145\163\040\146\157\162\040\120\117\123\111\130\054\040\115\151\156\107\127\054\040\141\156\144\040\103\171\147\167\151\156\000\004\014\000\000\000\166\141\154\151\144\137\153\151\156\144\163\000\004\013\000\000\000\103\157\156\163\157\154\145\105\170\145\000\004\014\000\000\000\127\151\156\144\157\167\145\144\105\170\145\000\004\012\000\000\000\123\164\141\164\151\143\114\151\142\000\004\012\000\000\000\123\150\141\162\145\144\114\151\142\000\004\020\000\000\000\166\141\154\151\144\137\154\141\156\147\165\141\147\145\163\000\004\002\000\000\000\103\000\004\004\000\000\000\103\053\053\000\004\014\000\000\000\166\141\154\151\144\137\164\157\157\154\163\000\004\003\000\000\000\143\143\000\004\004\000\000\000\147\143\143\000\004\004\000\000\000\143\163\143\000\004\004\000\000\000\155\143\163\000\004\022\000\000\000\163\157\154\165\164\151\157\156\164\145\155\160\154\141\164\145\163\000\004\013\000\000\000\137\124\105\115\120\114\101\124\105\123\000\004\016\000\000\000\155\141\153\145\137\163\157\154\165\164\151\157\156\000\004\021\000\000\000\160\162\157\152\145\143\164\164\145\155\160\154\141\164\145\163\000\004\021\000\000\000\155\141\153\145\137\143\160\160\137\160\162\157\152\145\143\164\000\005\000\000\000\000\000\000\000\016\000\000\000\031\000\000\000\000\001\000\013\034\000\000\000\105\000\000\000\200\000\000\000\134\200\000\001\027\100\300\000\026\000\004\200\112\000\000\000\205\200\000\000\300\000\000\000\234\000\001\001\026\300\001\200\305\101\000\000\306\301\300\003\000\002\200\000\105\002\001\000\106\102\301\004\200\002\000\003\134\002\000\001\334\101\000\000\241\200\000\000\026\100\375\177\136\000\000\001\026\000\001\200\113\200\101\000\301\300\001\000\001\001\002\000\134\200\000\002\136\000\000\001\036\000\200\000\011\000\000\000\004\005\000\000\000\164\171\160\145\000\004\006\000\000\000\164\141\142\154\145\000\004\007\000\000\000\151\160\141\151\162\163\000\004\007\000\000\000\151\156\163\145\162\164\000\004\005\000\000\000\155\141\153\145\000\004\004\000\000\000\145\163\143\000\004\005\000\000\000\147\163\165\142\000\004\002\000\000\000\040\000\004\003\000\000\000\134\040\000\000\000\000\000\034\000\000\000\017\000\000\000\017\000\000\000\017\000\000\000\017\000\000\000\017\000\000\000\020\000\000\000\021\000\000\000\021\000\000\000\021\000\000\000\021\000\000\000\022\000\000\000\022\000\000\000\022\000\000\000\022\000\000\000\022\000\000\000\022\000\000\000\022\000\000\000\022\000\000\000\021\000\000\000\022\000\000\000\024\000\000\000\024\000\000\000\026\000\000\000\026\000\000\000\026\000\000\000\026\000\000\000\027\000\000\000\031\000\000\000\010\000\000\000\006\000\000\000\166\141\154\165\145\000\000\000\000\000\033\000\000\000\007\000\000\000\162\145\163\165\154\164\000\006\000\000\000\025\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\011\000\000\000\024\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\011\000\000\000\024\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\011\000\000\000\024\000\000\000\002\000\000\000\137\000\012\000\000\000\022\000\000\000\002\000\000\000\166\000\012\000\000\000\022\000\000\000\007\000\000\000\162\145\163\165\154\164\000\032\000\000\000\033\000\000\000\000\000\000\000\000\000\000\000\042\000\000\000\063\000\000\000\000\002\000\017\043\000\000\000\201\000\000\000\305\100\000\000\005\201\000\000\334\000\001\001\026\100\004\200\006\302\300\003\106\302\100\000\027\100\002\004\026\000\000\200\214\000\101\001\132\000\000\000\026\200\002\200\005\102\000\000\106\102\301\003\034\002\001\001\026\000\001\200\106\303\100\006\206\303\100\000\027\200\203\006\026\000\000\200\214\000\101\001\041\202\000\000\026\000\376\177\341\200\000\000\026\300\372\177\027\000\101\001\026\200\000\200\301\200\001\000\336\000\000\001\026\300\000\200\306\300\101\000\001\001\002\000\325\000\201\001\336\000\000\001\036\000\200\000\011\000\000\000\003\000\000\000\000\000\000\000\000\004\007\000\000\000\151\160\141\151\162\163\000\004\013\000\000\000\137\123\117\114\125\124\111\117\116\123\000\004\011\000\000\000\154\157\143\141\164\151\157\156\000\003\000\000\000\000\000\000\360\077\004\011\000\000\000\160\162\157\152\145\143\164\163\000\004\011\000\000\000\115\141\153\145\146\151\154\145\000\004\005\000\000\000\156\141\155\145\000\004\006\000\000\000\056\155\141\153\145\000\000\000\000\000\043\000\000\000\044\000\000\000\045\000\000\000\045\000\000\000\045\000\000\000\045\000\000\000\046\000\000\000\046\000\000\000\046\000\000\000\046\000\000\000\046\000\000\000\047\000\000\000\047\000\000\000\050\000\000\000\050\000\000\000\050\000\000\000\050\000\000\000\051\000\000\000\051\000\000\000\051\000\000\000\051\000\000\000\051\000\000\000\050\000\000\000\051\000\000\000\045\000\000\000\053\000\000\000\056\000\000\000\056\000\000\000\057\000\000\000\057\000\000\000\057\000\000\000\061\000\000\000\061\000\000\000\061\000\000\000\061\000\000\000\063\000\000\000\015\000\000\000\005\000\000\000\164\150\151\163\000\000\000\000\000\042\000\000\000\013\000\000\000\163\145\141\162\143\150\160\162\152\163\000\000\000\000\000\042\000\000\000\006\000\000\000\143\157\165\156\164\000\001\000\000\000\042\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\004\000\000\000\031\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\004\000\000\000\031\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\004\000\000\000\031\000\000\000\002\000\000\000\137\000\005\000\000\000\027\000\000\000\004\000\000\000\163\154\156\000\005\000\000\000\027\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\017\000\000\000\027\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\017\000\000\000\027\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\017\000\000\000\027\000\000\000\002\000\000\000\137\000\020\000\000\000\025\000\000\000\004\000\000\000\160\162\152\000\020\000\000\000\025\000\000\000\000\000\000\000\000\000\000\000\072\000\000\000\100\000\000\000\000\001\000\011\022\000\000\000\105\000\000\000\106\100\300\000\200\000\000\000\301\200\000\000\134\200\200\001\205\300\000\000\300\000\200\000\234\000\001\001\026\000\001\200\305\001\001\000\306\101\301\003\000\002\000\003\334\201\000\001\111\300\201\002\241\200\000\000\026\000\376\177\136\000\000\001\036\000\200\000\006\000\000\000\004\006\000\000\000\164\141\142\154\145\000\004\010\000\000\000\145\170\164\162\141\143\164\000\004\005\000\000\000\156\141\155\145\000\004\006\000\000\000\160\141\151\162\163\000\004\005\000\000\000\155\141\153\145\000\004\004\000\000\000\145\163\143\000\000\000\000\000\022\000\000\000\073\000\000\000\073\000\000\000\073\000\000\000\073\000\000\000\073\000\000\000\074\000\000\000\074\000\000\000\074\000\000\000\074\000\000\000\075\000\000\000\075\000\000\000\075\000\000\000\075\000\000\000\075\000\000\000\074\000\000\000\075\000\000\000\077\000\000\000\100\000\000\000\007\000\000\000\004\000\000\000\164\142\154\000\000\000\000\000\021\000\000\000\007\000\000\000\162\145\163\165\154\164\000\005\000\000\000\021\000\000\000\020\000\000\000\050\146\157\162\040\147\145\156\145\162\141\164\157\162\051\000\010\000\000\000\020\000\000\000\014\000\000\000\050\146\157\162\040\163\164\141\164\145\051\000\010\000\000\000\020\000\000\000\016\000\000\000\050\146\157\162\040\143\157\156\164\162\157\154\051\000\010\000\000\000\020\000\000\000\002\000\000\000\153\000\011\000\000\000\016\000\000\000\002\000\000\000\166\000\011\000\000\000\016\000\000\000\000\000\000\000\000\000\000\000\126\000\000\000\126\000\000\000\000\001\000\004\007\000\000\000\105\000\000\000\106\100\300\000\200\000\000\000\302\000\000\000\135\000\200\001\136\000\000\000\036\000\200\000\002\000\000\000\004\005\000\000\000\155\141\153\145\000\004\020\000\000\000\147\145\164\155\141\153\145\146\151\154\145\156\141\155\145\000\000\000\000\000\007\000\000\000\126\000\000\000\126\000\000\000\126\000\000\000\126\000\000\000\126\000\000\000\126\000\000\000\126\000\000\000\001\000\000\000\005\000\000\000\164\150\151\163\000\000\000\000\000\006\000\000\000\000\000\000\000\000\000\000\000\133\000\000\000\133\000\000\000\000\001\000\004\007\000\000\000\105\000\000\000\106\100\300\000\200\000\000\000\302\000\200\000\135\000\200\001\136\000\000\000\036\000\200\000\002\000\000\000\004\005\000\000\000\155\141\153\145\000\004\020\000\000\000\147\145\164\155\141\153\145\146\151\154\145\156\141\155\145\000\000\000\000\000\007\000\000\000\133\000\000\000\133\000\000\000\133\000\000\000\133\000\000\000\133\000\000\000\133\000\000\000\133\000\000\000\001\000\000\000\005\000\000\000\164\150\151\163\000\000\000\000\000\006\000\000\000\000\000\000\000\070\000\000\000\007\000\000\000\007\000\000\000\016\000\000\000\031\000\000\000\016\000\000\000\042\000\000\000\063\000\000\000\042\000\000\000\072\000\000\000\100\000\000\000\072\000\000\000\107\000\000\000\107\000\000\000\107\000\000\000\110\000\000\000\111\000\000\000\113\000\000\000\113\000\000\000\113\000\000\000\113\000\000\000\113\000\000\000\113\000\000\000\113\000\000\000\115\000\000\000\115\000\000\000\115\000\000\000\115\000\000\000\115\000\000\000\117\000\000\000\120\000\000\000\120\000\000\000\120\000\000\000\120\000\000\000\121\000\000\000\121\000\000\000\121\000\000\000\121\000\000\000\122\000\000\000\124\000\000\000\125\000\000\000\126\000\000\000\126\000\000\000\126\000\000\000\126\000\000\000\127\000\000\000\127\000\000\000\131\000\000\000\132\000\000\000\133\000\000\000\133\000\000\000\133\000\000\000\133\000\000\000\134\000\000\000\134\000\000\000\135\000\000\000\135\000\000\000\000\000\000\000\000\000\000\000",
+ "\033\114\165\141\121\000\001\004\004\004\010\000\042\000\000\000\100\163\162\143\057\141\143\164\151\157\156\163\057\166\163\164\165\144\151\157\057\137\166\163\164\165\144\151\157\056\154\165\141\000\000\000\000\000\000\000\000\000\000\000\002\002\001\000\000\000\036\000\200\000\000\000\000\000\000\000\000\000\001\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000",
+};
+
+int builtin_sizes[] = {
+ 4913,
+ 1482,
+ 2006,
+ 2996,
+ 2370,
+ 3336,
+ 3317,
+ 16242,
+ 9269,
+ 4678,
+ 4229,
+ 1211,
+ 3019,
+ 996,
+ 2301,
+ 2879,
+ 94,
+ 0
+};
diff --git a/src/host/host.c b/src/host/host.c
deleted file mode 100644
index 4175d15..0000000
--- a/src/host/host.c
+++ /dev/null
@@ -1,184 +0,0 @@
-/**
- * \file host.c
- * \brief Main executable API.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include <assert.h>
-#include <stdlib.h>
-#include "premake.h"
-#include "host/host.h"
-#include "script/script.h"
-#include "actions/actions.h"
-#include "base/cstr.h"
-#include "base/env.h"
-#include "base/error.h"
-#include "base/file.h"
-
-
-DEFINE_CLASS(Host)
-{
- Script script;
- const char** args;
-};
-
-
-/**
- * Create a new Premake host object.
- * \returns A new session object, or NULL if the scripting engine fails to start.
- */
-Host host_create()
-{
- Host host;
-
- Script script = script_create();
- if (script == NULL)
- {
- return NULL;
- }
-
- host = ALLOC_CLASS(Host);
- host->script = script;
- host->args = NULL;
- return host;
-}
-
-
-/**
- * Destroy a Premake host object and release the associated memory.
- */
-void host_destroy(Host host)
-{
- assert(host);
- script_destroy(host->script);
- free(host);
-}
-
-
-/**
- * Initial processing and validation of the command line arguments.
- * \returns OKAY on success.
- */
-int host_parse_argv(Host host)
-{
- script_set_action(host->script, host->args[0]);
- env_set_action(host->args[0]);
- return OKAY;
-}
-
-
-/**
- * Display the results of the application run.
- * Any errors returned during the run will be written to stderr; otherwise, a
- * success message is written to stdout.
- */
-int host_report_results()
-{
- const char* error = error_get();
- if (error)
- {
- stream_writeline(Console, "Error: %s", error);
- }
- return OKAY;
-}
-
-
-/**
- * Run the action specified by the user on the command line.
- * \returns OKAY on success.
- */
-int host_run_action(Host host)
-{
- Session sess;
- const char* action;
- int i, z = OKAY;
-
- assert(host);
-
- /* there must be a project file defined or I can go no further */
- if (!file_exists(DEFAULT_SCRIPT_NAME))
- {
- error_set("script file '%s' not found", DEFAULT_SCRIPT_NAME);
- return !OKAY;
- }
-
- /* unload the defined objects from the script */
- sess = script_unload(host->script);
- if (sess == NULL)
- {
- return !OKAY;
- }
-
- /* find the action in the master list and execute the associated callback */
- action = host->args[0];
- for (i = 0; Actions[i].name != NULL; ++i)
- {
- if (cstr_eq(Actions[i].name, action))
- {
- z = Actions[i].callback(sess);
- session_destroy(sess);
- return z;
- }
- }
-
- /* an invalid action was specified */
- error_set("invalid action '%s'", action);
- return !OKAY;
-}
-
-
-/**
- * Find and execute the project script file.
- * \returns OKAY on success.
- */
-int host_run_script(Host host)
-{
- assert(host);
-
- /* run the default file for now. If the script file doesn't exist let execution
- * continue so I can display help, etc. */
- if (file_exists(DEFAULT_SCRIPT_NAME))
- {
- script_run_file(host->script, DEFAULT_SCRIPT_NAME);
- return (error_get() == NULL) ? OKAY : !OKAY;
- }
- else
- {
- return OKAY;
- }
-}
-
-
-/**
- * Remember the list of command-line parameters for subsequent calls
- * to the other host functions later in the processing steps.
- */
-void host_set_argv(Host host, const char** argv)
-{
- /* skip over the progam name in argv[0] and just store the arguments */
- host->args = &argv[1];
-}
-
-
-/**
- * Display help and version messages as appropriate. If any messages are
- * shown, execution of the main step loop will be stopped and the application
- * will exit (this seems to be the standard behavior of POSIX apps when
- * help is requested).
- * \returns OKAY is no help information was required, !OKAY to stop the loop.
- */
-int host_show_help(Host host)
-{
- /* while (arg is option) { */
- /* if (/version) ... */
- /* if (/help) ... */
-
- /* if no action was specified give the user a clue */
- if (host->args[0] == NULL)
- {
- stream_writeline(Console, HOST_SHORT_HELP);
- return !OKAY;
- }
-
- return OKAY;
-}
diff --git a/src/host/host.h b/src/host/host.h
deleted file mode 100644
index d4ca24b..0000000
--- a/src/host/host.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * \file host.h
- * \brief Main executable API.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- *
- * \defgroup host Host
- *
- * The "host" part of the application, which is responsible for parsing the command
- * line arguments, and the overall flow of the application.
- *
- * @{
- */
-#if !defined(PREMAKE_HOST_H)
-#define PREMAKE_HOST_H
-
-#include "objects/session.h"
-
-DECLARE_CLASS(Host)
-
-
-/**
- * The short help message, displayed if Premake is run with no arguments.
- */
-#define HOST_SHORT_HELP "Type 'premake --help' for help."
-
-
-Host host_create();
-void host_destroy(Host host);
-
-int host_parse_argv(Host host);
-int host_report_results(void);
-int host_run_action(Host host);
-int host_run_script(Host host);
-void host_set_argv(Host host, const char** argv);
-int host_show_help(Host host);
-int host_tests(void);
-
-#endif
-/** @} */
diff --git a/src/base/lua-5.1.2/COPYRIGHT b/src/host/lua-5.1.2/COPYRIGHT
index a54a16e..a54a16e 100644
--- a/src/base/lua-5.1.2/COPYRIGHT
+++ b/src/host/lua-5.1.2/COPYRIGHT
diff --git a/src/base/lua-5.1.2/HISTORY b/src/host/lua-5.1.2/HISTORY
index ce0c95b..ce0c95b 100644
--- a/src/base/lua-5.1.2/HISTORY
+++ b/src/host/lua-5.1.2/HISTORY
diff --git a/src/base/lua-5.1.2/INSTALL b/src/host/lua-5.1.2/INSTALL
index 17eb8ae..17eb8ae 100644
--- a/src/base/lua-5.1.2/INSTALL
+++ b/src/host/lua-5.1.2/INSTALL
diff --git a/src/base/lua-5.1.2/Makefile b/src/host/lua-5.1.2/Makefile
index c5ec666..c5ec666 100644
--- a/src/base/lua-5.1.2/Makefile
+++ b/src/host/lua-5.1.2/Makefile
diff --git a/src/base/lua-5.1.2/PREMAKE_CHANGES.txt b/src/host/lua-5.1.2/PREMAKE_CHANGES.txt
index ca2f322..ca2f322 100644
--- a/src/base/lua-5.1.2/PREMAKE_CHANGES.txt
+++ b/src/host/lua-5.1.2/PREMAKE_CHANGES.txt
diff --git a/src/base/lua-5.1.2/README b/src/host/lua-5.1.2/README
index 11b4dff..11b4dff 100644
--- a/src/base/lua-5.1.2/README
+++ b/src/host/lua-5.1.2/README
diff --git a/src/base/lua-5.1.2/doc/amazon.gif b/src/host/lua-5.1.2/doc/amazon.gif
index f2586d5..f2586d5 100644
--- a/src/base/lua-5.1.2/doc/amazon.gif
+++ b/src/host/lua-5.1.2/doc/amazon.gif
Binary files differ
diff --git a/src/base/lua-5.1.2/doc/contents.html b/src/host/lua-5.1.2/doc/contents.html
index 01b069f..01b069f 100644
--- a/src/base/lua-5.1.2/doc/contents.html
+++ b/src/host/lua-5.1.2/doc/contents.html
diff --git a/src/base/lua-5.1.2/doc/cover.png b/src/host/lua-5.1.2/doc/cover.png
index 2dbb198..2dbb198 100644
--- a/src/base/lua-5.1.2/doc/cover.png
+++ b/src/host/lua-5.1.2/doc/cover.png
Binary files differ
diff --git a/src/base/lua-5.1.2/doc/logo.gif b/src/host/lua-5.1.2/doc/logo.gif
index 2f5e4ac..2f5e4ac 100644
--- a/src/base/lua-5.1.2/doc/logo.gif
+++ b/src/host/lua-5.1.2/doc/logo.gif
Binary files differ
diff --git a/src/base/lua-5.1.2/doc/lua.1 b/src/host/lua-5.1.2/doc/lua.1
index 24809cc..24809cc 100644
--- a/src/base/lua-5.1.2/doc/lua.1
+++ b/src/host/lua-5.1.2/doc/lua.1
diff --git a/src/base/lua-5.1.2/doc/lua.css b/src/host/lua-5.1.2/doc/lua.css
index 039cf11..039cf11 100644
--- a/src/base/lua-5.1.2/doc/lua.css
+++ b/src/host/lua-5.1.2/doc/lua.css
diff --git a/src/base/lua-5.1.2/doc/lua.html b/src/host/lua-5.1.2/doc/lua.html
index 1d435ab..1d435ab 100644
--- a/src/base/lua-5.1.2/doc/lua.html
+++ b/src/host/lua-5.1.2/doc/lua.html
diff --git a/src/base/lua-5.1.2/doc/luac.1 b/src/host/lua-5.1.2/doc/luac.1
index d814678..d814678 100644
--- a/src/base/lua-5.1.2/doc/luac.1
+++ b/src/host/lua-5.1.2/doc/luac.1
diff --git a/src/base/lua-5.1.2/doc/luac.html b/src/host/lua-5.1.2/doc/luac.html
index 179ffe8..179ffe8 100644
--- a/src/base/lua-5.1.2/doc/luac.html
+++ b/src/host/lua-5.1.2/doc/luac.html
diff --git a/src/base/lua-5.1.2/doc/manual.css b/src/host/lua-5.1.2/doc/manual.css
index 93f1ab2..93f1ab2 100644
--- a/src/base/lua-5.1.2/doc/manual.css
+++ b/src/host/lua-5.1.2/doc/manual.css
diff --git a/src/base/lua-5.1.2/doc/manual.html b/src/host/lua-5.1.2/doc/manual.html
index 6b137ff..6b137ff 100644
--- a/src/base/lua-5.1.2/doc/manual.html
+++ b/src/host/lua-5.1.2/doc/manual.html
diff --git a/src/base/lua-5.1.2/doc/readme.html b/src/host/lua-5.1.2/doc/readme.html
index 28b1d14..28b1d14 100644
--- a/src/base/lua-5.1.2/doc/readme.html
+++ b/src/host/lua-5.1.2/doc/readme.html
diff --git a/src/base/lua-5.1.2/etc/Makefile b/src/host/lua-5.1.2/etc/Makefile
index 6d00008..6d00008 100644
--- a/src/base/lua-5.1.2/etc/Makefile
+++ b/src/host/lua-5.1.2/etc/Makefile
diff --git a/src/base/lua-5.1.2/etc/README b/src/host/lua-5.1.2/etc/README
index 5149fc9..5149fc9 100644
--- a/src/base/lua-5.1.2/etc/README
+++ b/src/host/lua-5.1.2/etc/README
diff --git a/src/base/lua-5.1.2/etc/all.c b/src/host/lua-5.1.2/etc/all.c
index dab68fa..dab68fa 100644
--- a/src/base/lua-5.1.2/etc/all.c
+++ b/src/host/lua-5.1.2/etc/all.c
diff --git a/src/base/lua-5.1.2/etc/lua.hpp b/src/host/lua-5.1.2/etc/lua.hpp
index ec417f5..ec417f5 100644
--- a/src/base/lua-5.1.2/etc/lua.hpp
+++ b/src/host/lua-5.1.2/etc/lua.hpp
diff --git a/src/base/lua-5.1.2/etc/lua.ico b/src/host/lua-5.1.2/etc/lua.ico
index ccbabc4..ccbabc4 100644
--- a/src/base/lua-5.1.2/etc/lua.ico
+++ b/src/host/lua-5.1.2/etc/lua.ico
Binary files differ
diff --git a/src/base/lua-5.1.2/etc/lua.pc b/src/host/lua-5.1.2/etc/lua.pc
index 03a2e68..03a2e68 100644
--- a/src/base/lua-5.1.2/etc/lua.pc
+++ b/src/host/lua-5.1.2/etc/lua.pc
diff --git a/src/base/lua-5.1.2/etc/luavs.bat b/src/host/lua-5.1.2/etc/luavs.bat
index 6b1120b..6b1120b 100644
--- a/src/base/lua-5.1.2/etc/luavs.bat
+++ b/src/host/lua-5.1.2/etc/luavs.bat
diff --git a/src/base/lua-5.1.2/etc/min.c b/src/host/lua-5.1.2/etc/min.c
index 404bd50..404bd50 100644
--- a/src/base/lua-5.1.2/etc/min.c
+++ b/src/host/lua-5.1.2/etc/min.c
diff --git a/src/base/lua-5.1.2/etc/noparser.c b/src/host/lua-5.1.2/etc/noparser.c
index 13ba546..13ba546 100644
--- a/src/base/lua-5.1.2/etc/noparser.c
+++ b/src/host/lua-5.1.2/etc/noparser.c
diff --git a/src/base/lua-5.1.2/etc/strict.lua b/src/host/lua-5.1.2/etc/strict.lua
index 16ee26b..16ee26b 100644
--- a/src/base/lua-5.1.2/etc/strict.lua
+++ b/src/host/lua-5.1.2/etc/strict.lua
diff --git a/src/base/lua-5.1.2/src/Makefile b/src/host/lua-5.1.2/src/Makefile
index cd7f6ba..cd7f6ba 100644
--- a/src/base/lua-5.1.2/src/Makefile
+++ b/src/host/lua-5.1.2/src/Makefile
diff --git a/src/base/lua-5.1.2/src/lapi.c b/src/host/lua-5.1.2/src/lapi.c
index 7c532b8..7c532b8 100644
--- a/src/base/lua-5.1.2/src/lapi.c
+++ b/src/host/lua-5.1.2/src/lapi.c
diff --git a/src/base/lua-5.1.2/src/lapi.h b/src/host/lua-5.1.2/src/lapi.h
index 9d1d435..9d1d435 100644
--- a/src/base/lua-5.1.2/src/lapi.h
+++ b/src/host/lua-5.1.2/src/lapi.h
diff --git a/src/base/lua-5.1.2/src/lauxlib.c b/src/host/lua-5.1.2/src/lauxlib.c
index 96a6b85..96a6b85 100644
--- a/src/base/lua-5.1.2/src/lauxlib.c
+++ b/src/host/lua-5.1.2/src/lauxlib.c
diff --git a/src/base/lua-5.1.2/src/lauxlib.h b/src/host/lua-5.1.2/src/lauxlib.h
index 1f34308..1f34308 100644
--- a/src/base/lua-5.1.2/src/lauxlib.h
+++ b/src/host/lua-5.1.2/src/lauxlib.h
diff --git a/src/base/lua-5.1.2/src/lbaselib.c b/src/host/lua-5.1.2/src/lbaselib.c
index 147a727..147a727 100644
--- a/src/base/lua-5.1.2/src/lbaselib.c
+++ b/src/host/lua-5.1.2/src/lbaselib.c
diff --git a/src/base/lua-5.1.2/src/lcode.c b/src/host/lua-5.1.2/src/lcode.c
index 9ce515a..9ce515a 100644
--- a/src/base/lua-5.1.2/src/lcode.c
+++ b/src/host/lua-5.1.2/src/lcode.c
diff --git a/src/base/lua-5.1.2/src/lcode.h b/src/host/lua-5.1.2/src/lcode.h
index c02cb2b..c02cb2b 100644
--- a/src/base/lua-5.1.2/src/lcode.h
+++ b/src/host/lua-5.1.2/src/lcode.h
diff --git a/src/base/lua-5.1.2/src/ldblib.c b/src/host/lua-5.1.2/src/ldblib.c
index 26a19b6..26a19b6 100644
--- a/src/base/lua-5.1.2/src/ldblib.c
+++ b/src/host/lua-5.1.2/src/ldblib.c
diff --git a/src/base/lua-5.1.2/src/ldebug.c b/src/host/lua-5.1.2/src/ldebug.c
index 9c8bdf2..9c8bdf2 100644
--- a/src/base/lua-5.1.2/src/ldebug.c
+++ b/src/host/lua-5.1.2/src/ldebug.c
diff --git a/src/base/lua-5.1.2/src/ldebug.h b/src/host/lua-5.1.2/src/ldebug.h
index 9c76aa1..9c76aa1 100644
--- a/src/base/lua-5.1.2/src/ldebug.h
+++ b/src/host/lua-5.1.2/src/ldebug.h
diff --git a/src/base/lua-5.1.2/src/ldo.c b/src/host/lua-5.1.2/src/ldo.c
index ab86fb7..ab86fb7 100644
--- a/src/base/lua-5.1.2/src/ldo.c
+++ b/src/host/lua-5.1.2/src/ldo.c
diff --git a/src/base/lua-5.1.2/src/ldo.h b/src/host/lua-5.1.2/src/ldo.h
index b2de92b..b2de92b 100644
--- a/src/base/lua-5.1.2/src/ldo.h
+++ b/src/host/lua-5.1.2/src/ldo.h
diff --git a/src/base/lua-5.1.2/src/ldump.c b/src/host/lua-5.1.2/src/ldump.c
index f08277d..f08277d 100644
--- a/src/base/lua-5.1.2/src/ldump.c
+++ b/src/host/lua-5.1.2/src/ldump.c
diff --git a/src/base/lua-5.1.2/src/lfunc.c b/src/host/lua-5.1.2/src/lfunc.c
index 05bd5ff..05bd5ff 100644
--- a/src/base/lua-5.1.2/src/lfunc.c
+++ b/src/host/lua-5.1.2/src/lfunc.c
diff --git a/src/base/lua-5.1.2/src/lfunc.h b/src/host/lua-5.1.2/src/lfunc.h
index 2e02419..2e02419 100644
--- a/src/base/lua-5.1.2/src/lfunc.h
+++ b/src/host/lua-5.1.2/src/lfunc.h
diff --git a/src/base/lua-5.1.2/src/lgc.c b/src/host/lua-5.1.2/src/lgc.c
index 2d24a12..2d24a12 100644
--- a/src/base/lua-5.1.2/src/lgc.c
+++ b/src/host/lua-5.1.2/src/lgc.c
diff --git a/src/base/lua-5.1.2/src/lgc.h b/src/host/lua-5.1.2/src/lgc.h
index 5f69acb..5f69acb 100644
--- a/src/base/lua-5.1.2/src/lgc.h
+++ b/src/host/lua-5.1.2/src/lgc.h
diff --git a/src/base/lua-5.1.2/src/linit.c b/src/host/lua-5.1.2/src/linit.c
index 483d9c8..483d9c8 100644
--- a/src/base/lua-5.1.2/src/linit.c
+++ b/src/host/lua-5.1.2/src/linit.c
diff --git a/src/base/lua-5.1.2/src/liolib.c b/src/host/lua-5.1.2/src/liolib.c
index be60972..be60972 100644
--- a/src/base/lua-5.1.2/src/liolib.c
+++ b/src/host/lua-5.1.2/src/liolib.c
diff --git a/src/base/lua-5.1.2/src/llex.c b/src/host/lua-5.1.2/src/llex.c
index 1c07cad..1c07cad 100644
--- a/src/base/lua-5.1.2/src/llex.c
+++ b/src/host/lua-5.1.2/src/llex.c
diff --git a/src/base/lua-5.1.2/src/llex.h b/src/host/lua-5.1.2/src/llex.h
index ff07e83..ff07e83 100644
--- a/src/base/lua-5.1.2/src/llex.h
+++ b/src/host/lua-5.1.2/src/llex.h
diff --git a/src/base/lua-5.1.2/src/llimits.h b/src/host/lua-5.1.2/src/llimits.h
index b03221a..b03221a 100644
--- a/src/base/lua-5.1.2/src/llimits.h
+++ b/src/host/lua-5.1.2/src/llimits.h
diff --git a/src/base/lua-5.1.2/src/lmathlib.c b/src/host/lua-5.1.2/src/lmathlib.c
index d181a73..d181a73 100644
--- a/src/base/lua-5.1.2/src/lmathlib.c
+++ b/src/host/lua-5.1.2/src/lmathlib.c
diff --git a/src/base/lua-5.1.2/src/lmem.c b/src/host/lua-5.1.2/src/lmem.c
index cef2bc5..cef2bc5 100644
--- a/src/base/lua-5.1.2/src/lmem.c
+++ b/src/host/lua-5.1.2/src/lmem.c
diff --git a/src/base/lua-5.1.2/src/lmem.h b/src/host/lua-5.1.2/src/lmem.h
index 19df1fb..19df1fb 100644
--- a/src/base/lua-5.1.2/src/lmem.h
+++ b/src/host/lua-5.1.2/src/lmem.h
diff --git a/src/base/lua-5.1.2/src/loadlib.c b/src/host/lua-5.1.2/src/loadlib.c
index 808368b..808368b 100644
--- a/src/base/lua-5.1.2/src/loadlib.c
+++ b/src/host/lua-5.1.2/src/loadlib.c
diff --git a/src/base/lua-5.1.2/src/lobject.c b/src/host/lua-5.1.2/src/lobject.c
index acde82c..acde82c 100644
--- a/src/base/lua-5.1.2/src/lobject.c
+++ b/src/host/lua-5.1.2/src/lobject.c
diff --git a/src/base/lua-5.1.2/src/lobject.h b/src/host/lua-5.1.2/src/lobject.h
index 8ce4405..8ce4405 100644
--- a/src/base/lua-5.1.2/src/lobject.h
+++ b/src/host/lua-5.1.2/src/lobject.h
diff --git a/src/base/lua-5.1.2/src/lopcodes.c b/src/host/lua-5.1.2/src/lopcodes.c
index bf9cd52..bf9cd52 100644
--- a/src/base/lua-5.1.2/src/lopcodes.c
+++ b/src/host/lua-5.1.2/src/lopcodes.c
diff --git a/src/base/lua-5.1.2/src/lopcodes.h b/src/host/lua-5.1.2/src/lopcodes.h
index 48105f1..48105f1 100644
--- a/src/base/lua-5.1.2/src/lopcodes.h
+++ b/src/host/lua-5.1.2/src/lopcodes.h
diff --git a/src/base/lua-5.1.2/src/loslib.c b/src/host/lua-5.1.2/src/loslib.c
index fdda474..fdda474 100644
--- a/src/base/lua-5.1.2/src/loslib.c
+++ b/src/host/lua-5.1.2/src/loslib.c
diff --git a/src/base/lua-5.1.2/src/lparser.c b/src/host/lua-5.1.2/src/lparser.c
index 6c473c4..6c473c4 100644
--- a/src/base/lua-5.1.2/src/lparser.c
+++ b/src/host/lua-5.1.2/src/lparser.c
diff --git a/src/base/lua-5.1.2/src/lparser.h b/src/host/lua-5.1.2/src/lparser.h
index e5b5b57..e5b5b57 100644
--- a/src/base/lua-5.1.2/src/lparser.h
+++ b/src/host/lua-5.1.2/src/lparser.h
diff --git a/src/base/lua-5.1.2/src/lstate.c b/src/host/lua-5.1.2/src/lstate.c
index 4bcb759..4bcb759 100644
--- a/src/base/lua-5.1.2/src/lstate.c
+++ b/src/host/lua-5.1.2/src/lstate.c
diff --git a/src/base/lua-5.1.2/src/lstate.h b/src/host/lua-5.1.2/src/lstate.h
index d296a4c..d296a4c 100644
--- a/src/base/lua-5.1.2/src/lstate.h
+++ b/src/host/lua-5.1.2/src/lstate.h
diff --git a/src/base/lua-5.1.2/src/lstring.c b/src/host/lua-5.1.2/src/lstring.c
index 4319930..4319930 100644
--- a/src/base/lua-5.1.2/src/lstring.c
+++ b/src/host/lua-5.1.2/src/lstring.c
diff --git a/src/base/lua-5.1.2/src/lstring.h b/src/host/lua-5.1.2/src/lstring.h
index 1d2e91e..1d2e91e 100644
--- a/src/base/lua-5.1.2/src/lstring.h
+++ b/src/host/lua-5.1.2/src/lstring.h
diff --git a/src/base/lua-5.1.2/src/lstrlib.c b/src/host/lua-5.1.2/src/lstrlib.c
index fc7ae48..fc7ae48 100644
--- a/src/base/lua-5.1.2/src/lstrlib.c
+++ b/src/host/lua-5.1.2/src/lstrlib.c
diff --git a/src/base/lua-5.1.2/src/ltable.c b/src/host/lua-5.1.2/src/ltable.c
index bc91cac..bc91cac 100644
--- a/src/base/lua-5.1.2/src/ltable.c
+++ b/src/host/lua-5.1.2/src/ltable.c
diff --git a/src/base/lua-5.1.2/src/ltable.h b/src/host/lua-5.1.2/src/ltable.h
index 09193cd..09193cd 100644
--- a/src/base/lua-5.1.2/src/ltable.h
+++ b/src/host/lua-5.1.2/src/ltable.h
diff --git a/src/base/lua-5.1.2/src/ltablib.c b/src/host/lua-5.1.2/src/ltablib.c
index 453b23b..453b23b 100644
--- a/src/base/lua-5.1.2/src/ltablib.c
+++ b/src/host/lua-5.1.2/src/ltablib.c
diff --git a/src/base/lua-5.1.2/src/ltm.c b/src/host/lua-5.1.2/src/ltm.c
index 097b815..097b815 100644
--- a/src/base/lua-5.1.2/src/ltm.c
+++ b/src/host/lua-5.1.2/src/ltm.c
diff --git a/src/base/lua-5.1.2/src/ltm.h b/src/host/lua-5.1.2/src/ltm.h
index 866c796..866c796 100644
--- a/src/base/lua-5.1.2/src/ltm.h
+++ b/src/host/lua-5.1.2/src/ltm.h
diff --git a/src/base/lua-5.1.2/src/lua.c b/src/host/lua-5.1.2/src/lua.c
index 5cee7fa..5cee7fa 100644
--- a/src/base/lua-5.1.2/src/lua.c
+++ b/src/host/lua-5.1.2/src/lua.c
diff --git a/src/base/lua-5.1.2/src/lua.h b/src/host/lua-5.1.2/src/lua.h
index 2865a7f..2865a7f 100644
--- a/src/base/lua-5.1.2/src/lua.h
+++ b/src/host/lua-5.1.2/src/lua.h
diff --git a/src/base/lua-5.1.2/src/luac.c b/src/host/lua-5.1.2/src/luac.c
index d070173..d070173 100644
--- a/src/base/lua-5.1.2/src/luac.c
+++ b/src/host/lua-5.1.2/src/luac.c
diff --git a/src/base/lua-5.1.2/src/luaconf.h b/src/host/lua-5.1.2/src/luaconf.h
index cfc12dc..cfc12dc 100644
--- a/src/base/lua-5.1.2/src/luaconf.h
+++ b/src/host/lua-5.1.2/src/luaconf.h
diff --git a/src/base/lua-5.1.2/src/lualib.h b/src/host/lua-5.1.2/src/lualib.h
index 0c76232..0c76232 100644
--- a/src/base/lua-5.1.2/src/lualib.h
+++ b/src/host/lua-5.1.2/src/lualib.h
diff --git a/src/base/lua-5.1.2/src/lundump.c b/src/host/lua-5.1.2/src/lundump.c
index 7fc635e..7fc635e 100644
--- a/src/base/lua-5.1.2/src/lundump.c
+++ b/src/host/lua-5.1.2/src/lundump.c
diff --git a/src/base/lua-5.1.2/src/lundump.h b/src/host/lua-5.1.2/src/lundump.h
index 58cca5d..58cca5d 100644
--- a/src/base/lua-5.1.2/src/lundump.h
+++ b/src/host/lua-5.1.2/src/lundump.h
diff --git a/src/base/lua-5.1.2/src/lvm.c b/src/host/lua-5.1.2/src/lvm.c
index 08802f4..08802f4 100644
--- a/src/base/lua-5.1.2/src/lvm.c
+++ b/src/host/lua-5.1.2/src/lvm.c
diff --git a/src/base/lua-5.1.2/src/lvm.h b/src/host/lua-5.1.2/src/lvm.h
index 788423f..788423f 100644
--- a/src/base/lua-5.1.2/src/lvm.h
+++ b/src/host/lua-5.1.2/src/lvm.h
diff --git a/src/base/lua-5.1.2/src/lzio.c b/src/host/lua-5.1.2/src/lzio.c
index 5121ada..5121ada 100644
--- a/src/base/lua-5.1.2/src/lzio.c
+++ b/src/host/lua-5.1.2/src/lzio.c
diff --git a/src/base/lua-5.1.2/src/lzio.h b/src/host/lua-5.1.2/src/lzio.h
index 8f403b8..8f403b8 100644
--- a/src/base/lua-5.1.2/src/lzio.h
+++ b/src/host/lua-5.1.2/src/lzio.h
diff --git a/src/base/lua-5.1.2/src/print.c b/src/host/lua-5.1.2/src/print.c
index e240cfc..e240cfc 100644
--- a/src/base/lua-5.1.2/src/print.c
+++ b/src/host/lua-5.1.2/src/print.c
diff --git a/src/base/lua-5.1.2/test/README b/src/host/lua-5.1.2/test/README
index 0c7f38b..0c7f38b 100644
--- a/src/base/lua-5.1.2/test/README
+++ b/src/host/lua-5.1.2/test/README
diff --git a/src/base/lua-5.1.2/test/bisect.lua b/src/host/lua-5.1.2/test/bisect.lua
index f91e69b..f91e69b 100644
--- a/src/base/lua-5.1.2/test/bisect.lua
+++ b/src/host/lua-5.1.2/test/bisect.lua
diff --git a/src/base/lua-5.1.2/test/cf.lua b/src/host/lua-5.1.2/test/cf.lua
index 8cda54b..8cda54b 100644
--- a/src/base/lua-5.1.2/test/cf.lua
+++ b/src/host/lua-5.1.2/test/cf.lua
diff --git a/src/base/lua-5.1.2/test/echo.lua b/src/host/lua-5.1.2/test/echo.lua
index 4313439..4313439 100644
--- a/src/base/lua-5.1.2/test/echo.lua
+++ b/src/host/lua-5.1.2/test/echo.lua
diff --git a/src/base/lua-5.1.2/test/env.lua b/src/host/lua-5.1.2/test/env.lua
index 9e62a57..9e62a57 100644
--- a/src/base/lua-5.1.2/test/env.lua
+++ b/src/host/lua-5.1.2/test/env.lua
diff --git a/src/base/lua-5.1.2/test/factorial.lua b/src/host/lua-5.1.2/test/factorial.lua
index 7c4cf0f..7c4cf0f 100644
--- a/src/base/lua-5.1.2/test/factorial.lua
+++ b/src/host/lua-5.1.2/test/factorial.lua
diff --git a/src/base/lua-5.1.2/test/fib.lua b/src/host/lua-5.1.2/test/fib.lua
index 97a921b..97a921b 100644
--- a/src/base/lua-5.1.2/test/fib.lua
+++ b/src/host/lua-5.1.2/test/fib.lua
diff --git a/src/base/lua-5.1.2/test/fibfor.lua b/src/host/lua-5.1.2/test/fibfor.lua
index 8bbba39..8bbba39 100644
--- a/src/base/lua-5.1.2/test/fibfor.lua
+++ b/src/host/lua-5.1.2/test/fibfor.lua
diff --git a/src/base/lua-5.1.2/test/globals.lua b/src/host/lua-5.1.2/test/globals.lua
index d4c20e1..d4c20e1 100644
--- a/src/base/lua-5.1.2/test/globals.lua
+++ b/src/host/lua-5.1.2/test/globals.lua
diff --git a/src/base/lua-5.1.2/test/hello.lua b/src/host/lua-5.1.2/test/hello.lua
index 0925498..0925498 100644
--- a/src/base/lua-5.1.2/test/hello.lua
+++ b/src/host/lua-5.1.2/test/hello.lua
diff --git a/src/base/lua-5.1.2/test/life.lua b/src/host/lua-5.1.2/test/life.lua
index 911d9fe..911d9fe 100644
--- a/src/base/lua-5.1.2/test/life.lua
+++ b/src/host/lua-5.1.2/test/life.lua
diff --git a/src/base/lua-5.1.2/test/luac.lua b/src/host/lua-5.1.2/test/luac.lua
index 96a0a97..96a0a97 100644
--- a/src/base/lua-5.1.2/test/luac.lua
+++ b/src/host/lua-5.1.2/test/luac.lua
diff --git a/src/base/lua-5.1.2/test/printf.lua b/src/host/lua-5.1.2/test/printf.lua
index 58c63ff..58c63ff 100644
--- a/src/base/lua-5.1.2/test/printf.lua
+++ b/src/host/lua-5.1.2/test/printf.lua
diff --git a/src/base/lua-5.1.2/test/readonly.lua b/src/host/lua-5.1.2/test/readonly.lua
index 85c0b4e..85c0b4e 100644
--- a/src/base/lua-5.1.2/test/readonly.lua
+++ b/src/host/lua-5.1.2/test/readonly.lua
diff --git a/src/base/lua-5.1.2/test/sieve.lua b/src/host/lua-5.1.2/test/sieve.lua
index 0871bb2..0871bb2 100644
--- a/src/base/lua-5.1.2/test/sieve.lua
+++ b/src/host/lua-5.1.2/test/sieve.lua
diff --git a/src/base/lua-5.1.2/test/sort.lua b/src/host/lua-5.1.2/test/sort.lua
index 0bcb15f..0bcb15f 100644
--- a/src/base/lua-5.1.2/test/sort.lua
+++ b/src/host/lua-5.1.2/test/sort.lua
diff --git a/src/base/lua-5.1.2/test/table.lua b/src/host/lua-5.1.2/test/table.lua
index 235089c..235089c 100644
--- a/src/base/lua-5.1.2/test/table.lua
+++ b/src/host/lua-5.1.2/test/table.lua
diff --git a/src/base/lua-5.1.2/test/trace-calls.lua b/src/host/lua-5.1.2/test/trace-calls.lua
index 6d7a7b3..6d7a7b3 100644
--- a/src/base/lua-5.1.2/test/trace-calls.lua
+++ b/src/host/lua-5.1.2/test/trace-calls.lua
diff --git a/src/base/lua-5.1.2/test/trace-globals.lua b/src/host/lua-5.1.2/test/trace-globals.lua
index 295e670..295e670 100644
--- a/src/base/lua-5.1.2/test/trace-globals.lua
+++ b/src/host/lua-5.1.2/test/trace-globals.lua
diff --git a/src/base/lua-5.1.2/test/xd.lua b/src/host/lua-5.1.2/test/xd.lua
index ebc3eff..ebc3eff 100644
--- a/src/base/lua-5.1.2/test/xd.lua
+++ b/src/host/lua-5.1.2/test/xd.lua
diff --git a/src/host/os_chdir.c b/src/host/os_chdir.c
new file mode 100644
index 0000000..3acce68
--- /dev/null
+++ b/src/host/os_chdir.c
@@ -0,0 +1,32 @@
+/**
+ * \file os_chdir.c
+ * \brief Change the current working directory.
+ * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
+ */
+
+#include "premake.h"
+
+
+int os_chdir(lua_State* L)
+{
+ int z;
+ const char* path = luaL_checkstring(L, 1);
+
+#if PLATFORM_WINDOWS
+ z = SetCurrentDirectory(path);
+#else
+ z = !chdir(path);
+#endif
+
+ if (!z)
+ {
+ lua_pushnil(L);
+ lua_pushfstring(L, "unable to switch to directory '%s'", path);
+ return 2;
+ }
+ else
+ {
+ lua_pushboolean(L, 1);
+ return 1;
+ }
+}
diff --git a/src/host/os_getcwd.c b/src/host/os_getcwd.c
new file mode 100644
index 0000000..0dc5538
--- /dev/null
+++ b/src/host/os_getcwd.c
@@ -0,0 +1,30 @@
+/**
+ * \file os_getcwd.c
+ * \brief Retrieve the current working directory.
+ * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
+ */
+
+#include "premake.h"
+
+int os_getcwd(lua_State* L)
+{
+ char buffer[0x4000];
+ char* ch;
+
+#if PLATFORM_WINDOWS
+ GetCurrentDirectory(0x4000, buffer);
+#else
+ getcwd(buffer, 0x4000);
+#endif
+
+ /* convert to platform-neutral directory separators */
+ for (ch = buffer; *ch != '\0'; ++ch)
+ {
+ if (*ch == '\\') *ch = '/';
+ }
+
+ lua_pushstring(L, buffer);
+ return 1;
+}
+
+
diff --git a/src/host/os_isdir.c b/src/host/os_isdir.c
new file mode 100644
index 0000000..fb5e8bb
--- /dev/null
+++ b/src/host/os_isdir.c
@@ -0,0 +1,34 @@
+/**
+ * \file os_isdir.c
+ * \brief Returns true if the specified directory exists.
+ * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
+ */
+
+#include <string.h>
+#include <sys/stat.h>
+#include "premake.h"
+
+
+int os_isdir(lua_State* L)
+{
+ struct stat buf;
+ const char* path = luaL_checkstring(L, 1);
+
+ /* empty path is equivalent to ".", must be true */
+ if (strlen(path) == 0)
+ {
+ lua_pushboolean(L, 1);
+ }
+ else if (stat(path, &buf) == 0)
+ {
+ lua_pushboolean(L, buf.st_mode & S_IFDIR);
+ }
+ else
+ {
+ lua_pushboolean(L, 0);
+ }
+
+ return 1;
+}
+
+
diff --git a/src/host/os_isfile.c b/src/host/os_isfile.c
new file mode 100644
index 0000000..61e0def
--- /dev/null
+++ b/src/host/os_isfile.c
@@ -0,0 +1,30 @@
+/**
+ * \file os_isfile.c
+ * \brief Returns true if the given file exists on the file system.
+ * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
+ */
+
+#include <sys/stat.h>
+#include "premake.h"
+
+
+int os_isfile(lua_State* L)
+{
+ const char* filename = luaL_checkstring(L, 1);
+ lua_pushboolean(L, do_isfile(filename));
+ return 1;
+}
+
+
+int do_isfile(const char* filename)
+{
+ struct stat buf;
+ if (stat(filename, &buf) == 0)
+ {
+ return ((buf.st_mode & S_IFDIR) == 0);
+ }
+ else
+ {
+ return 0;
+ }
+}
diff --git a/src/host/os_match.c b/src/host/os_match.c
new file mode 100644
index 0000000..e96b6b5
--- /dev/null
+++ b/src/host/os_match.c
@@ -0,0 +1,178 @@
+/**
+ * \file os_match.c
+ * \brief Match files and directories.
+ * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include "premake.h"
+
+
+#if PLATFORM_WINDOWS
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+typedef struct struct_MatchInfo
+{
+ HANDLE handle;
+ int is_first;
+ WIN32_FIND_DATA entry;
+} MatchInfo;
+
+int os_matchstart(lua_State* L)
+{
+ const char* mask = luaL_checkstring(L, 1);
+ MatchInfo* m = (MatchInfo*)malloc(sizeof(MatchInfo));
+ m->handle = FindFirstFile(mask, &m->entry);
+ m->is_first = 1;
+ lua_pushlightuserdata(L, m);
+ return 1;
+}
+
+int os_matchdone(lua_State* L)
+{
+ MatchInfo* m = (MatchInfo*)lua_touserdata(L, 1);
+ if (m->handle != INVALID_HANDLE_VALUE)
+ FindClose(m->handle);
+ free(m);
+ return 0;
+}
+
+int os_matchname(lua_State* L)
+{
+ MatchInfo* m = (MatchInfo*)lua_touserdata(L, 1);
+ lua_pushstring(L, m->entry.cFileName);
+ return 1;
+}
+
+int os_matchisfile(lua_State* L)
+{
+ MatchInfo* m = (MatchInfo*)lua_touserdata(L, 1);
+ lua_pushboolean(L, (m->entry.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0);
+ return 1;
+}
+
+int os_matchnext(lua_State* L)
+{
+ MatchInfo* m = (MatchInfo*)lua_touserdata(L, 1);
+ if (m->handle == INVALID_HANDLE_VALUE)
+ return 0;
+
+ while (1)
+ {
+ if (!m->is_first)
+ {
+ if (!FindNextFile(m->handle, &m->entry))
+ return 0;
+ }
+
+ m->is_first = 0;
+ if (m->entry.cFileName[0] != '.')
+ {
+ lua_pushboolean(L, 1);
+ return 1;
+ }
+ }
+}
+
+#else
+
+#include <dirent.h>
+#include <fnmatch.h>
+#include <sys/stat.h>
+
+typedef struct struct_MatchInfo
+{
+ DIR* handle;
+ struct dirent* entry;
+ char* path;
+ char* mask;
+} MatchInfo;
+
+int os_matchstart(lua_State* L)
+{
+ const char* split;
+ const char* mask = luaL_checkstring(L, 1);
+ MatchInfo* m = (MatchInfo*)malloc(sizeof(MatchInfo));
+
+ /* split the mask into path and filename components */
+ split = strrchr(mask, '/');
+ if (split)
+ {
+ m->path = (char*)malloc(split - mask + 1);
+ strncpy(m->path, mask, split - mask);
+ m->path[split - mask] = '\0';
+ m->mask = (char*)(split + 1);
+ }
+ else
+ {
+ m->path = (char*)malloc(2);
+ strcpy(m->path, ".");
+ m->mask = (char*)mask;
+ }
+
+ m->handle = opendir(m->path);
+ lua_pushlightuserdata(L, m);
+ return 1;
+}
+
+int os_matchdone(lua_State* L)
+{
+ MatchInfo* m = (MatchInfo*)lua_touserdata(L, 1);
+ if (m->handle != NULL)
+ closedir(m->handle);
+ free(m->path);
+ free(m);
+ return 0;
+}
+
+int os_matchname(lua_State* L)
+{
+ MatchInfo* m = (MatchInfo*)lua_touserdata(L, 1);
+ lua_pushstring(L, m->entry->d_name);
+ return 1;
+}
+
+int os_matchisfile(lua_State* L)
+{
+ struct stat info;
+ const char* fname;
+
+ MatchInfo* m = (MatchInfo*)lua_touserdata(L, 1);
+ lua_pushfstring(L, "%s/%s", m->path, m->entry->d_name);
+ fname = lua_tostring(L, -1);
+ lua_pop(L, 1);
+
+ if (stat(fname, &info) == 0)
+ {
+ lua_pushboolean(L, S_ISREG(info.st_mode));
+ return 1;
+ }
+
+ return 0;
+}
+
+int os_matchnext(lua_State* L)
+{
+ MatchInfo* m = (MatchInfo*)lua_touserdata(L, 1);
+ if (m->handle == NULL)
+ return 0;
+
+ m->entry = readdir(m->handle);
+ while (m->entry != NULL)
+ {
+ const char* name = m->entry->d_name;
+ if (strcmp(name, ".") && strcmp(name,"..") && fnmatch(m->mask, name, 0) == 0)
+ {
+ lua_pushboolean(L, 1);
+ return 1;
+ }
+ m->entry = readdir(m->handle);
+ }
+
+ return 0;
+}
+
+#endif
diff --git a/src/host/os_mkdir.c b/src/host/os_mkdir.c
new file mode 100644
index 0000000..a7a69db
--- /dev/null
+++ b/src/host/os_mkdir.c
@@ -0,0 +1,33 @@
+/**
+ * \file os_mkdir.c
+ * \brief Create a subdirectory.
+ * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
+ */
+
+#include <sys/stat.h>
+#include "premake.h"
+
+
+int os_mkdir(lua_State* L)
+{
+ int z;
+ const char* path = luaL_checkstring(L, 1);
+
+#if PLATFORM_WINDOWS
+ z = CreateDirectory(path, NULL);
+#else
+ z = (mkdir(path, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) == 0);
+#endif
+
+ if (!z)
+ {
+ lua_pushnil(L);
+ lua_pushfstring(L, "unable to create directory '%s'", path);
+ return 2;
+ }
+ else
+ {
+ lua_pushboolean(L, 1);
+ return 1;
+ }
+}
diff --git a/src/host/os_pathsearch.c b/src/host/os_pathsearch.c
new file mode 100644
index 0000000..1e26333
--- /dev/null
+++ b/src/host/os_pathsearch.c
@@ -0,0 +1,84 @@
+/**
+ * \file os_pathsearch.c
+ * \brief Locates a file, given a set of search paths.
+ * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
+ *
+ * \note This function is required by the bootstrapping code; it must be
+ * implemented here in the host and not scripted.
+ */
+
+#include <string.h>
+#include "premake.h"
+
+
+int os_pathsearch(lua_State* L)
+{
+ int i;
+ for (i = 2; i <= lua_gettop(L); ++i)
+ {
+ const char* path;
+
+ if (lua_isnil(L, i))
+ continue;
+
+ path = luaL_checkstring(L, i);
+ do
+ {
+ const char* split;
+
+ /* look for the closest path separator ; or : */
+ /* can't use : on windows because it breaks on C:\path */
+ const char* semi = strchr(path, ';');
+#if !defined(PLATFORM_WINDOWS)
+ const char* full = strchr(path, ':');
+#else
+ const char* full = NULL;
+#endif
+
+ if (!semi)
+ {
+ split = full;
+ }
+ else if (!full)
+ {
+ split = semi;
+ }
+ else
+ {
+ split = (semi < full) ? semi : full;
+ }
+
+ /* push this piece of the full search string onto the stack */
+ if (split)
+ {
+ lua_pushlstring(L, path, split - path);
+ }
+ else
+ {
+ lua_pushstring(L, path);
+ }
+
+ /* keep an extra copy around, so I can return it if I have a match */
+ lua_pushvalue(L, -1);
+
+ /* append the filename to make the full test path */
+ lua_pushstring(L, "/");
+ lua_pushvalue(L, 1);
+ lua_concat(L, 3);
+
+ /* test it - if it exists return the path */
+ if (do_isfile(lua_tostring(L, -1)))
+ {
+ lua_pop(L, 1);
+ return 1;
+ }
+
+ /* no match, set up the next try */
+ lua_pop(L, 2);
+ path = (split) ? split + 1 : NULL;
+ }
+ while (path);
+ }
+
+ return 0;
+}
diff --git a/src/host/os_rmdir.c b/src/host/os_rmdir.c
new file mode 100644
index 0000000..cdfc75c
--- /dev/null
+++ b/src/host/os_rmdir.c
@@ -0,0 +1,35 @@
+/**
+ * \file os_rmdir.c
+ * \brief Remove a subdirectory.
+ * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
+ */
+
+#include <stdlib.h>
+#include "premake.h"
+
+
+int os_rmdir(lua_State* L)
+{
+ int z;
+ const char* path = luaL_checkstring(L, 1);
+
+#if PLATFORM_WINDOWS
+ z = RemoveDirectory(path);
+#else
+ lua_pushfstring(L, "rm -rf %s", path);
+ z = (system(lua_tostring(L, -1)) == 0);
+ lua_pop(L, 1);
+#endif
+
+ if (!z)
+ {
+ lua_pushnil(L);
+ lua_pushfstring(L, "unable to remove directory '%s'", path);
+ return 2;
+ }
+ else
+ {
+ lua_pushboolean(L, 1);
+ return 1;
+ }
+}
diff --git a/src/host/premake.c b/src/host/premake.c
new file mode 100644
index 0000000..cecca20
--- /dev/null
+++ b/src/host/premake.c
@@ -0,0 +1,265 @@
+/**
+ * \file premake.c
+ * \brief Program entry point.
+ * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include "premake.h"
+
+
+#define VERSION "SVN"
+#define COPYRIGHT "Copyright (C) 2002-2008 Jason Perkins and the Premake Project"
+#define ERROR_MESSAGE "%s\n"
+
+
+static int process_arguments(lua_State* L, int argc, const char** argv);
+static int process_option(lua_State* L, const char* arg);
+static int load_builtin_scripts(lua_State* L);
+
+
+/* A search path for script files */
+static const char* scripts_path = NULL;
+
+
+/* precompiled bytecode buffer; in bytecode.c */
+extern const char* builtin_bytecode[];
+extern int builtin_sizes[];
+
+
+/* Built-in functions */
+static const luaL_Reg os_functions[] = {
+ { "chdir", os_chdir },
+ { "isdir", os_isdir },
+ { "getcwd", os_getcwd },
+ { "isfile", os_isfile },
+ { "matchdone", os_matchdone },
+ { "matchisfile", os_matchisfile },
+ { "matchname", os_matchname },
+ { "matchnext", os_matchnext },
+ { "matchstart", os_matchstart },
+ { "mkdir", os_mkdir },
+ { "pathsearch", os_pathsearch },
+ { "rmdir", os_rmdir },
+ { NULL, NULL }
+};
+
+
+
+/**
+ * Program entry point.
+ */
+int main(int argc, const char** argv)
+{
+ lua_State* L;
+ int z = OKAY;
+
+ /* prepare Lua for use */
+ L = lua_open();
+ luaL_openlibs(L);
+ luaL_register(L, "os", os_functions);
+
+ /* push the application metadata */
+ lua_pushstring(L, LUA_COPYRIGHT);
+ lua_setglobal(L, "_COPYRIGHT");
+
+ lua_pushstring(L, VERSION);
+ lua_setglobal(L, "_PREMAKE_VERSION");
+
+ lua_pushstring(L, COPYRIGHT);
+ lua_setglobal(L, "_PREMAKE_COPYRIGHT");
+
+ /* set the OS platform variable */
+ lua_pushstring(L, PLATFORM_STRING);
+ lua_setglobal(L, "_OS");
+
+ /* Parse the command line arguments */
+ if (z == OKAY) z = process_arguments(L, argc, argv);
+
+ /* Run the built-in Premake scripts */
+ if (z == OKAY) z = load_builtin_scripts(L);
+
+ /* Clean up and turn off the lights */
+ lua_close(L);
+ return z;
+}
+
+
+
+/**
+ * Process the command line arguments, splitting them into options, the
+ * target action, and any arguments to that action. The results are pushed
+ * into the session for later use. I could have done this in the scripts,
+ * but I need the value of the /scripts option to find them.
+ * \returns OKAY if successful.
+ */
+int process_arguments(lua_State* L, int argc, const char** argv)
+{
+ int i;
+
+ /* Create empty lists for Options and Args */
+ lua_newtable(L);
+ lua_newtable(L);
+
+ for (i = 1; i < argc; ++i)
+ {
+ /* Options start with '/' or '--'. The first argument that isn't an option
+ * is the action. Anything after that is an argument to the action */
+ if (argv[i][0] == '/')
+ {
+ process_option(L, argv[i] + 1);
+ }
+ else if (argv[i][0] == '-' && argv[i][1] == '-')
+ {
+ process_option(L, argv[i] + 2);
+ }
+ else
+ {
+ /* not an option, is the action */
+ lua_pushstring(L, argv[i++]);
+ lua_setglobal(L, "_ACTION");
+
+ /* everything else is an argument */
+ while (i < argc)
+ {
+ lua_pushstring(L, argv[i++]);
+ lua_rawseti(L, -2, luaL_getn(L, -2) + 1);
+ }
+ }
+ }
+
+ /* push the Options and Args lists */
+ lua_setglobal(L, "_ARGS");
+ lua_setglobal(L, "_OPTIONS");
+ return OKAY;
+}
+
+
+
+/**
+ * Parse an individual command-line option.
+ * \returns OKAY if successful.
+ */
+int process_option(lua_State* L, const char* arg)
+{
+ char key[512];
+ const char* value;
+
+ /* If a value is specified, split the option into a key/value pair */
+ char* ptr = strchr(arg, '=');
+ if (ptr)
+ {
+ int len = ptr - arg;
+ if (len > 511) len = 511;
+ strncpy(key, arg, len);
+ key[len] = '\0';
+ value = ptr + 1;
+ }
+ else
+ {
+ strcpy(key, arg);
+ value = "";
+ }
+
+ /* Store it in the Options table, which is already on the stack */
+ lua_pushstring(L, value);
+ lua_setfield(L, -3, key);
+
+ /* The /scripts option gets picked up here to find the built-in scripts */
+ if (strcmp(key, "scripts") == 0 && strlen(value) > 0)
+ {
+ scripts_path = value;
+ }
+
+ return OKAY;
+}
+
+
+
+#if defined(_DEBUG)
+/**
+ * When running in debug mode, the scripts are loaded from the disk. The path to
+ * the scripts must be provided via either the /scripts command line option or
+ * the PREMAKE_PATH environment variable.
+ */
+int load_builtin_scripts(lua_State* L)
+{
+ const char* filename;
+
+ /* call os.pathsearch() to locate _premake_main.lua */
+ lua_pushcfunction(L, os_pathsearch);
+ lua_pushstring(L, "_premake_main.lua");
+ lua_pushstring(L, scripts_path);
+ lua_pushstring(L, getenv("PREMAKE_PATH"));
+ lua_call(L, 3, 1);
+
+ if (lua_isnil(L, -1))
+ {
+ printf(ERROR_MESSAGE,
+ "Unable to find _premake_main.lua; use /scripts option when in debug mode!\n"
+ "Please refer to the documentation (or build in release mode instead)."
+ );
+ return !OKAY;
+ }
+
+ /* run the bootstrapping script */
+ scripts_path = lua_tostring(L, -1);
+ filename = lua_pushfstring(L, "%s/_premake_main.lua", scripts_path);
+ if (luaL_dofile(L, filename))
+ {
+ printf(ERROR_MESSAGE, lua_tostring(L, -1));
+ return !OKAY;
+ }
+
+ /* hand off control to the scripts */
+ lua_getglobal(L, "_premake_main");
+ lua_pushstring(L, scripts_path);
+ if (lua_pcall(L, 1, 1, 0) != OKAY)
+ {
+ printf(ERROR_MESSAGE, lua_tostring(L, -1));
+ return !OKAY;
+ }
+ else
+ {
+ return (int)lua_tonumber(L, -1);
+ }
+}
+#endif
+
+
+#if defined(NDEBUG)
+/**
+ * When running in release mode, the scripts are loaded from a static data
+ * buffer, where they were stored as bytecode by a preprocess. To regenerate
+ * the bytecodes, run `premake --compile` and then rebuild.
+ */
+int load_builtin_scripts(lua_State* L)
+{
+ int i;
+ for (i = 0; builtin_sizes[i] > 0; ++i)
+ {
+ /* use loadstring() to put the bytecodes on the stack */
+ lua_getglobal(L, "loadstring");
+ lua_pushlstring(L, builtin_bytecode[i], builtin_sizes[i]);
+
+ /* evaluate the chunk */
+ lua_pcall(L, 1, 1, 0);
+ if (lua_pcall(L, 0, 0, 0) != OKAY)
+ {
+ printf(ERROR_MESSAGE, lua_tostring(L,-1));
+ return !OKAY;
+ }
+ }
+
+ /* hand off control to the scripts */
+ lua_getglobal(L, "_premake_main");
+ if (lua_pcall(L, 0, 1, 0) != OKAY)
+ {
+ printf(ERROR_MESSAGE, lua_tostring(L,-1));
+ return !OKAY;
+ }
+
+ return OKAY;
+}
+#endif
diff --git a/src/host/premake.h b/src/host/premake.h
new file mode 100644
index 0000000..10726fb
--- /dev/null
+++ b/src/host/premake.h
@@ -0,0 +1,60 @@
+/**
+ * \file premake.h
+ * \brief Program-wide constants and definitions.
+ * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
+ */
+
+#define lua_c
+#include "lua.h"
+#include "lauxlib.h"
+#include "lualib.h"
+
+
+/* Identify the current platform I'm not sure how to reliably detect
+ * Windows but since it is the most common I use it as the default */
+#if defined(__linux__)
+#define PLATFORM_LINUX (1)
+#define PLATFORM_STRING "linux"
+#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
+#define PLATFORM_BSD (1)
+#define PLATFORM_STRING "bsd"
+#elif defined(__APPLE__) && defined(__MACH__)
+#define PLATFORM_MACOSX (1)
+#define PLATFORM_STRING "macosx"
+#else
+#define PLATFORM_WINDOWS (1)
+#define PLATFORM_STRING "windows"
+#endif
+
+
+/* Pull in platform-specific headers required by built-in functions */
+#if PLATFORM_WINDOWS
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#else
+#include <unistd.h>
+#endif
+
+
+/* A success return code */
+#define OKAY (0)
+
+
+/* Bootstrapping helper functions */
+int do_isfile(const char* filename);
+
+
+/* Built-in functions */
+int os_chdir(lua_State* L);
+int os_getcwd(lua_State* L);
+int os_isdir(lua_State* L);
+int os_isfile(lua_State* L);
+int os_matchdone(lua_State* L);
+int os_matchisfile(lua_State* L);
+int os_matchname(lua_State* L);
+int os_matchnext(lua_State* L);
+int os_matchstart(lua_State* L);
+int os_mkdir(lua_State* L);
+int os_pathsearch(lua_State* L);
+int os_rmdir(lua_State* L);
+
diff --git a/src/host/tests/host_args_tests.cpp b/src/host/tests/host_args_tests.cpp
deleted file mode 100644
index 3eb29ab..0000000
--- a/src/host/tests/host_args_tests.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * \file host_args_tests.cpp
- * \brief Automated tests for application command line argument processing.
- * \author Copyright (c) 2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "testing/testing.h"
-extern "C" {
-#include "host/host.h"
-#include "base/env.h"
-#include "base/error.h"
-#include "base/stream.h"
-}
-
-struct FxHostArgs
-{
- Host host;
- Session sess;
- char buffer[8192];
-
- FxHostArgs()
- {
- host = host_create();
- sess = session_create();
- stream_set_buffer(Console, buffer);
- }
-
- ~FxHostArgs()
- {
- session_destroy(sess);
- host_destroy(host);
- error_clear();
- }
-};
-
-
-SUITE(host)
-{
- TEST_FIXTURE(FxHostArgs, ParseArgv_SetsAction_OnAction)
- {
- const char* argv[] = { "premake", "action", NULL };
- host_set_argv(host, argv);
- host_parse_argv(host);
- CHECK_EQUAL("action", env_get_action());
- }
-}
diff --git a/src/host/tests/host_help_tests.cpp b/src/host/tests/host_help_tests.cpp
deleted file mode 100644
index 5917a5a..0000000
--- a/src/host/tests/host_help_tests.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- * \file host_help_tests.cpp
- * \brief Automated test for application help and version display.
- * \author Copyright (c) 2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "testing/testing.h"
-extern "C" {
-#include "host/host.h"
-#include "base/error.h"
-#include "base/stream.h"
-}
-
-struct FxHostHelp
-{
- Host host;
- Session sess;
- char buffer[8192];
-
- FxHostHelp()
- {
- host = host_create();
- sess = session_create();
- stream_set_buffer(Console, buffer);
- }
-
- ~FxHostHelp()
- {
- session_destroy(sess);
- host_destroy(host);
- error_clear();
- }
-};
-
-
-SUITE(host)
-{
- /**********************************************************************
- * Do nothing if an action is set.
- **********************************************************************/
-
- TEST_FIXTURE(FxHostHelp, Help_ReturnsOkay_OnAction)
- {
- const char* argv[] = { "premake", "vs2005", NULL };
- host_set_argv(host, argv);
- int result = host_show_help(host);
- CHECK(result == OKAY);
- }
-
- TEST_FIXTURE(FxHostHelp, Help_PrintsNothing_OnAction)
- {
- const char* argv[] = { "premake", "vs2005", NULL };
- host_set_argv(host, argv);
- host_show_help(host);
- CHECK_EQUAL("", buffer);
- }
-
-
- /**********************************************************************
- * Should display short help (and end loop) if there is no action set.
- **********************************************************************/
-
- TEST_FIXTURE(FxHostHelp, Help_ReturnsNotOkay_OnNoAction)
- {
- const char* argv[] = { "premake", NULL };
- host_set_argv(host, argv);
- int result = host_show_help(host);
- CHECK(result != OKAY);
- }
-
- TEST_FIXTURE(FxHostHelp, Help_ShowsShortHelp_OnNoAction)
- {
- const char* argv[] = { "premake", NULL };
- host_set_argv(host, argv);
- host_show_help(host);
- CHECK_EQUAL(HOST_SHORT_HELP "\n", buffer);
- }
-}
diff --git a/src/host/tests/host_results_tests.cpp b/src/host/tests/host_results_tests.cpp
deleted file mode 100644
index 599763d..0000000
--- a/src/host/tests/host_results_tests.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * \file host_results_tests.cpp
- * \brief Automated test for application status reporting.
- * \author Copyright (c) 2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "testing/testing.h"
-extern "C" {
-#include "host/host.h"
-#include "base/error.h"
-#include "base/stream.h"
-}
-
-struct FxResults
-{
- Session sess;
- char buffer[1024];
-
- FxResults()
- {
- sess = session_create();
- stream_set_buffer(Console, buffer);
- }
-
- ~FxResults()
- {
- session_destroy(sess);
- error_clear();
- }
-};
-
-
-SUITE(host)
-{
- TEST_FIXTURE(FxResults, ReportResults_NoMessage_OnNoError)
- {
- host_report_results();
- CHECK_EQUAL("", buffer);
- }
-
- TEST_FIXTURE(FxResults, ReportResults_ErrorMessage_OnError)
- {
- error_set("an error occurred");
- host_report_results();
- CHECK_EQUAL("Error: an error occurred\n", buffer);
- }
-}
diff --git a/src/host/tests/host_run_tests.cpp b/src/host/tests/host_run_tests.cpp
deleted file mode 100644
index 0ee7391..0000000
--- a/src/host/tests/host_run_tests.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * \file host_run_tests.cpp
- * \brief Automated test for the host script execution logic.
- * \author Copyright (c) 2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "testing/testing.h"
-extern "C" {
-#include "host/host.h"
-#include "base/dir.h"
-#include "base/error.h"
-}
-
-struct FxHostRun
-{
- Host host;
-
- FxHostRun()
- {
- host = host_create();
- dir_set_current("testing/test_files");
- }
-
- ~FxHostRun()
- {
- dir_set_current("../..");
- host_destroy(host);
- error_clear();
- }
-};
-
-SUITE(host)
-{
- /**********************************************************************
- * host_run_action() tests
- **********************************************************************/
-
- TEST_FIXTURE(FxHostRun, HostRunAction_ReturnsNotOkay_OnInvalidAction)
- {
- const char* argv[] = { "premake", "nonesuch", NULL };
- host_set_argv(host, argv);
- int result = host_run_action(host);
- CHECK(result != OKAY);
- }
-
- TEST_FIXTURE(FxHostRun, HostRunAction_SetsError_OnInvalidAction)
- {
- const char* argv[] = { "premake", "nonesuch", NULL };
- host_set_argv(host, argv);
- host_run_action(host);
- CHECK_EQUAL("invalid action 'nonesuch'", error_get());
- }
-}
diff --git a/src/host/tests/host_tests.cpp b/src/host/tests/host_tests.cpp
deleted file mode 100644
index 870ce5e..0000000
--- a/src/host/tests/host_tests.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * \file host_tests.cpp
- * \brief Main executable automated tests.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "testing/testing.h"
-extern "C" {
-#include "host/host.h"
-#include "base/base.h"
-#include "script/script.h"
-#include "objects/objects.h"
-}
-
-
-/**
- * Run the automated host tests.
- * \returns OKAY if all tests completed successfully.
- * \note Also runs the tests for all dependencies, which for the host is everything.
- */
-int host_tests()
-{
- int z = OKAY;
- if (z == OKAY) z = base_tests();
- if (z == OKAY) z = script_tests();
- if (z == OKAY) z = objects_tests();
- if (z == OKAY) z = tests_run_suite("action");
- if (z == OKAY) z = tests_run_suite("host");
- return z;
-}
diff --git a/src/objects/block.c b/src/objects/block.c
deleted file mode 100644
index 41700e0..0000000
--- a/src/objects/block.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/**
- * \file block.c
- * \brief The configuration block class.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include <assert.h>
-#include <stdlib.h>
-#include "premake.h"
-#include "block.h"
-#include "base/cstr.h"
-#include "base/env.h"
-
-
-FieldInfo BlockFieldInfo[] =
-{
- { "defines", ListField, NULL },
- { "flags", ListField, block_is_valid_flag },
- { "objdir", PathField, NULL },
- { "terms", ListField, NULL },
- { 0, 0, NULL }
-};
-
-
-static const char* ValidFlags[] =
-{
- "Managed",
- "NoEditAndContinue",
- "Optimize",
- "OptimizeSize",
- "OptimizeSpeed",
- "Symbols",
- NULL
-};
-
-
-DEFINE_CLASS(Block)
-{
- Fields fields;
-};
-
-
-/**
- * Create and initialize a new configuration block.
- */
-Block block_create()
-{
- Block blk = ALLOC_CLASS(Block);
- blk->fields = fields_create(BlockFieldInfo);
- return blk;
-}
-
-
-/**
- * Destroy a configuration block and release the associated memory.
- */
-void block_destroy(Block blk)
-{
- assert(blk);
- fields_destroy(blk->fields);
- free(blk);
-}
-
-
-/**
- * Checks the block's list of terms to see if this block applies to
- * the current environment. All of the block's terms must find a match
- * among the keyword sources, which include the current OS, the action,
- * and the provided configuration name.
- * \param blk The block to test.
- * \param cfg_name The name of the active configuration.
- * \returns True if every term in the block finds a keyword match.
- */
-int block_applies_to(Block blk, const char* cfg_name)
-{
- int i, n;
- Strings terms = block_get_values(blk, BlockTerms);
- n = strings_size(terms);
- for (i = 0; i < n; ++i)
- {
- const char* term = strings_item(terms, i);
- if ((cfg_name != NULL && cstr_matches_pattern(cfg_name, term)) ||
- cstr_matches_pattern(env_get_os_name(), term) ||
- cstr_matches_pattern(env_get_action(), term))
- {
- continue;
- }
-
- /* no match was found for this term */
- return 0;
- }
-
- return 1;
-}
-
-
-/**
- * Retrieve the fields object for this block; used to unload values from the script.
- */
-Fields block_get_fields(Block blk)
-{
- assert(blk);
- return blk->fields;
-}
-
-
-/**
- * Retrieve a list of values associated with a block.
- */
-Strings block_get_values(Block blk, BlockField which)
-{
- assert(blk);
- return fields_get_values(blk->fields, which);
-}
-
-
-/**
- * Returns true if the specified language is recognized. See the ValidLanguages at
- * the top of this file for a list of valid values.
- */
-int block_is_valid_flag(const char* flag)
-{
- const char** i;
- for (i = ValidFlags; (*i) != NULL; ++i)
- {
- if (cstr_eqi((*i), flag))
- return 1;
- }
- return 0;
-}
-
-
-/**
- * Set a value list field on the block.
- */
-void block_set_values(Block blk, BlockField which, Strings strs)
-{
- assert(blk);
- fields_set_values(blk->fields, which, strs);
-}
diff --git a/src/objects/block.h b/src/objects/block.h
deleted file mode 100644
index 57c7b0c..0000000
--- a/src/objects/block.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * \file block.h
- * \brief Configuration blocks API.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- *
- * \defgroup block Configuration Block
- * \ingroup objects
- * @{
- */
-#if !defined(PREMAKE_BLOCK_H)
-#define PREMAKE_BLOCK_H
-
-#include "fields.h"
-
-
-/**
- * Configuration block field index.
- * \note If you modify this list, you must also update BlockFieldInfo[].
- */
-typedef enum enum_BlockField
-{
- BlockDefines,
- BlockFlags,
- BlockObjDir,
- BlockTerms,
- NumBlockFields
-} BlockField;
-
-extern FieldInfo BlockFieldInfo[];
-
-
-DECLARE_CLASS(Block)
-
-Block block_create(void);
-void block_destroy(Block blk);
-
-int block_applies_to(Block blk, const char* cfg_name);
-Fields block_get_fields(Block blk);
-Strings block_get_values(Block blk, BlockField which);
-int block_is_valid_flag(const char* flag);
-void block_set_values(Block blk, BlockField which, Strings strs);
-
-
-#endif
-/** @} */
diff --git a/src/objects/blocks.c b/src/objects/blocks.c
deleted file mode 100644
index cff37d1..0000000
--- a/src/objects/blocks.c
+++ /dev/null
@@ -1,84 +0,0 @@
-/**
- * \file blocks.h
- * \brief A list of configuration blocks.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include <assert.h>
-#include <stdlib.h>
-#include "premake.h"
-#include "blocks.h"
-#include "base/array.h"
-
-
-DEFINE_CLASS(Blocks)
-{
- Array blocks;
-};
-
-
-/**
- * Create and initialize a new list of configuration blocks.
- * \returns A new configuration block list.
- */
-Blocks blocks_create(void)
-{
- Blocks blks = ALLOC_CLASS(Blocks);
- blks->blocks = array_create();
- return blks;
-}
-
-
-/**
- * Destroy a configuration block list and release the associated memory.
- * \param blks The configuration block list to destroy.
- */
-void blocks_destroy(Blocks blks)
-{
- int i, n;
- assert(blks);
- n = blocks_size(blks);
- for (i = 0; i < n; ++i)
- {
- Block blk = blocks_item(blks, i);
- block_destroy(blk);
- }
- array_destroy(blks->blocks);
- free(blks);
-}
-
-
-/**
- * Add a new block to a list.
- * \param blks The configuration block list.
- * \param blk The block to add to the list.
- */
-void blocks_add(Blocks blks, Block blk)
-{
- assert(blks);
- assert(blk);
- array_add(blks->blocks, blk);
-}
-
-
-/**
- * Retrieve an item from the list of blocks.
- * \param blks The configuration block list.
- * \param index The index of the item to retrieve.
- * \returns The block at the given index.
- */
-Block blocks_item(Blocks blks, int index)
-{
- assert(blks);
- return (Block)array_item(blks->blocks, index);
-}
-
-
-/**
- * Returns the number of blocks in the list.
- * \param blks The configuration block list.
- */
-int blocks_size(Blocks blks)
-{
- return array_size(blks->blocks);
-}
diff --git a/src/objects/blocks.h b/src/objects/blocks.h
deleted file mode 100644
index f6532d5..0000000
--- a/src/objects/blocks.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * \file blocks.h
- * \brief A list of configuration blocks.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- *
- * \addtogroup block
- * @{
- */
-#if !defined(PREMAKE_BLOCKS_H)
-#define PREMAKE_BLOCKS_H
-
-#include "block.h"
-
-DECLARE_CLASS(Blocks)
-
-Blocks blocks_create(void);
-void blocks_destroy(Blocks blks);
-
-void blocks_add(Blocks blks, Block blk);
-Block blocks_item(Blocks blks, int index);
-int blocks_size(Blocks blks);
-
-
-#endif
-/** @} */
diff --git a/src/objects/fields.c b/src/objects/fields.c
deleted file mode 100644
index 8957115..0000000
--- a/src/objects/fields.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/**
- * \file fields.c
- * \brief Project object fields enumeration and handling.
- * \author Copyright (c) 2007-2008 Jason Perkins and the Premake project
- */
-
-#include <assert.h>
-#include <stdlib.h>
-#include "premake.h"
-#include "fields.h"
-#include "base/strings.h"
-
-
-DEFINE_CLASS(Fields)
-{
- FieldInfo* info;
- Strings* values;
- int count;
-};
-
-
-/**
- * Create a new, empty collection of fields.
- * \param info Metadata about the field collection.
- * \returns A new collection of fields.
- */
-Fields fields_create(FieldInfo* info)
-{
- int i;
- Fields fields;
-
- assert(info);
-
- fields = ALLOC_CLASS(Fields);
- fields->info = info;
-
- /* figure out how many fields are in the collection */
- for (i = 0; info[i].name != NULL; ++i);
- fields->count = i;
-
- /* initialize the values */
- fields->values = (Strings*)malloc(sizeof(Strings) * fields->count);
- for (i = 0; i < fields->count; ++i)
- {
- fields->values[i] = strings_create();
- }
-
- return fields;
-}
-
-
-/**
- * Destroy a collection of fields and release the associated memory.
- */
-void fields_destroy(Fields fields)
-{
- int i;
-
- assert(fields);
-
- for (i = 0; i < fields->count; ++i)
- {
- strings_destroy(fields->values[i]);
- }
- free(fields->values);
- free(fields);
-}
-
-
-/**
- * Add a new value to the end of an existing list.
- */
-void fields_add_value(Fields fields, int index, const char* value)
-{
- assert(fields);
- assert(index >= 0 && index < fields->count);
- strings_add(fields->values[index], value);
-}
-
-
-/**
- * Identify the type of field at the given index.
- */
-FieldKind fields_get_kind(Fields fields, int index)
-{
- assert(fields);
- assert(index >= 0 && index < fields->count);
- return fields->info[index].kind;
-}
-
-
-/**
- * Retrieve the value of a string (single value) field.
- * \returns The field value if set, or NULL.
- */
-const char* fields_get_value(Fields fields, int index)
-{
- Strings values;
- assert(fields);
- assert(index >= 0 && index < fields->count);
-
- values = fields->values[index];
- if (strings_size(values) > 0)
- {
- return strings_item(values, 0);
- }
- else
- {
- return NULL;
- }
-}
-
-
-/**
- * Retrieve the list of values for a field.
- */
-Strings fields_get_values(Fields fields, int index)
-{
- assert(fields);
- assert(index >= 0 && index < fields->count);
- return fields->values[index];
-}
-
-
-/**
- * Sets the value of a string (single value) field.
- */
-void fields_set_value(Fields fields, int index, const char* value)
-{
- Strings values;
-
- assert(fields);
- assert(index >= 0 && index < fields->count);
-
- values = fields->values[index];
- if (strings_size(values) == 0 && value != NULL)
- {
- strings_add(values, value);
- }
- else
- {
- strings_set(values, 0, value);
- }
-}
-
-
-/**
- * Sets the list of values associated with a field. The field will subsequently
- * "own" the list, and take responsibility for destroying it with the field set.
- */
-void fields_set_values(Fields fields, int index, Strings values)
-{
- assert(fields);
- assert(index >= 0 && index < fields->count);
- assert(values);
-
- if (fields->values[index] != NULL)
- {
- strings_destroy(fields->values[index]);
- }
-
- fields->values[index] = values;
-}
-
-
-/**
- * Return the number of fields in the collection.
- */
-int fields_size(Fields fields)
-{
- assert(fields);
- return fields->count;
-}
diff --git a/src/objects/fields.h b/src/objects/fields.h
deleted file mode 100644
index 206b941..0000000
--- a/src/objects/fields.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/**
- * \file fields.h
- * \brief Project object fields enumeration and handling.
- * \author Copyright (c) 2007-2008 Jason Perkins and the Premake project
- *
- * \defgroup fields Object Fields
- * \ingroup objects
- *
- * The fields class implements a generic collection of string, list, and
- * files fields which are reused by the other project objects.
- *
- * @{
- */
-#if !defined(PREMAKE_FIELDS_H)
-#define PREMAKE_FIELDS_H
-
-#include "base/strings.h"
-
-
-/**
- * Field types.
- */
-typedef enum enum_FieldKind
-{
- StringField, /**< field containing a single, string value */
- ListField, /**< field containing a list of string values */
- FilesField, /**< field containing a list of file names */
- PathField /**< field containing a file path (directory or file name) */
-} FieldKind;
-
-
-/**
- * Field validation function signature.
- * \param value The value to validate.
- * \returns True if the value is considered valid.
- */
-typedef int (*FieldValidator)(const char* value);
-
-
-/**
- * Metadata about a project object field.
- */
-typedef struct struct_FieldInfo
-{
- const char* name; /**< The name of the field. */
- FieldKind kind; /**< StringField, ListField, etc. */
- FieldValidator validator; /**< The field validation function */
-} FieldInfo;
-
-
-DECLARE_CLASS(Fields)
-
-
-Fields fields_create(FieldInfo* info);
-void fields_destroy(Fields fields);
-
-void fields_add_value(Fields fields, int index, const char* value);
-FieldKind fields_get_kind(Fields fields, int index);
-const char* fields_get_value(Fields fields, int index);
-Strings fields_get_values(Fields fields, int index);
-void fields_set_value(Fields fields, int index, const char* value);
-void fields_set_values(Fields fields, int index, Strings values);
-int fields_size(Fields fields);
-
-#endif
-/* @} */
diff --git a/src/objects/objects.h b/src/objects/objects.h
deleted file mode 100644
index d9126ff..0000000
--- a/src/objects/objects.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/**
- * \file objects.h
- * \brief Premake project-related objects.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- *
- * \defgroup objects Objects
- *
- * This component defines all of the project-related objects: solution, project,
- * and configuration blocks as well as the supporting fields class.
- */
-
-int objects_tests();
diff --git a/src/objects/objects_internal.h b/src/objects/objects_internal.h
deleted file mode 100644
index 9ae707c..0000000
--- a/src/objects/objects_internal.h
+++ /dev/null
@@ -1,9 +0,0 @@
-/**
- * \file objects_internal.h
- * \brief An internal API for inter-object data shuffling.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-Solution project_get_solution(Project prj);
-void project_set_solution(Project prj, Solution sln);
-void solution_set_session(Solution sln, Session sess);
diff --git a/src/objects/project.c b/src/objects/project.c
deleted file mode 100644
index 636221a..0000000
--- a/src/objects/project.c
+++ /dev/null
@@ -1,507 +0,0 @@
-/**
- * \file project.c
- * \brief The project class.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-#include "premake.h"
-#include "solution.h"
-#include "base/buffers.h"
-#include "base/cstr.h"
-#include "base/env.h"
-#include "base/guid.h"
-#include "base/path.h"
-#include "base/strings.h"
-
-
-FieldInfo ProjectFieldInfo[] =
-{
- { "basedir", StringField, NULL },
- { "files", FilesField, NULL },
- { "guid", StringField, guid_is_valid },
- { "kind", StringField, project_is_valid_kind },
- { "language", StringField, project_is_valid_language },
- { "location", StringField, NULL },
- { "name", StringField, NULL },
- { 0, 0, NULL }
-};
-
-static const char* ValidKinds[] =
-{
- "Console", NULL
-};
-
-static const char* ValidLanguages[] =
-{
- "C++", NULL
-};
-
-
-DEFINE_CLASS(Project)
-{
- Solution solution;
- Blocks blocks;
- Fields fields;
- Strings config_cache[NumBlockFields];
- const char* active_config;
-};
-
-
-/**
- * Create and initialize a new project object.
- */
-Project project_create()
-{
- int i;
-
- Project prj = ALLOC_CLASS(Project);
- prj->solution = NULL;
- prj->blocks = blocks_create();
- prj->fields = fields_create(ProjectFieldInfo);
- prj->active_config = NULL;
-
- for (i = 0; i < NumBlockFields; ++i)
- {
- prj->config_cache[i] = NULL;
- }
-
- return prj;
-}
-
-
-/**
- * Destroy a project object and release the associated memory.
- */
-void project_destroy(Project prj)
-{
- int i;
-
- assert(prj);
- blocks_destroy(prj->blocks);
- fields_destroy(prj->fields);
- for (i = 0; i < NumBlockFields; ++i)
- {
- if (prj->config_cache[i] != NULL)
- strings_destroy(prj->config_cache[i]);
- }
- free(prj);
-}
-
-
-
-/**
- * Get the base directory for the project; any properties containing relative
- * paths are relative to this location.
- */
-const char* project_get_base_dir(Project prj)
-{
- return project_get_value(prj, ProjectBaseDir);
-}
-
-
-/**
- * Retrieve the list of configuration blocks associated with a project.
- */
-Blocks project_get_blocks(Project prj)
-{
- assert(prj);
- return prj->blocks;
-}
-
-
-
-/**
- * Scans a list of blocks and appends any values found to the provided list.
- */
-static void project_get_values_from_blocks(Project prj, Strings values, Blocks blks, BlockField field)
-{
- int i, n = blocks_size(blks);
- for (i = 0; i < n; ++i)
- {
- Block blk = blocks_item(blks, i);
-
- if (block_applies_to(blk, prj->active_config))
- {
- Strings block_values = block_get_values(blk, field);
- strings_append(values, block_values);
- }
- }
-}
-
-
-/**
- * Retrieve the currently active configuration name; only settings contained by
- * blocks targeted to this configuration will be accessible. Returns NULL if no
- * configuration has been selected, in which case only global settings will
- * be available.
- */
-const char* project_get_config(Project prj)
-{
- assert(prj);
- return prj->active_config;
-}
-
-
-/**
- * Retrieve a list value from the project configuration, respecting the current filter set.
- */
-Strings project_get_config_values(Project prj, BlockField field)
-{
- Strings values;
-
- assert(prj);
- assert(field >= 0 && field < NumBlockFields);
-
- values = strings_create();
-
- /* The "cache" just keeps track of all lists that I return to callers; I will
- * take responsibility for destroying the lists, so the callers don't have to
- * do it themselves. A bit of complexity here to simplify the action handers. */
- if (prj->config_cache[field] != NULL)
- {
- strings_destroy(prj->config_cache[field]);
- }
- prj->config_cache[field] = values;
-
- project_get_values_from_blocks(prj, values, solution_get_blocks(prj->solution), field);
- project_get_values_from_blocks(prj, values, project_get_blocks(prj), field);
- return values;
-}
-
-
-/**
- * Retrieve the list of preprocessor defines, using the current configuration filter.
- */
-Strings project_get_defines(Project prj)
-{
- Strings values = project_get_config_values(prj, BlockDefines);
- return values;
-}
-
-
-/**
- * Retrieve the fields object for this project; used to unload values from the script.
- */
-Fields project_get_fields(Project prj)
-{
- assert(prj);
- return prj->fields;
-}
-
-
-/**
- * Get the path to the project output file, using the provided file name and extension.
- * \param prj The project object to query.
- * \param basename The base filename; if NULL the project name will be used.
- * \param ext The file extension to be used on the filename; may be NULL.
- * \returns The path to the project file.
- */
-const char* project_get_filename(Project prj, const char* basename, const char* ext)
-{
- const char* location = project_get_location(prj);
- if (!basename)
- {
- basename = project_get_name(prj);
- }
- return path_assemble(location, basename, ext);
-}
-
-
-/**
- * Get the relative path from the solution to the project file, using the
- * provided file name and extension.
- * \param prj The project object to query.
- * \param basename The base filename; if NULL the project name will be used.
- * \param ext The file extension to be used on the filename; may be NULL.
- * \returns The path to the project file.
- */
-const char* project_get_filename_relative(Project prj, const char* basename, const char* ext)
-{
- const char* sln_location;
- const char* abs_filename;
- assert(prj);
- assert(prj->solution);
-
- sln_location = solution_get_location(prj->solution);
- abs_filename = project_get_filename(prj, basename, ext);
-
- return path_relative(sln_location, abs_filename);
-}
-
-
-
-/**
- * Retrieve the list of source files associated with a project.
- */
-Strings project_get_files(Project prj)
-{
- assert(prj);
- return fields_get_values(prj->fields, ProjectFiles);
-}
-
-
-/**
- * Retrieve the GUID associated with a project.
- */
-const char* project_get_guid(Project prj)
-{
- return project_get_value(prj, ProjectGuid);
-}
-
-
-/**
- * Get the project kind: console, windowed, etc.
- */
-const char* project_get_kind(Project prj)
-{
- const char* kind = project_get_value(prj, ProjectKind);
- if (kind == NULL && prj->solution != NULL)
- {
- kind = solution_get_kind(prj->solution);
- }
- return kind;
-}
-
-
-/**
- * Get the programming language used by the project.
- */
-const char* project_get_language(Project prj)
-{
- const char* lang = project_get_value(prj, ProjectLanguage);
- if (lang == NULL && prj->solution != NULL)
- {
- lang = solution_get_language(prj->solution);
- }
- return lang;
-}
-
-
-/**
- * Retrieve the output location (the relative path from the base directory to the
- * target output directory) for this project.
- */
-const char* project_get_location(Project prj)
-{
- return project_get_value(prj, ProjectLocation);
-}
-
-
-/**
- * Get the name of the project.
- */
-const char* project_get_name(Project prj)
-{
- return project_get_value(prj, ProjectName);
-}
-
-
-/**
- * Retrieve the output filename for this project, taking into account platform-specific
- * naming conventions. For instance, for a project named "MyProject" this function would
- * return "MyProject.exe" on Windows. No path information is included, use the function
- * project_get_outdir() for that.
- */
-const char* project_get_outfile(Project prj)
-{
- char* buffer = buffers_next();
- strcpy(buffer, project_get_name(prj));
- if (env_is_os(Windows))
- {
- strcat(buffer, ".exe");
- }
- return buffer;
-}
-
-
-/**
- * Retrieve the session which contains this project.
- */
-Session project_get_session(Project prj)
-{
- assert(prj);
- return solution_get_session(prj->solution);
-}
-
-
-/**
- * Retrieve the solution associated with this project (internal).
- */
-Solution project_get_solution(Project prj)
-{
- return prj->solution;
-}
-
-
-/**
- * Retrieve a string (single value) fields from a project, using the field indices.
- */
-const char* project_get_value(Project prj, ProjectField field)
-{
- assert(prj);
- return fields_get_value(prj->fields, field);
-}
-
-
-/**
- * Returns true if the project flags contain the specified flag.
- */
-int project_has_flag(Project prj, const char* flag)
-{
- Strings flags = project_get_config_values(prj, BlockFlags);
- return strings_contains(flags, flag);
-}
-
-
-/**
- * Returns true if the project kind matches the parameter.
- */
-int project_is_kind(Project prj, const char* kind)
-{
- assert(prj);
- return cstr_eqi(project_get_kind(prj), kind);
-}
-
-
-/**
- * Returns true if the project language matches the parameter.
- */
-int project_is_language(Project prj, const char* language)
-{
- assert(prj);
- return cstr_eqi(project_get_language(prj), language);
-}
-
-
-/**
- * Returns true if the specified language is recognized. See the ValidLanguages at
- * the top of this file for a list of valid values.
- */
-int project_is_valid_kind(const char* kind)
-{
- const char** i;
- for (i = ValidKinds; (*i) != NULL; ++i)
- {
- if (cstr_eqi((*i), kind))
- return 1;
- }
- return 0;
-}
-
-
-/**
- * Returns true if the specified language is recognized. See the ValidLanguages at
- * the top of this file for a list of valid values.
- */
-int project_is_valid_language(const char* language)
-{
- const char** i;
- for (i = ValidLanguages; (*i) != NULL; ++i)
- {
- if (cstr_eqi((*i), language))
- return 1;
- }
- return 0;
-}
-
-
-/**
- * Set the base directory of the project.
- */
-void project_set_base_dir(Project prj, const char* base_dir)
-{
- project_set_value(prj, ProjectBaseDir, base_dir);
-}
-
-
-/**
- * Selects a particular configuration; any subsequent calls to retrieve settings will
- * only return values which are part of this configuration. A value of NULL will clear
- * the configuration, and only return global settings.
- */
-void project_set_config(Project prj, const char* cfg_name)
-{
- assert(prj);
- prj->active_config = cfg_name;
-}
-
-
-/**
- * Set the GUID associated with a project. The GUID is required by the Visual
- * Studio generators, and must be unique per project.
- */
-void project_set_guid(Project prj, const char* guid)
-{
- project_set_value(prj, ProjectGuid, guid);
-}
-
-
-/**
- * Set the project kind: console, windowed, etc.
- */
-void project_set_kind(Project prj, const char* kind)
-{
- project_set_value(prj, ProjectKind, kind);
-}
-
-
-/**
- * Set the programming language used by a project.
- */
-void project_set_language(Project prj, const char* language)
-{
- project_set_value(prj, ProjectLanguage, language);
-}
-
-
-/**
- * Set the output location (the relative path from the base directory to the
- * target output directory) for this project.
- */
-void project_set_location(Project prj, const char* location)
-{
- project_set_value(prj, ProjectLocation, location);
-}
-
-
-/**
- * Set the name of the project.
- */
-void project_set_name(Project prj, const char* name)
-{
- project_set_value(prj, ProjectName, name);
-}
-
-
-/**
- * Associate a solution with this project (internal).
- */
-void project_set_solution(Project prj, Solution sln)
-{
- assert(prj);
- prj->solution = sln;
-}
-
-
-/**
- * Set a string (single value) field on a project, using the field indices.
- */
-void project_set_value(Project prj, ProjectField field, const char* value)
-{
- assert(prj);
- fields_set_value(prj->fields, field, value);
-}
-
-
-/**
- * Sets the list of values associated with a field. The field will subsequently
- * "own" the list, and take responsibility to destroying it with the field set.
- */
-void project_set_values(Project prj, ProjectField field, Strings values)
-{
- assert(prj);
- fields_set_values(prj->fields, field, values);
-}
diff --git a/src/objects/project.h b/src/objects/project.h
deleted file mode 100644
index 1d8b408..0000000
--- a/src/objects/project.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/**
- * \file project.h
- * \brief Project object API.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- *
- * \defgroup project Project
- * \ingroup objects
- *
- * @{
- */
-#if !defined(PREMAKE_PROJECT_H)
-#define PREMAKE_PROJECT_H
-
-DECLARE_CLASS(Project)
-
-#include "session.h"
-#include "fields.h"
-#include "blocks.h"
-
-
-/**
- * Project field index.
- * \note If you modify this list, you must also update ProjectFieldInfo[].
- */
-typedef enum enum_ProjectField
-{
- ProjectBaseDir,
- ProjectFiles,
- ProjectGuid,
- ProjectKind,
- ProjectLanguage,
- ProjectLocation,
- ProjectName,
- NumProjectFields
-} ProjectField;
-
-extern FieldInfo ProjectFieldInfo[];
-
-
-Project project_create(void);
-void project_destroy(Project prj);
-
-const char* project_get_base_dir(Project prj);
-Blocks project_get_blocks(Project prj);
-const char* project_get_config(Project prj);
-Strings project_get_config_values(Project prj, BlockField field);
-Fields project_get_fields(Project prj);
-const char* project_get_filename(Project prj, const char* basename, const char* ext);
-const char* project_get_filename_relative(Project prj, const char* basename, const char* ext);
-Strings project_get_files(Project prj);
-const char* project_get_guid(Project prj);
-const char* project_get_kind(Project prj);
-const char* project_get_language(Project prj);
-const char* project_get_location(Project prj);
-const char* project_get_name(Project prj);
-const char* project_get_outfile(Project prj);
-Session project_get_session(Project prj);
-const char* project_get_value(Project prj, ProjectField field);
-int project_has_flag(Project prj, const char* flag);
-int project_is_kind(Project prj, const char* kind);
-int project_is_language(Project prj, const char* language);
-int project_is_valid_kind(const char* kind);
-int project_is_valid_language(const char* language);
-void project_set_base_dir(Project prj, const char* base_dir);
-void project_set_config(Project prj, const char* cfg_name);
-void project_set_guid(Project prj, const char* guid);
-void project_set_kind(Project prj, const char* kind);
-void project_set_language(Project prj, const char* language);
-void project_set_location(Project prj, const char* location);
-void project_set_name(Project prj, const char* name);
-void project_set_value(Project prj, ProjectField field, const char* value);
-void project_set_values(Project prj, ProjectField field, Strings values);
-
-
-#endif
-/** @} */
diff --git a/src/objects/session.c b/src/objects/session.c
deleted file mode 100644
index 444304d..0000000
--- a/src/objects/session.c
+++ /dev/null
@@ -1,301 +0,0 @@
-/**
- * \file session.c
- * \brief Context for a program execution session.
- * \author Copyright (c) 2008 Jason Perkins and the Premake project
- */
-
-#include <assert.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "premake.h"
-#include "session.h"
-#include "objects_internal.h"
-#include "base/array.h"
-#include "base/cstr.h"
-#include "base/env.h"
-#include "base/error.h"
-
-
-DEFINE_CLASS(Session)
-{
- Array solutions;
- Stream active_stream;
-};
-
-
-/**
- * Create a new session object.
- * \returns A new session object, or NULL if the scripting engine fails to start.
- */
-Session session_create(void)
-{
- Session sess = ALLOC_CLASS(Session);
- sess->solutions = array_create();
- sess->active_stream = NULL;
- return sess;
-}
-
-
-/**
- * Destroy a session object and release the associated memory.
- * \param sess The session object to destroy.
- */
-void session_destroy(Session sess)
-{
- int i, n;
-
- assert(sess);
-
- n = session_num_solutions(sess);
- for (i = 0; i < n; ++i)
- {
- Solution sln = session_get_solution(sess, i);
- solution_destroy(sln);
- }
-
- array_destroy(sess->solutions);
- free(sess);
-}
-
-
-/**
- * Adds a new solution to the list of solutions contained by the session.
- * \param sess The session object.
- * \param sln The new solution to add.
- */
-void session_add_solution(Session sess, Solution sln)
-{
- assert(sess);
- assert(sln);
- array_add(sess->solutions, sln);
- solution_set_session(sln, sess);
-}
-
-
-/**
- * A bit of black magic: this function acts as a special token for the project handler
- * function list to indicate where configurations should appear. For more details, see
- * the implementation of session_enumerate_objects().
- */
-int session_enumerate_configurations(Project prj, Stream strm)
-{
- UNUSED(prj);
- UNUSED(strm);
- return OKAY;
-}
-
-
-/**
- * Iterate the project objects contained by the session and hand them off to handler callbacks.
- * \param sess The session object.
- * \param sln_funcs A list of per-solution object callbacks.
- * \param prj_funcs A list of per-project object callbacks.
- * \param cfg_funcs A list of per-configuration callbacks.
- * \returns OKAY if successful.
- */
-int session_enumerate_objects(Session sess, SessionSolutionCallback* sln_funcs, SessionProjectCallback* prj_funcs, SessionProjectCallback* cfg_funcs)
-{
- int si, sn;
- int result = OKAY;
-
- assert(sess);
- assert(sln_funcs);
- assert(prj_funcs);
- assert(cfg_funcs);
-
- /* enumerate solutions */
- sn = session_num_solutions(sess);
- for (si = 0; si < sn; ++si)
- {
- /* call all solution functions */
- int fi, pi, pn;
- Solution sln = session_get_solution(sess, si);
- for (fi = 0; result == OKAY && sln_funcs[fi] != NULL; ++fi)
- {
- result = sln_funcs[fi](sln, sess->active_stream);
- }
-
- /* enumerate projects */
- pn = solution_num_projects(sln);
- for (pi = 0; pi < pn; ++pi)
- {
- Project prj = solution_get_project(sln, pi);
-
- for (fi = 0; result == OKAY && prj_funcs[fi]; ++fi)
- {
- /* A bit of black magic here - I use the "session_enumerate_configurations"
- * token to indicate where the list of configurations should appear in the
- * project file. */
- if (prj_funcs[fi] == session_enumerate_configurations)
- {
- int ci, cn;
- cn = solution_num_configs(sln);
- for (ci = 0; result == OKAY && ci < cn; ++ci)
- {
- int cfi;
- const char* cfg_name = solution_get_config(sln, ci);
- project_set_config(prj, cfg_name);
-
- /* enumerate configurations */
- for (cfi = 0; result == OKAY && cfg_funcs[cfi]; ++cfi)
- {
- result = cfg_funcs[cfi](prj, sess->active_stream);
- }
-
- project_set_config(prj, NULL);
- }
- }
- else
- {
- result = prj_funcs[fi](prj, sess->active_stream);
- }
- }
- }
- }
-
- if (sess->active_stream)
- {
- stream_destroy(sess->active_stream);
- sess->active_stream = NULL;
- }
-
- return result;
-}
-
-
-/**
- * Retrieve the currently active output stream.
- * \param sess The session object.
- * \return The currently active stream, or NULL if no stream is active.
- */
-Stream session_get_active_stream(Session sess)
-{
- assert(sess);
- return sess->active_stream;
-}
-
-
-/**
- * Retrieve the contained solution at the given index in the solution list.
- * \param sess The session object.
- * \param index The index of the solution to return.
- * \returns The solution object at the given index.
- */
-Solution session_get_solution(Session sess, int index)
-{
- assert(sess);
- assert(index >= 0 && array_size(sess->solutions) > 0 && index < array_size(sess->solutions));
- return (Solution)array_item(sess->solutions, index);
-}
-
-
-/**
- * Return the number of solutions contained by the session.
- * \param sess The session object.
- */
-int session_num_solutions(Session sess)
-{
- assert(sess);
- return array_size(sess->solutions);
-}
-
-
-/**
- * Set the active output stream, which will be passed to subsequent callbacks during
- * object processing by session_enumerate_objects(). If there is an existing active
- * stream it will be released before setting the new stream.
- * \param sess The current execution session context.
- * \param strm The new active stream.
- */
-void session_set_active_stream(Session sess, Stream strm)
-{
- assert(sess);
- assert(strm);
- if (sess->active_stream)
- {
- stream_destroy(sess->active_stream);
- }
- sess->active_stream = strm;
-}
-
-
-/**
- * Make sure that all required objects and values have been defined by the project script.
- * \param sess The session to validate.
- * \param features The features (language, kind, etc.) supported by the current action.
- * \returns OKAY if the session is valid.
- */
-int session_validate(Session sess, SessionFeatures* features)
-{
- int si, sn;
-
- assert(sess);
- assert(features);
-
- sn = session_num_solutions(sess);
- for (si = 0; si < sn; ++si)
- {
- int pi, pn;
- Solution sln = session_get_solution(sess, si);
-
- /* every solution must have at least one project */
- pn = solution_num_projects(sln);
- if (pn == 0)
- {
- error_set("no projects defined for solution '%s'", solution_get_name(sln));
- return !OKAY;
- }
-
- for (pi = 0; pi < pn; ++pi)
- {
- int i;
-
- Project prj = solution_get_project(sln, pi);
- const char* prj_name = project_get_name(prj);
- const char* prj_kind = project_get_kind(prj);
- const char* prj_lang = project_get_language(prj);
-
- /* every project must have these fields defined */
- if (prj_kind == NULL)
- {
- error_set("project '%s' needs a kind", prj_name);
- return !OKAY;
- }
-
- if (prj_lang == NULL)
- {
- error_set("project '%s' needs a language", prj_name);
- return !OKAY;
- }
-
- /* check actual project values against the list of supported values */
- for (i = 0; features->kinds[i] != NULL; ++i)
- {
- if (cstr_eqi(prj_kind, features->kinds[i]))
- break;
- }
-
- if (features->kinds[i] == NULL)
- {
- error_set("%s projects are not supported by this action", prj_kind);
- return !OKAY;
- }
-
- for (i = 0; features->languages[i] != NULL; ++i)
- {
- if (cstr_eqi(prj_lang, features->languages[i]))
- break;
- }
-
- if (features->languages[i] == NULL)
- {
- error_set("%s projects are not supported by this action", prj_lang);
- return !OKAY;
- }
- }
- }
-
- return OKAY;
-}
diff --git a/src/objects/session.h b/src/objects/session.h
deleted file mode 100644
index 0dfdef3..0000000
--- a/src/objects/session.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * \file session.h
- * \brief Context for a program execution session.
- * \author Copyright (c) 2008 Jason Perkins and the Premake project
- *
- * \defgroup session Session
- * \ingroup objects
- *
- * The session is the top-level object, providing containment and enumeration
- * of a set of solutions (and their contained projects, etc.)
- *
- * @{
- */
-#if !defined(PREMAKE_SESSION_H)
-#define PREMAKE_SESSION_H
-
-DECLARE_CLASS(Session)
-
-#include "base/stream.h"
-#include "objects/solution.h"
-#include "objects/project.h"
-
-
-
-/**
- * Per-solution object callback signature for session_enumerate_objects(). The
- * solution callback will be called once for each solution in the session.
- * \param sess The execution session context.
- * \param sln The current solution.
- * \param strm The currently active stream; set with session_set_active_stream(). May be NULL.
- * \returns OKAY if successful.
- */
-typedef int (*SessionSolutionCallback)(Solution sln, Stream strm);
-
-
-/**
- * Per-project object callback signature for session_enumerate_objects(). The
- * project callback will be called once for each solution in the session.
- * \param sess The execution session context.
- * \param prj The current project.
- * \param strm The currently active stream; set with session_set_active_stream(). May be NULL.
- * \returns OKAY if successful.
- */
-typedef int (*SessionProjectCallback)(Project prj, Stream strm);
-
-
-/**
- * Describe the features (languages, project kinds, etc.) supported by an action. Used by
- * session_validate() to ensure that action handler functions only get called with data
- * that they can handle.
- */
-typedef struct struct_SessionFeatures
-{
- const char* kinds[32];
- const char* languages[64];
-} SessionFeatures;
-
-
-Session session_create(void);
-void session_destroy(Session sess);
-void session_add_solution(Session sess, Solution sln);
-int session_enumerate_configurations(Project prj, Stream strm);
-int session_enumerate_objects(Session sess, SessionSolutionCallback* sln_funcs, SessionProjectCallback* prj_funcs, SessionProjectCallback* cfg_funcs);
-Stream session_get_active_stream(Session sess);
-Solution session_get_solution(Session sess, int index);
-int session_num_solutions(Session sess);
-void session_set_active_stream(Session sess, Stream strm);
-int session_tests(void);
-int session_validate(Session sess, SessionFeatures* features);
-
-#endif
-/** @} */
-
diff --git a/src/objects/solution.c b/src/objects/solution.c
deleted file mode 100644
index 9426411..0000000
--- a/src/objects/solution.c
+++ /dev/null
@@ -1,327 +0,0 @@
-/**
- * \file solution.c
- * \brief The Solution class, representing the top-level container for projects.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include <assert.h>
-#include <stdlib.h>
-#include "premake.h"
-#include "solution.h"
-#include "session.h"
-#include "objects_internal.h"
-#include "base/array.h"
-#include "base/path.h"
-#include "base/strings.h"
-
-
-FieldInfo SolutionFieldInfo[] =
-{
- { "basedir", StringField, NULL },
- { "configurations", ListField, NULL },
- { "kind", StringField, project_is_valid_kind },
- { "language", StringField, project_is_valid_language },
- { "location", StringField, NULL },
- { "name", StringField, NULL },
- { 0, 0, NULL }
-};
-
-
-DEFINE_CLASS(Solution)
-{
- Session session;
- Fields fields;
- Array projects;
- Blocks blocks;
-};
-
-
-/**
- * Create and initialize a new solution object.
- */
-Solution solution_create()
-{
- Solution sln = ALLOC_CLASS(Solution);
- sln->session = NULL;
- sln->fields = fields_create(SolutionFieldInfo);
- sln->projects = array_create();
- sln->blocks = blocks_create();
- return sln;
-}
-
-
-/**
- * Destroy a solution object and release the associated memory.
- */
-void solution_destroy(Solution sln)
-{
- int i, n;
-
- assert(sln);
- fields_destroy(sln->fields);
- blocks_destroy(sln->blocks);
-
- n = solution_num_projects(sln);
- for (i = 0; i < n; ++i)
- {
- Project prj = solution_get_project(sln, i);
- project_destroy(prj);
- }
- array_destroy(sln->projects);
-
- free(sln);
-}
-
-
-/**
- * Add a configuration name to a solution.
- */
-void solution_add_config(Solution sln, const char* config_name)
-{
- assert(sln);
- assert(config_name);
- fields_add_value(sln->fields, SolutionConfigurations, config_name);
-}
-
-
-/**
- * Add a project to a solution.
- */
-void solution_add_project(Solution sln, Project prj)
-{
- assert(sln);
- assert(prj);
- array_add(sln->projects, prj);
- project_set_solution(prj, sln);
-}
-
-
-/**
- * Get the base directory for the solution; any properties containing relative
- * paths are relative to this location.
- */
-const char* solution_get_base_dir(Solution sln)
-{
- return solution_get_value(sln, SolutionBaseDir);
-}
-
-
-/**
- * Retrieve the list of configuration blocks associated with a solution.
- */
-Blocks solution_get_blocks(Solution sln)
-{
- assert(sln);
- return sln->blocks;
-}
-
-
-/**
- * Get the configuration name at a given index.
- */
-const char* solution_get_config(Solution sln, int index)
-{
- Strings names;
- const char* name;
- assert(sln);
- names = fields_get_values(sln->fields, SolutionConfigurations);
- name = strings_item(names, index);
- return name;
-}
-
-
-/**
- * Get the list of configuration names.
- */
-Strings solution_get_configs(Solution sln)
-{
- assert(sln);
- return fields_get_values(sln->fields, SolutionConfigurations);
-}
-
-
-/**
- * Retrieve the fields object for this solution; used to unload values from the script.
- */
-Fields solution_get_fields(Solution sln)
-{
- assert(sln);
- return sln->fields;
-}
-
-
-/**
- * Get the path to the solution output file, using the provided file extension.
- * \param sln The solution object to query.
- * \param basename The base filename; if NULL the solution name will be used.
- * \param ext The file extension to be used on the filename; may be NULL.
- * \returns The path to the solution file.
- */
-const char* solution_get_filename(Solution sln, const char* basename, const char* ext)
-{
- const char* location = solution_get_location(sln);
- if (!basename)
- {
- basename = solution_get_name(sln);
- }
- return path_assemble(location, basename, ext);
-}
-
-
-/**
- * Get the solution-wide project kind.
- */
-const char* solution_get_kind(Solution sln)
-{
- return solution_get_value(sln, SolutionKind);
-}
-
-
-/**
- * Get the programming language set globally for the solution.
- */
-const char* solution_get_language(Solution sln)
-{
- return solution_get_value(sln, SolutionLanguage);
-}
-
-
-/**
- * Retrieve the output location (the relative path from the base directory to the
- * target output directory) for this solution.
- */
-const char* solution_get_location(Solution sln)
-{
- return solution_get_value(sln, SolutionLocation);
-}
-
-
-/**
- * Get the name of the solution.
- */
-const char* solution_get_name(Solution sln)
-{
- return solution_get_value(sln, SolutionName);
-}
-
-
-/**
- * Retrieve a project from the solution.
- */
-Project solution_get_project(Solution sln, int index)
-{
- Project prj;
-
- assert(sln);
-
- prj = (Project)array_item(sln->projects, index);
- return prj;
-}
-
-
-/**
- * Retrieve the session which contains this solution.
- */
-Session solution_get_session(Solution sln)
-{
- assert(sln);
- return sln->session;
-}
-
-
-/**
- * Retrieve a string (single value) fields from a solution, using the field indices.
- */
-const char* solution_get_value(Solution sln, SolutionField field)
-{
- assert(sln);
- return fields_get_value(sln->fields, field);
-}
-
-
-/**
- * Return the number of configurations contained by this solution.
- */
-int solution_num_configs(Solution sln)
-{
- Strings names;
- assert(sln);
- names = fields_get_values(sln->fields, SolutionConfigurations);
- return strings_size(names);
-}
-
-
-/**
- * Return the number of projects contained by this solution.
- */
-int solution_num_projects(Solution sln)
-{
- assert(sln);
- return array_size(sln->projects);
-}
-
-
-/**
- * Set the base directory of the solution.
- */
-void solution_set_base_dir(Solution sln, const char* base_dir)
-{
- solution_set_value(sln, SolutionBaseDir, base_dir);
-}
-
-
-/**
- * Set the solution-wide project kind.
- */
-void solution_set_kind(Solution sln, const char* kind)
-{
- solution_set_value(sln, SolutionKind, kind);
-}
-
-
-/**
- * Set the global programming language for the solution.
- */
-void solution_set_language(Solution sln, const char* language)
-{
- solution_set_value(sln, SolutionLanguage, language);
-}
-
-
-/*
- * Set the output location (the relative path from the base directory to the
- * target output directory) for this solution.
- */
-void solution_set_location(Solution sln, const char* location)
-{
- solution_set_value(sln, SolutionLocation, location);
-}
-
-
-/**
- * Set the name of the solution.
- */
-void solution_set_name(Solution sln, const char* name)
-{
- solution_set_value(sln, SolutionName, name);
-}
-
-
-/**
- * Associate this solution with a session (internal).
- */
-void solution_set_session(Solution sln, Session sess)
-{
- assert(sln);
- sln->session = sess;
-}
-
-
-/**
- * Set a string (single value) field on a solution, using the field indices.
- */
-void solution_set_value(Solution sln, SolutionField field, const char* value)
-{
- assert(sln);
- fields_set_value(sln->fields, field, value);
-}
diff --git a/src/objects/solution.h b/src/objects/solution.h
deleted file mode 100644
index 57bd692..0000000
--- a/src/objects/solution.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- * \file solution.h
- * \brief The Solution class, representing the top-level container for projects.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- *
- * \defgroup solution Solution
- * \ingroup objects
- *
- * @{
- */
-#if !defined(PREMAKE_SOLUTION_H)
-#define PREMAKE_SOLUTION_H
-
-DECLARE_CLASS(Solution)
-
-#include "fields.h"
-#include "project.h"
-#include "blocks.h"
-#include "base/strings.h"
-
-
-/**
- * Solution field index.
- * \note If you modify this list, you must also update SolutionFieldInfo[].
- */
-typedef enum enum_SolutionField
-{
- SolutionBaseDir,
- SolutionConfigurations,
- SolutionKind,
- SolutionLanguage,
- SolutionLocation,
- SolutionName,
- NumSolutionFields
-} SolutionField;
-
-extern FieldInfo SolutionFieldInfo[];
-
-
-Solution solution_create(void);
-void solution_destroy(Solution sln);
-
-void solution_add_config(Solution sln, const char* config_name);
-void solution_add_project(Solution sln, Project prj);
-const char* solution_get_base_dir(Solution sln);
-Blocks solution_get_blocks(Solution sln);
-const char* solution_get_config(Solution sln, int index);
-Strings solution_get_configs(Solution sln);
-Fields solution_get_fields(Solution sln);
-const char* solution_get_filename(Solution sln, const char* basename, const char* ext);
-const char* solution_get_kind(Solution sln);
-const char* solution_get_language(Solution sln);
-const char* solution_get_location(Solution sln);
-const char* solution_get_name(Solution sln);
-Project solution_get_project(Solution sln, int index);
-Session solution_get_session(Solution sln);
-const char* solution_get_value(Solution sln, SolutionField field);
-int solution_num_configs(Solution sln);
-int solution_num_projects(Solution sln);
-void solution_set_base_dir(Solution sln, const char* base_dir);
-void solution_set_kind(Solution sln, const char* kind);
-void solution_set_language(Solution sln, const char* language);
-void solution_set_location(Solution sln, const char* location);
-void solution_set_name(Solution sln, const char* name);
-void solution_set_value(Solution sln, SolutionField field, const char* value);
-
-
-#endif
-/** @} */
diff --git a/src/objects/tests/block_tests.cpp b/src/objects/tests/block_tests.cpp
deleted file mode 100644
index 3b83a8e..0000000
--- a/src/objects/tests/block_tests.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-/**
- * \file block_tests.cpp
- * \brief Automated tests for the configuration blocks API.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "testing/testing.h"
-extern "C" {
-#include "objects/solution.h"
-#include "objects/block.h"
-#include "base/env.h"
-}
-
-
-struct FxBlock
-{
- Block blk;
- Strings terms;
-
- FxBlock()
- {
- blk = block_create();
- terms = strings_create();
- block_set_values(blk, BlockTerms, terms);
- }
-
- ~FxBlock()
- {
- block_destroy(blk);
- }
-};
-
-
-SUITE(project)
-{
- TEST_FIXTURE(FxBlock, Create_ReturnsObject_OnSuccess)
- {
- CHECK(blk != NULL);
- }
-
- TEST_FIXTURE(FxBlock, AppliesTo_CanMatchOS)
- {
- env_set_os(MacOSX);
- strings_add(terms, "macosx");
- CHECK(block_applies_to(blk, "Debug"));
- }
-
- TEST_FIXTURE(FxBlock, AppliesTo_CanMatchAction)
- {
- env_set_action("vs2005");
- strings_add(terms, "vs2005");
- CHECK(block_applies_to(blk, "Debug"));
- }
-
- TEST_FIXTURE(FxBlock, AppliesTo_CanMatchConfig)
- {
- strings_add(terms, "debug");
- CHECK(block_applies_to(blk, "Debug"));
- }
-
- TEST_FIXTURE(FxBlock, AppliesTo_AcceptsPatterns)
- {
- strings_add(terms, "Debug .*");
- CHECK(block_applies_to(blk, "Debug DLL"));
- }
-
- TEST_FIXTURE(FxBlock, AppliesTo_AcceptsNullConfig)
- {
- CHECK(block_applies_to(blk, NULL));
- }
-
- TEST_FIXTURE(FxBlock, AppliesTo_ReturnsFalse_OnUnmatchedTerm)
- {
- strings_add(terms, "NoSuchKeyword");
- CHECK(!block_applies_to(blk, "Debug"));
- }
-}
-
-
diff --git a/src/objects/tests/fields_tests.cpp b/src/objects/tests/fields_tests.cpp
deleted file mode 100644
index 7be0fb7..0000000
--- a/src/objects/tests/fields_tests.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * \file fields_tests.cpp
- * \brief Automated tests for the Fields class.
- * \author Copyright (c) 2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "testing/testing.h"
-extern "C" {
-#include "objects/fields.h"
-}
-
-enum TestFields
-{
- TestStringValue,
- TestListValue
-};
-
-static FieldInfo TestFieldInfo[] =
-{
- { "stringval", StringField },
- { "listval", ListField },
- { 0, StringField }
-};
-
-
-struct FxFields
-{
- Fields fields;
-
- FxFields()
- {
- fields = fields_create(TestFieldInfo);
- }
-
- ~FxFields()
- {
- fields_destroy(fields);
- }
-};
-
-
-SUITE(fields)
-{
- TEST_FIXTURE(FxFields, GetValue_ReturnsNull_OnUnsetString)
- {
- const char* result = fields_get_value(fields, TestStringValue);
- CHECK(result == NULL);
- }
-
- TEST_FIXTURE(FxFields, SetValue_CanRoundtrip)
- {
- fields_set_value(fields, TestStringValue, "String Value");
- const char* result = fields_get_value(fields, TestStringValue);
- CHECK_EQUAL("String Value", result);
- }
-
- TEST_FIXTURE(FxFields, SetValues_CanRoundtrip)
- {
- Strings values = strings_create();
- fields_set_values(fields, TestListValue, values);
- CHECK(values == fields_get_values(fields, TestListValue));
- }
-}
diff --git a/src/objects/tests/objects_tests.cpp b/src/objects/tests/objects_tests.cpp
deleted file mode 100644
index 9ef0e56..0000000
--- a/src/objects/tests/objects_tests.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * \file objects_tests.cpp
- * \brief Automated tests for the project-related objects.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "testing/testing.h"
-extern "C" {
-#include "objects/objects.h"
-}
-
-
-/**
- * \brief Run the objects library automated tests.
- * \returns OKAY if all tests completed successfully.
- */
-int objects_tests()
-{
- int z = OKAY;
- if (z == OKAY) z = tests_run_suite("fields");
- if (z == OKAY) z = tests_run_suite("project");
- if (z == OKAY) z = tests_run_suite("project_config");
- if (z == OKAY) z = tests_run_suite("session");
- return z;
-}
diff --git a/src/objects/tests/project_config_tests.cpp b/src/objects/tests/project_config_tests.cpp
deleted file mode 100644
index 16d3d03..0000000
--- a/src/objects/tests/project_config_tests.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * \file project_config_tests.cpp
- * \brief Automated tests for the project configuration data API.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "testing/testing.h"
-extern "C" {
-#include "objects/solution.h"
-#include "objects/objects_internal.h"
-}
-
-
-struct FxPrjConfig
-{
- Solution sln;
- Fields sln_blk0_fields;
-
- Project prj;
- Fields prj_blk0_fields;
-
- FxPrjConfig()
- {
- Blocks blks;
- Block blk;
- Strings strs;
-
- sln = solution_create();
- prj = project_create();
- solution_add_project(sln, prj);
-
- blks = solution_get_blocks(sln);
- blk = block_create();
- blocks_add(blks, blk);
- sln_blk0_fields = block_get_fields(blk);
-
- strs = strings_create();
- strings_add(strs, "SLN");
- fields_set_values(sln_blk0_fields, BlockDefines, strs);
-
- blks = project_get_blocks(prj);
- blk = block_create();
- blocks_add(blks, blk);
- prj_blk0_fields = block_get_fields(blk);
-
- strs = strings_create();
- strings_add(strs, "PRJ");
- fields_set_values(prj_blk0_fields, BlockDefines, strs);
- }
-
- ~FxPrjConfig()
- {
- solution_destroy(sln);
- }
-};
-
-
-SUITE(project_config)
-{
- TEST_FIXTURE(FxPrjConfig, GetValues_GetsFromBoth)
- {
- Strings strs = project_get_config_values(prj, BlockDefines);
- CHECK(strings_size(strs) == 2);
- if (strings_size(strs) == 2)
- {
- CHECK_EQUAL("SLN", strings_item(strs, 0));
- CHECK_EQUAL("PRJ", strings_item(strs, 1));
- }
- }
-}
-
diff --git a/src/objects/tests/project_tests.cpp b/src/objects/tests/project_tests.cpp
deleted file mode 100644
index 62c681f..0000000
--- a/src/objects/tests/project_tests.cpp
+++ /dev/null
@@ -1,125 +0,0 @@
-/**
- * \file project_tests.cpp
- * \brief Automated tests for the project objects API.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "testing/testing.h"
-extern "C" {
-#include "objects/solution.h"
-#include "objects/objects_internal.h"
-#include "base/env.h"
-}
-
-
-struct FxProject
-{
- Solution sln;
- Project prj;
-
- FxProject()
- {
- sln = solution_create();
- solution_set_name(sln, "MySolution");
- solution_set_location(sln, "/BaseDir/MySolution");
-
- prj = project_create();
- solution_add_project(sln, prj);
- project_set_name(prj, "MyProject");
- }
-
- ~FxProject()
- {
- solution_destroy(sln);
- }
-};
-
-
-SUITE(project)
-{
- TEST_FIXTURE(FxProject, Create_ReturnsObject_OnSuccess)
- {
- CHECK(prj != NULL);
- }
-
-
- /**********************************************************************
- * Filename tests
- **********************************************************************/
-
- TEST_FIXTURE(FxProject, GetFilenameRel_ReturnsCorrectPath_OnSameDir)
- {
- project_set_location(prj, "/BaseDir/MySolution");
- const char* filename = project_get_filename_relative(prj, NULL, ".xyz");
- CHECK_EQUAL("MyProject.xyz", filename);
- }
-
- TEST_FIXTURE(FxProject, GetFilenameRel_ReturnsCorrectPath_OnDifferentDir)
- {
- project_set_location(prj, "/BaseDir/MyProject");
- const char* filename = project_get_filename_relative(prj, NULL, ".xyz");
- CHECK_EQUAL("../MyProject/MyProject.xyz", filename);
- }
-
-
-
- /**********************************************************************
- * Kind tests
- **********************************************************************/
-
- TEST_FIXTURE(FxProject, GetKind_ReturnsSolutionKind_OnNoProjectKind)
- {
- project_set_solution(prj, sln);
- solution_set_kind(sln, "console");
- const char* result = project_get_kind(prj);
- CHECK_EQUAL("console", result);
- }
-
-
- /**********************************************************************
- * Language tests
- **********************************************************************/
-
- TEST_FIXTURE(FxProject, GetLanguage_ReturnsSolutionLanguage_OnNoProjectLanguage)
- {
- project_set_solution(prj, sln);
- solution_set_language(sln, "c#");
- const char* result = project_get_language(prj);
- CHECK_EQUAL("c#", result);
- }
-
-
- /**********************************************************************
- * Output file tests
- **********************************************************************/
-
- TEST_FIXTURE(FxProject, GetOutFile_ReturnsProjectName_OnNoTargetAndNotWindows)
- {
- env_set_os(MacOSX);
- project_set_name(prj, "MyProject");
- const char* result = project_get_outfile(prj);
- CHECK_EQUAL("MyProject", result);
- }
-
- TEST_FIXTURE(FxProject, GetOutFile_AddsExe_OnNoTargetAndWindows)
- {
- env_set_os(Windows);
- project_set_name(prj, "MyProject");
- const char* result = project_get_outfile(prj);
- CHECK_EQUAL("MyProject.exe", result);
- }
-
-
- /**********************************************************************
- * Solution tests
- **********************************************************************/
-
- TEST_FIXTURE(FxProject, SetSolution_CanRoundtrip)
- {
- CHECK(sln == project_get_solution(prj));
- }
-
-}
-
-
diff --git a/src/objects/tests/session_tests.cpp b/src/objects/tests/session_tests.cpp
deleted file mode 100644
index 916cbcc..0000000
--- a/src/objects/tests/session_tests.cpp
+++ /dev/null
@@ -1,341 +0,0 @@
-/**
- * \file session_tests.cpp
- * \brief Automated test for the Session class.
- * \author Copyright (c) 2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "testing/testing.h"
-extern "C" {
-#include "objects/session.h"
-#include "base/base.h"
-#include "base/error.h"
-#include "base/env.h"
-}
-
-
-/**************************************************************************
- * Support functions for Session object testing
- **************************************************************************/
-
-#define FAIL_SLN_PARAM (1)
-#define FAIL_PRJ_PARAM (2)
-
-static SessionFeatures features = {
- { "console", NULL },
- { "c", "c++", NULL },
-};
-
-
-static int num_solution_calls;
-static int num_project_calls;
-static int num_config_calls;
-static const char* last_config_filter;
-
-
-static int test_solution_okay(Solution sln, Stream strm)
-{
- UNUSED(sln); UNUSED(strm);
- num_solution_calls++;
- return OKAY;
-}
-
-static int test_solution_fail(Solution sln, Stream strm)
-{
- UNUSED(sln); UNUSED(strm);
- return !OKAY;
-}
-
-static int test_project_okay(Project prj, Stream strm)
-{
- UNUSED(prj); UNUSED(strm);
- num_project_calls++;
- return OKAY;
-}
-
-static int test_project_fail(Project prj, Stream strm)
-{
- UNUSED(prj); UNUSED(strm);
- return !OKAY;
-}
-
-static int test_config_okay(Project prj, Stream strm)
-{
- UNUSED(strm);
- num_config_calls++;
- last_config_filter = project_get_config(prj);
- return OKAY;
-}
-
-
-struct FxSession
-{
- Session sess;
- Solution sln;
- Project prj;
-
- FxSession()
- {
- sess = session_create();
- num_solution_calls = 0;
- num_project_calls = 0;
- num_config_calls = 0;
- last_config_filter = NULL;
- }
-
- ~FxSession()
- {
- session_destroy(sess);
- error_clear();
- }
-
- Solution AddSolution()
- {
- sln = solution_create();
- session_add_solution(sess, sln);
- solution_set_name(sln, "MySolution");
- return sln;
- }
-
- Project AddProject()
- {
- prj = project_create();
- solution_add_project(sln, prj);
- project_set_name(prj, "MyProject");
- project_set_kind(prj, "Console");
- project_set_language(prj, "C++");
- return prj;
- }
-};
-
-
-SUITE(session)
-{
- /**********************************************************************
- * Initial state checks
- **********************************************************************/
-
- TEST_FIXTURE(FxSession, Create_ReturnsObject_OnSuccess)
- {
- CHECK(sess != NULL);
- }
-
-
- /**********************************************************************
- * Solution containment tests
- **********************************************************************/
-
- TEST_FIXTURE(FxSession, NumSolutions_ReturnsZero_OnCreate)
- {
- int n = session_num_solutions(sess);
- CHECK(n == 0);
- }
-
- TEST_FIXTURE(FxSession, NumSolutions_ReturnsOne_OnAddSolution)
- {
- AddSolution();
- int n = session_num_solutions(sess);
- CHECK(n == 1);
- }
-
- TEST_FIXTURE(FxSession, GetSolution_ReturnsSolution_OnAddSolution)
- {
- Solution sln = AddSolution();
- CHECK(sln == session_get_solution(sess, 0));
- }
-
-
- /**********************************************************************
- * Object enumeration tests
- **********************************************************************/
-
- TEST_FIXTURE(FxSession, Enumerate_ReturnsOkay_OnSuccess)
- {
- SessionSolutionCallback sln_funcs[] = { NULL };
- SessionProjectCallback prj_funcs[] = { NULL };
- SessionProjectCallback cfg_funcs[] = { NULL };
- int result = session_enumerate_objects(sess, sln_funcs, prj_funcs, cfg_funcs);
- CHECK(result == OKAY);
- }
-
- TEST_FIXTURE(FxSession, Enumerate_CallsAllSolutionFuncs_OnSolution)
- {
- SessionSolutionCallback sln_funcs[] = { test_solution_okay, test_solution_okay, NULL };
- SessionProjectCallback prj_funcs[] = { NULL };
- SessionProjectCallback cfg_funcs[] = { NULL };
- AddSolution();
- session_enumerate_objects(sess, sln_funcs, prj_funcs, cfg_funcs);
- CHECK(num_solution_calls == 2);
- }
-
- TEST_FIXTURE(FxSession, Enumerate_CallsSolutionFunc_OnEachSolution)
- {
- SessionSolutionCallback sln_funcs[] = { test_solution_okay, NULL };
- SessionProjectCallback prj_funcs[] = { NULL };
- SessionProjectCallback cfg_funcs[] = { NULL };
- AddSolution();
- AddSolution();
- session_enumerate_objects(sess, sln_funcs, prj_funcs, cfg_funcs);
- CHECK(num_solution_calls == 2);
- }
-
- TEST_FIXTURE(FxSession, Enumerate_ReturnsNotOkay_OnSolutionError)
- {
- SessionSolutionCallback sln_funcs[] = { test_solution_fail, NULL };
- SessionProjectCallback prj_funcs[] = { NULL };
- SessionProjectCallback cfg_funcs[] = { NULL };
- AddSolution();
- int result = session_enumerate_objects(sess, sln_funcs, prj_funcs, cfg_funcs);
- CHECK(result != OKAY);
- }
-
- TEST_FIXTURE(FxSession, Enumerate_StopsProcessing_OnSolutionError)
- {
- SessionSolutionCallback sln_funcs[] = { test_solution_fail, test_solution_okay, NULL };
- SessionProjectCallback prj_funcs[] = { NULL };
- SessionProjectCallback cfg_funcs[] = { NULL };
- AddSolution();
- AddSolution();
- session_enumerate_objects(sess, sln_funcs, prj_funcs, cfg_funcs);
- CHECK(num_solution_calls == 0);
- }
-
- TEST_FIXTURE(FxSession, Enumerate_CallsAllProjectFuncs_OnProject)
- {
- SessionSolutionCallback sln_funcs[] = { NULL };
- SessionProjectCallback prj_funcs[] = { test_project_okay, test_project_okay, NULL };
- SessionProjectCallback cfg_funcs[] = { NULL };
- AddSolution();
- AddProject();
- session_enumerate_objects(sess, sln_funcs, prj_funcs, cfg_funcs);
- CHECK(num_project_calls == 2);
- }
-
- TEST_FIXTURE(FxSession, Enumerate_CallsProjectFunc_OnEachProject)
- {
- SessionSolutionCallback sln_funcs[] = { NULL };
- SessionProjectCallback prj_funcs[] = { test_project_okay, NULL };
- SessionProjectCallback cfg_funcs[] = { NULL };
- AddSolution();
- AddProject();
- AddProject();
- session_enumerate_objects(sess, sln_funcs, prj_funcs, cfg_funcs);
- CHECK(num_project_calls == 2);
- }
-
- TEST_FIXTURE(FxSession, Enumerate_ReturnsNotOkay_OnProjectError)
- {
- SessionSolutionCallback sln_funcs[] = { NULL };
- SessionProjectCallback prj_funcs[] = { test_project_fail, NULL };
- SessionProjectCallback cfg_funcs[] = { NULL };
- AddSolution();
- AddProject();
- int result = session_enumerate_objects(sess, sln_funcs, prj_funcs, cfg_funcs);
- CHECK(result != OKAY);
- }
-
- TEST_FIXTURE(FxSession, Enumerate_StopsProcessing_OnProjectError)
- {
- SessionSolutionCallback sln_funcs[] = { NULL };
- SessionProjectCallback prj_funcs[] = { test_project_fail, test_project_okay, NULL };
- SessionProjectCallback cfg_funcs[] = { NULL };
- AddSolution();
- AddProject();
- AddProject();
- session_enumerate_objects(sess, sln_funcs, prj_funcs, cfg_funcs);
- CHECK(num_project_calls == 0);
- }
-
- TEST_FIXTURE(FxSession, Enumerate_CallsAllConfigFuncs_OnConfig)
- {
- SessionSolutionCallback sln_funcs[] = { NULL };
- SessionProjectCallback prj_funcs[] = { session_enumerate_configurations, NULL };
- SessionProjectCallback cfg_funcs[] = { test_config_okay, test_config_okay, NULL };
- AddSolution();
- AddProject();
- solution_add_config(sln, "Debug");
- session_enumerate_objects(sess, sln_funcs, prj_funcs, cfg_funcs);
- CHECK(num_config_calls == 2);
- }
-
- TEST_FIXTURE(FxSession, Enumerate_SetsConfigFilter_OnConfig)
- {
- SessionSolutionCallback sln_funcs[] = { NULL };
- SessionProjectCallback prj_funcs[] = { session_enumerate_configurations, NULL };
- SessionProjectCallback cfg_funcs[] = { test_config_okay, test_config_okay, NULL };
- AddSolution();
- AddProject();
- solution_add_config(sln, "Debug");
- session_enumerate_objects(sess, sln_funcs, prj_funcs, cfg_funcs);
- CHECK_EQUAL("Debug", last_config_filter);
- }
-
-
- /**********************************************************************
- * Session validation tests
- **********************************************************************/
-
- TEST_FIXTURE(FxSession, Validate_ReturnsOkay_OnNoSolutions)
- {
- int result = session_validate(sess, &features);
- CHECK(result == OKAY);
- }
-
- TEST_FIXTURE(FxSession, Validate_ReturnsOkay_OnAllsWell)
- {
- AddSolution();
- AddProject();
- project_set_language(prj, "c++");
- int result = session_validate(sess, &features);
- CHECK(result == OKAY);
- }
-
- TEST_FIXTURE(FxSession, Validate_NotOkay_OnEmptySolution)
- {
- AddSolution();
- int result = session_validate(sess, &features);
- CHECK(result != OKAY);
- CHECK_EQUAL("no projects defined for solution 'MySolution'", error_get());
- }
-
- TEST_FIXTURE(FxSession, Validate_NotOkay_OnNullKind)
- {
- AddSolution();
- AddProject();
- project_set_kind(prj, NULL);
- int result = session_validate(sess, &features);
- CHECK(result != OKAY);
- CHECK_EQUAL("project 'MyProject' needs a kind", error_get());
- }
-
- TEST_FIXTURE(FxSession, Validate_NotOkay_OnUnsupportedKind)
- {
- AddSolution();
- AddProject();
- project_set_kind(prj, "nonesuch");
- int result = session_validate(sess, &features);
- CHECK(result != OKAY);
- CHECK_EQUAL("nonesuch projects are not supported by this action", error_get());
- }
-
- TEST_FIXTURE(FxSession, Validate_NotOkay_OnNullLanguage)
- {
- AddSolution();
- AddProject();
- project_set_language(prj, NULL);
- int result = session_validate(sess, &features);
- CHECK(result != OKAY);
- CHECK_EQUAL("project 'MyProject' needs a language", error_get());
- }
-
- TEST_FIXTURE(FxSession, Validate_NotOkay_OnUnsupportedLanguage)
- {
- AddSolution();
- AddProject();
- project_set_language(prj, "nonesuch");
- int result = session_validate(sess, &features);
- CHECK(result != OKAY);
- CHECK_EQUAL("nonesuch projects are not supported by this action", error_get());
- }
-}
-
diff --git a/src/objects/tests/solution_tests.cpp b/src/objects/tests/solution_tests.cpp
deleted file mode 100644
index ccf2073..0000000
--- a/src/objects/tests/solution_tests.cpp
+++ /dev/null
@@ -1,110 +0,0 @@
-/**
- * \file solution_tests.cpp
- * \brief Automated tests for the Solution class.
- * \author Copyright (c) 2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "testing/testing.h"
-extern "C" {
-#include "objects/solution.h"
-#include "objects/objects_internal.h"
-#include "base/strings.h"
-}
-
-
-struct FxSolution
-{
- Solution sln;
-
- FxSolution()
- {
- sln = solution_create();
- }
-
- ~FxSolution()
- {
- if (sln)
- solution_destroy(sln);
- }
-};
-
-
-SUITE(project)
-{
- TEST_FIXTURE(FxSolution, Create_ReturnsObject_OnSuccess)
- {
- CHECK(sln != NULL);
- }
-
- /**********************************************************************
- * Configuration containment tests
- **********************************************************************/
-
- TEST_FIXTURE(FxSolution, NumConfigs_IsZero_OnStartup)
- {
- int result = solution_num_configs(sln);
- CHECK(result == 0);
- }
-
- TEST_FIXTURE(FxSolution, AddConfig_IncrementsNumConfigs)
- {
- solution_add_config(sln, "Debug");
- int result = solution_num_configs(sln);
- CHECK(result == 1);
- }
-
- TEST_FIXTURE(FxSolution, AddConfig_CanRoundtrip)
- {
- solution_add_config(sln, "Debug");
- const char* result = solution_get_config(sln, 0);
- CHECK_EQUAL("Debug", result);
- }
-
- TEST_FIXTURE(FxSolution, GetConfigs_ReturnsEmptyList_OnStartup)
- {
- Strings result = solution_get_configs(sln);
- CHECK(strings_size(result) == 0);
- }
-
- TEST_FIXTURE(FxSolution, GetConfigs_ReturnsList_OnItemsAdded)
- {
- solution_add_config(sln, "Debug");
- Strings result = solution_get_configs(sln);
- CHECK_EQUAL("Debug", strings_item(result, 0));
- }
-
-
- /**********************************************************************
- * Project containment tests
- **********************************************************************/
-
- TEST_FIXTURE(FxSolution, NumProjects_IsZero_OnStartup)
- {
- int result = solution_num_projects(sln);
- CHECK(result == 0);
- }
-
- TEST_FIXTURE(FxSolution, AddProject_IncrementsNumProjects)
- {
- Project prj = project_create();
- solution_add_project(sln, prj);
- int result = solution_num_projects(sln);
- CHECK(result == 1);
- }
-
- TEST_FIXTURE(FxSolution, AddProject_CanRoundtrip)
- {
- Project prj = project_create();
- solution_add_project(sln, prj);
- Project result = solution_get_project(sln, 0);
- CHECK(prj == result);
- }
-
- TEST_FIXTURE(FxSolution, AddProject_SetsProjectSolution)
- {
- Project prj = project_create();
- solution_add_project(sln, prj);
- CHECK(sln == project_get_solution(prj));
- }
-}
diff --git a/src/platform/platform.h b/src/platform/platform.h
deleted file mode 100644
index a3a740d..0000000
--- a/src/platform/platform.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/**
- * \file platform.h
- * \brief Platform abstraction API.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- *
- * \defgroup platform Platform
- *
- * Platform abstraction; primarily file system and directory management.
- *
- * @{
- */
-#if !defined(PREMAKE_PLATFORM_H)
-#define PREMAKE_PLATFORM_H
-
-
-#if defined(__linux__)
-#define PLATFORM_LINUX (1)
-#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
-#define PLATFORM_BSD (1)
-#elif defined(__APPLE__) && defined(__MACH__)
-#define PLATFORM_MACOSX (1)
-#else
-#define PLATFORM_WINDOWS (1)
-#endif
-
-
-DECLARE_CLASS(PlatformSearch)
-
-
-/**
- * Create a directory, if it doesn't exist already.
- * \returns OKAY if successful.
- */
-int platform_create_dir(const char* path);
-
-
-/**
- * Create a GUID and copy it into the supplied buffer.
- * \param buffer The buffer to hold the new GUID; must hold at least 36 characters.
- */
-void platform_create_guid(char* buffer);
-
-
-/**
- * Get the current working directory.
- * \param buffer A buffer to hold the directory.
- * \param size The size of the buffer.
- * \returns OKAY if successful.
- */
-int platform_dir_get_current(char* buffer, int size);
-
-
-/**
- * Set the current working directory.
- * \param path The new working directory.
- * \returns OKAY if successful.
- */
-int platform_dir_set_current(const char* path);
-
-
-/**
- * Create a new platform file search context.
- */
-PlatformSearch platform_search_create(const char* mask);
-
-
-/**
- * Destroy a platform search context.
- */
-void platform_search_destroy(PlatformSearch search);
-
-
-/**
- * Retrieve the name of the current match in the search.
- */
-const char* platform_search_get_name(PlatformSearch search);
-
-
-/**
- * Determine if the current match is a file or a directory.
- */
-int platform_search_is_file(PlatformSearch search);
-
-
-/**
- * Retrieve the next match in a file system search.
- * \returns True if another match is available.
- */
-int platform_search_next(PlatformSearch search);
-
-
-#endif
-/** @} */
diff --git a/src/platform/posix.c b/src/platform/posix.c
deleted file mode 100644
index e1cecf1..0000000
--- a/src/platform/posix.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
- * \file posix.c
- * \brief POSIX implementation of Premake platform abstraction.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "platform/platform.h"
-#include "base/path.h"
-#include "base/string.h"
-
-#if !defined(PLATFORM_WINDOWS)
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <dlfcn.h>
-#include <dirent.h>
-#include <fnmatch.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/stat.h>
-#include <ctype.h>
-
-DEFINE_CLASS(PlatformSearch)
-{
- String directory;
- String mask;
- DIR* handle;
- struct dirent* entry;
-};
-
-
-int platform_create_dir(const char* path)
-{
- return mkdir(path, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
-}
-
-
-void platform_create_guid(char* buffer)
-{
- /* not sure how to get a UUID here, so I fake it */
- FILE* rnd = fopen("/dev/random", "rb");
- fread(buffer, 16, 1, rnd);
- fclose(rnd);
-}
-
-
-int platform_dir_get_current(char* buffer, int size)
-{
- char* result = getcwd(buffer, size);
- return (result != NULL) ? OKAY : !OKAY;
-}
-
-
-int platform_dir_set_current(const char* path)
-{
- return chdir(path);
-}
-
-
-PlatformSearch platform_search_create(const char* mask)
-{
- PlatformSearch search;
- const char* dir;
-
- dir = path_directory(mask);
- mask = path_filename(mask);
- if (strlen(dir) == 0)
- {
- dir = ".";
- }
-
- search = ALLOC_CLASS(PlatformSearch);
- search->directory = string_create(dir);
- search->mask = string_create(mask);
- search->handle = opendir(dir);
- search->entry = NULL;
- return search;
-}
-
-
-void platform_search_destroy(PlatformSearch search)
-{
- if (search->handle != NULL)
- {
- closedir(search->handle);
- }
- free(search);
-}
-
-
-const char* platform_search_get_name(PlatformSearch search)
-{
- return search->entry->d_name;
-}
-
-
-int platform_search_is_file(PlatformSearch search)
-{
- struct stat info;
-
- const char* dir = string_cstr(search->directory);
- const char* path = path_join(dir, search->entry->d_name);
- if (stat(path, &info) == 0)
- {
- return S_ISREG(info.st_mode);
- }
-
- return 0;
-}
-
-
-int platform_search_next(PlatformSearch search)
-{
- const char* mask = string_cstr(search->mask);
-
- if (search->handle == NULL)
- {
- return 0;
- }
-
- search->entry = readdir(search->handle);
- while (search->entry != NULL)
- {
- if (fnmatch(mask, search->entry->d_name, 0) == 0)
- {
- return 1;
- }
- search->entry = readdir(search->handle);
- }
-
- return 0;
-}
-
-#endif
-
diff --git a/src/platform/windows.c b/src/platform/windows.c
deleted file mode 100644
index 1a1ae6d..0000000
--- a/src/platform/windows.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/**
- * \file windows.c
- * \brief Windows implementation of Premake platform abstraction.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include <stdlib.h>
-#include "premake.h"
-#include "platform/platform.h"
-#if defined(PLATFORM_WINDOWS)
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-
-
-DEFINE_CLASS(PlatformSearch)
-{
- HANDLE handle;
- int is_first;
- WIN32_FIND_DATA entry;
-};
-
-
-int platform_create_dir(const char* path)
-{
- return CreateDirectory(path, NULL) ? OKAY : !OKAY;
-}
-
-
-void platform_create_guid(char* buffer)
-{
- static int (__stdcall *CoCreateGuid)(char*) = NULL;
- if (CoCreateGuid == NULL)
- {
- HMODULE hOleDll = LoadLibrary("OLE32.DLL");
- CoCreateGuid = (int(__stdcall*)(char*))GetProcAddress(hOleDll, "CoCreateGuid");
- }
- CoCreateGuid(buffer);
-}
-
-
-int platform_dir_get_current(char* buffer, int size)
-{
- DWORD result = GetCurrentDirectory(size, buffer);
- return (result != 0) ? OKAY : !OKAY;
-}
-
-
-int platform_dir_set_current(const char* path)
-{
- DWORD result = SetCurrentDirectory(path);
- return (result != 0) ? OKAY : !OKAY;
-}
-
-
-PlatformSearch platform_search_create(const char* mask)
-{
- PlatformSearch search = ALLOC_CLASS(PlatformSearch);
- search->handle = FindFirstFile(mask, &search->entry);
- search->is_first = 1;
- return search;
-}
-
-
-void platform_search_destroy(PlatformSearch search)
-{
- if (search->handle != INVALID_HANDLE_VALUE)
- {
- FindClose(search->handle);
- }
- free(search);
-}
-
-
-const char* platform_search_get_name(PlatformSearch search)
-{
- return search->entry.cFileName;
-}
-
-
-int platform_search_is_file(PlatformSearch search)
-{
- return (search->entry.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0;
-}
-
-
-int platform_search_next(PlatformSearch search)
-{
- if (search->handle == INVALID_HANDLE_VALUE)
- {
- return 0;
- }
-
- if (search->is_first)
- {
- search->is_first = 0;
- return 1;
- }
- else
- {
- return FindNextFile(search->handle, &search->entry);
- }
-}
-
-#endif
diff --git a/src/premake.c b/src/premake.c
deleted file mode 100644
index 63e4668..0000000
--- a/src/premake.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * \file premake.c
- * \brief Program entry point.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include <stdlib.h>
-#include "premake.h"
-#include "host/host.h"
-#include "actions/actions.h"
-
-
-/**
- * \brief Program entry point.
- */
-int main(int argc, const char** argv)
-{
- Host host;
- int z = OKAY;
-
- /* If testing is enabled, calling premake.exe with no arguments will
- * trigger a call to the automated tests. This is used by a post-build
- * step to run the tests after every successful build. */
-#if defined(TESTING_ENABLED)
- if (argc == 1)
- {
- return host_tests();
- }
-#else
- UNUSED(argc);
-#endif
-
- /* initialize */
- host = host_create();
- host_set_argv(host, argv);
-
- /* run */
- if (z == OKAY) z = host_parse_argv(host);
- if (z == OKAY) z = host_run_script(host);
- if (z == OKAY) z = host_show_help(host);
- if (z == OKAY) z = host_run_action(host);
-
- /* report back to the user and clean up */
- host_report_results();
- host_destroy(host);
- return z;
-}
-
diff --git a/src/premake.h b/src/premake.h
deleted file mode 100644
index c5adb88..0000000
--- a/src/premake.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * \file premake.h
- * \brief Global program definitions.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-
-/**
- * The default filename for Premake scripts.
- */
-#define DEFAULT_SCRIPT_NAME "premake4.lua"
-
-
-/**
- * The success return code; the symbol avoids confusion about zero == false.
- */
-#define OKAY (0)
-
-
-/**
- * Macro to declare new "classes" - just opaque struct pointers. The macro
- * ensures that they all get defined consistently.
- */
-#define DECLARE_CLASS(n) typedef struct n##_impl* n;
-
-
-/**
- * Macro to define new "classes" - just structs with a special name.
- */
-#define DEFINE_CLASS(n) struct n##_impl
-
-
-/**
- * Macro to allocate memory for a "class" - just a struct with a special name.
- */
-#define ALLOC_CLASS(n) (n)malloc(sizeof(struct n##_impl))
-
-
-/**
- * Mark a variable as unused, so the compiler won't complain about it. I suspect
- * there is a better way to do this.
- */
-#define UNUSED(var) var = 0
diff --git a/src/premake.lua b/src/premake.lua
index d4059b5..15963a5 100644
--- a/src/premake.lua
+++ b/src/premake.lua
@@ -3,10 +3,6 @@ package.target = "premake4"
package.language = "c"
package.kind = "exe"
- local lua = "base/lua-5.1.2"
- local unittest = "testing/UnitTest++/src"
-
-
-- Build settings
package.buildflags =
@@ -37,49 +33,30 @@ package.kind = "exe"
{
"_CRT_SECURE_NO_WARNINGS"
}
-
+
package.includepaths =
{
- ".",
- lua .. "/src",
+ "host/lua-5.1.2/src"
}
-
+
package.files =
{
- matchrecursive("*.h", "*.c"),
+ matchrecursive("host/*.h", "host/*.c"),
+ matchrecursive("*.lua", "*.tmpl"),
+ matchrecursive("../tests/*.lua")
}
-
+
package.excludes =
{
- lua .. "/src/lua.c",
- lua .. "/src/luac.c",
- lua .. "/src/print.c",
- matchfiles(lua .. "/etc/*.c")
- }
-
-
--- Automated tests
-
- if (not options["no-tests"]) then
-
- -- UnitTest++ is a C++ system
- package.language = "c++"
+ "premake.lua", "premake4.lua",
+ "host/lua-5.1.2/src/lua.c",
+ "host/lua-5.1.2/src/luac.c",
+ "host/lua-5.1.2/src/print.c",
+ matchrecursive("host/lua-5.1.2/*.lua"),
+ matchfiles("host/lua-5.1.2/etc/*.c")
+ }
- -- Define a symbol so I can compile in the testing calls
- table.insert(package.defines, "TESTING_ENABLED")
-
- table.insert(package.files, matchrecursive("*.cpp"))
- table.insert(package.excludes, matchfiles(unittest .. "/tests/*"))
-
- if (windows) then
- table.insert(package.excludes, matchfiles(unittest .. "/Posix/*"))
- package.config["Debug"].postbuildcommands = { "..\\bin\\debug\\premake4.exe" }
- package.config["Release"].postbuildcommands = { "..\\bin\\release\\premake4.exe" }
- else
- table.insert(package.excludes, matchfiles(unittest .. "/Win32/*"))
- package.config["Debug"].postbuildcommands = { "../bin/debug/premake4" }
- package.config["Release"].postbuildcommands = { "../bin/release/premake4" }
- end
-
+ if (linux) then
+ table.insert(package.links, "m")
end
diff --git a/src/script/fn_accessor.c b/src/script/fn_accessor.c
deleted file mode 100644
index e2b02d4..0000000
--- a/src/script/fn_accessor.c
+++ /dev/null
@@ -1,246 +0,0 @@
-/**
- * \file fn_accessor.c
- * \brief A generic getter/setter for project fields.
- * \author Copyright (c) 2007-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "script_internal.h"
-#include "base/cstr.h"
-#include "base/error.h"
-
-
-static int fn_accessor_object_has_field(FieldInfo* fields, const char* field_name);
-static int fn_accessor_register(lua_State* L, FieldInfo* fields);
-static int fn_accessor_register_field(lua_State* L, FieldInfo* field);
-static int fn_accessor_append_value(lua_State* L, FieldInfo* field, int tbl, int idx);
-
-
-/**
- * Using the field information lists for each of the project objects (solution, project,
- * and configuration) register accessor functions in the script environment. Examples of
- * accessor functions include location(), language(), kind(), and so on; function that
- * get and set the project object properties.
- * \returns OKAY if successful.
- */
-int fn_accessor_register_all(lua_State* L)
-{
- int z = OKAY;
- if (z == OKAY) z = fn_accessor_register(L, SolutionFieldInfo);
- if (z == OKAY) z = fn_accessor_register(L, ProjectFieldInfo);
- if (z == OKAY) z = fn_accessor_register(L, BlockFieldInfo);
- return z;
-}
-
-
-/**
- * Register the accessor functions for a particular set of fields.
- * \returns OKAY if successful.
- */
-static int fn_accessor_register(lua_State* L, FieldInfo* fields)
-{
- int i, z = OKAY;
-
- for (i = 0; z == OKAY && fields[i].name != NULL; ++i)
- {
- z = fn_accessor_register_field(L, &fields[i]);
- }
-
- return z;
-}
-
-
-/**
- * Register a single accessor function.
- * \returns OKAY if successful.
- */
-static int fn_accessor_register_field(lua_State* L, FieldInfo* field)
-{
- int container_type, z;
-
- /* has this accessor already been registered? This will happen if two object
- * types (ie. solution and project) define the same property. If so, skip it */
- lua_getglobal(L, field->name);
- z = lua_isnil(L, -1);
- lua_pop(L, 1);
- if (!z) return OKAY;
-
- /* figure out what object types this accessor applies to; may be more than one */
- container_type = 0;
- if (fn_accessor_object_has_field(SolutionFieldInfo, field->name)) container_type |= SolutionObject;
- if (fn_accessor_object_has_field(ProjectFieldInfo, field->name)) container_type |= ProjectObject;
- if (fn_accessor_object_has_field(BlockFieldInfo, field->name)) container_type |= BlockObject;
-
- /* register the accessor function */
- lua_pushnumber(L, container_type);
- lua_pushlightuserdata(L, field);
- lua_pushcclosure(L, fn_accessor, 2);
- lua_setglobal(L, field->name);
- return OKAY;
-}
-
-
-/**
- * Determine if a field list contains a field with a particular name.
- * \returns True if the field is contained by the list.
- */
-static int fn_accessor_object_has_field(FieldInfo* fields, const char* field_name)
-{
- int i;
- for (i = 0; fields[i].name != NULL; ++i)
- {
- if (cstr_eq(fields[i].name, field_name))
- return 1;
- }
- return 0;
-}
-
-
-/**
- * The accessor script function; all of the individually registered accessors
- * (location(), language(), etc.) point to here, and this is where all of the
- * work gets done to get or set an object property or list.
- * \returns The current value of the field.
- */
-int fn_accessor(lua_State* L)
-{
- FieldInfo* field;
- int container_type;
-
- /* get the required container object */
- container_type = lua_tointeger(L, lua_upvalueindex(1));
- if (!script_internal_get_active_object(L, container_type, IS_REQUIRED))
- {
- return 0;
- }
-
- /* get information about the field being accessed */
- field = (FieldInfo*)lua_touserdata(L, lua_upvalueindex(2));
-
- /* if a value is provided, set the field */
- if (lua_gettop(L) > 1)
- {
- if (field->kind == StringField || field->kind == PathField)
- {
- fn_accessor_set_string_value(L, field);
- }
- else
- {
- fn_accessor_set_list_value(L, field);
- }
- }
-
- /* return the current value of the field */
- lua_getfield(L, -1, field->name);
- return 1;
-}
-
-
-/**
- * Sets a string field to the value on the bottom of the Lua stack.
- * \returns OKAY if successful.
- */
-int fn_accessor_set_string_value(lua_State* L, FieldInfo* field)
-{
- /* can't set lists to simple fields */
- if (lua_istable(L, 1))
- {
- luaL_error(L, "the field '%s' does not support lists of values", field->name);
- return !OKAY;
- }
-
- /* if a validator function is present, call it */
- if (field->validator != NULL)
- {
- const char* value = luaL_checkstring(L, 1);
- if (!field->validator(value))
- {
- luaL_error(L, "invalid value '%s'", value);
- return !OKAY;
- }
- }
-
- /* set the field */
- lua_pushvalue(L, 1);
- lua_setfield(L, -2, field->name);
- return OKAY;
-}
-
-
-/**
- * Appends the value or list at the bottom of the Lua stack to the specified list field.
- * \returns OKAY if successful.
- */
-int fn_accessor_set_list_value(lua_State* L, FieldInfo* field)
-{
- int z;
-
- /* get the current value of the field */
- lua_getfield(L, -1, field->name);
-
- /* move the values into the field */
- z = fn_accessor_append_value(L, field, lua_gettop(L), 1);
-
- /* remove the field value from the stack */
- lua_pop(L, 1);
- return z;
-}
-
-
-/**
- * Append a value to table. If the value is itself a table, it is "flattened" into the
- * destination table by iterating over each of its items and adding each in turn to the
- * target table.
- * \param L The current Lua state.
- * \param field A description of the field being populated.
- * \param tbl The table to contain the values.
- * \param idx The value to add to the table.
- */
-static int fn_accessor_append_value(lua_State* L, FieldInfo* field, int tbl, int idx)
-{
- int i, n;
-
- /* if the value to be appended is a table, expand it and insert each item individually */
- if (lua_istable(L, idx))
- {
- n = luaL_getn(L, idx);
- for (i = 1; i <= n; ++i)
- {
- lua_rawgeti(L, idx, i);
- fn_accessor_append_value(L, field, tbl, lua_gettop(L));
- lua_pop(L, 1);
- }
- }
- else
- {
- /* if this field contains files, check for and expand wildcards by calling match() */
- const char* value = lua_tostring(L, idx);
- if (field->kind == FilesField && cstr_contains(value, "*"))
- {
- lua_getglobal(L, "match");
- lua_pushvalue(L, idx);
- lua_call(L, 1, 1);
- fn_accessor_append_value(L, field, tbl, lua_gettop(L));
- lua_pop(L, 1);
- }
- else
- {
- /* if a validator function is present, call it */
- if (field->validator != NULL)
- {
- const char* value = lua_tostring(L, idx);
- if (!field->validator(value))
- {
- luaL_error(L, "invalid value '%s'", value);
- return !OKAY;
- }
- }
-
- lua_pushvalue(L, idx);
- n = luaL_getn(L, tbl);
- lua_rawseti(L, tbl, n + 1);
- }
- }
-
- return OKAY;
-}
diff --git a/src/script/fn_configuration.c b/src/script/fn_configuration.c
deleted file mode 100644
index 4a6154c..0000000
--- a/src/script/fn_configuration.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * \file fn_configuration.c
- * \brief Implements the configuration() function.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "script_internal.h"
-
-
-/**
- * Specify the build configurations for a solution.
- */
-int fn_configuration(lua_State* L)
-{
- /* if there are parameters, create a new configuration block */
- if (lua_gettop(L) > 0)
- {
- /* get the active object, which will contain this new configuration */
- if (!script_internal_get_active_object(L, SolutionObject | ProjectObject, IS_REQUIRED))
- {
- return 0;
- }
-
- /* create a new configuration block in the container */
- script_internal_create_block(L);
-
- /* populate the list of terms from the arguments */
- script_internal_get_active_object(L, BlockObject, IS_REQUIRED);
- fn_accessor_set_list_value(L, &BlockFieldInfo[BlockTerms]);
- }
-
- script_internal_get_active_object(L, BlockObject, IS_OPTIONAL);
- return 1;
-}
-
diff --git a/src/script/fn_configurations.c b/src/script/fn_configurations.c
deleted file mode 100644
index 96615b8..0000000
--- a/src/script/fn_configurations.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * \file fn_configurations.c
- * \brief Specify the build configurations.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "script_internal.h"
-
-
-/**
- * Specify the build configurations for a solution.
- */
-int fn_configurations(lua_State* L)
-{
- FieldInfo* field;
-
- if (!script_internal_get_active_object(L, SolutionObject, IS_REQUIRED))
- {
- return 0;
- }
-
- /* configurations may not be modified once projects are defined */
- lua_getfield(L, -1, PROJECTS_KEY);
- if (luaL_getn(L, -1) > 0)
- {
- luaL_error(L, "configurations may not be modified after projects are defined");
- }
- lua_pop(L, 1);
-
- /* get information about the field being accessed */
- field = (FieldInfo*)lua_touserdata(L, lua_upvalueindex(2));
-
- /* if a value is provided, set the field */
- if (lua_gettop(L) > 1)
- {
- fn_accessor_set_list_value(L, &SolutionFieldInfo[SolutionConfigurations]);
- }
-
- /* return the current value of the field */
- lua_getfield(L, -1, SolutionFieldInfo[SolutionConfigurations].name);
- return 1;
-}
diff --git a/src/script/fn_dofile.c b/src/script/fn_dofile.c
deleted file mode 100644
index 4d0ffc0..0000000
--- a/src/script/fn_dofile.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/**
- * \file fn_dofile.c
- * \brief A custom implementation of dofile().
- * \author Copyright (c) 2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "script_internal.h"
-#include "base/dir.h"
-#include "base/path.h"
-#include "base/string.h"
-
-
-/**
- * Replacement implementation for Lua's dofile() function; manages Premake specific
- * features like the _FILE variable, and makes sure the directory containing the
- * running script is kept current.
- */
-int fn_dofile(lua_State* L)
-{
- const char *filename;
- const char* full_path;
- const char* script_dir;
- String old_file;
- String old_working_dir;
- int top, result;
-
- filename = luaL_checkstring(L, 1);
-
- /* remember the previous file that was being run; will restore after script runs */
- lua_getglobal(L, FILE_KEY);
- old_file = string_create(lua_tostring(L, -1));
- lua_pop(L, 1);
-
- /* remember the current working directory; will restore after script runs */
- old_working_dir = string_create(dir_get_current());
-
- /* set the _FILE global to the full path of the script being run */
- full_path = path_absolute(filename);
- lua_pushstring(L, full_path);
- lua_setglobal(L, FILE_KEY);
-
- /* make the script directory the current directory */
- script_dir = path_directory(full_path);
- dir_set_current(script_dir);
-
- /* I'll need this to figure the number of return values later */
- top = lua_gettop(L);
-
- /* use absolute path to run script so full path will be shown in error messages */
- full_path = path_translate(full_path, NULL);
- result = luaL_loadfile(L, full_path);
- if (result == OKAY)
- {
- lua_call(L, 0, LUA_MULTRET);
- }
-
- /* restore the previous working directory */
- dir_set_current(string_cstr(old_working_dir));
-
- /* restore the previous file value */
- lua_pushstring(L, string_cstr(old_file));
- lua_setglobal(L, FILE_KEY);
-
- /* clean up */
- string_destroy(old_working_dir);
- string_destroy(old_file);
-
- if (result != OKAY)
- {
- lua_error(L);
- }
-
- /* return the number of values returned by the script */
- return lua_gettop(L) - top;
-}
diff --git a/src/script/fn_error.c b/src/script/fn_error.c
deleted file mode 100644
index 0b00add..0000000
--- a/src/script/fn_error.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/**
- * \file fn_error.c
- * \brief Script error handler.
- * \author Copyright (c) 2007-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "script_internal.h"
-#include "base/error.h"
-
-
-/**
- * Handler for errors reported out the script; copies the error message to
- * Premake's global error state.
- */
-int fn_error(lua_State* L)
-{
- const char* message = lua_tostring(L, 1);
- error_set(message);
- return 0;
-}
diff --git a/src/script/fn_getcwd.c b/src/script/fn_getcwd.c
deleted file mode 100644
index 47d1a20..0000000
--- a/src/script/fn_getcwd.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/**
- * \file fn_getcwd.c
- * \brief os.getcwd() returns the current working directory.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "script_internal.h"
-#include "base/dir.h"
-
-
-/**
- * Implementation of os.getcwd(): returns the current working directory.
- */
-int fn_getcwd(lua_State* L)
-{
- const char* cwd = dir_get_current();
- lua_pushstring(L, cwd);
- return 1;
-}
diff --git a/src/script/fn_include.c b/src/script/fn_include.c
deleted file mode 100644
index f2abc1e..0000000
--- a/src/script/fn_include.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * \file fn_include.c
- * \brief Include an directory in the script, running the contained "premake4.lua".
- * \author Copyright (c) 2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "script_internal.h"
-#include "base/path.h"
-
-
-/**
- * Include a directory into the current script, calling the enclosed "premake4.lua".
- * This is a shortcut for `dofile("some_directory/premake4.lua")`.
- */
-int fn_include(lua_State* L)
-{
- /* append default file name to the passed in path */
- const char* directory = luaL_checkstring(L, 1);
- const char* path = path_join(directory, DEFAULT_SCRIPT_NAME);
-
- /* then pass it to dofile() */
- lua_pop(L, 1);
- lua_pushstring(L, path);
- return fn_dofile(L);
-}
diff --git a/src/script/fn_match.c b/src/script/fn_match.c
deleted file mode 100644
index f05a7a5..0000000
--- a/src/script/fn_match.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/**
- * \file fn_match.c
- * \brief Perform a wildcard match for files.
- * \author Copyright (c) 2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "script_internal.h"
-#include "platform/platform.h"
-#include "base/cstr.h"
-#include "base/path.h"
-#include "base/string.h"
-
-static void do_scan(lua_State* L, const char* mask);
-
-
-/**
- * Perform a wildcard match for files; returns a table of file names which
- * match the supplied pattern.
- */
-int fn_match(lua_State* L)
-{
- int i, n;
-
- /* table to hold the results */
- lua_newtable(L);
-
- /* scan each mask in the provided list */
- n = lua_gettop(L);
- for (i = 1; i < n; ++i)
- {
- const char* mask = luaL_checkstring(L, i);
- do_scan(L, mask);
- }
-
- return 1;
-}
-
-
-/**
- * Does the real work of scanning the file system and matching the supplied patterns.
- */
-void do_scan(lua_State* L, const char* mask)
-{
- /* mark the end of the results lists so I know where to add new entries */
- int n = luaL_getn(L, -1);
-
- /* the search will only return file names; remember the path so I can add it back */
- String dir = string_create(path_directory(mask));
-
- /* search */
- PlatformSearch search = platform_search_create(mask);
- while (platform_search_next(search))
- {
- const char* filename = platform_search_get_name(search);
- int is_file = platform_search_is_file(search);
-
- if (is_file)
- {
- /* add it to the results */
- const char* path = path_join(string_cstr(dir), filename);
- lua_pushstring(L, path);
- lua_rawseti(L, -2, ++n);
- }
- }
- platform_search_destroy(search);
-
- /* if the mask uses the ** pattern, recurse into subdirectories */
- if (cstr_contains(mask, "**"))
- {
- mask = path_filename(mask);
-
- /* look for subdirectories */
- search = platform_search_create(path_join(string_cstr(dir), "*"));
- while (platform_search_next(search))
- {
- if (!platform_search_is_file(search))
- {
- const char* dirname = platform_search_get_name(search);
- if (dirname[0] != '.')
- {
- /* build a new mask from the original directory, this new subdirectory,
- * and the original search mask. Need to put it in a string to ensure
- * its buffer doesn't get overwritten */
- String subsearch;
- const char* path = path_join(string_cstr(dir), dirname);
- path = path_join(path, mask);
- subsearch = string_create(path);
-
- /* recurse to search this subdirectory */
- do_scan(L, string_cstr(subsearch));
-
- string_destroy(subsearch);
- }
- }
- }
- platform_search_destroy(search);
- }
-
- string_destroy(dir);
-}
diff --git a/src/script/fn_project.c b/src/script/fn_project.c
deleted file mode 100644
index 4874634..0000000
--- a/src/script/fn_project.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * \file fn_project.c
- * \brief Create or select a project object.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "script_internal.h"
-#include "base/guid.h"
-
-
-/**
- * Create a new project object, or select an existing one.
- */
-int fn_project(lua_State* L)
-{
- const char* name;
-
- /* if there are no parameters, return the active project */
- if (lua_gettop(L) == 0)
- {
- script_internal_get_active_object(L, ProjectObject, IS_OPTIONAL);
- return 1;
- }
-
- /* get the active solution, which will contain this project */
- if (!script_internal_get_active_object(L, SolutionObject, IS_REQUIRED))
- {
- return 0;
- }
-
- name = luaL_checkstring(L, 1);
-
- /* get the projects list from the solution */
- lua_getfield(L, -1, PROJECTS_KEY);
-
- /* check to see if a project with this name already exists */
- lua_getfield(L, -1, name);
- if (lua_isnil(L, -1))
- {
- /* this is a new project; check to be sure the configurations have been set */
- lua_getfield(L, -3, SolutionFieldInfo[SolutionConfigurations].name);
- if (luaL_getn(L, -1) == 0)
- {
- luaL_error(L, "no configurations defined");
- return 0;
- }
- lua_pop(L, 1);
-
- /* project does not exists, create it */
- lua_newtable(L);
-
- /* set the name */
- lua_pushvalue(L, 1);
- lua_setfield(L, -2, ProjectFieldInfo[ProjectName].name);
-
- /* set the base directory */
- lua_pushstring(L, script_internal_script_dir(L));
- lua_setfield(L, -2, ProjectFieldInfo[ProjectBaseDir].name);
-
- /* set a default GUID */
- lua_pushstring(L, guid_create());
- lua_setfield(L, -2, ProjectFieldInfo[ProjectGuid].name);
-
- /* configure the initial configuration block list */
- lua_newtable(L);
- lua_setfield(L, -2, BLOCKS_KEY);
- script_internal_create_block(L);
-
- /* use the list of fields to populate the object properties and accessor functions */
- script_internal_populate_object(L, ProjectFieldInfo);
-
- /* add it to solution's list of projects, keyed by name */
- lua_pushvalue(L, -1);
- lua_setfield(L, -4, name);
-
- /* also add with integer key */
- lua_pushvalue(L, -1);
- lua_rawseti(L, -4, luaL_getn(L, -4) + 1);
- }
-
- /* activate and return the solution object */
- script_internal_set_active_object(L, ProjectObject);
- return 1;
-}
-
diff --git a/src/script/fn_solution.c b/src/script/fn_solution.c
deleted file mode 100644
index ba3e852..0000000
--- a/src/script/fn_solution.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/**
- * \file fn_solution.c
- * \brief Create or select a solution object.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "script_internal.h"
-
-
-/**
- * Create a new solution object, or select an existing one.
- */
-int fn_solution(lua_State* L)
-{
- const char* name;
-
- /* if there are no parameters, return the active solution */
- if (lua_gettop(L) == 0)
- {
- script_internal_get_active_object(L, SolutionObject, IS_OPTIONAL);
- return 1;
- }
-
- name = luaL_checkstring(L, 1);
-
- /* check to see if a solution with this name already exists */
- lua_getglobal(L, SOLUTIONS_KEY);
- lua_getfield(L, -1, name);
- if (lua_isnil(L, -1))
- {
- /* solution does not exists, create it */
- lua_newtable(L);
-
- /* set the name */
- lua_pushstring(L, name);
- lua_setfield(L, -2, SolutionFieldInfo[SolutionName].name);
-
- /* set the base directory */
- lua_pushstring(L, script_internal_script_dir(L));
- lua_setfield(L, -2, SolutionFieldInfo[SolutionBaseDir].name);
-
- /* create an empty list of projects */
- lua_newtable(L);
- lua_setfield(L, -2, PROJECTS_KEY);
-
- /* configure the initial configuration block list */
- lua_newtable(L);
- lua_setfield(L, -2, BLOCKS_KEY);
- script_internal_create_block(L);
-
- /* use the list of fields to populate the object properties and accessor functions */
- script_internal_populate_object(L, SolutionFieldInfo);
-
- /* add it to the master list of solutions, keyed by name */
- lua_pushvalue(L, -1);
- lua_setfield(L, -4, name);
-
- /* also add with integer key */
- lua_pushvalue(L, -1);
- lua_rawseti(L, -4, luaL_getn(L, -4) + 1);
- }
-
- /* activate and return the solution object */
- script_internal_set_active_object(L, SolutionObject);
- return 1;
-}
diff --git a/src/script/script.c b/src/script/script.c
deleted file mode 100644
index bfcce58..0000000
--- a/src/script/script.c
+++ /dev/null
@@ -1,275 +0,0 @@
-/**
- * \file script.c
- * \brief The project scripting engine.
- * \author Copyright (c) 2008 Jason Perkins and the Premake project
- */
-
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-#include "premake.h"
-#include "script_internal.h"
-#include "base/cstr.h"
-#include "base/error.h"
-
-
-/** Functions to add to the global namespace */
-static const luaL_Reg global_funcs[] = {
- { "configuration", fn_configuration },
- { "configurations", fn_configurations },
- { "dofile", fn_dofile },
- { "include", fn_include },
- { "match", fn_match },
- { "project", fn_project },
- { "solution", fn_solution },
- { NULL, NULL }
-};
-
-/** Functions to add to Lua's "os" namespace */
-static const luaL_Reg os_funcs[] = {
- { "getcwd", fn_getcwd },
- { NULL, NULL }
-};
-
-
-DEFINE_CLASS(Script)
-{
- lua_State* L;
-};
-
-
-/**
- * Create a new instance of the project scripting engine.
- * \returns A new engine object, or NULL if an error occurred.
- */
-Script script_create(void)
-{
- Script script;
-
- /* create a new Lua scripting environment */
- lua_State* L = luastate_create();
- if (L == NULL)
- {
- error_set("failed to start Lua scripting engine");
- return NULL;
- }
-
- /* register all the standard Lua libraries */
- luaL_openlibs(L);
-
- /* create an empty list of solutions in the script environment */
- lua_newtable(L);
- lua_setglobal(L, SOLUTIONS_KEY);
-
- /* register the project object accessor functions */
- fn_accessor_register_all(L);
-
- /* register the Premake non-configuration related functions */
- luaL_register(L, "_G", global_funcs);
- luaL_register(L, "os", os_funcs);
-
- script = ALLOC_CLASS(Script);
- script->L = L;
- return script;
-}
-
-
-/**
- * Destroy an instance of the project scripting engine, including any contained
- * scripting project objects.
- * \param script The script engine instance to destroy.
- */
-void script_destroy(Script script)
-{
- assert(script);
- luastate_destroy(script->L);
- free(script);
-}
-
-
-/**
- * Get the current value of the _ACTION global variable.
- * \param script The project scripting engine instance.
- * \returns The action name if set, or NULL if not.
- */
-const char* script_get_action(Script script)
-{
- const char* result;
- assert(script);
- lua_getglobal(script->L, ACTION_KEY);
- result = lua_tostring(script->L, -1);
- lua_pop(script->L, 1);
- return result;
-}
-
-
-/**
- * Retrieve the Lua scripting environment object from the project scripting engine.
- * \param script The script engine instance.
- * \returns The Lua scripting environment associated with the script engine instance.
- */
-lua_State* script_get_lua(Script script)
-{
- assert(script);
- return script->L;
-}
-
-
-/**
- * Internal shared implementation for script_run_file() and script_run_string().
- * \param L The Lua scripting environment.
- * \param param The filename, or the code string, to be run.
- * \param is_file True if param is a file, false if it is a code string.
- * \returns If the script returns a value, it is converted to a string and returned.
- * If the script does not return a value, NULL is returned. If an error
- * occurs in the script, the error message is returned.
- */
-static const char* script_run(lua_State* L, const char* param, int is_file)
-{
- const char* result;
- int top, status;
-
- /* set an error handler */
- lua_pushcfunction(L, fn_error);
-
- /* remember stack top, to figure out how many values were returned by the script */
- top = lua_gettop(L);
-
- if (is_file)
- {
- /* call Lua's dofile() function to do the work. I've implemented a
- * custom version in fn_dofile.c; routing the call there keeps all
- * of the logic in one place. */
- lua_getglobal(L, "dofile");
- lua_pushstring(L, param);
- status = lua_pcall(L, 1, LUA_MULTRET, -3);
- }
- else
- {
- status = luaL_loadstring(L, param);
- if (status == OKAY)
- {
- /* fake a file name for the _FILE global */
- lua_pushstring(L, "(string)/(string)");
- lua_setglobal(L, FILE_KEY);
-
- status = lua_pcall(L, 0, LUA_MULTRET, -2);
- }
- }
-
- if (status == OKAY)
- {
- /* if results were returned, pass them back to the caller */
- if (lua_gettop(L) > top)
- {
- if (lua_isboolean(L, top + 1))
- {
- int value = lua_toboolean(L, top + 1);
- result = (value) ? "true" : "false";
- }
- else
- {
- result = lua_tostring(L, top + 1);
- }
- }
- else
- {
- result = NULL;
- }
- }
- else
- {
- result = error_get();
- }
-
- return result;
-}
-
-
-/**
- * Execute a project script stored in a file.
- * \param script The project scripting engine instance.
- * \param filename The name of the file containing the script code to be executed.
- * \returns If the script returns a value, it is converted to a string and returned.
- * If the script does not return a value, NULL is returned. If an error
- * occurs in the script, the error message is returned.
- */
-const char* script_run_file(Script script, const char* filename)
-{
- assert(script);
- assert(filename);
- return script_run(script->L, filename, 1);
-}
-
-
-/**
- * Execute a project script stored in a string.
- * \param script The project scripting engine instance.
- * \param code The string containing the script code to be executed.
- * \returns If the script returns a value, it is converted to a string and returned.
- * If the script does not return a value, NULL is returned. If an error
- * occurs in the script, the error message is returned.
- */
-const char* script_run_string(Script script, const char* code)
-{
- const char* result;
-
- assert(script);
- assert(code);
-
- result = script_run(script->L, code, 0);
-
- /* if an error was returned, clean up the message to make it easier to test */
- if (cstr_starts_with(result, "[string "))
- {
- result = strstr(result, ":1:") + 4;
- }
-
- return result;
-}
-
-
-/**
- * Set the value of the _ACTION global variable.
- * \param script The project scripting engine instance.
- * \param action The name of the action to be performed.
- */
-void script_set_action(Script script, const char* action)
-{
- assert(script);
- lua_pushstring(script->L, action);
- lua_setglobal(script->L, ACTION_KEY);
-}
-
-
-/**
- * Copy project information out of the scripting environment and into C objects that
- * can be more easily manipulated by the action code.
- * \returns A new session object if successful (which must be destroyed by the caller), or NULL.
- */
-Session script_unload(Script script)
-{
- struct UnloadFuncs funcs;
- Session sess;
- int result;
-
- assert(script);
-
- funcs.unload_solution = unload_solution;
- funcs.unload_project = unload_project;
- funcs.unload_block = unload_block;
-
- sess = session_create();
- result = unload_all(script->L, sess, &funcs);
- if (result != OKAY)
- {
- session_destroy(sess);
- return NULL;
- }
- else
- {
- return sess;
- }
-}
-
-
diff --git a/src/script/script.h b/src/script/script.h
deleted file mode 100644
index 04ab922..0000000
--- a/src/script/script.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * \file script.h
- * \brief The project scripting engine.
- * \author Copyright (c) 2008 Jason Perkins and the Premake project
- *
- * \defgroup script Scripting Engine
- *
- * The project scripting engine.
- *
- * @{
- */
-#if !defined(PREMAKE_SCRIPT_H)
-#define PREMAKE_SCRIPT_H
-
-#include "objects/session.h"
-
-DECLARE_CLASS(Script)
-
-Script script_create(void);
-void script_destroy(Script script);
-const char* script_get_action(Script script);
-const char* script_run_file(Script script, const char* filename);
-const char* script_run_string(Script script, const char* code);
-void script_set_action(Script script, const char* action);
-int script_tests(void);
-Session script_unload(Script script);
-
-#endif
-/** @} */
diff --git a/src/script/script_internal.c b/src/script/script_internal.c
deleted file mode 100644
index fe57d52..0000000
--- a/src/script/script_internal.c
+++ /dev/null
@@ -1,201 +0,0 @@
-/**
- * \file script_internal.h
- * \brief Project scripting engine internal API.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include <string.h>
-#include "premake.h"
-#include "script_internal.h"
-#include "base/buffers.h"
-#include "base/path.h"
-
-
-/**
- * Create a new configuration block in the object at the top of the stack.
- * \param L The Lua state.
- */
-int script_internal_create_block(lua_State* L)
-{
- int i;
-
- /* get the current list of configuration blocks */
- lua_getfield(L, -1, BLOCKS_KEY);
-
- /* create a new block and make it active */
- lua_newtable(L);
- script_internal_set_active_object(L, BlockObject);
-
- /* set all list-type configuration block values to empty tables */
- for (i = 0; i < NumBlockFields; ++i)
- {
- int kind = BlockFieldInfo[i].kind;
- if (kind != StringField && kind != PathField)
- {
- lua_newtable(L);
- lua_setfield(L, -2, BlockFieldInfo[i].name);
- }
- }
-
- /* add it to the list of blocks */
- lua_rawseti(L, -2, luaL_getn(L,-2) + 1);
- lua_pop(L, 1);
- return OKAY;
-}
-
-
-/**
- * Pushes the active value for the given object type to the top of the stack.
- * This function is used to retrieve the current solution, project, etc.
- * \param L The Lua state.
- * \param type One or more of the script object type enumerations.
- * A bitmask may be supplied if more than one object type
- * can be valid. If so, the objects will be returned in
- * following order: configuration, project, then solution.
- * \param is_required If true, will set error if no active object is found.
- * \returns The active object, pushed onto the stack. May be nil if there is
- * no currently active object. If is_required is true, returns true
- * if an active object was found, false otherwise.
- */
-int script_internal_get_active_object(lua_State* L, enum ObjectType type, int is_required)
-{
- int top;
-
- lua_getregistry(L);
- top = lua_gettop(L);
-
- if (lua_gettop(L) == top && (type & BlockObject))
- {
- lua_getfield(L, -1, CONFIGURATION_KEY);
- if (lua_isnil(L, -1))
- lua_pop(L, 1);
- }
-
- if (lua_gettop(L) == top && (type & ProjectObject))
- {
- lua_getfield(L, -1, PROJECT_KEY);
- if (lua_isnil(L, -1))
- lua_pop(L, 1);
- }
-
- if (lua_gettop(L) == top && (type & SolutionObject))
- {
- lua_getfield(L, -1, SOLUTION_KEY);
- if (lua_isnil(L, -1))
- lua_pop(L, 1);
- }
-
- /* if an active object was found, return it */
- if (lua_gettop(L) > top)
- {
- /* remove the registry table first */
- lua_remove(L, -2);
- return 1;
- }
-
- /* if no active object was found, and none is required, return nil */
- else if (!is_required)
- {
- /* remove the registry table first */
- lua_pop(L, 1);
- lua_pushnil(L);
- return 1;
- }
-
- /* else set an error */
- else
- {
- /* build an error message */
- char* buffer = buffers_next();
- strcpy(buffer, "no active ");
- switch (type)
- {
- case SolutionObject:
- strcat(buffer, "solution");
- break;
- case ProjectObject:
- strcat(buffer, "project");
- break;
- case BlockObject:
- strcat(buffer, "configuration block");
- break;
- case SolutionObject | ProjectObject:
- strcat(buffer, "solution or project");
- break;
- case SolutionObject | ProjectObject | BlockObject:
- strcat(buffer, "solution, project, or configuration block");
- break;
- default:
- strcat(buffer, "object");
- }
- luaL_error(L, buffer);
- return 0;
- }
-}
-
-
-/**
- * Remembers the object at the top of the stack as active for the given object type.
- * This function is used to indicate the current solution, project, etc.
- * \param L The Lua state.
- * \param type One of the script object type enumerations.
- */
-void script_internal_set_active_object(lua_State* L, enum ObjectType type)
-{
- lua_getregistry(L);
- lua_pushvalue(L, -2);
-
- if (type == SolutionObject)
- {
- lua_setfield(L, -2, SOLUTION_KEY);
- }
- else if (type == ProjectObject)
- {
- lua_setfield(L, -2, PROJECT_KEY);
- }
- else
- {
- lua_setfield(L, -2, CONFIGURATION_KEY);
- }
-
- lua_pop(L, 1);
-}
-
-
-/**
- * Returns the directory containing the currently executing script file. Used to
- * locate external resources (files, etc.) specified relative to the current script.
- * \param L The Lua script environment.
- * \returns The directory containing the currently executing script file.
- */
-const char* script_internal_script_dir(lua_State* L)
-{
- const char* result;
- lua_getglobal(L, FILE_KEY);
- result = lua_tostring(L, -1);
- result = path_directory(result);
- lua_pop(L, 1);
- return result;
-}
-
-
-/**
- * Uses a list of fields to populate a project object (solution, project, or
- * configuration) with a matching set of properties and accessor functions.
- * \param L The Lua state.
- * \param fields The list of object fields.
- */
-void script_internal_populate_object(lua_State* L, FieldInfo* fields)
-{
- FieldInfo* field;
-
- /* set all list-type configuration values to empty tables */
- for (field = fields; field->name != NULL; ++field)
- {
- if (field->kind != StringField && field->kind != PathField)
- {
- lua_newtable(L);
- lua_setfield(L, -2, field->name);
- }
- }
-}
diff --git a/src/script/script_internal.h b/src/script/script_internal.h
deleted file mode 100644
index 8836eb0..0000000
--- a/src/script/script_internal.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/**
- * \file script_internal.h
- * \brief Project scripting engine internal API.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-#if !defined(PREMAKE_SCRIPT_INTERNAL_H)
-#define PREMAKE_SCRIPT_INTERNAL_H
-
-#include "script.h"
-#include "objects/session.h"
-#include "base/luastate.h"
-
-
-/* string constants for script variables and functions */
-#define ACTION_KEY "_ACTION"
-#define BLOCKS_KEY "blocks"
-#define CONFIGURATION_KEY "configuration"
-#define FILE_KEY "_FILE"
-#define PROJECT_KEY "project"
-#define PROJECTS_KEY "projects"
-#define SOLUTION_KEY "solution"
-#define SOLUTIONS_KEY "_SOLUTIONS"
-
-
-/** Used to specify type of object for engine_get/set_active_object */
-enum ObjectType
-{
- SolutionObject = 0x01,
- ProjectObject = 0x02,
- BlockObject = 0x04
-};
-
-#define IS_OPTIONAL (0)
-#define IS_REQUIRED (1)
-
-lua_State* script_get_lua(Script script);
-
-/* internal state management */
-int script_internal_create_block(lua_State* L);
-int script_internal_get_active_object(lua_State* L, enum ObjectType type, int is_required);
-void script_internal_set_active_object(lua_State* L, enum ObjectType type);
-const char* script_internal_script_dir(lua_State* L);
-void script_internal_populate_object(lua_State* L, FieldInfo* fields);
-
-/* Generic project object field getter/setter API */
-int fn_accessor_register_all(lua_State* L);
-int fn_accessor_set_string_value(lua_State* L, FieldInfo* field);
-int fn_accessor_set_list_value(lua_State* L, FieldInfo* field);
-
-/* script function handlers */
-int fn_accessor(lua_State* L);
-int fn_configuration(lua_State* L);
-int fn_configurations(lua_State* L);
-int fn_dofile(lua_State* L);
-int fn_error(lua_State* L);
-int fn_getcwd(lua_State* L);
-int fn_include(lua_State* L);
-int fn_match(lua_State* L);
-int fn_project(lua_State* L);
-int fn_solution(lua_State* L);
-
-/* Project object unloading API. The unload functions "interface" provides an
- * opportunity to mock the actual implementation for automated testing */
-struct UnloadFuncs
-{
- int (*unload_solution)(lua_State* L, Solution sln);
- int (*unload_project)(lua_State* L, Project prj);
- int (*unload_block)(lua_State* L, Block blk);
-};
-
-int unload_all(lua_State* L, Session sess, struct UnloadFuncs* funcs);
-int unload_solution(lua_State* L, Solution sln);
-int unload_project(lua_State* L, Project prj);
-int unload_block(lua_State* L, Block blk);
-
-#endif
diff --git a/src/script/tests/fn_accessor_tests.cpp b/src/script/tests/fn_accessor_tests.cpp
deleted file mode 100644
index 8c2f62e..0000000
--- a/src/script/tests/fn_accessor_tests.cpp
+++ /dev/null
@@ -1,142 +0,0 @@
-/**
- * \file fn_accessor_tests.cpp
- * \brief Automated tests for the generic value getter/setter function.
- * \author Copyright (c) 2007-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "script_tests.h"
-
-
-SUITE(script)
-{
- /**************************************************************************
- * String field tests
- **************************************************************************/
-
- TEST_FIXTURE(FxAccessor, Accessor_ReturnsNil_OnEmptyStringValue)
- {
- const char* result = script_run_string(script,
- "return (location() == nil)");
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FxAccessor, Accessor_RaisesError_OnListValueAndStringField)
- {
- const char* result = script_run_string(script,
- "location {}");
- CHECK_EQUAL("the field 'location' does not support lists of values", result);
- }
-
- TEST_FIXTURE(FxAccessor, Accessor_SetsField_OnStringField)
- {
- const char* result = script_run_string(script,
- "location 'MyLocation';"
- "return prj.location" );
- CHECK_EQUAL("MyLocation", result);
- }
-
- TEST_FIXTURE(FxAccessor, Accessor_GetsField_OnStringField)
- {
- const char* result = script_run_string(script,
- "prj.location = 'MyLocation';"
- "return location()" );
- CHECK_EQUAL("MyLocation", result);
- }
-
-
- /**************************************************************************
- * List field tests
- **************************************************************************/
-
- TEST_FIXTURE(FxAccessor, Accessor_ReturnsEmptyTable_OnEmptyListValue)
- {
- const char* result = script_run_string(script,
- "return (#files() == 0)");
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FxAccessor, Accessor_Appends_OnStringValue)
- {
- const char* result = script_run_string(script,
- "files { 'Hello.c' };"
- "return (prj.files[1] == 'Hello.c')" );
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FxAccessor, Accessor_Appends_OnListValue)
- {
- const char* result = script_run_string(script,
- "files { 'Hello.c', 'Goodbye.c' };"
- "return (prj.files[1] == 'Hello.c' and prj.files[2] == 'Goodbye.c')" );
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FxAccessor, Accessor_Appends_OnTwoCalls)
- {
- const char* result = script_run_string(script,
- "files { 'Hello.c' };"
- "files { 'Goodbye.c' };"
- "return (prj.files[1] == 'Hello.c' and prj.files[2] == 'Goodbye.c')" );
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FxAccessor, Accessor_ReturnsList_OnNoArgs)
- {
- const char* result = script_run_string(script,
- "files { 'Hello.c', 'Goodbye.c' };"
- "lst = files();"
- "return (lst[1] == 'Hello.c' and lst[2] == 'Goodbye.c')" );
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FxAccessor, Accessor_FlattensTables_OnNestedLists)
- {
- const char* result = script_run_string(script,
- "files { {'Hello.c'}, {'Goodbye.c'} };"
- "return (prj.files[1] == 'Hello.c' and prj.files[2] == 'Goodbye.c')" );
- CHECK_EQUAL("true", result);
- }
-
-
- /**************************************************************************
- * Data validation tests
- **************************************************************************/
-
- TEST_FIXTURE(FxAccessor, Accessor_Succeeds_OnGoodData)
- {
- const char* result = script_run_string(script, "language 'c++'");
- CHECK(result == NULL);
- }
-
- TEST_FIXTURE(FxAccessor, Accessor_RaisesError_OnBadData)
- {
- const char* result = script_run_string(script, "language 'none'");
- CHECK_EQUAL("invalid value 'none'", result);
- }
-
- TEST_FIXTURE(FxAccessor, Accessor_Succeeds_OnDifferingCase)
- {
- const char* result = script_run_string(script, "language 'C++'");
- CHECK(result == NULL);
- }
-
- TEST_FIXTURE(FxAccessor, Accessor_RaisesError_OnBadListData)
- {
- const char* result = script_run_string(script, "flags { 'none' }");
- CHECK_EQUAL("invalid value 'none'", result);
- }
-
-
- /**************************************************************************
- * Files field tests
- **************************************************************************/
-
- TEST_FIXTURE(FxAccessor, Accessor_ExpandsWildcards)
- {
- const char* result = script_run_string(script,
- "files { 'testing/test_files/*.lua' };"
- "return (#prj.files > 0)");
- CHECK_EQUAL("true", result);
- }
-}
diff --git a/src/script/tests/fn_configuration_tests.cpp b/src/script/tests/fn_configuration_tests.cpp
deleted file mode 100644
index 7da2451..0000000
--- a/src/script/tests/fn_configuration_tests.cpp
+++ /dev/null
@@ -1,99 +0,0 @@
-/**
- * \file fn_configuration_tests.cpp
- * \brief Automated tests for the configuration() function.
- * \author Copyright (c) 2007-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "script_tests.h"
-
-struct FnConfiguration : FxScript
-{
- FnConfiguration()
- {
- script_run_string(script,
- "sln = solution('MySolution');"
- " configurations {'Debug','Release'};"
- "prj = project('MyProject');"
- "cfg = configuration('Debug')");
- }
-};
-
-
-SUITE(script)
-{
- /**************************************************************************
- * Initial state tests
- **************************************************************************/
-
- TEST_FIXTURE(FxScript, Configuration_Exists_OnStartup)
- {
- const char* result = script_run_string(script,
- "return (configuration ~= nil)");
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FxScript, Configuration_ReturnsNil_OnNoActiveProject)
- {
- const char* result = script_run_string(script,
- "return (configuration() == nil)");
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FxScript, Configuration_RaisesError_OnNoActiveContainer)
- {
- const char* result = script_run_string(script, "configuration('Debug')");
- CHECK_EQUAL("no active solution or project", result);
- }
-
-
- /**************************************************************************
- * Object creation tests
- **************************************************************************/
-
- TEST_FIXTURE(FnConfiguration, Configuration_ReturnsObject_OnConfigName)
- {
- const char* result = script_run_string(script, "return (cfg ~= nil)");
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FnConfiguration, Configuration_ReturnsPreviousObject_OnNoParameters)
- {
- const char* result = script_run_string(script, "return (cfg == configuration())");
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FnConfiguration, Configuration_AddsToContainer)
- {
- const char* result = script_run_string(script, "return (#prj.blocks == 2)");
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FnConfiguration, Configuration_DoesNothing_OnSimpleField)
- {
- const char* result = script_run_string(script, "return (cfg.objdir == nil)");
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FnConfiguration, Configuration_SetsEmptyList_OnListField)
- {
- const char* result = script_run_string(script, "return (#cfg.defines == 0)");
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FnConfiguration, Configuration_SetsTerms_OnSingleValue)
- {
- const char* result = script_run_string(script,
- "cfg = configuration 'Debug';"
- "return (#cfg.terms == 1 and cfg.terms[1] == 'Debug')");
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FnConfiguration, Configuration_SetsTerms_OnMultipleValues)
- {
- const char* result = script_run_string(script,
- "cfg = configuration { 'Debug', 'windows' };"
- "return (#cfg.terms == 2 and cfg.terms[1] == 'Debug' and cfg.terms[2] == 'windows')");
- CHECK_EQUAL("true", result);
- }
-}
diff --git a/src/script/tests/fn_configurations_tests.cpp b/src/script/tests/fn_configurations_tests.cpp
deleted file mode 100644
index 44a2adc..0000000
--- a/src/script/tests/fn_configurations_tests.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * \file fn_configurations_tests.cpp
- * \brief Automated tests for the configurations() function.
- * \author Copyright (c) 2007-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "script_tests.h"
-
-SUITE(script)
-{
- TEST_FIXTURE(FxScript, Configurations_Exists_OnStartup)
- {
- const char* result = script_run_string(script,
- "return (configurations ~= nil)");
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FxScript, Configurations_Error_OnNoActiveSolution)
- {
- const char* result = script_run_string(script, "configurations {'Debug'}");
- CHECK_EQUAL("no active solution", result);
- }
-
- TEST_FIXTURE(FxScript, Configurations_CanRoundtrip)
- {
- const char* result = script_run_string(script,
- "solution 'MySolution';"
- " configurations {'Debug','Release'};"
- "return configurations()[1]");
- CHECK_EQUAL("Debug", result);
- }
-
- TEST_FIXTURE(FxScript, Configurations_RaisesError_OnProjectDefined)
- {
- const char* result = script_run_string(script,
- "solution 'MySolution';"
- " configurations {'Debug','Release'};"
- "project 'MyProject';"
- " configurations {'DebugDLL','ReleaseDLL'}");
- CHECK_EQUAL("configurations may not be modified after projects are defined", result);
- }
-
-}
diff --git a/src/script/tests/fn_defines_tests.cpp b/src/script/tests/fn_defines_tests.cpp
deleted file mode 100644
index 4d643ef..0000000
--- a/src/script/tests/fn_defines_tests.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * \file fn_defines_tests.cpp
- * \brief Automated tests for the defines() function.
- * \author Copyright (c) 2007-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "script_tests.h"
-
-
-SUITE(script)
-{
- TEST_FIXTURE(FxAccessor, Defines_Exists_OnStartup)
- {
- const char* result = script_run_string(script,
- "return (defines ~= nil)");
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FxAccessor, Defines_Error_OnNoActiveObject)
- {
- Script script = script_create();
- const char* result = script_run_string(script, "defines {'DEBUG'}");
- CHECK_EQUAL("no active configuration block", result);
- script_destroy(script);
- }
-
- TEST_FIXTURE(FxAccessor, Defines_CanRoundtrip)
- {
- const char* result = script_run_string(script,
- "defines {'DEBUG'};"
- "return defines()[1]");
- CHECK_EQUAL("DEBUG", result);
- }
-}
diff --git a/src/script/tests/fn_dofile_tests.cpp b/src/script/tests/fn_dofile_tests.cpp
deleted file mode 100644
index 3e814a3..0000000
--- a/src/script/tests/fn_dofile_tests.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * \file fn_dofile_tests.cpp
- * \brief Automated test for the dofile() function.
- * \author Copyright (c) 2007-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "script_tests.h"
-extern "C" {
-#include "base/cstr.h"
-#include "base/dir.h"
-}
-
-
-SUITE(script)
-{
- TEST_FIXTURE(FxScript, DoFile_Exists_OnStartup)
- {
- const char* result = script_run_string(script,
- "return (dofile ~= nil)");
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FxScript, DoFile_ReturnsValue_OnValidFile)
- {
- const char* result = script_run_string(script,
- "return dofile('testing/test_files/true.lua')");
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FxScript, DoFile_SetsError_OnFileNotFound)
- {
- script_run_string(script,
- "dofile('nosuchfile.lua')");
- CHECK(cstr_ends_with(error_get(), "No such file or directory"));
- }
-
- TEST_FIXTURE(FxScript, DoFile_SetsCwd_BeforeScript)
- {
- const char* result = script_run_string(script,
- "return dofile('testing/test_files/getcwd.lua')");
- CHECK(cstr_ends_with(result, "testing/test_files"));
- }
-
- TEST_FIXTURE(FxScript, DoFile_SetsCwd_BeforeNestedScript)
- {
- const char* result = script_run_string(script,
- "return dofile('testing/test_files/dofile.lua')");
- CHECK(cstr_ends_with(result, "testing/test_files/nested"));
- }
-
- TEST_FIXTURE(FxScript, DoFile_RestoresCwd_AfterNestedScript)
- {
- const char* result = script_run_string(script,
- "return dofile('testing/test_files/dofile_getcwd.lua')");
- CHECK(cstr_ends_with(result, "testing/test_files"));
- }
-
- TEST_FIXTURE(FxScript, DoFile_RestoresCwd_OnFileNotFound)
- {
- script_run_string(script,
- "dofile('testing/test_files/nosuchfile.lua')");
- const char* cwd = dir_get_current();
- CHECK(cstr_ends_with(cwd, "/src"));
- }
-
- TEST_FIXTURE(FxScript, DoFile_SetsFileGlobal)
- {
- const char* result = script_run_string(script,
- "return dofile('testing/test_files/_FILE.lua')");
- CHECK(cstr_ends_with(result, "testing/test_files/_FILE.lua"));
- }
-}
diff --git a/src/script/tests/fn_error_tests.cpp b/src/script/tests/fn_error_tests.cpp
deleted file mode 100644
index c6b8fea..0000000
--- a/src/script/tests/fn_error_tests.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * \file fn_error_tests.cpp
- * \brief Automated test for the error() function.
- * \author Copyright (c) 2007-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "script_tests.h"
-
-SUITE(script)
-{
- TEST_FIXTURE(FxScript, Error_Exists_OnStartup)
- {
- const char* result = script_run_string(script,
- "return (error ~= nil)");
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FxScript, Error_SetsSessionError_OnCall)
- {
- script_run_string(script,
- "error('an error message')");
- CHECK_EQUAL("[string \"error('an error message')\"]:1: an error message", error_get());
- }
-}
diff --git a/src/script/tests/fn_files_tests.cpp b/src/script/tests/fn_files_tests.cpp
deleted file mode 100644
index 0fad2b4..0000000
--- a/src/script/tests/fn_files_tests.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * \file fn_files_tests.cpp
- * \brief Automated tests for the files() function.
- * \author Copyright (c) 2007-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "script_tests.h"
-
-
-SUITE(script)
-{
- TEST_FIXTURE(FxAccessor, Files_Exists_OnStartup)
- {
- const char* result = script_run_string(script,
- "return (files ~= nil)");
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FxAccessor, Files_Error_OnNoActiveProject)
- {
- Script script = script_create();
- const char* result = script_run_string(script, "files {'hello.c'}");
- CHECK_EQUAL("no active project", result);
- script_destroy(script);
- }
-
- TEST_FIXTURE(FxAccessor, Files_CanRoundtrip)
- {
- const char* result = script_run_string(script,
- "files {'hello.c'};"
- "return files()[1]");
- CHECK_EQUAL("hello.c", result);
- }
-}
diff --git a/src/script/tests/fn_flags_tests.cpp b/src/script/tests/fn_flags_tests.cpp
deleted file mode 100644
index 5b2c695..0000000
--- a/src/script/tests/fn_flags_tests.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * \file fn_flags_tests.cpp
- * \brief Automated tests for the flags() function.
- * \author Copyright (c) 2007-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "script_tests.h"
-
-
-SUITE(script)
-{
- TEST_FIXTURE(FxAccessor, Flags_Exists_OnStartup)
- {
- const char* result = script_run_string(script,
- "return (flags ~= nil)");
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FxAccessor, Flags_Error_OnNoActiveObject)
- {
- Script script = script_create();
- const char* result = script_run_string(script, "flags {'Symbols'}");
- CHECK_EQUAL("no active configuration block", result);
- script_destroy(script);
- }
-
- TEST_FIXTURE(FxAccessor, Flags_CanRoundtrip)
- {
- const char* result = script_run_string(script,
- "flags {'Symbols'};"
- "return flags()[1]");
- CHECK_EQUAL("Symbols", result);
- }
-
- TEST_FIXTURE(FxAccessor, Flags_RaisesError_OnInvalidValue)
- {
- const char* result = script_run_string(script,
- "flags 'nosuch'");
- CHECK_EQUAL("invalid value 'nosuch'", result);
- }
-}
diff --git a/src/script/tests/fn_getcwd_tests.cpp b/src/script/tests/fn_getcwd_tests.cpp
deleted file mode 100644
index 94ea7ce..0000000
--- a/src/script/tests/fn_getcwd_tests.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * \file fn_getcwd_tests.cpp
- * \brief Automated test for the getcwd() function.
- * \author Copyright (c) 2007-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "script_tests.h"
-extern "C" {
-#include "base/cstr.h"
-}
-
-
-SUITE(script)
-{
- TEST_FIXTURE(FxScript, GetCwd_Exists_OnStartup)
- {
- const char* result = script_run_string(script,
- "return (os.getcwd ~= nil)");
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FxScript, GetCwd_ReturnsCwd)
- {
- const char* result = script_run_string(script,
- "return os.getcwd()");
- CHECK(cstr_ends_with(result, "/src"));
- }
-}
diff --git a/src/script/tests/fn_guid_tests.cpp b/src/script/tests/fn_guid_tests.cpp
deleted file mode 100644
index 3650674..0000000
--- a/src/script/tests/fn_guid_tests.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * \file fn_guid_tests.cpp
- * \brief Automated tests for the guid() function.
- * \author Copyright (c) 2007-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "script_tests.h"
-extern "C" {
-#include "base/guid.h"
-}
-
-
-SUITE(script)
-{
- TEST_FIXTURE(FxAccessor, Guid_Exists_OnStartup)
- {
- const char* result = script_run_string(script,
- "return (guid ~= nil)");
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FxAccessor, Guid_Error_OnNoActiveProject)
- {
- Script script = script_create();
- const char* result = script_run_string(script, "guid()");
- CHECK_EQUAL("no active project", result);
- script_destroy(script);
- }
-
- TEST_FIXTURE(FxAccessor, Guid_CanRoundtrip)
- {
- const char* result = script_run_string(script,
- "guid '0C202E43-B9AF-4972-822B-5A42F0BF008C';"
- "return guid()");
- CHECK_EQUAL("0C202E43-B9AF-4972-822B-5A42F0BF008C", result);
- }
-
- TEST_FIXTURE(FxAccessor, Guid_RaisesError_OnInvalidGuid)
- {
- const char* result = script_run_string(script,
- "guid '0C202E43-XXXX-4972-822B-5A42F0BF008C'");
- CHECK_EQUAL("invalid value '0C202E43-XXXX-4972-822B-5A42F0BF008C'", result);
- }
-}
diff --git a/src/script/tests/fn_include_tests.cpp b/src/script/tests/fn_include_tests.cpp
deleted file mode 100644
index 16be83a..0000000
--- a/src/script/tests/fn_include_tests.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * \file fn_include_tests.cpp
- * \brief Automated test for the include() function.
- * \author Copyright (c) 2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "script_tests.h"
-extern "C" {
-#include "base/cstr.h"
-}
-
-
-SUITE(script)
-{
- TEST_FIXTURE(FxScript, Include_Exists_OnStartup)
- {
- const char* result = script_run_string(script,
- "return (include ~= nil)");
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FxScript, Include_ReturnsValue_OnPremake4Found)
- {
- const char* result = script_run_string(script,
- "return include('testing/test_files')");
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FxScript, Include_SetsError_OnFileNotFound)
- {
- script_run_string(script,
- "include('testing')");
- CHECK(cstr_ends_with(error_get(), "No such file or directory"));
- }
-}
diff --git a/src/script/tests/fn_language_tests.cpp b/src/script/tests/fn_language_tests.cpp
deleted file mode 100644
index a2791da..0000000
--- a/src/script/tests/fn_language_tests.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * \file fn_language_tests.cpp
- * \brief Automated tests for the language() function.
- * \author Copyright (c) 2007-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "script_tests.h"
-
-
-SUITE(script)
-{
- TEST_FIXTURE(FxAccessor, Language_Exists_OnStartup)
- {
- const char* result = script_run_string(script,
- "return (language ~= nil)");
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FxAccessor, Guid_Error_OnNoActiveObject)
- {
- Script script = script_create();
- const char* result = script_run_string(script, "language()");
- CHECK_EQUAL("no active solution or project", result);
- script_destroy(script);
- }
-
- TEST_FIXTURE(FxAccessor, Language_CanRoundtrip)
- {
- const char* result = script_run_string(script,
- "language 'c++';"
- "return language()");
- CHECK_EQUAL("c++", result);
- }
-
- TEST_FIXTURE(FxAccessor, Language_RaisesError_OnInvalidLanguage)
- {
- const char* result = script_run_string(script,
- "language 'nosuch'");
- CHECK_EQUAL("invalid value 'nosuch'", result);
- }
-}
diff --git a/src/script/tests/fn_location_tests.cpp b/src/script/tests/fn_location_tests.cpp
deleted file mode 100644
index 8e060f1..0000000
--- a/src/script/tests/fn_location_tests.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * \file fn_location_tests.cpp
- * \brief Automated tests for the location() function.
- * \author Copyright (c) 2007-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "script_tests.h"
-
-
-SUITE(script)
-{
- TEST_FIXTURE(FxAccessor, Location_Exists_OnStartup)
- {
- const char* result = script_run_string(script,
- "return (location ~= nil)");
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FxAccessor, Location_Error_OnNoActiveProject)
- {
- Script script = script_create();
- const char* result = script_run_string(script, "location()");
- CHECK_EQUAL("no active solution or project", result);
- script_destroy(script);
- }
-
- TEST_FIXTURE(FxAccessor, Location_CanRoundtrip)
- {
- const char* result = script_run_string(script,
- "location 'elsewhere';"
- "return location()");
- CHECK_EQUAL("elsewhere", result);
- }
-}
diff --git a/src/script/tests/fn_match_tests.cpp b/src/script/tests/fn_match_tests.cpp
deleted file mode 100644
index 50f15d7..0000000
--- a/src/script/tests/fn_match_tests.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * \file fn_match_tests.cpp
- * \brief Automated test for the match() function.
- * \author Copyright (c) 2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "script_tests.h"
-extern "C" {
-}
-
-struct FxMatch : FxScript
-{
- FxMatch()
- {
- script_run_string(script,
- "function contains(tbl,val)"
- " for i,v in ipairs(files) do"
- " if (v == val) then return true end"
- " end"
- " return false;"
- "end");
- };
-};
-
-
-SUITE(script)
-{
- TEST_FIXTURE(FxMatch, Match_Exists_OnStartup)
- {
- const char* result = script_run_string(script,
- "return (match ~= nil)");
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FxMatch, Match_ReturnsEmptyTable_OnNoMatches)
- {
- const char* result = script_run_string(script,
- "return #match('*.xyz')");
- CHECK_EQUAL("0", result);
- }
-
- TEST_FIXTURE(FxMatch, Match_ReturnsMatches_OnMatch)
- {
- const char* result = script_run_string(script,
- "files = match('testing/test_files/*.lua');"
- "return contains(files, 'testing/test_files/true.lua');");
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FxMatch, Match_Recurses_OnDoubleStar)
- {
- const char* result = script_run_string(script,
- "files = match('testing/test_files/**.lua');"
- "return contains(files, 'testing/test_files/nested/getcwd.lua');");
- CHECK_EQUAL("true", result);
- }
-}
diff --git a/src/script/tests/fn_project_tests.cpp b/src/script/tests/fn_project_tests.cpp
deleted file mode 100644
index 44908c0..0000000
--- a/src/script/tests/fn_project_tests.cpp
+++ /dev/null
@@ -1,132 +0,0 @@
-/**
- * \file fn_project_tests.cpp
- * \brief Automated tests for the project() function.
- * \author Copyright (c) 2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "script_tests.h"
-
-
-struct FnProject : FxScript
-{
- FnProject()
- {
- script_run_string(script,
- "sln = solution('MySolution');"
- " configurations {'Debug','Release'};"
- "prj = project('MyProject')");
- }
-};
-
-
-SUITE(script)
-{
- /**************************************************************************
- * Initial state tests
- **************************************************************************/
-
- TEST_FIXTURE(FxScript, Project_Exists_OnStartup)
- {
- const char* result = script_run_string(script,
- "return (project ~= nil)");
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FxScript, Project_ReturnsNil_OnNoActiveProject)
- {
- const char* result = script_run_string(script,
- "return (project() == nil)");
- CHECK_EQUAL("true", result);
- }
-
-
- /**************************************************************************
- * Object creation tests
- **************************************************************************/
-
- TEST_FIXTURE(FxScript, Project_Fails_OnNoActiveSolution)
- {
- const char* result = script_run_string(script, "project('MyProject')");
- CHECK_EQUAL("no active solution", result);
- }
-
- TEST_FIXTURE(FnProject, Project_ReturnsNewObject_OnNewName)
- {
- const char* result = script_run_string(script,
- "return (prj ~= nil)");
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FnProject, Project_ReturnsObject_OnActiveProject)
- {
- const char* result = script_run_string(script,
- "return (prj == project())");
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FnProject, Project_AddsToKeyList_OnNewName)
- {
- const char* result = script_run_string(script,
- "return (prj == sln.projects['MyProject']);");
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FnProject, Project_AddsToIndexList_OnNewName)
- {
- const char* result = script_run_string(script,
- "return (prj == sln.projects[1]);");
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FnProject, Project_IncrementsTableSize_OnNewName)
- {
- const char* result = script_run_string(script,
- "return #sln.projects");
- CHECK_EQUAL("1", result);
- }
-
- TEST_FIXTURE(FnProject, Project_ReturnsSameObject_OnExistingName)
- {
- const char* result = script_run_string(script,
- "prj1 = project('SecondProject');"
- "return (prj == project('MyProject'))");
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FxScript, Project_RaisesError_OnNoConfigurations)
- {
- const char* result = script_run_string(script,
- "sln = solution('MySolution');"
- "prj = project('MyProject')");
- CHECK_EQUAL("no configurations defined", result);
- }
-
- /**************************************************************************
- * Initial object state tests
- **************************************************************************/
-
- TEST_FIXTURE(FnProject, Project_SetsName)
- {
- const char* result = script_run_string(script, "return prj.name");
- CHECK_EQUAL("MyProject", result);
- }
-
- TEST_FIXTURE(FnProject, Project_CreatesEmptyConfigList)
- {
- const char* result = script_run_string(script, "return (#prj.blocks[1])");
- CHECK_EQUAL("0", result);
- }
-
- TEST_FIXTURE(FnProject, Project_SetsBaseDir)
- {
- const char* result = script_run_string(script, "return prj.basedir");
- CHECK_EQUAL("(string)", result);
- }
-
- TEST_FIXTURE(FnProject, Project_SetsGuid)
- {
- const char* result = script_run_string(script, "return prj.guid");
- CHECK(result != NULL && strlen(result) == 36);
- }
-}
diff --git a/src/script/tests/fn_solution_tests.cpp b/src/script/tests/fn_solution_tests.cpp
deleted file mode 100644
index 42a3098..0000000
--- a/src/script/tests/fn_solution_tests.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-/**
- * \file fn_solution_tests.cpp
- * \brief Automated tests for the solution() function.
- * \author Copyright (c) 2007-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "script_tests.h"
-
-
-struct FnSolution : FxScript
-{
- FnSolution()
- {
- script_run_string(script, "sln = solution('MySolution');");
- }
-};
-
-
-SUITE(script)
-{
- /**************************************************************************
- * Initial state tests
- **************************************************************************/
-
- TEST_FIXTURE(FxScript, Solution_Exists_OnStartup)
- {
- const char* result = script_run_string(script,
- "return (solution ~= nil)");
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FxScript, Solution_ReturnsNil_OnNoActiveSolution)
- {
- const char* result = script_run_string(script,
- "return (solution() == nil)");
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FxScript, Solutions_Exists_OnStartup)
- {
- const char* result = script_run_string(script,
- "return #_SOLUTIONS");
- CHECK_EQUAL("0", result);
- }
-
-
- /**************************************************************************
- * Object creation tests
- **************************************************************************/
-
- TEST_FIXTURE(FnSolution, Solution_ReturnsNewObject_OnNewName)
- {
- const char* result = script_run_string(script,
- "return (sln ~= nil)");
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FnSolution, Solution_ReturnsObject_OnActiveSolution)
- {
- const char* result = script_run_string(script,
- "return (sln == solution())");
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FnSolution, Solution_AddsToKeyList_OnNewName)
- {
- const char* result = script_run_string(script,
- "return (sln == _SOLUTIONS['MySolution']);");
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FnSolution, Solution_AddsToIndexList_OnNewName)
- {
- const char* result = script_run_string(script,
- "return (sln == _SOLUTIONS[1]);");
- CHECK_EQUAL("true", result);
- }
-
- TEST_FIXTURE(FnSolution, Solution_IncrementsTableSize_OnNewName)
- {
- const char* result = script_run_string(script,
- "return #_SOLUTIONS;");
- CHECK_EQUAL("1", result);
- }
-
- TEST_FIXTURE(FnSolution, Solution_ReturnsSameObject_OnExistingName)
- {
- const char* result = script_run_string(script,
- "sln1 = solution('SecondSolution');"
- "return (sln == solution('MySolution'))");
- CHECK_EQUAL("true", result);
- }
-
-
- /**************************************************************************
- * Initial object state tests
- **************************************************************************/
-
- TEST_FIXTURE(FnSolution, Solution_SetsName)
- {
- const char* result = script_run_string(script,
- "return sln.name");
- CHECK_EQUAL("MySolution", result);
- }
-
- TEST_FIXTURE(FnSolution, Solution_CreatesEmptyConfigList)
- {
- const char* result = script_run_string(script, "return (#sln.blocks[1])");
- CHECK_EQUAL("0", result);
- }
-
- TEST_FIXTURE(FnSolution, Solution_SetsBaseDir)
- {
- const char* result = script_run_string(script,
- "return sln.basedir");
- CHECK_EQUAL("(string)", result);
- }
-
- TEST_FIXTURE(FnSolution, Solution_HasEmptyProjectsList)
- {
- const char* result = script_run_string(script,
- "return #sln.projects");
- CHECK_EQUAL("0", result);
- }
-}
diff --git a/src/script/tests/script_tests.cpp b/src/script/tests/script_tests.cpp
deleted file mode 100644
index 9a8d792..0000000
--- a/src/script/tests/script_tests.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * \file script_tests.cpp
- * \brief Automated test for the project scripting engine.
- * \author Copyright (c) 2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "testing/testing.h"
-extern "C" {
-#include "script/script.h"
-#include "base/error.h"
-}
-
-
-/**
- * Run the suite of project scripting engine automated tests.
- * \returns OKAY if all tests completed successfully.
- */
-int script_tests()
-{
- int z = OKAY;
- if (z == OKAY) z = tests_run_suite("script");
- if (z == OKAY) z = tests_run_suite("unload");
- return z;
-}
-
-
-struct FxScript
-{
- Script script;
-
- FxScript()
- {
- script = script_create();
- }
-
- ~FxScript()
- {
- script_destroy(script);
- error_clear();
- }
-};
-
-
-SUITE(script)
-{
- TEST_FIXTURE(FxScript, ScriptCreate_ReturnsObject)
- {
- CHECK(script != NULL);
- }
-}
-
diff --git a/src/script/tests/script_tests.h b/src/script/tests/script_tests.h
deleted file mode 100644
index 5791ccc..0000000
--- a/src/script/tests/script_tests.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * \file script_tests.h
- * \brief Common fixtures for script function tests.
- * \author Copyright (c) 2008 Jason Perkins and the Premake project
- */
-
-#include "testing/testing.h"
-extern "C" {
-#include "script/script.h"
-#include "base/error.h"
-}
-
-
-struct FxScript
-{
- Script script;
-
- FxScript()
- {
- script = script_create();
- }
-
- ~FxScript()
- {
- script_destroy(script);
- error_clear();
- }
-};
-
-
-struct FxAccessor : FxScript
-{
- FxAccessor()
- {
- script_run_string(script,
- "sln = solution 'MySolution';"
- " configurations {'Debug','Release'};"
- "prj = project 'MyProject';");
- }
-};
diff --git a/src/script/tests/unload_block_tests.cpp b/src/script/tests/unload_block_tests.cpp
deleted file mode 100644
index 8835b0f..0000000
--- a/src/script/tests/unload_block_tests.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
- * \file unload_block_tests.cpp
- * \brief Automated tests for configuration block unloading from the script environment.
- * \author Copyright (c) 2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "testing/testing.h"
-extern "C" {
-#include "script/script_internal.h"
-}
-
-
-struct FxUnloadBlock
-{
- lua_State* L;
- Script script;
- Block blk;
-
- FxUnloadBlock()
- {
- script = script_create();
- L = script_get_lua(script);
-
- blk = block_create();
-
- script_run_string(script,
- "solution('MySolution');"
- " configurations { 'Debug', 'Release' };"
- " configuration 'Debug';"
- " defines { 'DEBUG', 'DEBUG2' };"
- " return configuration()");
- }
-
- ~FxUnloadBlock()
- {
- block_destroy(blk);
- script_destroy(script);
- }
-};
-
-
-SUITE(unload)
-{
- TEST_FIXTURE(FxUnloadBlock, UnloadBlock_UnloadsDefines)
- {
- unload_block(L, blk);
- Strings defines = block_get_values(blk, BlockDefines);
- CHECK(strings_size(defines) == 2);
- if (strings_size(defines) == 2) {
- CHECK_EQUAL("DEBUG", strings_item(defines, 0));
- CHECK_EQUAL("DEBUG2", strings_item(defines, 1));
- }
- }
-
- TEST_FIXTURE(FxUnloadBlock, UnloadBlock_UnloadsTerms)
- {
- unload_block(L, blk);
- Strings terms = block_get_values(blk, BlockTerms);
- CHECK(strings_size(terms) == 1);
- if (strings_size(terms) == 1) {
- CHECK_EQUAL("Debug", strings_item(terms, 0));
- }
- }
-}
diff --git a/src/script/tests/unload_project_tests.cpp b/src/script/tests/unload_project_tests.cpp
deleted file mode 100644
index 21f9c06..0000000
--- a/src/script/tests/unload_project_tests.cpp
+++ /dev/null
@@ -1,122 +0,0 @@
-/**
- * \file unload_project_tests.cpp
- * \brief Automated tests for project object unloading from the script environment.
- * \author Copyright (c) 2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "testing/testing.h"
-extern "C" {
-#include "script/script_internal.h"
-}
-
-
-struct FxUnloadProject
-{
- Script script;
- lua_State* L;
- Project prj;
-
- FxUnloadProject()
- {
- script = script_create();
- L = script_get_lua(script);
-
- prj = project_create();
-
- script_run_string(script,
- "solution('MySolution');"
- " configurations {'Debug','Release'};"
- "prj = project('MyProject');"
- " prj.basedir = '/basedir';"
- " guid '0C202E43-B9AF-4972-822B-5A42F0BF008C';"
- " language 'C++';"
- " kind 'Console';"
- " files { 'Hello.cpp', 'Goodbye.cpp' };"
- "return prj");
- }
-
- ~FxUnloadProject()
- {
- project_destroy(prj);
- script_destroy(script);
- }
-};
-
-
-SUITE(unload)
-{
- TEST_FIXTURE(FxUnloadProject, UnloadProject_SetsName)
- {
- unload_project(L, prj);
- const char* result = project_get_name(prj);
- CHECK_EQUAL("MyProject", result);
- }
-
- TEST_FIXTURE(FxUnloadProject, UnloadProject_SetsBaseDir)
- {
- unload_project(L, prj);
- const char* result = project_get_base_dir(prj);
- CHECK_EQUAL("/basedir", result);
- }
-
- TEST_FIXTURE(FxUnloadProject, UnloadProject_UnloadsFiles)
- {
- unload_project(L, prj);
- Strings files = project_get_files(prj);
- CHECK(strings_size(files) == 2);
- if (strings_size(files) == 2) {
- CHECK_EQUAL("Hello.cpp", strings_item(files, 0));
- CHECK_EQUAL("Goodbye.cpp", strings_item(files, 1));
- }
- }
-
- TEST_FIXTURE(FxUnloadProject, UnloadProject_RepointsFiles_OnLocation)
- {
- script_run_string(script, "location 'build'; return prj");
- unload_project(L, prj);
- Strings files = project_get_files(prj);
- CHECK(strings_size(files) == 2);
- if (strings_size(files) == 2) {
- CHECK_EQUAL("../Hello.cpp", strings_item(files, 0));
- CHECK_EQUAL("../Goodbye.cpp", strings_item(files, 1));
- }
- }
-
- TEST_FIXTURE(FxUnloadProject, UnloadProject_SetsGuid)
- {
- unload_project(L, prj);
- const char* result = project_get_guid(prj);
- CHECK_EQUAL("0C202E43-B9AF-4972-822B-5A42F0BF008C", result);
- }
-
- TEST_FIXTURE(FxUnloadProject, UnloadProject_SetsKind)
- {
- unload_project(L, prj);
- const char* result = project_get_kind(prj);
- CHECK_EQUAL("Console", result);
- }
-
- TEST_FIXTURE(FxUnloadProject, UnloadProject_SetsLanguage)
- {
- unload_project(L, prj);
- const char* result = project_get_language(prj);
- CHECK_EQUAL("C++", result);
- }
-
- TEST_FIXTURE(FxUnloadProject, UnloadProject_SetsLocation_OnUnsetLocation)
- {
- unload_project(L, prj);
- const char* result = project_get_location(prj);
- CHECK_EQUAL("/basedir", result);
- }
-
- TEST_FIXTURE(FxUnloadProject, UnloadProject_SetsLocation_OnSetLocation)
- {
- script_run_string(script, "location 'location'; return prj");
- unload_project(L, prj);
- const char* result = project_get_location(prj);
- CHECK_EQUAL("/basedir/location", result);
- }
-}
-
diff --git a/src/script/tests/unload_solution_tests.cpp b/src/script/tests/unload_solution_tests.cpp
deleted file mode 100644
index eef5668..0000000
--- a/src/script/tests/unload_solution_tests.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-/**
- * \file unload_solution_tests.cpp
- * \brief Automated tests for solution object unloading from the script environment.
- * \author Copyright (c) 2007-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "testing/testing.h"
-extern "C" {
-#include "script/script_internal.h"
-}
-
-
-struct FxUnloadSolution
-{
- Script script;
- lua_State* L;
- Solution sln;
-
- FxUnloadSolution()
- {
- script = script_create();
- L = script_get_lua(script);
-
- sln = solution_create();
-
- script_run_string(script,
- "sln = solution('MySolution');"
- " configurations { 'Debug', 'Release' };"
- " sln.basedir = '/basedir';"
- " location 'location';"
- "return sln");
- }
-
- ~FxUnloadSolution()
- {
- solution_destroy(sln);
- script_destroy(script);
- }
-};
-
-
-SUITE(unload)
-{
- TEST_FIXTURE(FxUnloadSolution, UnloadSolution_SetsName)
- {
- unload_solution(L, sln);
- const char* result = solution_get_name(sln);
- CHECK_EQUAL("MySolution", result);
- }
-
- TEST_FIXTURE(FxUnloadSolution, UnloadSolution_SetsBaseDir)
- {
- unload_solution(L, sln);
- const char* result = solution_get_base_dir(sln);
- CHECK_EQUAL("/basedir", result);
- }
-
- TEST_FIXTURE(FxUnloadSolution, UnloadSolution_SetsConfigurations)
- {
- unload_solution(L, sln);
- CHECK(solution_num_configs(sln) == 2);
- CHECK_EQUAL("Debug", solution_get_config(sln, 0));
- CHECK_EQUAL("Release", solution_get_config(sln, 1));
- }
-
- TEST_FIXTURE(FxUnloadSolution, UnloadSolution_SetsLocation)
- {
- unload_solution(L, sln);
- const char* result = solution_get_location(sln);
- CHECK_EQUAL("/basedir/location", result);
- }
-}
-
diff --git a/src/script/tests/unload_tests.cpp b/src/script/tests/unload_tests.cpp
deleted file mode 100644
index 8c348bc..0000000
--- a/src/script/tests/unload_tests.cpp
+++ /dev/null
@@ -1,226 +0,0 @@
-/**
- * \file unload_tests.cpp
- * \brief Automated tests for project object enumeration from the script environment.
- * \author Copyright (c) 2007-2008 Jason Perkins and the Premake project
- */
-
-#include "premake.h"
-#include "testing/testing.h"
-extern "C" {
-#include "script/script_internal.h"
-}
-
-/* mock interface to object loaders */
-
-static int num_solution_calls;
-static int num_project_calls;
-static int num_block_calls;
-
-static int stub_solution_func(lua_State* L, Solution sln)
-{
- UNUSED(L); UNUSED(sln);
- num_solution_calls++;
- return OKAY;
-}
-
-static int stub_solution_fail_func(lua_State* L, Solution sln)
-{
- UNUSED(L); UNUSED(sln);
- num_solution_calls++;
- return !OKAY;
-}
-
-static int stub_project_func(lua_State* L, Project prj)
-{
- UNUSED(L); UNUSED(prj);
- num_project_calls++;
- return OKAY;
-}
-
-static int stub_project_fail_func(lua_State* L, Project prj)
-{
- UNUSED(L); UNUSED(prj);
- num_project_calls++;
- return !OKAY;
-}
-
-static int stub_block_func(lua_State* L, Block blk)
-{
- UNUSED(L); UNUSED(blk);
- num_block_calls++;
- return OKAY;
-}
-
-static int stub_block_fail_func(lua_State* L, Block blk)
-{
- UNUSED(L); UNUSED(blk);
- num_block_calls++;
- return !OKAY;
-}
-
-
-struct FxUnload
-{
- Script script;
- Session sess;
- lua_State* L;
- UnloadFuncs funcs;
-
- FxUnload()
- {
- script = script_create();
- L = script_get_lua(script);
-
- sess = session_create();
-
- funcs.unload_solution = stub_solution_func;
- funcs.unload_project = stub_project_func;
- funcs.unload_block = stub_block_func;
- num_solution_calls = 0;
- num_project_calls = 0;
- num_block_calls = 0;
- }
-
- ~FxUnload()
- {
- session_destroy(sess);
- script_destroy(script);
- }
-};
-
-
-struct FxUnload2 : FxUnload
-{
- FxUnload2()
- {
- script_run_string(script,
- "solution 'MySolution';"
- " configurations{'Debug','Release'};"
- " project 'MyProject';"
- " project 'MyProject2';"
- " configuration 'Debug';"
- "solution 'MySolution2';");
- }
-};
-
-
-SUITE(unload)
-{
- TEST_FIXTURE(FxUnload, Unload_ReturnsOkay_OnEmptySession)
- {
- int result = unload_all(L, sess, &funcs);
- CHECK(result == OKAY);
- }
-
- TEST_FIXTURE(FxUnload, Unload_ReturnsEmptySession_OnEmptySession)
- {
- unload_all(L, sess, &funcs);
- int n = session_num_solutions(sess);
- CHECK(n == 0);
- }
-
- TEST_FIXTURE(FxUnload2, Unload_ReturnsOkay_OnNonEmptySession)
- {
- int result = unload_all(L, sess, &funcs);
- CHECK(result == OKAY);
- }
-
-
- /**********************************************************************
- * Solution enumeration tests
- **********************************************************************/
-
- TEST_FIXTURE(FxUnload2, Unload_AddsSolutions_OnNonEmptySession)
- {
- unload_all(L, sess, &funcs);
- int n = session_num_solutions(sess);
- CHECK(n == 2);
- }
-
- TEST_FIXTURE(FxUnload2, Unload_CallsSolutionFunc_OnEachSolution)
- {
- unload_all(L, sess, &funcs);
- CHECK(num_solution_calls == 2);
- }
-
- TEST_FIXTURE(FxUnload2, Unload_ReturnsNotOkay_OnSolutionFailure)
- {
- funcs.unload_solution = stub_solution_fail_func;
- int result = unload_all(L, sess, &funcs);
- CHECK(result != OKAY);
- }
-
- TEST_FIXTURE(FxUnload2, Unload_AbortsSolutionLoop_OnNotOkay)
- {
- funcs.unload_solution = stub_solution_fail_func;
- unload_all(L, sess, &funcs);
- CHECK(num_solution_calls == 1);
- }
-
-
- /**********************************************************************
- * Project enumeration tests
- **********************************************************************/
-
- TEST_FIXTURE(FxUnload2, Unload_AddsProjects_OnNonEmptySession)
- {
- unload_all(L, sess, &funcs);
- Solution sln = session_get_solution(sess, 0);
- int n = solution_num_projects(sln);
- CHECK(n == 2);
- }
-
- TEST_FIXTURE(FxUnload2, Unload_CallsProjectFunc_OnEachProject)
- {
- unload_all(L, sess, &funcs);
- CHECK(num_project_calls == 2);
- }
-
- TEST_FIXTURE(FxUnload2, Unload_ReturnsNotOkay_OnProjectFailure)
- {
- funcs.unload_project = stub_project_fail_func;
- int result = unload_all(L, sess, &funcs);
- CHECK(result != OKAY);
- }
-
- TEST_FIXTURE(FxUnload2, Unload_AbortsProjectLoop_OnNotOkay)
- {
- funcs.unload_project = stub_project_fail_func;
- unload_all(L, sess, &funcs);
- CHECK(num_project_calls == 1);
- }
-
-
- /**********************************************************************
- * Configuration block enumeration tests
- **********************************************************************/
-
- TEST_FIXTURE(FxUnload2, Unload_AddsBlocks_OnNonEmptySession)
- {
- unload_all(L, sess, &funcs);
- Solution sln = session_get_solution(sess, 0);
- int n = blocks_size(solution_get_blocks(sln));
- CHECK(n == 1);
- }
-
- TEST_FIXTURE(FxUnload2, Unload_CallsBlockFunc_OnEachConfig)
- {
- unload_all(L, sess, &funcs);
- CHECK(num_block_calls == 5);
- }
-
- TEST_FIXTURE(FxUnload2, Unload_ReturnsNotOkay_OnBlockFailure)
- {
- funcs.unload_block = stub_block_fail_func;
- int result = unload_all(L, sess, &funcs);
- CHECK(result != OKAY);
- }
-
- TEST_FIXTURE(FxUnload2, Unload_AbortsBlockLoop_OnNotOkay)
- {
- funcs.unload_block = stub_block_fail_func;
- unload_all(L, sess, &funcs);
- CHECK(num_block_calls == 1);
- }
-
-}
diff --git a/src/script/unload.c b/src/script/unload.c
deleted file mode 100644
index 32fe172..0000000
--- a/src/script/unload.c
+++ /dev/null
@@ -1,264 +0,0 @@
-/**
- * \file unload.c
- * \brief Unload project objects from the scripting environment.
- * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
- */
-
-#include <assert.h>
-#include "premake.h"
-#include "script/script_internal.h"
-#include "base/path.h"
-
-
-static int unload_blocks(lua_State* L, struct UnloadFuncs* funcs, Blocks blocks);
-static int unload_projects(lua_State* L, struct UnloadFuncs* funcs, Solution sln);
-static int unload_repoint_paths(Fields fields, int base_dir_idx, int location_idx);
-
-
-/**
- * Copy project information out of the scripting environment and into C objects that
- * can be more easily manipulated by the action code.
- * \param L The Lua scripting engine state.
- * \param sess The session will contain the unloaded objects.
- * \param funcs The unloading "interface", providing an opportunity to mock for automated testing.
- * \returns OKAY if successful.
- */
-int unload_all(lua_State* L, Session sess, struct UnloadFuncs* funcs)
-{
- int si, sn, z = OKAY;
-
- assert(L);
- assert(sess);
- assert(funcs);
- assert(funcs->unload_solution);
- assert(funcs->unload_project);
- assert(funcs->unload_block);
-
- /* iterate over the list of solutions */
- lua_getglobal(L, SOLUTIONS_KEY);
- sn = luaL_getn(L, -1);
- for (si = 1; z == OKAY && si <= sn; ++si)
- {
- /* add a new solution to the master list */
- Solution sln = solution_create();
- session_add_solution(sess, sln);
-
- /* get the scripted solution object from the solutions list */
- lua_rawgeti(L, -1, si);
-
- /* unload the solution fields, then configuration blocks, then projects */
- z = funcs->unload_solution(L, sln);
- if (z == OKAY)
- {
- Blocks blocks = solution_get_blocks(sln);
- z = unload_blocks(L, funcs, blocks);
- }
- if (z == OKAY)
- {
- z = unload_projects(L, funcs, sln);
- }
-
- /* remove solution object from stack */
- lua_pop(L, 1);
- }
-
- /* remove list of solutions from stack */
- lua_pop(L, 1);
- return z;
-}
-
-
-static int unload_projects(lua_State* L, struct UnloadFuncs* funcs, Solution sln)
-{
- int pi, pn, z = OKAY;
-
- /* iterate over list of projects from the solution */
- lua_getfield(L, -1, PROJECTS_KEY);
- pn = luaL_getn(L, -1);
- for (pi = 1; z == OKAY && pi <= pn; ++pi)
- {
- /* add a new project to the master list */
- Project prj = project_create();
- solution_add_project(sln, prj);
-
- /* get the scripted project object from the solutions list */
- lua_rawgeti(L, -1, pi);
-
- /* unload the project fields, then configuration blocks */
- z = funcs->unload_project(L, prj);
- if (z == OKAY)
- {
- Blocks blocks = project_get_blocks(prj);
- z = unload_blocks(L, funcs, blocks);
- }
-
- /* remove project object from stack */
- lua_pop(L, 1);
- }
-
- /* remove list of projects from stack */
- lua_pop(L, 1);
- return z;
-}
-
-
-static int unload_blocks(lua_State* L, struct UnloadFuncs* funcs, Blocks blocks)
-{
- int ci, cn, z = OKAY;
-
- /* iterate over the list configuration blocks from the solution */
- lua_getfield(L, -1, BLOCKS_KEY);
- cn = luaL_getn(L, -1);
- for (ci = 1; z == OKAY && ci <= cn; ++ci)
- {
- Block blk = block_create();
- blocks_add(blocks, blk);
-
- /* unload the configuration block fields */
- lua_rawgeti(L, -1, ci);
- z = funcs->unload_block(L, blk);
-
- /* remove the configuration block object from the stack */
- lua_pop(L, 1);
- }
-
- /* remove the list of blocks from the stack */
- lua_pop(L, 1);
- return z;
-}
-
-
-int unload_fields(lua_State* L, Fields fields, FieldInfo* info)
-{
- const char* value;
- int fi;
-
- for (fi = 0; info[fi].name != NULL; ++fi)
- {
- Strings values = strings_create();
-
- lua_getfield(L, -1, info[fi].name);
- if (lua_istable(L, -1))
- {
- int i, n;
- n = luaL_getn(L, -1);
- for (i = 1; i <= n; ++i)
- {
- lua_rawgeti(L, -1, i);
- value = lua_tostring(L, -1);
- if (value != NULL)
- {
- strings_add(values, value);
- }
- lua_pop(L, 1);
- }
- }
- else
- {
- value = lua_tostring(L, -1);
- if (value != NULL)
- {
- strings_add(values, value);
- }
- }
-
- /* remove the field value from the top of the stack */
- lua_pop(L, 1);
-
- /* store the field values */
- fields_set_values(fields, fi, values);
- }
-
- return OKAY;
-}
-
-
-/**
- * Unload information from the scripting environment for a particular solution.
- * \param L The Lua scripting engine state.
- * \param sln The solution object to be populated.
- * \returns OKAY if successful.
- */
-int unload_solution(lua_State* L, Solution sln)
-{
- Fields fields = solution_get_fields(sln);
- int z = unload_fields(L, fields, SolutionFieldInfo);
- unload_repoint_paths(fields, SolutionBaseDir, SolutionLocation);
- return z;
-}
-
-
-/**
- * Unload information from the scripting environment for a particular project.
- * \param L The Lua scripting engine state.
- * \param prj The project object to be populated.
- * \returns OKAY if successful.
- */
-int unload_project(lua_State* L, Project prj)
-{
- Fields fields = project_get_fields(prj);
- int z = unload_fields(L, fields, ProjectFieldInfo);
- unload_repoint_paths(fields, ProjectBaseDir, ProjectLocation);
- return z;
-}
-
-
-/**
- * Unload information from the scripting environment for a particular configuration.
- * \param L The Lua scripting engine state.
- * \param blk The configuration block to be populated.
- * \returns OKAY if successful.
- */
-int unload_block(lua_State* L, Block blk)
-{
- return unload_fields(L, block_get_fields(blk), BlockFieldInfo);
-}
-
-
-
-/**
- * Walks a list of fields and repoints all paths to be relative to
- * base_directory/location. Once this is done, all paths will end up
- * relative to the generated project or solution file.
- * \param fields The list of fields to repoint.
- * \param base_dir_idx The index of the BaseDir field in the field list.
- * \param location_idx The index of the Location field in the field list.
- */
-int unload_repoint_paths(Fields fields, int base_dir_idx, int location_idx)
-{
- const char* base_dir;
- const char* location;
- int fi, fn;
-
- /* first I have to update the Location field; this is the absolute path that
- * I will base all the other relative paths upon */
- base_dir = fields_get_value(fields, base_dir_idx);
- location = path_join(base_dir, fields_get_value(fields, location_idx));
- fields_set_value(fields, location_idx, location);
-
- /* now I can can for other pathed fields and repoint them */
- fn = fields_size(fields);
- for (fi = 0; fi < fn; ++fi)
- {
- /* only repoint pathed fields */
- int kind = fields_get_kind(fields, fi);
- if (kind == FilesField || kind == PathField)
- {
- /* enumerate all values of the field */
- int vi, vn;
- Strings values = fields_get_values(fields, fi);
- vn = strings_size(values);
- for (vi = 0; vi < vn; ++vi)
- {
- const char* value = strings_item(values, vi);
-
- const char* abs_path = path_join(base_dir, value);
- const char* rel_path = path_relative(location, abs_path);
-
- strings_set(values, vi, rel_path);
- }
- }
- }
-
- return OKAY;
-}
diff --git a/src/testing/UnitTest++/COPYING b/src/testing/UnitTest++/COPYING
deleted file mode 100644
index 9f96308..0000000
--- a/src/testing/UnitTest++/COPYING
+++ /dev/null
@@ -1,20 +0,0 @@
-Copyright (c) 2006 Noel Llopis and Charles Nicholson
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/src/testing/UnitTest++/Makefile b/src/testing/UnitTest++/Makefile
deleted file mode 100644
index 97809d3..0000000
--- a/src/testing/UnitTest++/Makefile
+++ /dev/null
@@ -1,93 +0,0 @@
-CC = g++
-CCFLAGS = -g -ansi -Wall -W -ansi # -pedantic
-SED = sed
-MV = mv
-RM = rm
-
-.SUFFIXES: .o .cpp
-
-lib = libUnitTest++.a
-test = TestUnitTest++
-
-src = src/AssertException.cpp \
- src/Test.cpp \
- src/Checks.cpp \
- src/TestRunner.cpp \
- src/TestResults.cpp \
- src/TestReporter.cpp \
- src/TestReporterStdout.cpp \
- src/ReportAssert.cpp \
- src/TestList.cpp \
- src/TimeConstraint.cpp \
- src/TestDetails.cpp \
- src/MemoryOutStream.cpp \
- src/DeferredTestReporter.cpp \
- src/DeferredTestResult.cpp \
- src/XmlTestReporter.cpp
-
-ifeq ($(MSYSTEM), MINGW32)
- src += src/Win32/TimeHelpers.cpp
-else
- src += src/Posix/SignalTranslator.cpp \
- src/Posix/TimeHelpers.cpp
-endif
-
-test_src = src/tests/Main.cpp \
- src/tests/TestAssertHandler.cpp \
- src/tests/TestChecks.cpp \
- src/tests/TestUnitTest++.cpp \
- src/tests/TestTest.cpp \
- src/tests/TestTestResults.cpp \
- src/tests/TestTestRunner.cpp \
- src/tests/TestCheckMacros.cpp \
- src/tests/TestTestList.cpp \
- src/tests/TestTestMacros.cpp \
- src/tests/TestTimeConstraint.cpp \
- src/tests/TestTimeConstraintMacro.cpp \
- src/tests/TestMemoryOutStream.cpp \
- src/tests/TestDeferredTestReporter.cpp \
- src/tests/TestXmlTestReporter.cpp
-
-objects = $(patsubst %.cpp, %.o, $(src))
-test_objects = $(patsubst %.cpp, %.o, $(test_src))
-dependencies = $(subst .o,.d,$(objects))
-test_dependencies = $(subst .o,.d,$(test_objects))
-
-define make-depend
- $(CC) $(CCFLAGS) -M $1 | \
- $(SED) -e 's,\($(notdir $2)\) *:,$(dir $2)\1: ,' > $3.tmp
- $(SED) -e 's/#.*//' \
- -e 's/^[^:]*: *//' \
- -e 's/ *\\$$//' \
- -e '/^$$/ d' \
- -e 's/$$/ :/' $3.tmp >> $3.tmp
- $(MV) $3.tmp $3
-endef
-
-
-all: $(test)
-
-
-$(lib): $(objects)
- @echo Creating $(lib) library...
- @ar cr $(lib) $(objects)
-
-$(test): $(lib) $(test_objects)
- @echo Linking $(test)...
- @$(CC) -o $(test) $(test_objects) $(lib)
- @echo Running unit tests...
- @./$(test)
-
-clean:
- -@$(RM) $(objects) $(test_objects) $(dependencies) $(test_dependencies) $(test) $(lib) 2> /dev/null
-
-%.o : %.cpp
- @echo $<
- @$(call make-depend,$<,$@,$(subst .o,.d,$@))
- @$(CC) $(CCFLAGS) -c $< -o $(patsubst %.cpp, %.o, $<)
-
-
-ifneq "$(MAKECMDGOALS)" "clean"
--include $(dependencies)
--include $(test_dependencies)
-endif
diff --git a/src/testing/UnitTest++/PREMAKE_CHANGES.txt b/src/testing/UnitTest++/PREMAKE_CHANGES.txt
deleted file mode 100644
index bd25432..0000000
--- a/src/testing/UnitTest++/PREMAKE_CHANGES.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-Modified CheckStringsEqual() in checks.cpp to allow for actual==NULL (the
-previous behavior was to explode violently).
-
diff --git a/src/testing/UnitTest++/README b/src/testing/UnitTest++/README
deleted file mode 100644
index b32ff5f..0000000
--- a/src/testing/UnitTest++/README
+++ /dev/null
@@ -1,62 +0,0 @@
-UnitTest++ README
-Version: v1.3
-Last update: 2007-4-22
-
-
-UnitTest++ is free software. You may copy, distribute, and modify it under
-the terms of the License contained in the file COPYING distributed
-with this package. This license is the same as the MIT/X Consortium
-license.
-
-See src/tests/TestUnitTest++.cpp for usage.
-
-Authors:
-Noel Llopis (llopis@convexhull.com)
-Charles Nicholson (cn@cnicholson.net)
-
-Contributors:
-Jim Tilander (jim.tilander@gmail.com)
-Kim Grasman (kim@mvps.org)
-Jonathan Jansson (lilliemarck@users.sourceforge.net)
-Dirck Blaskey (listtarget2@danbala.com)
-Rory Driscoll (rorydriscoll@gmail.com)
-Dan Lind (podcat@gmail.com)
-Matt Kimmel (mattkimmel@gmail.com) -- Submitted with permission from Blue Fang Games
-Anthony Moralez (anthony.moralez@gmail.com)
-Jeff Dixon <bodisafa@helixe.com>
-
-
-Release notes
---------------
-Version 1.3 (2007-4-22)
-- Removed dynamic memory allocations (other than streams)
-- MinGW support
-- Consistent (native) line endings
-- Minor bug fixing
-
-Version 1.2 (2006-10-29)
-- First pass at documentation.
-- More detailed error crash catching in fixtures.
-- Standard streams used for printing objects under check. This should allow the
- use of standard class types such as std::string or other custom classes with
- stream operators to ostream.
-- Standard streams can be optionally compiled off by defining UNITTEST_USE_CUSTOM_STREAMS
- in Config.h
-- Added named test suites
-- Added CHECK_ARRAY2D_CLOSE
-- Posix library name is libUnitTest++.a now
-- Floating point numbers are postfixed with f in the failure reports
-
-Version 1.1 (2006-04-18)
-- CHECK macros do not have side effects even if one of the parameters changes state
-- Removed CHECK_ARRAY_EQUAL (too similar to CHECK_ARRAY_CLOSE)
-- Added local and global time constraints
-- Removed dependencies on strstream
-- Improved Posix signal to exception translator
-- Failing tests are added to Visual Studio's error list
-- Fixed Visual Studio projects to work with spaces in directories
-
-
-Version 1.0 (2006-03-15)
-- Initial release
-
diff --git a/src/testing/UnitTest++/TestUnitTest++.vsnet2003.vcproj b/src/testing/UnitTest++/TestUnitTest++.vsnet2003.vcproj
deleted file mode 100644
index 03c3ca1..0000000
--- a/src/testing/UnitTest++/TestUnitTest++.vsnet2003.vcproj
+++ /dev/null
@@ -1,168 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="TestUnitTest++.vsnet2003"
- ProjectGUID="{ACDF9A6A-874F-49E5-AB7C-74F8150BB4C7}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="obj\$(ProjectName)\$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
- MinimalRebuild="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="5"
- UsePrecompiledHeader="0"
- WarningLevel="4"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="4"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/TestUnitTest++.vsnet2003.exe"
- LinkIncremental="2"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile="$(OutDir)/TestUnitTest++.vsnet2003.pdb"
- SubSystem="1"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine="&quot;$(TargetPath)&quot;"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="obj\$(ProjectName)\$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
- RuntimeLibrary="4"
- UsePrecompiledHeader="0"
- WarningLevel="4"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/TestUnitTest++.vsnet2003.exe"
- LinkIncremental="1"
- GenerateDebugInformation="TRUE"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine="&quot;$(TargetPath)&quot;"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <File
- RelativePath=".\src\tests\Main.cpp">
- </File>
- <File
- RelativePath=".\src\tests\RecordingReporter.h">
- </File>
- <File
- RelativePath=".\src\tests\TestAssertHandler.cpp">
- </File>
- <File
- RelativePath=".\src\tests\TestCheckMacros.cpp">
- </File>
- <File
- RelativePath=".\src\tests\TestChecks.cpp">
- </File>
- <File
- RelativePath=".\src\tests\TestDeferredTestReporter.cpp">
- </File>
- <File
- RelativePath=".\src\tests\TestMemoryOutStream.cpp">
- </File>
- <File
- RelativePath=".\src\tests\TestTest.cpp">
- </File>
- <File
- RelativePath=".\src\tests\TestTestList.cpp">
- </File>
- <File
- RelativePath=".\src\tests\TestTestMacros.cpp">
- </File>
- <File
- RelativePath=".\src\tests\TestTestResults.cpp">
- </File>
- <File
- RelativePath=".\src\tests\TestTestRunner.cpp">
- </File>
- <File
- RelativePath=".\src\tests\TestTestSuite.cpp">
- </File>
- <File
- RelativePath=".\src\tests\TestTimeConstraint.cpp">
- </File>
- <File
- RelativePath=".\src\tests\TestTimeConstraintMacro.cpp">
- </File>
- <File
- RelativePath=".\src\tests\TestUnitTest++.cpp">
- </File>
- <File
- RelativePath=".\src\tests\TestXmlTestReporter.cpp">
- </File>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/src/testing/UnitTest++/TestUnitTest++.vsnet2005.vcproj b/src/testing/UnitTest++/TestUnitTest++.vsnet2005.vcproj
deleted file mode 100644
index 7140ed4..0000000
--- a/src/testing/UnitTest++/TestUnitTest++.vsnet2005.vcproj
+++ /dev/null
@@ -1,248 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="TestUnitTest++.vsnet2005"
- ProjectGUID="{9CCC3439-309E-4E85-B3B8-CE704D385D48}"
- RootNamespace="TestUnitTestvsnet2005"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="obj\$(ProjectName)\$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
- MinimalRebuild="true"
- ExceptionHandling="2"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- UsePrecompiledHeader="0"
- WarningLevel="4"
- Detect64BitPortabilityProblems="true"
- DebugInformationFormat="4"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- SubSystem="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine="&quot;$(TargetPath)&quot;"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="obj\$(ProjectName)\$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="1"
- WholeProgramOptimization="0"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
- ExceptionHandling="2"
- RuntimeLibrary="2"
- UsePrecompiledHeader="0"
- WarningLevel="4"
- Detect64BitPortabilityProblems="true"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine="&quot;$(TargetPath)&quot;"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <File
- RelativePath=".\src\tests\Main.cpp"
- >
- </File>
- <File
- RelativePath=".\src\tests\RecordingReporter.h"
- >
- </File>
- <File
- RelativePath=".\src\tests\TestAssertHandler.cpp"
- >
- </File>
- <File
- RelativePath=".\src\tests\TestCheckMacros.cpp"
- >
- </File>
- <File
- RelativePath=".\src\tests\TestChecks.cpp"
- >
- </File>
- <File
- RelativePath=".\src\tests\TestDeferredTestReporter.cpp"
- >
- </File>
- <File
- RelativePath=".\src\tests\TestMemoryOutStream.cpp"
- >
- </File>
- <File
- RelativePath=".\src\tests\TestTest.cpp"
- >
- </File>
- <File
- RelativePath=".\src\tests\TestTestList.cpp"
- >
- </File>
- <File
- RelativePath=".\src\tests\TestTestMacros.cpp"
- >
- </File>
- <File
- RelativePath=".\src\tests\TestTestResults.cpp"
- >
- </File>
- <File
- RelativePath=".\src\tests\TestTestRunner.cpp"
- >
- </File>
- <File
- RelativePath=".\src\tests\TestTestSuite.cpp"
- >
- </File>
- <File
- RelativePath=".\src\tests\TestTimeConstraint.cpp"
- >
- </File>
- <File
- RelativePath=".\src\tests\TestTimeConstraintMacro.cpp"
- >
- </File>
- <File
- RelativePath=".\src\tests\TestUnitTest++.cpp"
- >
- </File>
- <File
- RelativePath=".\src\tests\TestXmlTestReporter.cpp"
- >
- </File>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/src/testing/UnitTest++/UnitTest++.vsnet2003.sln b/src/testing/UnitTest++/UnitTest++.vsnet2003.sln
deleted file mode 100644
index 265d7ba..0000000
--- a/src/testing/UnitTest++/UnitTest++.vsnet2003.sln
+++ /dev/null
@@ -1,30 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 8.00
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UnitTest++.vsnet2003", "UnitTest++.vsnet2003.vcproj", "{7E5DD804-EC63-4FA5-BB6D-53DA86806EF5}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestUnitTest++.vsnet2003", "TestUnitTest++.vsnet2003.vcproj", "{ACDF9A6A-874F-49E5-AB7C-74F8150BB4C7}"
- ProjectSection(ProjectDependencies) = postProject
- {7E5DD804-EC63-4FA5-BB6D-53DA86806EF5} = {7E5DD804-EC63-4FA5-BB6D-53DA86806EF5}
- EndProjectSection
-EndProject
-Global
- GlobalSection(SolutionConfiguration) = preSolution
- Debug = Debug
- Release = Release
- EndGlobalSection
- GlobalSection(ProjectConfiguration) = postSolution
- {7E5DD804-EC63-4FA5-BB6D-53DA86806EF5}.Debug.ActiveCfg = Debug|Win32
- {7E5DD804-EC63-4FA5-BB6D-53DA86806EF5}.Debug.Build.0 = Debug|Win32
- {7E5DD804-EC63-4FA5-BB6D-53DA86806EF5}.Release.ActiveCfg = Release|Win32
- {7E5DD804-EC63-4FA5-BB6D-53DA86806EF5}.Release.Build.0 = Release|Win32
- {ACDF9A6A-874F-49E5-AB7C-74F8150BB4C7}.Debug.ActiveCfg = Debug|Win32
- {ACDF9A6A-874F-49E5-AB7C-74F8150BB4C7}.Debug.Build.0 = Debug|Win32
- {ACDF9A6A-874F-49E5-AB7C-74F8150BB4C7}.Release.ActiveCfg = Release|Win32
- {ACDF9A6A-874F-49E5-AB7C-74F8150BB4C7}.Release.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- EndGlobalSection
- GlobalSection(ExtensibilityAddIns) = postSolution
- EndGlobalSection
-EndGlobal
diff --git a/src/testing/UnitTest++/UnitTest++.vsnet2003.vcproj b/src/testing/UnitTest++/UnitTest++.vsnet2003.vcproj
deleted file mode 100644
index ccf0dbd..0000000
--- a/src/testing/UnitTest++/UnitTest++.vsnet2003.vcproj
+++ /dev/null
@@ -1,217 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="UnitTest++.vsnet2003"
- ProjectGUID="{7E5DD804-EC63-4FA5-BB6D-53DA86806EF5}"
- RootNamespace="UnitTest++.vsnet2003"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="obj\$(ProjectName)\$(ConfigurationName)"
- ConfigurationType="4"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
- MinimalRebuild="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="5"
- UsePrecompiledHeader="0"
- WarningLevel="4"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="4"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/UnitTest++.vsnet2003.lib"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="obj\$(ProjectName)\$(ConfigurationName)"
- ConfigurationType="4"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
- RuntimeLibrary="4"
- UsePrecompiledHeader="0"
- WarningLevel="4"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/UnitTest++.vsnet2003.lib"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Win32">
- <File
- RelativePath=".\src\Win32\TimeHelpers.cpp">
- </File>
- <File
- RelativePath=".\src\Win32\TimeHelpers.h">
- </File>
- </Filter>
- <File
- RelativePath=".\src\AssertException.cpp">
- </File>
- <File
- RelativePath=".\src\AssertException.h">
- </File>
- <File
- RelativePath=".\src\CheckMacros.h">
- </File>
- <File
- RelativePath=".\src\Checks.cpp">
- </File>
- <File
- RelativePath=".\src\Checks.h">
- </File>
- <File
- RelativePath=".\src\Config.h">
- </File>
- <File
- RelativePath=".\src\DeferredTestReporter.cpp">
- </File>
- <File
- RelativePath=".\src\DeferredTestReporter.h">
- </File>
- <File
- RelativePath=".\src\DeferredTestResult.cpp">
- </File>
- <File
- RelativePath=".\src\DeferredTestResult.h">
- </File>
- <File
- RelativePath=".\src\MemoryOutStream.cpp">
- </File>
- <File
- RelativePath=".\src\MemoryOutStream.h">
- </File>
- <File
- RelativePath=".\src\ReportAssert.cpp">
- </File>
- <File
- RelativePath=".\src\ReportAssert.h">
- </File>
- <File
- RelativePath=".\src\Test.cpp">
- </File>
- <File
- RelativePath=".\src\Test.h">
- </File>
- <File
- RelativePath=".\src\TestDetails.cpp">
- </File>
- <File
- RelativePath=".\src\TestDetails.h">
- </File>
- <File
- RelativePath=".\src\TestList.cpp">
- </File>
- <File
- RelativePath=".\src\TestList.h">
- </File>
- <File
- RelativePath=".\src\TestMacros.h">
- </File>
- <File
- RelativePath=".\src\TestReporter.cpp">
- </File>
- <File
- RelativePath=".\src\TestReporter.h">
- </File>
- <File
- RelativePath=".\src\TestReporterStdout.cpp">
- </File>
- <File
- RelativePath=".\src\TestReporterStdout.h">
- </File>
- <File
- RelativePath=".\src\TestResults.cpp">
- </File>
- <File
- RelativePath=".\src\TestResults.h">
- </File>
- <File
- RelativePath=".\src\TestRunner.cpp">
- </File>
- <File
- RelativePath=".\src\TestRunner.h">
- </File>
- <File
- RelativePath=".\src\TestSuite.h">
- </File>
- <File
- RelativePath=".\src\TimeConstraint.cpp">
- </File>
- <File
- RelativePath=".\src\TimeConstraint.h">
- </File>
- <File
- RelativePath=".\src\TimeHelpers.h">
- </File>
- <File
- RelativePath=".\src\UnitTest++.h">
- </File>
- <File
- RelativePath=".\src\XmlTestReporter.cpp">
- </File>
- <File
- RelativePath=".\src\XmlTestReporter.h">
- </File>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/src/testing/UnitTest++/UnitTest++.vsnet2005.sln b/src/testing/UnitTest++/UnitTest++.vsnet2005.sln
deleted file mode 100644
index 382f334..0000000
--- a/src/testing/UnitTest++/UnitTest++.vsnet2005.sln
+++ /dev/null
@@ -1,29 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2005
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UnitTest++.vsnet2005", "UnitTest++.vsnet2005.vcproj", "{64A4FEFE-0461-4E95-8CC1-91EF5F57DBC6}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestUnitTest++.vsnet2005", "TestUnitTest++.vsnet2005.vcproj", "{9CCC3439-309E-4E85-B3B8-CE704D385D48}"
- ProjectSection(ProjectDependencies) = postProject
- {64A4FEFE-0461-4E95-8CC1-91EF5F57DBC6} = {64A4FEFE-0461-4E95-8CC1-91EF5F57DBC6}
- EndProjectSection
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Release|Win32 = Release|Win32
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {64A4FEFE-0461-4E95-8CC1-91EF5F57DBC6}.Debug|Win32.ActiveCfg = Debug|Win32
- {64A4FEFE-0461-4E95-8CC1-91EF5F57DBC6}.Debug|Win32.Build.0 = Debug|Win32
- {64A4FEFE-0461-4E95-8CC1-91EF5F57DBC6}.Release|Win32.ActiveCfg = Release|Win32
- {64A4FEFE-0461-4E95-8CC1-91EF5F57DBC6}.Release|Win32.Build.0 = Release|Win32
- {9CCC3439-309E-4E85-B3B8-CE704D385D48}.Debug|Win32.ActiveCfg = Debug|Win32
- {9CCC3439-309E-4E85-B3B8-CE704D385D48}.Debug|Win32.Build.0 = Debug|Win32
- {9CCC3439-309E-4E85-B3B8-CE704D385D48}.Release|Win32.ActiveCfg = Release|Win32
- {9CCC3439-309E-4E85-B3B8-CE704D385D48}.Release|Win32.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/src/testing/UnitTest++/UnitTest++.vsnet2005.vcproj b/src/testing/UnitTest++/UnitTest++.vsnet2005.vcproj
deleted file mode 100644
index 0540f6b..0000000
--- a/src/testing/UnitTest++/UnitTest++.vsnet2005.vcproj
+++ /dev/null
@@ -1,306 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="UnitTest++.vsnet2005"
- ProjectGUID="{64A4FEFE-0461-4E95-8CC1-91EF5F57DBC6}"
- RootNamespace="UnitTestvsnet2005"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="obj\$(ProjectName)\$(ConfigurationName)"
- ConfigurationType="4"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE"
- MinimalRebuild="true"
- ExceptionHandling="2"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- UsePrecompiledHeader="0"
- WarningLevel="4"
- Detect64BitPortabilityProblems="true"
- DebugInformationFormat="4"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="obj\$(ProjectName)\$(ConfigurationName)"
- ConfigurationType="4"
- CharacterSet="1"
- WholeProgramOptimization="0"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="1"
- PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE"
- ExceptionHandling="2"
- RuntimeLibrary="2"
- UsePrecompiledHeader="0"
- WarningLevel="4"
- Detect64BitPortabilityProblems="true"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Win32"
- >
- <File
- RelativePath=".\src\Win32\TimeHelpers.cpp"
- >
- </File>
- <File
- RelativePath=".\src\Win32\TimeHelpers.h"
- >
- </File>
- </Filter>
- <File
- RelativePath=".\src\AssertException.cpp"
- >
- </File>
- <File
- RelativePath=".\src\AssertException.h"
- >
- </File>
- <File
- RelativePath=".\src\CheckMacros.h"
- >
- </File>
- <File
- RelativePath=".\src\Checks.cpp"
- >
- </File>
- <File
- RelativePath=".\src\Checks.h"
- >
- </File>
- <File
- RelativePath=".\src\Config.h"
- >
- </File>
- <File
- RelativePath=".\src\DeferredTestReporter.cpp"
- >
- </File>
- <File
- RelativePath=".\src\DeferredTestReporter.h"
- >
- </File>
- <File
- RelativePath=".\src\DeferredTestResult.cpp"
- >
- </File>
- <File
- RelativePath=".\src\DeferredTestResult.h"
- >
- </File>
- <File
- RelativePath=".\src\MemoryOutStream.cpp"
- >
- </File>
- <File
- RelativePath=".\src\MemoryOutStream.h"
- >
- </File>
- <File
- RelativePath=".\src\ReportAssert.cpp"
- >
- </File>
- <File
- RelativePath=".\src\ReportAssert.h"
- >
- </File>
- <File
- RelativePath=".\src\Test.cpp"
- >
- </File>
- <File
- RelativePath=".\src\Test.h"
- >
- </File>
- <File
- RelativePath=".\src\TestDetails.cpp"
- >
- </File>
- <File
- RelativePath=".\src\TestDetails.h"
- >
- </File>
- <File
- RelativePath=".\src\TestList.cpp"
- >
- </File>
- <File
- RelativePath=".\src\TestList.h"
- >
- </File>
- <File
- RelativePath=".\src\TestMacros.h"
- >
- </File>
- <File
- RelativePath=".\src\TestReporter.cpp"
- >
- </File>
- <File
- RelativePath=".\src\TestReporter.h"
- >
- </File>
- <File
- RelativePath=".\src\TestReporterStdout.cpp"
- >
- </File>
- <File
- RelativePath=".\src\TestReporterStdout.h"
- >
- </File>
- <File
- RelativePath=".\src\TestResults.cpp"
- >
- </File>
- <File
- RelativePath=".\src\TestResults.h"
- >
- </File>
- <File
- RelativePath=".\src\TestRunner.cpp"
- >
- </File>
- <File
- RelativePath=".\src\TestRunner.h"
- >
- </File>
- <File
- RelativePath=".\src\TestSuite.h"
- >
- </File>
- <File
- RelativePath=".\src\TimeConstraint.cpp"
- >
- </File>
- <File
- RelativePath=".\src\TimeConstraint.h"
- >
- </File>
- <File
- RelativePath=".\src\TimeHelpers.h"
- >
- </File>
- <File
- RelativePath=".\src\UnitTest++.h"
- >
- </File>
- <File
- RelativePath=".\src\XmlTestReporter.cpp"
- >
- </File>
- <File
- RelativePath=".\src\XmlTestReporter.h"
- >
- </File>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/src/testing/UnitTest++/docs/UnitTest++.html b/src/testing/UnitTest++/docs/UnitTest++.html
deleted file mode 100644
index cd40400..0000000
--- a/src/testing/UnitTest++/docs/UnitTest++.html
+++ /dev/null
@@ -1,260 +0,0 @@
-<html>
-<head>
- <title>UnitTest++ in brief</title>
-</head>
-<body>
-<h1>UnitTest++ in brief</h1>
-<h2>Introduction</h2>
-<p>This little document serves as bare-bones documentation for UnitTest++.</p>
-
-<p>For background, goals and license details, see:</p>
-
-<ul>
- <li><a href="http://unittest-cpp.sourceforge.net/">The UnitTest++ home page</a></li>
- <li><a href="http://www.gamesfromwithin.com/articles/0603/000108.html">Noel Llopis' announcement</a></li>
-</ul>
-
-<p>The documentation, while sparse, aims to be practical, so it should give you enough info to get started using UnitTest++ as fast as possible.</p>
-
-<h2>Building UnitTest++</h2>
-<p>Building UnitTest++ will be specific to each platform and build environment, but it should be straightforward.</p>
-
-<h3>Building with Visual Studio</h3>
-<p>If you are using Visual Studio, go for either of the provided .sln files, depending on version. There are no prefabricated solutions for versions earlier than VS.NET 2003, but we have had reports of people building UnitTest++ with at least VS.NET 2002.</p>
-
-<h3>Building with Make</h3>
-<p>The bundled makefile is written to build with g++. It also needs <code>sed</code> installed in the path, and to be able to use the <code>mv</code> and <code>rm</code> shell commands. The makefile should be usable on most Posix-like platforms.</p>
-
-<p>Do "make all" to generate a library and test executable. A final build step runs all unit tests to make sure that the result works as expected.</p>
-
-<h3>Packaging</h3>
-<p>You'll probably want to keep the generated library in a shared space in source control, so you can reuse it for multiple test projects. A redistributable package of UnitTest++ would consist of the generated library file, and all of the header files in <code>UnitTest++/src/</code> and its per-platform subfolders. The <code>tests</code> directory only contains the unit tests for the library, and need not be included.</p>
-
-<h2>Using UnitTest++</h2>
-<p>The source code for UnitTest++ comes with a full test suite written <em>using</em> UnitTest++. This is a great place to learn techniques for testing. There is one sample .cpp file: <code>UnitTest++/src/tests/TestUnitTest++.cpp</code>. It covers most of UnitTest++'s features in an easy-to-grasp context, so start there if you want a quick overview of typical usage.</p>
-
-<h3>Getting started</h3>
-<p>Listed below is a minimal C++ program to run a failing test through UnitTest++.</p>
-
-<pre>
- // test.cpp
- #include &lt;UnitTest++.h&gt;
-
- TEST(FailSpectacularly)
- {
- CHECK(false);
- }
-
- int main()
- {
- return UnitTest::RunAllTests();
- }
-</pre>
-
-<p><code>UnitTest++.h</code> is a facade header for UnitTest++, so including that should get you all features of the library. All classes and free functions are placed in namespace <code>UnitTest</code>, so you need to either qualify their full names (as with <code>RunAllTests()</code> in the example) or add a <code>using namespace UnitTest;</code> statement in your .cpp files. Note that any mention of UnitTest++ functions and classes in this document assume that the <code>UnitTest</code> namespace has been opened.</p>
-
-<p>Compiling and linking this program with UnitTest++'s static library into an executable, and running it, will produce the following output (details may vary):</p>
-
-<pre>
- .\test.cpp(5): error: Failure in FailSpectacularly: false
- FAILED: 1 out of 1 tests failed (1 failures).
- Test time: 0.00 seconds.
-</pre>
-
-<p>UnitTest++ attempts to report every failure in an IDE-friendly format, depending on platform (e.g. you can double-click it in Visual Studio's error list.) The exit code will be the number of failed tests, so that a failed test run always returns a non-zero exit code.</p>
-
-<h3>Test macros</h3>
-<p>To add a test, simply put the following code in a .cpp file of your choice:</p>
-
-<pre>
- TEST(YourTestName)
- {
- }
-</pre>
-
-<p>The <code>TEST</code> macro contains enough machinery to turn this slightly odd-looking syntax into legal C++, and automatically register the test in a global list. This test list forms the basis of what is executed by <code>RunAllTests()</code>.</p>
-
-<p>If you want to re-use a set of test data for more than one test, or provide setup/teardown for tests, you can use the <code>TEST_FIXTURE</code> macro instead. The macro requires that you pass it a class name that it will instantiate, so any setup and teardown code should be in its constructor and destructor.</p>
-
-<pre>
- struct SomeFixture
- {
- SomeFixture() { /* some setup */ }
- ~SomeFixture() { /* some teardown */ }
-
- int testData;
- };
-
- TEST_FIXTURE(SomeFixture, YourTestName)
- {
- int temp = testData;
- }
-</pre>
-
-<p>Note how members of the fixture are used as if they are a part of the test, since the macro-generated test class derives from the provided fixture class.</p>
-
-<h3>Suite macros</h3>
-<p>Tests can be grouped into suites, using the <code>SUITE</code> macro. A suite serves as a namespace for test names, so that the same test name can be used in two difference contexts.</p>
-
-<pre>
- SUITE(YourSuiteName)
- {
- TEST(YourTestName)
- {
- }
-
- TEST(YourOtherTestName)
- {
- }
- }
-</pre>
-
-<p>This will place the tests into a C++ namespace called <code>YourSuiteName</code>, and make the suite name available to UnitTest++. <code>RunAllTests()</code> can be called for a specific suite name, so you can use this to build named groups of tests to be run together.</p>
-
-<h3>Simple check macros</h3>
-<p>In test cases, we want to check the results of our system under test. UnitTest++ provides a number of check macros that handle comparison and proper failure reporting.</p>
-
-<p>The most basic variety is the boolean <code>CHECK</code> macro:</p>
-
-<pre>
- CHECK(false); // fails
-</pre>
-
-<p>It will fail if the boolean expression evaluates to false.</p>
-
-<p>For equality checks, it's generally better to use <code>CHECK_EQUAL</code>:</p>
-
-<pre>
- CHECK_EQUAL(10, 20); // fails
- CHECK_EQUAL("foo", "bar"); // fails
-</pre>
-
-<p>Note how <code>CHECK_EQUAL</code> is overloaded for C strings, so you don't have to resort to <code>strcmp</code> or similar. There is no facility for case-insensitive comparison or string searches, so you may have to drop down to a plain boolean <code>CHECK</code> with help from the CRT:</p>
-
-<pre>
- CHECK(std::strstr("zaza", "az") != 0); // succeeds
-</pre>
-
-<p>For floating-point comparison, equality <a href="http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm">isn't necessarily well-defined</a>, so you should prefer the <code>CHECK_CLOSE</code> macro:</p>
-
-<pre>
- CHECK_CLOSE(3.14, 3.1415, 0.01); // succeeds
-</pre>
-
-<p>All of the macros are tailored to avoid unintended side-effects, for example:</p>
-
-<pre>
- TEST(CheckMacrosHaveNoSideEffects)
- {
- int i = 4;
- CHECK_EQUAL(5, ++i); // succeeds
- CHECK_EQUAL(5, i); // succeeds
- }
-</pre>
-
-<p>The check macros guarantee that the <code>++i</code> expression isn't repeated internally, as demonstrated above.</p>
-
-<h3>Array check macros</h3>
-<p>There is a set of check macros for array comparison as well:</p>
-
-<pre>
- const float oned[2] = { 10, 20 };
- CHECK_ARRAY_EQUAL(oned, oned, 2); // succeeds
- CHECK_ARRAY_CLOSE(oned, oned, 2, 0.00); // succeeds
-
- const float twod[2][3] = { {0, 1, 2}, {2, 3, 4} };
- CHECK_ARRAY2D_CLOSE(twod, twod, 2, 3, 0.00); // succeeds
-</pre>
-
-<p>The array equal macro compares elements using <code>operator==</code>, so <code>CHECK_ARRAY_EQUAL</code> won't work for an array of C strings, for example.</p>
-
-<p>The array close macros are similar to the regular CHECK_CLOSE macro, and are really only useful for scalar types, that can be compared in terms of a difference between two array elements.</p>
-
-<p>Note that the one-dimensional array macros work for <code>std::vector</code> as well, as it can be indexed just as a C array.</p>
-
-<h3>Exception check macros</h3>
-<p>Finally, there's a <code>CHECK_THROW</code> macro, which asserts that its enclosed expression throws the specified type:</p>
-
-<pre>
- struct TestException {};
- CHECK_THROW(throw TestException(), TestException); // succeeds
-</pre>
-
-<p>UnitTest++ natively catches exceptions if your test code doesn't. So if your code under test throws any exception UnitTest++ will fail the test and report either using the <code>what()</code> method for <code>std::exception</code> derivatives or just a plain message for unknown exception types.</p>
-
-<p>Should your test or code raise an irrecoverable error (an Access Violation on Win32, for example, or a signal on Linux), UnitTest++ will attempt to map them to an exception and fail the test, just as for other unhandled exceptions.</p>
-
-<h3>Time constraints</h3>
-<p>UnitTest++ can fail a test if it takes too long to complete, using so-called time constraints.</p>
-
-<p>They come in two flavors; <em>local</em> and <em>global</em> time constraints.</p>
-
-<p>Local time constraints are limited to the current scope, like so:</p>
-
-<pre>
- TEST(YourTimedTest)
- {
- // Lengthy setup...
-
- {
- UNITTEST_TIME_CONSTRAINT(50);
-
- // Do time-critical stuff
- }
-
- // Lengthy teardown...
- }
-</pre>
-
-<p>The test will fail if the "Do time-critical stuff" block takes longer than 50 ms to complete. The time-consuming setup and teardown are not measured, since the time constraint is scope-bound. It's perfectly valid to have multiple local time constraints in the same test, as long as there is only one per block.</p>
-
-<p>A global time constraint, on the other hand, requires that all of the tests in a test run are faster than a specified amount of time. This allows you, when you run a suite of tests, to ask UnitTest++ to fail it entirely if any test exceeds the global constraint. The max time is passed as a parameter to an overload of <code>RunAllTests()</code>.</p>
-
-<p>If you want to use a global time constraint, but have one test that is notoriously slow, you can exempt it from inspection by using the <code>UNITTEST_TIME_CONSTRAINT_EXEMPT</code> macro anywhere inside the test body.</p>
-
-<pre>
- TEST(NotoriouslySlowTest)
- {
- UNITTEST_TIME_CONSTRAINT_EXEMPT();
-
- // Oh boy, this is going to take a while
- ...
- }
-</pre>
-
-<h3>Test runners</h3>
-<p>The <code>RunAllTests()</code> function has an overload that lets you customize the behavior of the runner, such as global time constraints, custom reporters, which suite to run, etc.</p>
-
-<pre>
- int RunAllTests(TestReporter& reporter, TestList const& list, char const* suiteName, int const maxTestTimeInMs);
-</pre>
-
-<p>If you attempt to pass custom parameters to <code>RunAllTests()</code>, note that the <code>list</code> parameter should have the value <code>Test::GetTestList()</code>.</p>
-
-<p>The parameterless <code>RunAllTests()</code> is a simple wrapper for this one, with sensible defaults.</p>
-
-<h3>Example setup</h3>
-<p>How to create a new test project varies depending on your environment, but here are some directions on common file structure and usage.</p>
-
-<p>The general idea is that you keep one <code>Main.cpp</code> file with the entry-point which calls <code>RunAllTests()</code>.</p>
-
-<p>Then you can simply compile and link new .cpp files at will, typically one per test suite.</p>
-
-<pre>
- + ShaverTests/
- |
- +- Main.cpp
- |
- +- TestBrush.cpp
- +- TestEngine.cpp
- +- TestRazor.cpp
-</pre>
-
-<p>Each of the <code>Test*.cpp</code> files will contain one or more <code>TEST</code> macro incantations with the associated test code. There are no source-level dependencies between <code>Main.cpp</code> and <code>Test*.cpp</code>, as the <code>TEST</code> macro handles the registration and setup necessary for <code>RunAllTests()</code> to find all tests compiled into the same final executable.</p>
-
-<p>UnitTest++ does not require this structure, even if this is how the library itself does it. As long as your test project contains one or more <code>TESTs</code> and calls <code>RunAllTests()</code> at one point or another, it will be handled by UnitTest++.</p>
-
-<p>It's common to make the generated executable start as a post-build step, so that merely building your test project will run the tests as well. Since the exit code is the count of failures, a failed test will generally break the build, as most build engines will fail a build if any step returns a non-zero exit code.</p>
-
-</body>
-</html> \ No newline at end of file
diff --git a/src/testing/UnitTest++/src/AssertException.cpp b/src/testing/UnitTest++/src/AssertException.cpp
deleted file mode 100644
index 49f7ba7..0000000
--- a/src/testing/UnitTest++/src/AssertException.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-#include "AssertException.h"
-#include <cstring>
-
-namespace UnitTest {
-
-AssertException::AssertException(char const* description, char const* filename, int const lineNumber)
- : m_lineNumber(lineNumber)
-{
- std::strcpy(m_description, description);
- std::strcpy(m_filename, filename);
-}
-
-AssertException::~AssertException() throw()
-{
-}
-
-char const* AssertException::what() const throw()
-{
- return m_description;
-}
-
-char const* AssertException::Filename() const
-{
- return m_filename;
-}
-
-int AssertException::LineNumber() const
-{
- return m_lineNumber;
-}
-
-}
diff --git a/src/testing/UnitTest++/src/AssertException.h b/src/testing/UnitTest++/src/AssertException.h
deleted file mode 100644
index e04d450..0000000
--- a/src/testing/UnitTest++/src/AssertException.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef UNITTEST_ASSERTEXCEPTION_H
-#define UNITTEST_ASSERTEXCEPTION_H
-
-#include <exception>
-
-
-namespace UnitTest {
-
-class AssertException : public std::exception
-{
-public:
- AssertException(char const* description, char const* filename, int lineNumber);
- virtual ~AssertException() throw();
-
- virtual char const* what() const throw();
-
- char const* Filename() const;
- int LineNumber() const;
-
-private:
- char m_description[512];
- char m_filename[256];
- int m_lineNumber;
-};
-
-}
-
-#endif
diff --git a/src/testing/UnitTest++/src/CheckMacros.h b/src/testing/UnitTest++/src/CheckMacros.h
deleted file mode 100644
index 2d499cc..0000000
--- a/src/testing/UnitTest++/src/CheckMacros.h
+++ /dev/null
@@ -1,102 +0,0 @@
-#ifndef UNITTEST_CHECKMACROS_H
-#define UNITTEST_CHECKMACROS_H
-
-#include "Checks.h"
-#include "AssertException.h"
-#include "MemoryOutStream.h"
-#include "TestDetails.h"
-
-#ifdef CHECK
- #error UnitTest++ redefines CHECK
-#endif
-
-
-#define CHECK(value) \
- do \
- { \
- try { \
- if (!UnitTest::Check(value)) \
- testResults_.OnTestFailure( UnitTest::TestDetails(m_details, __LINE__), #value); \
- } \
- catch (...) { \
- testResults_.OnTestFailure(UnitTest::TestDetails(m_details, __LINE__), \
- "Unhandled exception in CHECK(" #value ")"); \
- } \
- } while (0)
-
-#define CHECK_EQUAL(expected, actual) \
- do \
- { \
- try { \
- UnitTest::CheckEqual(testResults_, expected, actual, UnitTest::TestDetails(m_details, __LINE__)); \
- } \
- catch (...) { \
- testResults_.OnTestFailure(UnitTest::TestDetails(m_details, __LINE__), \
- "Unhandled exception in CHECK_EQUAL(" #expected ", " #actual ")"); \
- } \
- } while (0)
-
-#define CHECK_CLOSE(expected, actual, tolerance) \
- do \
- { \
- try { \
- UnitTest::CheckClose(testResults_, expected, actual, tolerance, UnitTest::TestDetails(m_details, __LINE__)); \
- } \
- catch (...) { \
- testResults_.OnTestFailure(UnitTest::TestDetails(m_details, __LINE__), \
- "Unhandled exception in CHECK_CLOSE(" #expected ", " #actual ")"); \
- } \
- } while (0)
-
-#define CHECK_ARRAY_EQUAL(expected, actual, count) \
- do \
- { \
- try { \
- UnitTest::CheckArrayEqual(testResults_, expected, actual, count, UnitTest::TestDetails(m_details, __LINE__)); \
- } \
- catch (...) { \
- testResults_.OnTestFailure(UnitTest::TestDetails(m_details, __LINE__), \
- "Unhandled exception in CHECK_ARRAY_EQUAL(" #expected ", " #actual ")"); \
- } \
- } while (0)
-
-#define CHECK_ARRAY_CLOSE(expected, actual, count, tolerance) \
- do \
- { \
- try { \
- UnitTest::CheckArrayClose(testResults_, expected, actual, count, tolerance, UnitTest::TestDetails(m_details, __LINE__)); \
- } \
- catch (...) { \
- testResults_.OnTestFailure(UnitTest::TestDetails(m_details, __LINE__), \
- "Unhandled exception in CHECK_ARRAY_CLOSE(" #expected ", " #actual ")"); \
- } \
- } while (0)
-
-#define CHECK_ARRAY2D_CLOSE(expected, actual, rows, columns, tolerance) \
- do \
- { \
- try { \
- UnitTest::CheckArray2DClose(testResults_, expected, actual, rows, columns, tolerance, UnitTest::TestDetails(m_details, __LINE__)); \
- } \
- catch (...) { \
- testResults_.OnTestFailure(UnitTest::TestDetails(m_details, __LINE__), \
- "Unhandled exception in CHECK_ARRAY_CLOSE(" #expected ", " #actual ")"); \
- } \
- } while (0)
-
-
-#define CHECK_THROW(expression, ExpectedExceptionType) \
- do \
- { \
- bool caught_ = false; \
- try { expression; } \
- catch (ExpectedExceptionType const&) { caught_ = true; } \
- catch (...) {} \
- if (!caught_) \
- testResults_.OnTestFailure(UnitTest::TestDetails(m_details, __LINE__), "Expected exception: \"" #ExpectedExceptionType "\" not thrown"); \
- } while(0)
-
-#define CHECK_ASSERT(expression) \
- CHECK_THROW(expression, UnitTest::AssertException);
-
-#endif
diff --git a/src/testing/UnitTest++/src/Checks.cpp b/src/testing/UnitTest++/src/Checks.cpp
deleted file mode 100644
index 337a96e..0000000
--- a/src/testing/UnitTest++/src/Checks.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-#include "Checks.h"
-#include <cstring>
-
-namespace UnitTest {
-
-namespace {
-
- static void WriteEncodedString(UnitTest::MemoryOutStream* stream, const char* value)
-{
- if (value == NULL)
- {
- (*stream) << "(null)";
- }
- else
- {
- for (const char* ch = value; *ch; ++ch)
- {
- if (*ch == '\n')
- (*stream) << "\\n";
- else if (*ch == '\t')
- (*stream) << "\\t";
- else if (*ch == '\r')
- (*stream) << "\\r";
- else
- (*stream) << (*ch);
- }
- }
-}
-
-
-void CheckStringsEqual(TestResults& results, char const* expected, char const* actual,
- TestDetails const& details)
-{
- // JP: Allow NULL values
-// if (std::strcmp(expected, actual))
- if (actual == NULL || std::strcmp(expected, actual))
- {
- UnitTest::MemoryOutStream stream;
-// stream << "Expected " << expected << " but was " << actual;
-// stream << "Expected " << expected << " but was " << (actual ? actual : "(null)");
-
- stream << "Expected ";
- WriteEncodedString(&stream, expected);
- stream << " but was ";
- WriteEncodedString(&stream, actual);
-
- results.OnTestFailure(details, stream.GetText());
- }
-}
-
-}
-
-
-void CheckEqual(TestResults& results, char const* expected, char const* actual,
- TestDetails const& details)
-{
- CheckStringsEqual(results, expected, actual, details);
-}
-
-void CheckEqual(TestResults& results, char* expected, char* actual,
- TestDetails const& details)
-{
- CheckStringsEqual(results, expected, actual, details);
-}
-
-void CheckEqual(TestResults& results, char* expected, char const* actual,
- TestDetails const& details)
-{
- CheckStringsEqual(results, expected, actual, details);
-}
-
-void CheckEqual(TestResults& results, char const* expected, char* actual,
- TestDetails const& details)
-{
- CheckStringsEqual(results, expected, actual, details);
-}
-
-
-}
diff --git a/src/testing/UnitTest++/src/Checks.h b/src/testing/UnitTest++/src/Checks.h
deleted file mode 100644
index b470b62..0000000
--- a/src/testing/UnitTest++/src/Checks.h
+++ /dev/null
@@ -1,146 +0,0 @@
-#ifndef UNITTEST_CHECKS_H
-#define UNITTEST_CHECKS_H
-
-#include "Config.h"
-#include "TestResults.h"
-#include "MemoryOutStream.h"
-
-namespace UnitTest {
-
-
-template< typename Value >
-bool Check(Value const value)
-{
- return !!value; // doing double negative to avoid silly VS warnings
-}
-
-
-template< typename Expected, typename Actual >
-void CheckEqual(TestResults& results, Expected const expected, Actual const actual, TestDetails const& details)
-{
- if (!(expected == actual))
- {
- UnitTest::MemoryOutStream stream;
- stream << "Expected " << expected << " but was " << actual;
-
- results.OnTestFailure(details, stream.GetText());
- }
-}
-
-void CheckEqual(TestResults& results, char const* expected, char const* actual, TestDetails const& details);
-
-void CheckEqual(TestResults& results, char* expected, char* actual, TestDetails const& details);
-
-void CheckEqual(TestResults& results, char* expected, char const* actual, TestDetails const& details);
-
-void CheckEqual(TestResults& results, char const* expected, char* actual, TestDetails const& details);
-
-template< typename Expected, typename Actual, typename Tolerance >
-bool AreClose(Expected const expected, Actual const actual, Tolerance const tolerance)
-{
- return (actual >= (expected - tolerance)) && (actual <= (expected + tolerance));
-}
-
-template< typename Expected, typename Actual, typename Tolerance >
-void CheckClose(TestResults& results, Expected const expected, Actual const actual, Tolerance const tolerance,
- TestDetails const& details)
-{
- if (!AreClose(expected, actual, tolerance))
- {
- UnitTest::MemoryOutStream stream;
- stream << "Expected " << expected << " +/- " << tolerance << " but was " << actual;
-
- results.OnTestFailure(details, stream.GetText());
- }
-}
-
-
-template< typename Expected, typename Actual >
-void CheckArrayEqual(TestResults& results, Expected const expected, Actual const actual,
- int const count, TestDetails const& details)
-{
- bool equal = true;
- for (int i = 0; i < count; ++i)
- equal &= (expected[i] == actual[i]);
-
- if (!equal)
- {
- UnitTest::MemoryOutStream stream;
- stream << "Expected [ ";
- for (int i = 0; i < count; ++i)
- stream << expected[i] << " ";
- stream << "] but was [ ";
- for (int i = 0; i < count; ++i)
- stream << actual[i] << " ";
- stream << "]";
-
- results.OnTestFailure(details, stream.GetText());
- }
-}
-
-template< typename Expected, typename Actual, typename Tolerance >
-bool ArrayAreClose(Expected const expected, Actual const actual, int const count, Tolerance const tolerance)
-{
- bool equal = true;
- for (int i = 0; i < count; ++i)
- equal &= AreClose(expected[i], actual[i], tolerance);
- return equal;
-}
-
-template< typename Expected, typename Actual, typename Tolerance >
-void CheckArrayClose(TestResults& results, Expected const expected, Actual const actual,
- int const count, Tolerance const tolerance, TestDetails const& details)
-{
- bool equal = ArrayAreClose(expected, actual, count, tolerance);
-
- if (!equal)
- {
- UnitTest::MemoryOutStream stream;
- stream << "Expected [ ";
- for (int i = 0; i < count; ++i)
- stream << expected[i] << " ";
- stream << "] +/- " << tolerance << " but was [ ";
- for (int i = 0; i < count; ++i)
- stream << actual[i] << " ";
- stream << "]";
-
- results.OnTestFailure(details, stream.GetText());
- }
-}
-
-template< typename Expected, typename Actual, typename Tolerance >
-void CheckArray2DClose(TestResults& results, Expected const expected, Actual const actual,
- int const rows, int const columns, Tolerance const tolerance, TestDetails const& details)
-{
- bool equal = true;
- for (int i = 0; i < rows; ++i)
- equal &= ArrayAreClose(expected[i], actual[i], columns, tolerance);
-
- if (!equal)
- {
- UnitTest::MemoryOutStream stream;
- stream << "Expected [ ";
- for (int i = 0; i < rows; ++i)
- {
- stream << "[ ";
- for (int j = 0; j < columns; ++j)
- stream << expected[i][j] << " ";
- stream << "] ";
- }
- stream << "] +/- " << tolerance << " but was [ ";
- for (int i = 0; i < rows; ++i)
- {
- stream << "[ ";
- for (int j = 0; j < columns; ++j)
- stream << actual[i][j] << " ";
- stream << "] ";
- }
- stream << "]";
-
- results.OnTestFailure(details, stream.GetText());
- }
-}
-
-}
-
-#endif
diff --git a/src/testing/UnitTest++/src/Config.h b/src/testing/UnitTest++/src/Config.h
deleted file mode 100644
index db423d4..0000000
--- a/src/testing/UnitTest++/src/Config.h
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifndef UNITTEST_CONFIG_H
-#define UNITTEST_CONFIG_H
-
-// Standard defines documented here: http://predef.sourceforge.net
-
-#if defined _MSC_VER
- #pragma warning(disable:4127) // conditional expression is constant
- #pragma warning(disable:4702) // unreachable code
- #pragma warning(disable:4722) // destructor never returns, potential memory leak
-#endif
-
-#if defined(unix) || defined(__unix__) || defined(__unix) || defined(linux) || \
- defined(__APPLE__) || defined (__NetBSD__) || defined (__OpenBSD__) || defined (__FreeBSD__)
- #define UNITTEST_POSIX
-#endif
-
-#if defined (__MINGW32__)
- #define UNITTEST_MINGW
-#endif
-
-// by default, MemoryOutStream is implemented in terms of std::ostringstream.
-// uncomment this line to use the custom MemoryOutStream (no deps on std::ostringstream).
-//#define UNITTEST_USE_CUSTOM_STREAMS
-
-#endif
diff --git a/src/testing/UnitTest++/src/DeferredTestReporter.cpp b/src/testing/UnitTest++/src/DeferredTestReporter.cpp
deleted file mode 100644
index 05e8055..0000000
--- a/src/testing/UnitTest++/src/DeferredTestReporter.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-#include "DeferredTestReporter.h"
-#include "TestDetails.h"
-
-using namespace UnitTest;
-
-void DeferredTestReporter::ReportTestStart(TestDetails const& details)
-{
- m_results.push_back(DeferredTestResult(details.suiteName, details.testName));
-}
-
-void DeferredTestReporter::ReportFailure(TestDetails const& details, char const* failure)
-{
- DeferredTestResult& r = m_results.back();
- r.failed = true;
- r.failures.push_back(DeferredTestResult::Failure(details.lineNumber, failure));
- r.failureFile = details.filename;
-}
-
-void DeferredTestReporter::ReportTestFinish(TestDetails const&, float const secondsElapsed)
-{
- DeferredTestResult& r = m_results.back();
- r.timeElapsed = secondsElapsed;
-}
-
-DeferredTestReporter::DeferredTestResultList& DeferredTestReporter::GetResults()
-{
- return m_results;
-}
diff --git a/src/testing/UnitTest++/src/DeferredTestReporter.h b/src/testing/UnitTest++/src/DeferredTestReporter.h
deleted file mode 100644
index 026ed05..0000000
--- a/src/testing/UnitTest++/src/DeferredTestReporter.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef UNITTEST_DEFERREDTESTREPORTER_H
-#define UNITTEST_DEFERREDTESTREPORTER_H
-
-#include "TestReporter.h"
-#include "DeferredTestResult.h"
-
-#include <vector>
-
-namespace UnitTest
-{
-
-class DeferredTestReporter : public TestReporter
-{
-public:
- virtual void ReportTestStart(TestDetails const& details);
- virtual void ReportFailure(TestDetails const& details, char const* failure);
- virtual void ReportTestFinish(TestDetails const& details, float secondsElapsed);
-
- typedef std::vector< DeferredTestResult > DeferredTestResultList;
- DeferredTestResultList& GetResults();
-
-private:
- DeferredTestResultList m_results;
-};
-
-}
-
-#endif
diff --git a/src/testing/UnitTest++/src/DeferredTestResult.cpp b/src/testing/UnitTest++/src/DeferredTestResult.cpp
deleted file mode 100644
index 6e35f86..0000000
--- a/src/testing/UnitTest++/src/DeferredTestResult.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-#include "DeferredTestResult.h"
-
-#include <cstdlib>
-
-namespace UnitTest
-{
-
-DeferredTestResult::DeferredTestResult()
- : suiteName("")
- , testName("")
- , failureFile("")
- , timeElapsed(0.0f)
- , failed(false)
-{
-}
-
-DeferredTestResult::DeferredTestResult(char const* suite, char const* test)
- : suiteName(suite)
- , testName(test)
- , failureFile("")
- , timeElapsed(0.0f)
- , failed(false)
-{
-}
-
-}
diff --git a/src/testing/UnitTest++/src/DeferredTestResult.h b/src/testing/UnitTest++/src/DeferredTestResult.h
deleted file mode 100644
index 6cca77c..0000000
--- a/src/testing/UnitTest++/src/DeferredTestResult.h
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef UNITTEST_DEFERREDTESTRESULT_H
-#define UNITTEST_DEFERREDTESTRESULT_H
-
-#include <string>
-#include <vector>
-
-namespace UnitTest
-{
-
-struct DeferredTestResult
-{
- DeferredTestResult();
- DeferredTestResult(char const* suite, char const* test);
-
- std::string suiteName;
- std::string testName;
- std::string failureFile;
-
- typedef std::pair< int, std::string > Failure;
- typedef std::vector< Failure > FailureVec;
- FailureVec failures;
-
- float timeElapsed;
- bool failed;
-};
-
-}
-
-#endif //UNITTEST_DEFERREDTESTRESULT_H
diff --git a/src/testing/UnitTest++/src/MemoryOutStream.cpp b/src/testing/UnitTest++/src/MemoryOutStream.cpp
deleted file mode 100644
index 04d4082..0000000
--- a/src/testing/UnitTest++/src/MemoryOutStream.cpp
+++ /dev/null
@@ -1,143 +0,0 @@
-#include "MemoryOutStream.h"
-
-#ifndef UNITTEST_USE_CUSTOM_STREAMS
-
-
-namespace UnitTest {
-
-char const* MemoryOutStream::GetText() const
-{
- m_text = this->str();
- return m_text.c_str();
-}
-
-
-}
-
-
-#else
-
-
-#include <cstring>
-#include <cstdio>
-
-namespace UnitTest {
-
-namespace {
-
-template<typename ValueType>
-void FormatToStream(MemoryOutStream& stream, char const* format, ValueType const& value)
-{
- char txt[32];
- std::sprintf(txt, format, value);
- stream << txt;
-}
-
-int RoundUpToMultipleOfPow2Number (int n, int pow2Number)
-{
- return (n + (pow2Number - 1)) & ~(pow2Number - 1);
-}
-
-}
-
-
-MemoryOutStream::MemoryOutStream(int const size)
- : m_capacity (0)
- , m_buffer (0)
-
-{
- GrowBuffer(size);
-}
-
-MemoryOutStream::~MemoryOutStream()
-{
- delete [] m_buffer;
-}
-
-char const* MemoryOutStream::GetText() const
-{
- return m_buffer;
-}
-
-MemoryOutStream& MemoryOutStream::operator << (char const* txt)
-{
- int const bytesLeft = m_capacity - (int)std::strlen(m_buffer);
- int const bytesRequired = (int)std::strlen(txt) + 1;
-
- if (bytesRequired > bytesLeft)
- {
- int const requiredCapacity = bytesRequired + m_capacity - bytesLeft;
- GrowBuffer(requiredCapacity);
- }
-
- std::strcat(m_buffer, txt);
- return *this;
-}
-
-MemoryOutStream& MemoryOutStream::operator << (int const n)
-{
- FormatToStream(*this, "%i", n);
- return *this;
-}
-
-MemoryOutStream& MemoryOutStream::operator << (long const n)
-{
- FormatToStream(*this, "%li", n);
- return *this;
-}
-
-MemoryOutStream& MemoryOutStream::operator << (unsigned long const n)
-{
- FormatToStream(*this, "%lu", n);
- return *this;
-}
-
-MemoryOutStream& MemoryOutStream::operator << (float const f)
-{
- FormatToStream(*this, "%ff", f);
- return *this;
-}
-
-MemoryOutStream& MemoryOutStream::operator << (void const* p)
-{
- FormatToStream(*this, "%p", p);
- return *this;
-}
-
-MemoryOutStream& MemoryOutStream::operator << (unsigned int const s)
-{
- FormatToStream(*this, "%u", s);
- return *this;
-}
-
-MemoryOutStream& MemoryOutStream::operator <<(double const d)
-{
- FormatToStream(*this, "%f", d);
- return *this;
-}
-
-int MemoryOutStream::GetCapacity() const
-{
- return m_capacity;
-}
-
-
-void MemoryOutStream::GrowBuffer(int const desiredCapacity)
-{
- int const newCapacity = RoundUpToMultipleOfPow2Number(desiredCapacity, GROW_CHUNK_SIZE);
-
- char* buffer = new char[newCapacity];
- if (m_buffer)
- std::strcpy(buffer, m_buffer);
- else
- std::strcpy(buffer, "");
-
- delete [] m_buffer;
- m_buffer = buffer;
- m_capacity = newCapacity;
-}
-
-}
-
-
-#endif
diff --git a/src/testing/UnitTest++/src/MemoryOutStream.h b/src/testing/UnitTest++/src/MemoryOutStream.h
deleted file mode 100644
index e03227e..0000000
--- a/src/testing/UnitTest++/src/MemoryOutStream.h
+++ /dev/null
@@ -1,67 +0,0 @@
-#ifndef UNITTEST_MEMORYOUTSTREAM_H
-#define UNITTEST_MEMORYOUTSTREAM_H
-
-#include "Config.h"
-
-#ifndef UNITTEST_USE_CUSTOM_STREAMS
-
-#include <sstream>
-
-namespace UnitTest
-{
-
-class MemoryOutStream : public std::ostringstream
-{
-public:
- MemoryOutStream() {}
- char const* GetText() const;
-
-private:
- MemoryOutStream(MemoryOutStream const&);
- void operator =(MemoryOutStream const&);
-
- mutable std::string m_text;
-};
-
-}
-
-#else
-
-#include <cstddef>
-
-namespace UnitTest
-{
-
-class MemoryOutStream
-{
-public:
- explicit MemoryOutStream(int const size = 256);
- ~MemoryOutStream();
-
- char const* GetText() const;
-
- MemoryOutStream& operator << (char const* txt);
- MemoryOutStream& operator << (int n);
- MemoryOutStream& operator << (long n);
- MemoryOutStream& operator << (unsigned long n);
- MemoryOutStream& operator << (float f);
- MemoryOutStream& operator << (double d);
- MemoryOutStream& operator << (void const* p);
- MemoryOutStream& operator << (unsigned int s);
-
- enum { GROW_CHUNK_SIZE = 32 };
- int GetCapacity() const;
-
-private:
- void operator= (MemoryOutStream const&);
- void GrowBuffer(int capacity);
-
- int m_capacity;
- char* m_buffer;
-};
-
-}
-
-#endif
-
-#endif
diff --git a/src/testing/UnitTest++/src/Posix/SignalTranslator.cpp b/src/testing/UnitTest++/src/Posix/SignalTranslator.cpp
deleted file mode 100644
index a31cb25..0000000
--- a/src/testing/UnitTest++/src/Posix/SignalTranslator.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-#include "SignalTranslator.h"
-
-namespace UnitTest {
-
-sigjmp_buf* SignalTranslator::s_jumpTarget = 0;
-
-namespace {
-
-void SignalHandler (int sig)
-{
- siglongjmp(*SignalTranslator::s_jumpTarget, sig );
-}
-
-}
-
-
-SignalTranslator::SignalTranslator ()
-{
- m_oldJumpTarget = s_jumpTarget;
- s_jumpTarget = &m_currentJumpTarget;
-
- struct sigaction action;
- action.sa_flags = 0;
- action.sa_handler = SignalHandler;
- sigemptyset( &action.sa_mask );
-
- sigaction( SIGSEGV, &action, &m_old_SIGSEGV_action );
- sigaction( SIGFPE , &action, &m_old_SIGFPE_action );
- sigaction( SIGTRAP, &action, &m_old_SIGTRAP_action );
- sigaction( SIGBUS , &action, &m_old_SIGBUS_action );
- sigaction( SIGILL , &action, &m_old_SIGBUS_action );
-}
-
-SignalTranslator::~SignalTranslator()
-{
- sigaction( SIGILL , &m_old_SIGBUS_action , 0 );
- sigaction( SIGBUS , &m_old_SIGBUS_action , 0 );
- sigaction( SIGTRAP, &m_old_SIGTRAP_action, 0 );
- sigaction( SIGFPE , &m_old_SIGFPE_action , 0 );
- sigaction( SIGSEGV, &m_old_SIGSEGV_action, 0 );
-
- s_jumpTarget = m_oldJumpTarget;
-}
-
-
-}
diff --git a/src/testing/UnitTest++/src/Posix/SignalTranslator.h b/src/testing/UnitTest++/src/Posix/SignalTranslator.h
deleted file mode 100644
index dfa0d11..0000000
--- a/src/testing/UnitTest++/src/Posix/SignalTranslator.h
+++ /dev/null
@@ -1,42 +0,0 @@
-#ifndef UNITTEST_SIGNALTRANSLATOR_H
-#define UNITTEST_SIGNALTRANSLATOR_H
-
-#include <setjmp.h>
-#include <signal.h>
-
-namespace UnitTest {
-
-class SignalTranslator
-{
-public:
- SignalTranslator();
- ~SignalTranslator();
-
- static sigjmp_buf* s_jumpTarget;
-
-private:
- sigjmp_buf m_currentJumpTarget;
- sigjmp_buf* m_oldJumpTarget;
-
- struct sigaction m_old_SIGFPE_action;
- struct sigaction m_old_SIGTRAP_action;
- struct sigaction m_old_SIGSEGV_action;
- struct sigaction m_old_SIGBUS_action;
- struct sigaction m_old_SIGABRT_action;
- struct sigaction m_old_SIGALRM_action;
-};
-
-#ifdef SOLARIS
- #define UNITTEST_EXTENSION
-#else
- #define UNITTEST_EXTENSION __extension__
-#endif
-
-#define UNITTEST_THROW_SIGNALS \
- UnitTest::SignalTranslator sig; \
- if (UNITTEST_EXTENSION sigsetjmp(*UnitTest::SignalTranslator::s_jumpTarget, 1) != 0) \
- throw ("Unhandled system exception");
-
-}
-
-#endif
diff --git a/src/testing/UnitTest++/src/Posix/TimeHelpers.cpp b/src/testing/UnitTest++/src/Posix/TimeHelpers.cpp
deleted file mode 100644
index bfd23c0..0000000
--- a/src/testing/UnitTest++/src/Posix/TimeHelpers.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-#include "TimeHelpers.h"
-#include <unistd.h>
-
-namespace UnitTest {
-
-Timer::Timer()
-{
- m_startTime.tv_sec = 0;
- m_startTime.tv_usec = 0;
-}
-
-void Timer::Start()
-{
- gettimeofday(&m_startTime, 0);
-}
-
-
-int Timer::GetTimeInMs() const
-{
- struct timeval currentTime;
- gettimeofday(&currentTime, 0);
- int const dsecs = currentTime.tv_sec - m_startTime.tv_sec;
- int const dus = currentTime.tv_usec - m_startTime.tv_usec;
- return dsecs*1000 + dus/1000;
-}
-
-
-void TimeHelpers::SleepMs (int ms)
-{
- usleep(ms * 1000);
-}
-
-}
diff --git a/src/testing/UnitTest++/src/Posix/TimeHelpers.h b/src/testing/UnitTest++/src/Posix/TimeHelpers.h
deleted file mode 100644
index fdc8428..0000000
--- a/src/testing/UnitTest++/src/Posix/TimeHelpers.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef UNITTEST_TIMEHELPERS_H
-#define UNITTEST_TIMEHELPERS_H
-
-#include <sys/time.h>
-
-namespace UnitTest {
-
-class Timer
-{
-public:
- Timer();
- void Start();
- int GetTimeInMs() const;
-
-private:
- struct timeval m_startTime;
-};
-
-
-namespace TimeHelpers
-{
-void SleepMs (int ms);
-}
-
-
-}
-
-#endif
diff --git a/src/testing/UnitTest++/src/ReportAssert.cpp b/src/testing/UnitTest++/src/ReportAssert.cpp
deleted file mode 100644
index 6c7db58..0000000
--- a/src/testing/UnitTest++/src/ReportAssert.cpp
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "AssertException.h"
-
-namespace UnitTest {
-
-void ReportAssert(char const* description, char const* filename, int const lineNumber)
-{
- throw AssertException(description, filename, lineNumber);
-}
-
-}
diff --git a/src/testing/UnitTest++/src/ReportAssert.h b/src/testing/UnitTest++/src/ReportAssert.h
deleted file mode 100644
index d4dd864..0000000
--- a/src/testing/UnitTest++/src/ReportAssert.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef UNITTEST_ASSERT_H
-#define UNITTEST_ASSERT_H
-
-namespace UnitTest {
-
-void ReportAssert(char const* description, char const* filename, int lineNumber);
-
-}
-
-#endif
diff --git a/src/testing/UnitTest++/src/Test.cpp b/src/testing/UnitTest++/src/Test.cpp
deleted file mode 100644
index 943fced..0000000
--- a/src/testing/UnitTest++/src/Test.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-#include "Config.h"
-#include "Test.h"
-#include "TestList.h"
-#include "TestResults.h"
-#include "AssertException.h"
-#include "MemoryOutStream.h"
-
-#ifdef UNITTEST_POSIX
- #include "Posix/SignalTranslator.h"
-#endif
-
-namespace UnitTest {
-
-TestList& Test::GetTestList()
-{
- static TestList s_list;
- return s_list;
-}
-
-Test::Test(char const* testName, char const* suiteName, char const* filename, int const lineNumber)
- : m_details(testName, suiteName, filename, lineNumber)
- , next(0)
- , m_timeConstraintExempt(false)
-{
-}
-
-Test::~Test()
-{
-}
-
-void Test::Run(TestResults& testResults) const
-{
- try
- {
-#ifdef UNITTEST_POSIX
- UNITTEST_THROW_SIGNALS
-#endif
- RunImpl(testResults);
- }
- catch (AssertException const& e)
- {
- testResults.OnTestFailure( TestDetails(m_details.testName, m_details.suiteName, e.Filename(), e.LineNumber()), e.what());
- }
- catch (std::exception const& e)
- {
- MemoryOutStream stream;
- stream << "Unhandled exception: " << e.what();
- testResults.OnTestFailure(m_details, stream.GetText());
- }
- catch (...)
- {
- testResults.OnTestFailure(m_details, "Unhandled exception: Crash!");
- }
-}
-
-
-void Test::RunImpl(TestResults&) const
-{
-}
-
-
-}
diff --git a/src/testing/UnitTest++/src/Test.h b/src/testing/UnitTest++/src/Test.h
deleted file mode 100644
index 458c75c..0000000
--- a/src/testing/UnitTest++/src/Test.h
+++ /dev/null
@@ -1,34 +0,0 @@
-#ifndef UNITTEST_TEST_H
-#define UNITTEST_TEST_H
-
-#include "TestDetails.h"
-
-namespace UnitTest {
-
-class TestResults;
-class TestList;
-
-class Test
-{
-public:
- Test(char const* testName, char const* suiteName = "DefaultSuite", char const* filename = "", int lineNumber = 0);
- virtual ~Test();
- void Run(TestResults& testResults) const;
-
- TestDetails const m_details;
- Test* next;
- mutable bool m_timeConstraintExempt;
-
- static TestList& GetTestList();
-
-private:
- virtual void RunImpl(TestResults& testResults_) const;
-
- Test(Test const&);
- Test& operator =(Test const&);
-};
-
-
-}
-
-#endif
diff --git a/src/testing/UnitTest++/src/TestDetails.cpp b/src/testing/UnitTest++/src/TestDetails.cpp
deleted file mode 100644
index a13a168..0000000
--- a/src/testing/UnitTest++/src/TestDetails.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-#include "TestDetails.h"
-
-namespace UnitTest {
-
-TestDetails::TestDetails(char const* testName_, char const* suiteName_, char const* filename_, int lineNumber_)
- : suiteName(suiteName_)
- , testName(testName_)
- , filename(filename_)
- , lineNumber(lineNumber_)
-{
-}
-
-TestDetails::TestDetails(const TestDetails& details, int lineNumber_)
- : suiteName(details.suiteName)
- , testName(details.testName)
- , filename(details.filename)
- , lineNumber(lineNumber_)
-{
-}
-
-
-}
diff --git a/src/testing/UnitTest++/src/TestDetails.h b/src/testing/UnitTest++/src/TestDetails.h
deleted file mode 100644
index eae0e71..0000000
--- a/src/testing/UnitTest++/src/TestDetails.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef UNITTEST_TESTDETAILS_H
-#define UNITTEST_TESTDETAILS_H
-
-namespace UnitTest {
-
-class TestDetails
-{
-public:
- TestDetails(char const* testName, char const* suiteName, char const* filename, int lineNumber);
- TestDetails(const TestDetails& details, int lineNumber);
-
- char const* const suiteName;
- char const* const testName;
- char const* const filename;
- int const lineNumber;
-
- TestDetails(TestDetails const&); // Why is it public? --> http://gcc.gnu.org/bugs.html#cxx_rvalbind
-private:
- TestDetails& operator=(TestDetails const&);
-};
-
-}
-
-#endif
diff --git a/src/testing/UnitTest++/src/TestList.cpp b/src/testing/UnitTest++/src/TestList.cpp
deleted file mode 100644
index d11965c..0000000
--- a/src/testing/UnitTest++/src/TestList.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-#include "TestList.h"
-#include "Test.h"
-
-#include <cassert>
-
-namespace UnitTest {
-
-TestList::TestList()
- : m_head(0)
- , m_tail(0)
-{
-}
-
-void TestList::Add(Test* test)
-{
- if (m_tail == 0)
- {
- assert(m_head == 0);
- m_head = test;
- m_tail = test;
- }
- else
- {
- m_tail->next = test;
- m_tail = test;
- }
-}
-
-const Test* TestList::GetHead() const
-{
- return m_head;
-}
-
-ListAdder::ListAdder(TestList& list, Test* test)
-{
- list.Add(test);
-}
-
-}
diff --git a/src/testing/UnitTest++/src/TestList.h b/src/testing/UnitTest++/src/TestList.h
deleted file mode 100644
index 14b978a..0000000
--- a/src/testing/UnitTest++/src/TestList.h
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef UNITTEST_TESTLIST_H
-#define UNITTEST_TESTLIST_H
-
-
-namespace UnitTest {
-
-class Test;
-
-class TestList
-{
-public:
- TestList();
- void Add (Test* test);
-
- const Test* GetHead() const;
-
-private:
- Test* m_head;
- Test* m_tail;
-};
-
-
-class ListAdder
-{
-public:
- ListAdder(TestList& list, Test* test);
-};
-
-}
-
-
-#endif
diff --git a/src/testing/UnitTest++/src/TestMacros.h b/src/testing/UnitTest++/src/TestMacros.h
deleted file mode 100644
index 09ecc6b..0000000
--- a/src/testing/UnitTest++/src/TestMacros.h
+++ /dev/null
@@ -1,99 +0,0 @@
-#ifndef UNITTEST_TESTMACROS_H
-#define UNITTEST_TESTMACROS_H
-
-#include "Config.h"
-
-#ifndef UNITTEST_POSIX
- #define UNITTEST_THROW_SIGNALS
-#else
- #include "Posix/SignalTranslator.h"
-#endif
-
-#ifdef TEST
- #error UnitTest++ redefines TEST
-#endif
-
-#define SUITE(Name) \
- namespace Name { \
- namespace UnitTestSuite { \
- inline char const* GetSuiteName () { \
- return #Name ; \
- } \
- } \
- } \
- namespace Name
-
-#define TEST_EX(Name, List) \
- class Test##Name : public UnitTest::Test \
- { \
- public: \
- Test##Name() : Test(#Name, UnitTestSuite::GetSuiteName(), __FILE__, __LINE__) {} \
- private: \
- virtual void RunImpl(UnitTest::TestResults& testResults_) const; \
- } test##Name##Instance; \
- \
- UnitTest::ListAdder adder##Name (List, &test##Name##Instance); \
- \
- void Test##Name::RunImpl(UnitTest::TestResults& testResults_) const
-
-
-#define TEST(Name) TEST_EX(Name, UnitTest::Test::GetTestList())
-
-
-#define TEST_FIXTURE_EX(Fixture, Name, List) \
- class Fixture##Name##Helper : public Fixture \
- { \
- public: \
- Fixture##Name##Helper(UnitTest::TestDetails const& details) : m_details(details) {} \
- void RunTest(UnitTest::TestResults& testResults_); \
- UnitTest::TestDetails const& m_details; \
- private: \
- Fixture##Name##Helper(Fixture##Name##Helper const&); \
- Fixture##Name##Helper& operator =(Fixture##Name##Helper const&); \
- }; \
- \
- class Test##Fixture##Name : public UnitTest::Test \
- { \
- public: \
- Test##Fixture##Name() : Test(#Name, UnitTestSuite::GetSuiteName(), __FILE__, __LINE__) {} \
- private: \
- virtual void RunImpl(UnitTest::TestResults& testResults_) const; \
- } test##Fixture##Name##Instance; \
- \
- UnitTest::ListAdder adder##Fixture##Name (List, &test##Fixture##Name##Instance); \
- \
- void Test##Fixture##Name::RunImpl(UnitTest::TestResults& testResults_) const \
- { \
- bool ctorOk = false; \
- try { \
- Fixture##Name##Helper fixtureHelper(m_details); \
- ctorOk = true; \
- try { \
- UNITTEST_THROW_SIGNALS; \
- fixtureHelper.RunTest(testResults_); \
- } catch (UnitTest::AssertException const& e) { \
- testResults_.OnTestFailure(UnitTest::TestDetails(m_details.testName, m_details.suiteName, e.Filename(), e.LineNumber()), e.what()); \
- } catch (std::exception const& e) { \
- UnitTest::MemoryOutStream stream; \
- stream << "Unhandled exception: " << e.what(); \
- testResults_.OnTestFailure(m_details, stream.GetText()); \
- } catch (...) { testResults_.OnTestFailure(m_details, "Unhandled exception: Crash!"); } \
- } \
- catch (...) { \
- if (ctorOk) \
- { \
- testResults_.OnTestFailure(UnitTest::TestDetails(m_details, __LINE__), \
- "Unhandled exception while destroying fixture " #Fixture); \
- } \
- else \
- { \
- testResults_.OnTestFailure(UnitTest::TestDetails(m_details, __LINE__), \
- "Unhandled exception while constructing fixture " #Fixture); \
- } \
- } \
- } \
- void Fixture##Name##Helper::RunTest(UnitTest::TestResults& testResults_)
-
-#define TEST_FIXTURE(Fixture,Name) TEST_FIXTURE_EX(Fixture, Name, UnitTest::Test::GetTestList())
-
-#endif
diff --git a/src/testing/UnitTest++/src/TestReporter.cpp b/src/testing/UnitTest++/src/TestReporter.cpp
deleted file mode 100644
index 608d3c6..0000000
--- a/src/testing/UnitTest++/src/TestReporter.cpp
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "TestReporter.h"
-
-namespace UnitTest {
-
-
-TestReporter::~TestReporter()
-{
-}
-
-}
diff --git a/src/testing/UnitTest++/src/TestReporter.h b/src/testing/UnitTest++/src/TestReporter.h
deleted file mode 100644
index 5a2f404..0000000
--- a/src/testing/UnitTest++/src/TestReporter.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef UNITTEST_TESTREPORTER_H
-#define UNITTEST_TESTREPORTER_H
-
-namespace UnitTest {
-
-class TestDetails;
-
-class TestReporter
-{
-public:
- virtual ~TestReporter();
-
- virtual void ReportTestStart(TestDetails const& test) = 0;
- virtual void ReportFailure(TestDetails const& test, char const* failure) = 0;
- virtual void ReportTestFinish(TestDetails const& test, float secondsElapsed) = 0;
- virtual void ReportSummary(int totalTestCount, int failedTestCount, int failureCount, float secondsElapsed) = 0;
-};
-
-}
-#endif
diff --git a/src/testing/UnitTest++/src/TestReporterStdout.cpp b/src/testing/UnitTest++/src/TestReporterStdout.cpp
deleted file mode 100644
index 133e6fa..0000000
--- a/src/testing/UnitTest++/src/TestReporterStdout.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-#include "TestReporterStdout.h"
-#include <cstdio>
-
-#include "TestDetails.h"
-
-namespace UnitTest {
-
-void TestReporterStdout::ReportFailure(TestDetails const& details, char const* failure)
-{
-#ifdef __APPLE__
- char const* const errorFormat = "%s:%d: error: Failure in %s: %s\n";
-#else
- char const* const errorFormat = "%s(%d): error: Failure in %s: %s\n";
-#endif
- std::printf(errorFormat, details.filename, details.lineNumber, details.testName, failure);
-}
-
-void TestReporterStdout::ReportTestStart(TestDetails const& /*test*/)
-{
-}
-
-void TestReporterStdout::ReportTestFinish(TestDetails const& /*test*/, float)
-{
-}
-
-void TestReporterStdout::ReportSummary(int const totalTestCount, int const failedTestCount,
- int const failureCount, float secondsElapsed)
-{
- if (failureCount > 0)
- std::printf("FAILURE: %d out of %d tests failed (%d failures).\n", failedTestCount, totalTestCount, failureCount);
- else
- std::printf("Success: %d tests passed.\n", totalTestCount);
- std::printf("Test time: %.2f seconds.\n", secondsElapsed);
-}
-
-}
diff --git a/src/testing/UnitTest++/src/TestReporterStdout.h b/src/testing/UnitTest++/src/TestReporterStdout.h
deleted file mode 100644
index eacbba3..0000000
--- a/src/testing/UnitTest++/src/TestReporterStdout.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#ifndef UNITTEST_TESTREPORTERSTDOUT_H
-#define UNITTEST_TESTREPORTERSTDOUT_H
-
-#include "TestReporter.h"
-
-namespace UnitTest {
-
-class TestReporterStdout : public TestReporter
-{
-private:
- virtual void ReportTestStart(TestDetails const& test);
- virtual void ReportFailure(TestDetails const& test, char const* failure);
- virtual void ReportTestFinish(TestDetails const& test, float secondsElapsed);
- virtual void ReportSummary(int totalTestCount, int failedTestCount, int failureCount, float secondsElapsed);
-};
-
-}
-
-#endif
diff --git a/src/testing/UnitTest++/src/TestResults.cpp b/src/testing/UnitTest++/src/TestResults.cpp
deleted file mode 100644
index b3b67c0..0000000
--- a/src/testing/UnitTest++/src/TestResults.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-#include "TestResults.h"
-#include "TestReporter.h"
-
-#include "TestDetails.h"
-
-namespace UnitTest {
-
-TestResults::TestResults(TestReporter* testReporter)
- : m_testReporter(testReporter)
- , m_totalTestCount(0)
- , m_failedTestCount(0)
- , m_failureCount(0)
- , m_currentTestFailed(false)
-{
-}
-
-void TestResults::OnTestStart(TestDetails const& test)
-{
- ++m_totalTestCount;
- m_currentTestFailed = false;
- if (m_testReporter)
- m_testReporter->ReportTestStart(test);
-}
-
-void TestResults::OnTestFailure(TestDetails const& test, char const* failure)
-{
- ++m_failureCount;
- if (!m_currentTestFailed)
- {
- ++m_failedTestCount;
- m_currentTestFailed = true;
- }
-
- if (m_testReporter)
- m_testReporter->ReportFailure(test, failure);
-}
-
-void TestResults::OnTestFinish(TestDetails const& test, float secondsElapsed)
-{
- if (m_testReporter)
- m_testReporter->ReportTestFinish(test, secondsElapsed);
-}
-
-int TestResults::GetTotalTestCount() const
-{
- return m_totalTestCount;
-}
-
-int TestResults::GetFailedTestCount() const
-{
- return m_failedTestCount;
-}
-
-int TestResults::GetFailureCount() const
-{
- return m_failureCount;
-}
-
-
-}
diff --git a/src/testing/UnitTest++/src/TestResults.h b/src/testing/UnitTest++/src/TestResults.h
deleted file mode 100644
index 8ef7fda..0000000
--- a/src/testing/UnitTest++/src/TestResults.h
+++ /dev/null
@@ -1,36 +0,0 @@
-#ifndef UNITTEST_TESTRESULTS_H
-#define UNITTEST_TESTRESULTS_H
-
-namespace UnitTest {
-
-class TestReporter;
-class TestDetails;
-
-class TestResults
-{
-public:
- explicit TestResults(TestReporter* reporter = 0);
-
- void OnTestStart(TestDetails const& test);
- void OnTestFailure(TestDetails const& test, char const* failure);
- void OnTestFinish(TestDetails const& test, float secondsElapsed);
-
- int GetTotalTestCount() const;
- int GetFailedTestCount() const;
- int GetFailureCount() const;
-
-private:
- TestReporter* m_testReporter;
- int m_totalTestCount;
- int m_failedTestCount;
- int m_failureCount;
-
- bool m_currentTestFailed;
-
- TestResults(TestResults const&);
- TestResults& operator =(TestResults const&);
-};
-
-}
-
-#endif
diff --git a/src/testing/UnitTest++/src/TestRunner.cpp b/src/testing/UnitTest++/src/TestRunner.cpp
deleted file mode 100644
index 5780d91..0000000
--- a/src/testing/UnitTest++/src/TestRunner.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-#include "TestRunner.h"
-#include "TestResults.h"
-#include "Test.h"
-#include "TestList.h"
-#include "TestReporter.h"
-#include "TestReporterStdout.h"
-#include "TimeHelpers.h"
-#include "MemoryOutStream.h"
-#include <cstring>
-
-
-namespace UnitTest {
-
-
-int RunAllTests(TestReporter& reporter, TestList const& list, char const* suiteName, int const maxTestTimeInMs )
-{
- TestResults result(&reporter);
-
- Timer overallTimer;
- overallTimer.Start();
-
- Test const* curTest = list.GetHead();
- while (curTest != 0)
- {
- if (suiteName == 0 || !std::strcmp(curTest->m_details.suiteName, suiteName))
- {
- Timer testTimer;
- testTimer.Start();
- result.OnTestStart(curTest->m_details);
-
- curTest->Run(result);
-
- int const testTimeInMs = testTimer.GetTimeInMs();
- if (maxTestTimeInMs > 0 && testTimeInMs > maxTestTimeInMs && !curTest->m_timeConstraintExempt)
- {
- MemoryOutStream stream;
- stream << "Global time constraint failed. Expected under " << maxTestTimeInMs <<
- "ms but took " << testTimeInMs << "ms.";
- result.OnTestFailure(curTest->m_details, stream.GetText());
- }
- result.OnTestFinish(curTest->m_details, testTimeInMs/1000.0f);
- }
-
- curTest = curTest->next;
- }
-
- float const secondsElapsed = overallTimer.GetTimeInMs() / 1000.0f;
- reporter.ReportSummary(result.GetTotalTestCount(), result.GetFailedTestCount(), result.GetFailureCount(), secondsElapsed);
-
- return result.GetFailureCount();
-}
-
-
-int RunAllTests()
-{
- TestReporterStdout reporter;
- return RunAllTests(reporter, Test::GetTestList(), 0);
-}
-
-}
diff --git a/src/testing/UnitTest++/src/TestRunner.h b/src/testing/UnitTest++/src/TestRunner.h
deleted file mode 100644
index 8b9934a..0000000
--- a/src/testing/UnitTest++/src/TestRunner.h
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef UNITTEST_TESTRUNNER_H
-#define UNITTEST_TESTRUNNER_H
-
-
-namespace UnitTest {
-
-class TestReporter;
-class TestList;
-
-
-int RunAllTests();
-int RunAllTests(TestReporter& reporter, TestList const& list, char const* suiteName, int maxTestTimeInMs = 0);
-
-}
-
-
-#endif
diff --git a/src/testing/UnitTest++/src/TestSuite.h b/src/testing/UnitTest++/src/TestSuite.h
deleted file mode 100644
index dd3717e..0000000
--- a/src/testing/UnitTest++/src/TestSuite.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef UNITTEST_TESTSUITE_H
-#define UNITTEST_TESTSUITE_H
-
-namespace UnitTestSuite {
-
- inline char const* GetSuiteName ()
- {
- return "DefaultSuite";
- }
-
-}
-
-#endif
-
diff --git a/src/testing/UnitTest++/src/TimeConstraint.cpp b/src/testing/UnitTest++/src/TimeConstraint.cpp
deleted file mode 100644
index 451c2b3..0000000
--- a/src/testing/UnitTest++/src/TimeConstraint.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-#include "TimeConstraint.h"
-#include "TestResults.h"
-#include "MemoryOutStream.h"
-
-namespace UnitTest {
-
-
-TimeConstraint::TimeConstraint(int ms, TestResults& result, TestDetails const& details)
- : m_result(result)
- , m_details(details)
- , m_maxMs(ms)
-{
- m_timer.Start();
-}
-
-TimeConstraint::~TimeConstraint()
-{
- int const totalTimeInMs = m_timer.GetTimeInMs();
- if (totalTimeInMs > m_maxMs)
- {
- MemoryOutStream stream;
- stream << "Time constraint failed. Expected to run test under " << m_maxMs <<
- "ms but took " << totalTimeInMs << "ms.";
- m_result.OnTestFailure(m_details, stream.GetText());
- }
-}
-
-}
diff --git a/src/testing/UnitTest++/src/TimeConstraint.h b/src/testing/UnitTest++/src/TimeConstraint.h
deleted file mode 100644
index 8451c66..0000000
--- a/src/testing/UnitTest++/src/TimeConstraint.h
+++ /dev/null
@@ -1,34 +0,0 @@
-#ifndef UNITTEST_TIMECONSTRAINT_H
-#define UNITTEST_TIMECONSTRAINT_H
-
-#include "TimeHelpers.h"
-
-namespace UnitTest {
-
-class TestResults;
-class TestDetails;
-
-class TimeConstraint
-{
-public:
- TimeConstraint(int ms, TestResults& result, TestDetails const& details);
- ~TimeConstraint();
-
-private:
- void operator=(TimeConstraint const&);
- TimeConstraint(TimeConstraint const&);
-
- Timer m_timer;
- TestResults& m_result;
- TestDetails const& m_details;
- int const m_maxMs;
-};
-
-#define UNITTEST_TIME_CONSTRAINT(ms) \
- UnitTest::TimeConstraint unitTest__timeConstraint__(ms, testResults_, UnitTest::TestDetails(m_details, __LINE__))
-
-#define UNITTEST_TIME_CONSTRAINT_EXEMPT() do { m_timeConstraintExempt = true; } while (0)
-
-}
-
-#endif
diff --git a/src/testing/UnitTest++/src/TimeHelpers.h b/src/testing/UnitTest++/src/TimeHelpers.h
deleted file mode 100644
index f34ed00..0000000
--- a/src/testing/UnitTest++/src/TimeHelpers.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#include "Config.h"
-
-#if defined UNITTEST_POSIX
- #include "Posix/TimeHelpers.h"
-#else
- #include "Win32/TimeHelpers.h"
-#endif
diff --git a/src/testing/UnitTest++/src/UnitTest++.h b/src/testing/UnitTest++/src/UnitTest++.h
deleted file mode 100644
index 019f80a..0000000
--- a/src/testing/UnitTest++/src/UnitTest++.h
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef UNITTESTCPP_H
-#define UNITTESTCPP_H
-
-#include "Config.h"
-#include "Test.h"
-#include "TestList.h"
-#include "TestSuite.h"
-#include "TestResults.h"
-
-#include <new>
-#include "TestMacros.h"
-
-#include "CheckMacros.h"
-#include "TestRunner.h"
-#include "TimeConstraint.h"
-
-#endif
diff --git a/src/testing/UnitTest++/src/Win32/TimeHelpers.cpp b/src/testing/UnitTest++/src/Win32/TimeHelpers.cpp
deleted file mode 100644
index 7c3dae8..0000000
--- a/src/testing/UnitTest++/src/Win32/TimeHelpers.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-#include "TimeHelpers.h"
-#include <windows.h>
-
-namespace UnitTest {
-
-Timer::Timer()
- : m_startTime(0)
-{
- m_threadId = ::GetCurrentThread();
- DWORD_PTR systemMask;
- ::GetProcessAffinityMask(GetCurrentProcess(), &m_processAffinityMask, &systemMask);
-
- ::SetThreadAffinityMask(m_threadId, 1);
- ::QueryPerformanceFrequency(reinterpret_cast< LARGE_INTEGER* >(&m_frequency));
- ::SetThreadAffinityMask(m_threadId, m_processAffinityMask);
-}
-
-void Timer::Start()
-{
- m_startTime = GetTime();
-}
-
-int Timer::GetTimeInMs() const
-{
- __int64 const elapsedTime = GetTime() - m_startTime;
- double const seconds = double(elapsedTime) / double(m_frequency);
- return int(seconds * 1000.0f);
-}
-
-__int64 Timer::GetTime() const
-{
- LARGE_INTEGER curTime;
- ::SetThreadAffinityMask(m_threadId, 1);
- ::QueryPerformanceCounter(&curTime);
- ::SetThreadAffinityMask(m_threadId, m_processAffinityMask);
- return curTime.QuadPart;
-}
-
-
-
-void TimeHelpers::SleepMs(int const ms)
-{
- ::Sleep(ms);
-}
-
-}
diff --git a/src/testing/UnitTest++/src/Win32/TimeHelpers.h b/src/testing/UnitTest++/src/Win32/TimeHelpers.h
deleted file mode 100644
index 56e30d5..0000000
--- a/src/testing/UnitTest++/src/Win32/TimeHelpers.h
+++ /dev/null
@@ -1,48 +0,0 @@
-#ifndef UNITTEST_TIMEHELPERS_H
-#define UNITTEST_TIMEHELPERS_H
-
-#include "../Config.h"
-
-
-#ifdef UNITTEST_MINGW
- #ifndef __int64
- #define __int64 long long
- #endif
-#endif
-
-namespace UnitTest {
-
-class Timer
-{
-public:
- Timer();
- void Start();
- int GetTimeInMs() const;
-
-private:
- __int64 GetTime() const;
-
- void* m_threadId;
-
-#if defined(_WIN64)
- unsigned __int64 m_processAffinityMask;
-#else
- unsigned long m_processAffinityMask;
-#endif
-
- __int64 m_startTime;
- __int64 m_frequency;
-};
-
-
-namespace TimeHelpers
-{
-void SleepMs (int ms);
-}
-
-
-}
-
-
-
-#endif
diff --git a/src/testing/UnitTest++/src/XmlTestReporter.cpp b/src/testing/UnitTest++/src/XmlTestReporter.cpp
deleted file mode 100644
index 0895e37..0000000
--- a/src/testing/UnitTest++/src/XmlTestReporter.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-#include "XmlTestReporter.h"
-
-#include <iostream>
-#include <sstream>
-#include <string>
-
-using std::string;
-using std::ostringstream;
-using std::ostream;
-
-namespace {
-
-void ReplaceChar(string& str, char const c, string const& replacement)
-{
- for (size_t pos = str.find(c); pos != string::npos; pos = str.find(c, pos + 1))
- str.replace(pos, 1, replacement);
-}
-
-string XmlEscape(string const& value)
-{
- string escaped = value;
-
- ReplaceChar(escaped, '&', "&amp;");
- ReplaceChar(escaped, '<', "&lt;");
- ReplaceChar(escaped, '>', "&gt;");
- ReplaceChar(escaped, '\'', "&apos;");
- ReplaceChar(escaped, '\"', "&quot;");
-
- return escaped;
-}
-
-string BuildFailureMessage(string const& file, int const line, string const& message)
-{
- ostringstream failureMessage;
- failureMessage << file << "(" << line << ") : " << message;
- return failureMessage.str();
-}
-
-}
-
-namespace UnitTest {
-
-XmlTestReporter::XmlTestReporter(ostream& ostream)
- : m_ostream(ostream)
-{
-}
-
-void XmlTestReporter::ReportSummary(int const totalTestCount, int const failedTestCount,
- int const failureCount, float const secondsElapsed)
-{
- AddXmlElement(m_ostream, NULL);
-
- BeginResults(m_ostream, totalTestCount, failedTestCount, failureCount, secondsElapsed);
-
- DeferredTestResultList const& results = GetResults();
- for (DeferredTestResultList::const_iterator i = results.begin(); i != results.end(); ++i)
- {
- BeginTest(m_ostream, *i);
-
- if (i->failed)
- AddFailure(m_ostream, *i);
-
- EndTest(m_ostream, *i);
- }
-
- EndResults(m_ostream);
-}
-
-void XmlTestReporter::AddXmlElement(ostream& os, char const* encoding)
-{
- os << "<?xml version=\"1.0\"";
-
- if (encoding != NULL)
- os << " encoding=\"" << encoding << "\"";
-
- os << "?>";
-}
-
-void XmlTestReporter::BeginResults(std::ostream& os, int const totalTestCount, int const failedTestCount,
- int const failureCount, float const secondsElapsed)
-{
- os << "<unittest-results"
- << " tests=\"" << totalTestCount << "\""
- << " failedtests=\"" << failedTestCount << "\""
- << " failures=\"" << failureCount << "\""
- << " time=\"" << secondsElapsed << "\""
- << ">";
-}
-
-void XmlTestReporter::EndResults(std::ostream& os)
-{
- os << "</unittest-results>";
-}
-
-void XmlTestReporter::BeginTest(std::ostream& os, DeferredTestResult const& result)
-{
- os << "<test"
- << " suite=\"" << result.suiteName << "\""
- << " name=\"" << result.testName << "\""
- << " time=\"" << result.timeElapsed << "\"";
-}
-
-void XmlTestReporter::EndTest(std::ostream& os, DeferredTestResult const& result)
-{
- if (result.failed)
- os << "</test>";
- else
- os << "/>";
-}
-
-void XmlTestReporter::AddFailure(std::ostream& os, DeferredTestResult const& result)
-{
- os << ">"; // close <test> element
-
- for (DeferredTestResult::FailureVec::const_iterator it = result.failures.begin();
- it != result.failures.end();
- ++it)
- {
- string const escapedMessage = XmlEscape(it->second);
- string const message = BuildFailureMessage(result.failureFile, it->first, escapedMessage);
-
- os << "<failure" << " message=\"" << message << "\"" << "/>";
- }
-}
-
-}
diff --git a/src/testing/UnitTest++/src/XmlTestReporter.h b/src/testing/UnitTest++/src/XmlTestReporter.h
deleted file mode 100644
index 884123b..0000000
--- a/src/testing/UnitTest++/src/XmlTestReporter.h
+++ /dev/null
@@ -1,34 +0,0 @@
-#ifndef UNITTEST_XMLTESTREPORTER_H
-#define UNITTEST_XMLTESTREPORTER_H
-
-#include "DeferredTestReporter.h"
-
-#include <iosfwd>
-
-namespace UnitTest
-{
-
-class XmlTestReporter : public DeferredTestReporter
-{
-public:
- explicit XmlTestReporter(std::ostream& ostream);
-
- virtual void ReportSummary(int totalTestCount, int failedTestCount, int failureCount, float secondsElapsed);
-
-private:
- XmlTestReporter(XmlTestReporter const&);
- XmlTestReporter& operator=(XmlTestReporter const&);
-
- void AddXmlElement(std::ostream& os, char const* encoding);
- void BeginResults(std::ostream& os, int totalTestCount, int failedTestCount, int failureCount, float secondsElapsed);
- void EndResults(std::ostream& os);
- void BeginTest(std::ostream& os, DeferredTestResult const& result);
- void AddFailure(std::ostream& os, DeferredTestResult const& result);
- void EndTest(std::ostream& os, DeferredTestResult const& result);
-
- std::ostream& m_ostream;
-};
-
-}
-
-#endif
diff --git a/src/testing/UnitTest++/src/tests/Main.cpp b/src/testing/UnitTest++/src/tests/Main.cpp
deleted file mode 100644
index b2d9615..0000000
--- a/src/testing/UnitTest++/src/tests/Main.cpp
+++ /dev/null
@@ -1,8 +0,0 @@
-#include "../UnitTest++.h"
-#include "../TestReporterStdout.h"
-
-
-int main(int, char const *[])
-{
- return UnitTest::RunAllTests();
-}
diff --git a/src/testing/UnitTest++/src/tests/RecordingReporter.h b/src/testing/UnitTest++/src/tests/RecordingReporter.h
deleted file mode 100644
index 48ee9fc..0000000
--- a/src/testing/UnitTest++/src/tests/RecordingReporter.h
+++ /dev/null
@@ -1,92 +0,0 @@
-#ifndef UNITTEST_RECORDINGREPORTER_H
-#define UNITTEST_RECORDINGREPORTER_H
-
-#include "../TestReporter.h"
-#include <cstring>
-
-#include "../TestDetails.h"
-
-struct RecordingReporter : public UnitTest::TestReporter
-{
-private:
- enum { kMaxStringLength = 256 };
-
-public:
- RecordingReporter()
- : testRunCount(0)
- , testFailedCount(0)
- , lastFailedLine(0)
- , testFinishedCount(0)
- , lastFinishedTestTime(0)
- , summaryTotalTestCount(0)
- , summaryFailedTestCount(0)
- , summaryFailureCount(0)
- , summarySecondsElapsed(0)
- {
- lastStartedSuite[0] = '\0';
- lastStartedTest[0] = '\0';
- lastFailedFile[0] = '\0';
- lastFailedSuite[0] = '\0';
- lastFailedTest[0] = '\0';
- lastFailedMessage[0] = '\0';
- lastFinishedSuite[0] = '\0';
- lastFinishedTest[0] = '\0';
- }
-
- virtual void ReportTestStart(UnitTest::TestDetails const& test)
- {
- ++testRunCount;
- std::strcpy(lastStartedSuite, test.suiteName);
- std::strcpy(lastStartedTest, test.testName);
- }
-
- virtual void ReportFailure(UnitTest::TestDetails const& test, char const* failure)
- {
- ++testFailedCount;
- std::strcpy(lastFailedFile, test.filename);
- lastFailedLine = test.lineNumber;
- std::strcpy(lastFailedSuite, test.suiteName);
- std::strcpy(lastFailedTest, test.testName);
- std::strcpy(lastFailedMessage, failure);
- }
-
- virtual void ReportTestFinish(UnitTest::TestDetails const& test, float testDuration)
- {
- ++testFinishedCount;
- std::strcpy(lastFinishedSuite, test.suiteName);
- std::strcpy(lastFinishedTest, test.testName);
- lastFinishedTestTime = testDuration;
- }
-
- virtual void ReportSummary(int totalTestCount, int failedTestCount, int failureCount, float secondsElapsed)
- {
- summaryTotalTestCount = totalTestCount;
- summaryFailedTestCount = failedTestCount;
- summaryFailureCount = failureCount;
- summarySecondsElapsed = secondsElapsed;
- }
-
- int testRunCount;
- char lastStartedSuite[kMaxStringLength];
- char lastStartedTest[kMaxStringLength];
-
- int testFailedCount;
- char lastFailedFile[kMaxStringLength];
- int lastFailedLine;
- char lastFailedSuite[kMaxStringLength];
- char lastFailedTest[kMaxStringLength];
- char lastFailedMessage[kMaxStringLength];
-
- int testFinishedCount;
- char lastFinishedSuite[kMaxStringLength];
- char lastFinishedTest[kMaxStringLength];
- float lastFinishedTestTime;
-
- int summaryTotalTestCount;
- int summaryFailedTestCount;
- int summaryFailureCount;
- float summarySecondsElapsed;
-};
-
-
-#endif
diff --git a/src/testing/UnitTest++/src/tests/TestAssertHandler.cpp b/src/testing/UnitTest++/src/tests/TestAssertHandler.cpp
deleted file mode 100644
index a5fd07c..0000000
--- a/src/testing/UnitTest++/src/tests/TestAssertHandler.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-#include "../UnitTest++.h"
-#include "../AssertException.h"
-#include "../ReportAssert.h"
-
-using namespace UnitTest;
-
-namespace {
-
-TEST(ReportAssertThrowsAssertException)
-{
- bool caught = false;
-
- try
- {
- ReportAssert("", "", 0);
- }
- catch(AssertException const&)
- {
- caught = true;
- }
-
- CHECK (true == caught);
-}
-
-TEST(ReportAssertSetsCorrectInfoInException)
-{
- const int lineNumber = 12345;
- const char* description = "description";
- const char* filename = "filename";
-
- try
- {
- ReportAssert(description, filename, lineNumber);
- }
- catch(AssertException const& e)
- {
- CHECK_EQUAL(description, e.what());
- CHECK_EQUAL(filename, e.Filename());
- CHECK_EQUAL(lineNumber, e.LineNumber());
- }
-}
-
-
-}
diff --git a/src/testing/UnitTest++/src/tests/TestCheckMacros.cpp b/src/testing/UnitTest++/src/tests/TestCheckMacros.cpp
deleted file mode 100644
index 940de25..0000000
--- a/src/testing/UnitTest++/src/tests/TestCheckMacros.cpp
+++ /dev/null
@@ -1,710 +0,0 @@
-#include "../UnitTest++.h"
-#include "RecordingReporter.h"
-
-
-namespace {
-
-TEST(CheckSucceedsOnTrue)
-{
- bool failure = true;
- {
- RecordingReporter reporter;
- UnitTest::TestResults testResults_(&reporter);
- CHECK (true);
- failure = (testResults_.GetFailureCount() > 0);
- }
-
- CHECK (!failure);
-}
-
-TEST(CheckFailsOnFalse)
-{
- bool failure = false;
- {
- RecordingReporter reporter;
- UnitTest::TestResults testResults_(&reporter);
- CHECK (false);
- failure = (testResults_.GetFailureCount() > 0);
- }
-
- CHECK (failure);
-}
-
-TEST(FailureReportsCorrectTestName)
-{
- RecordingReporter reporter;
- {
- UnitTest::TestResults testResults_(&reporter);
- CHECK (false);
- }
-
- CHECK_EQUAL (m_details.testName, reporter.lastFailedTest);
-}
-
-TEST(CheckFailureIncludesCheckContents)
-{
- RecordingReporter reporter;
- {
- UnitTest::TestResults testResults_(&reporter);
- const bool yaddayadda = false;
- CHECK (yaddayadda);
- }
-
- CHECK (std::strstr(reporter.lastFailedMessage, "yaddayadda"));
-}
-
-int ThrowingFunction()
-{
- throw "Doh";
-}
-
-TEST(CheckFailsOnException)
-{
- bool failure = false;
- {
- RecordingReporter reporter;
- UnitTest::TestResults testResults_(&reporter);
- CHECK (ThrowingFunction() == 1);
- failure = (testResults_.GetFailureCount() > 0);
- }
-
- CHECK (failure);
-}
-
-TEST(CheckFailureBecauseOfExceptionIncludesCheckContents)
-{
- RecordingReporter reporter;
- {
- UnitTest::TestResults testResults_(&reporter);
- CHECK (ThrowingFunction() == 1);
- }
-
- CHECK (std::strstr(reporter.lastFailedMessage, "ThrowingFunction() == 1"));
-}
-
-TEST(CheckEqualSucceedsOnEqual)
-{
- bool failure = true;
- {
- RecordingReporter reporter;
- UnitTest::TestResults testResults_(&reporter);
- CHECK_EQUAL (1, 1);
- failure = (testResults_.GetFailureCount() > 0);
- }
-
- CHECK (!failure);
-}
-
-TEST(CheckEqualFailsOnNotEqual)
-{
- bool failure = false;
- {
- RecordingReporter reporter;
- UnitTest::TestResults testResults_(&reporter);
- CHECK_EQUAL (1, 2);
- failure = (testResults_.GetFailureCount() > 0);
- }
-
- CHECK (failure);
-}
-
-TEST(CheckEqualFailsOnException)
-{
- bool failure = false;
- {
- RecordingReporter reporter;
- UnitTest::TestResults testResults_(&reporter);
- CHECK_EQUAL (ThrowingFunction(), 1);
- failure = (testResults_.GetFailureCount() > 0);
- }
-
- CHECK (failure);
-}
-
-TEST(CheckEqualFailureContainsCorrectDetails)
-{
- int line = 0;
- RecordingReporter reporter;
- {
- UnitTest::TestResults testResults_(&reporter);
- UnitTest::TestDetails const m_details("testName", "suiteName", "filename", -1);
- CHECK_EQUAL (1, 123); line = __LINE__;
- }
-
- CHECK_EQUAL("testName", reporter.lastFailedTest);
- CHECK_EQUAL("suiteName", reporter.lastFailedSuite);
- CHECK_EQUAL ("filename", reporter.lastFailedFile);
- CHECK_EQUAL (line, reporter.lastFailedLine);
-}
-
-TEST(CheckEqualFailureBecauseOfExceptionContainsCorrectDetails)
-{
- int line = 0;
- RecordingReporter reporter;
- {
- UnitTest::TestResults testResults_(&reporter);
- UnitTest::TestDetails const m_details("testName", "suiteName", "filename", -1);
- CHECK_EQUAL (ThrowingFunction(), 123); line = __LINE__;
- }
-
- CHECK_EQUAL("testName", reporter.lastFailedTest);
- CHECK_EQUAL("suiteName", reporter.lastFailedSuite);
- CHECK_EQUAL ("filename", reporter.lastFailedFile);
- CHECK_EQUAL (line, reporter.lastFailedLine);
-}
-
-TEST(CheckEqualFailureBecauseOfExceptionIncludesCheckContents)
-{
- RecordingReporter reporter;
- {
- UnitTest::TestResults testResults_(&reporter);
- CHECK_EQUAL (ThrowingFunction(), 123);
- }
-
- CHECK (std::strstr(reporter.lastFailedMessage, "ThrowingFunction()"));
- CHECK (std::strstr(reporter.lastFailedMessage, "123"));
-}
-
-int g_sideEffect = 0;
-int FunctionWithSideEffects()
-{
- ++g_sideEffect;
- return 1;
-}
-
-TEST(CheckEqualDoesNotHaveSideEffectsWhenPassing)
-{
- g_sideEffect = 0;
- {
- UnitTest::TestResults testResults_;
- CHECK_EQUAL (1, FunctionWithSideEffects());
- }
- CHECK_EQUAL (1, g_sideEffect);
-}
-
-TEST(CheckEqualDoesNotHaveSideEffectsWhenFailing)
-{
- g_sideEffect = 0;
- {
- UnitTest::TestResults testResults_;
- CHECK_EQUAL (2, FunctionWithSideEffects());
- }
- CHECK_EQUAL (1, g_sideEffect);
-}
-
-
-TEST(CheckCloseSucceedsOnEqual)
-{
- bool failure = true;
- {
- RecordingReporter reporter;
- UnitTest::TestResults testResults_(&reporter);
- CHECK_CLOSE (1.0f, 1.001f, 0.01f);
- failure = (testResults_.GetFailureCount() > 0);
- }
-
- CHECK (!failure);
-}
-
-TEST(CheckCloseFailsOnNotEqual)
-{
- bool failure = false;
- {
- RecordingReporter reporter;
- UnitTest::TestResults testResults_(&reporter);
- CHECK_CLOSE (1.0f, 1.1f, 0.01f);
- failure = (testResults_.GetFailureCount() > 0);
- }
-
- CHECK (failure);
-}
-
-TEST(CheckCloseFailsOnException)
-{
- bool failure = false;
- {
- RecordingReporter reporter;
- UnitTest::TestResults testResults_(&reporter);
- CHECK_CLOSE ((float)ThrowingFunction(), 1.0001f, 0.1f);
- failure = (testResults_.GetFailureCount() > 0);
- }
-
- CHECK (failure);
-}
-
-TEST(CheckCloseFailureContainsCorrectDetails)
-{
- int line = 0;
- RecordingReporter reporter;
- {
- UnitTest::TestResults testResults_(&reporter);
- UnitTest::TestDetails m_details("test", "suite", "filename", -1);
- CHECK_CLOSE (1.0f, 1.1f, 0.01f); line = __LINE__;
- }
-
- CHECK_EQUAL("test", reporter.lastFailedTest);
- CHECK_EQUAL("suite", reporter.lastFailedSuite);
- CHECK_EQUAL ("filename", reporter.lastFailedFile);
- CHECK_EQUAL (line, reporter.lastFailedLine);
-}
-
-TEST(CheckCloseFailureBecauseOfExceptionContainsCorrectDetails)
-{
- int line = 0;
- RecordingReporter reporter;
- {
- UnitTest::TestResults testResults_(&reporter);
- UnitTest::TestDetails m_details("closeTest", "closeSuite", "filename", -1);
- CHECK_CLOSE ((float)ThrowingFunction(), 1.0001f, 0.1f); line = __LINE__;
- }
-
- CHECK_EQUAL("closeTest", reporter.lastFailedTest);
- CHECK_EQUAL("closeSuite", reporter.lastFailedSuite);
- CHECK_EQUAL ("filename", reporter.lastFailedFile);
- CHECK_EQUAL (line, reporter.lastFailedLine);
-}
-
-TEST(CheckCloseFailureBecauseOfExceptionIncludesCheckContents)
-{
- RecordingReporter reporter;
- {
- UnitTest::TestResults testResults_(&reporter);
- CHECK_CLOSE ((float)ThrowingFunction(), 1.0001f, 0.1f);
- }
-
- CHECK (std::strstr(reporter.lastFailedMessage, "(float)ThrowingFunction()"));
- CHECK (std::strstr(reporter.lastFailedMessage, "1.0001f"));
-}
-
-TEST(CheckCloseDoesNotHaveSideEffectsWhenPassing)
-{
- g_sideEffect = 0;
- {
- UnitTest::TestResults testResults_;
- CHECK_CLOSE (1, FunctionWithSideEffects(), 0.1f);
- }
- CHECK_EQUAL (1, g_sideEffect);
-}
-
-TEST(CheckCloseDoesNotHaveSideEffectsWhenFailing)
-{
- g_sideEffect = 0;
- {
- UnitTest::TestResults testResults_;
- CHECK_CLOSE (2, FunctionWithSideEffects(), 0.1f);
- }
- CHECK_EQUAL (1, g_sideEffect);
-}
-
-
-class ThrowingObject
-{
-public:
- float operator[](int) const
- {
- throw "Test throw";
- }
-};
-
-
-TEST(CheckArrayCloseSucceedsOnEqual)
-{
- bool failure = true;
- {
- RecordingReporter reporter;
- UnitTest::TestResults testResults_(&reporter);
- const float data[4] = { 0, 1, 2, 3 };
- CHECK_ARRAY_CLOSE (data, data, 4, 0.01f);
- failure = (testResults_.GetFailureCount() > 0);
- }
-
- CHECK (!failure);
-}
-
-TEST(CheckArrayCloseFailsOnNotEqual)
-{
- bool failure = false;
- {
- RecordingReporter reporter;
- UnitTest::TestResults testResults_(&reporter);
- int const data1[4] = { 0, 1, 2, 3 };
- int const data2[4] = { 0, 1, 3, 3 };
- CHECK_ARRAY_CLOSE (data1, data2, 4, 0.01f);
- failure = (testResults_.GetFailureCount() > 0);
- }
-
- CHECK (failure);
-}
-
-TEST(CheckArrayCloseFailureIncludesCheckExpectedAndActual)
-{
- RecordingReporter reporter;
- {
- UnitTest::TestResults testResults_(&reporter);
- int const data1[4] = { 0, 1, 2, 3 };
- int const data2[4] = { 0, 1, 3, 3 };
- CHECK_ARRAY_CLOSE (data1, data2, 4, 0.01f);
- }
-
- CHECK (std::strstr(reporter.lastFailedMessage, "xpected [ 0 1 2 3 ]"));
- CHECK (std::strstr(reporter.lastFailedMessage, "was [ 0 1 3 3 ]"));
-}
-
-TEST(CheckArrayCloseFailureContainsCorrectDetails)
-{
- int line = 0;
- RecordingReporter reporter;
- {
- UnitTest::TestResults testResults_(&reporter);
- UnitTest::TestDetails m_details("arrayCloseTest", "arrayCloseSuite", "filename", -1);
- int const data1[4] = { 0, 1, 2, 3 };
- int const data2[4] = { 0, 1, 3, 3 };
- CHECK_ARRAY_CLOSE (data1, data2, 4, 0.01f); line = __LINE__;
- }
-
- CHECK_EQUAL("arrayCloseTest", reporter.lastFailedTest);
- CHECK_EQUAL("arrayCloseSuite", reporter.lastFailedSuite);
- CHECK_EQUAL ("filename", reporter.lastFailedFile);
- CHECK_EQUAL (line, reporter.lastFailedLine);
-}
-
-TEST(CheckArrayCloseFailureBecauseOfExceptionContainsCorrectDetails)
-{
- int line = 0;
- RecordingReporter reporter;
- {
- UnitTest::TestResults testResults_(&reporter);
- UnitTest::TestDetails m_details("arrayCloseTest", "arrayCloseSuite", "filename", -1);
- int const data[4] = { 0, 1, 2, 3 };
- CHECK_ARRAY_CLOSE (data, ThrowingObject(), 4, 0.01f); line = __LINE__;
- }
-
- CHECK_EQUAL("arrayCloseTest", reporter.lastFailedTest);
- CHECK_EQUAL("arrayCloseSuite", reporter.lastFailedSuite);
- CHECK_EQUAL ("filename", reporter.lastFailedFile);
- CHECK_EQUAL (line, reporter.lastFailedLine);
-}
-
-TEST(CheckArrayCloseFailureIncludesTolerance)
-{
- RecordingReporter reporter;
- {
- UnitTest::TestResults testResults_(&reporter);
- float const data1[4] = { 0, 1, 2, 3 };
- float const data2[4] = { 0, 1, 3, 3 };
- CHECK_ARRAY_CLOSE (data1, data2, 4, 0.01f);
- }
-
- CHECK (std::strstr(reporter.lastFailedMessage, "0.01"));
-}
-
-
-TEST(CheckArrayCloseFailsOnException)
-{
- bool failure = false;
- {
- RecordingReporter reporter;
- UnitTest::TestResults testResults_(&reporter);
- const float data[4] = { 0, 1, 2, 3 };
- ThrowingObject obj;
- CHECK_ARRAY_CLOSE (data, obj, 3, 0.01f);
- failure = (testResults_.GetFailureCount() > 0);
- }
-
- CHECK (failure);
-}
-
-TEST(CheckArrayCloseFailureOnExceptionIncludesCheckContents)
-{
- RecordingReporter reporter;
- {
- UnitTest::TestResults testResults_(&reporter);
- const float data[4] = { 0, 1, 2, 3 };
- ThrowingObject obj;
- CHECK_ARRAY_CLOSE (data, obj, 3, 0.01f);
- }
-
- CHECK (std::strstr(reporter.lastFailedMessage, "data"));
- CHECK (std::strstr(reporter.lastFailedMessage, "obj"));
-}
-
-
-TEST(CheckArrayEqualSuceedsOnEqual)
-{
- bool failure = true;
- {
- RecordingReporter reporter;
- UnitTest::TestResults testResults_(&reporter);
- const float data[4] = { 0, 1, 2, 3 };
- CHECK_ARRAY_EQUAL (data, data, 4);
- failure = (testResults_.GetFailureCount() > 0);
- }
-
- CHECK (!failure);
-}
-
-TEST(CheckArrayEqualFailsOnNotEqual)
-{
- bool failure = false;
- {
- RecordingReporter reporter;
- UnitTest::TestResults testResults_(&reporter);
- int const data1[4] = { 0, 1, 2, 3 };
- int const data2[4] = { 0, 1, 3, 3 };
- CHECK_ARRAY_EQUAL (data1, data2, 4);
- failure = (testResults_.GetFailureCount() > 0);
- }
-
- CHECK (failure);
-}
-
-TEST(CheckArrayEqualFailureIncludesCheckExpectedAndActual)
-{
- RecordingReporter reporter;
- {
- UnitTest::TestResults testResults_(&reporter);
- int const data1[4] = { 0, 1, 2, 3 };
- int const data2[4] = { 0, 1, 3, 3 };
- CHECK_ARRAY_EQUAL (data1, data2, 4);
- }
-
- CHECK (std::strstr(reporter.lastFailedMessage, "xpected [ 0 1 2 3 ]"));
- CHECK (std::strstr(reporter.lastFailedMessage, "was [ 0 1 3 3 ]"));
-}
-
-TEST(CheckArrayEqualFailureContainsCorrectInfo)
-{
- int line = 0;
- RecordingReporter reporter;
- {
- UnitTest::TestResults testResults_(&reporter);
- int const data1[4] = { 0, 1, 2, 3 };
- int const data2[4] = { 0, 1, 3, 3 };
- CHECK_ARRAY_EQUAL (data1, data2, 4); line = __LINE__;
- }
-
- CHECK_EQUAL ("CheckArrayEqualFailureContainsCorrectInfo", reporter.lastFailedTest);
- CHECK_EQUAL (__FILE__, reporter.lastFailedFile);
- CHECK_EQUAL (line, reporter.lastFailedLine);
-}
-
-TEST(CheckArrayEqualFailsOnException)
-{
- bool failure = false;
- {
- RecordingReporter reporter;
- UnitTest::TestResults testResults_(&reporter);
- const float data[4] = { 0, 1, 2, 3 };
- ThrowingObject obj;
- CHECK_ARRAY_EQUAL (data, obj, 3);
- failure = (testResults_.GetFailureCount() > 0);
- }
-
- CHECK (failure);
-}
-
-TEST(CheckArrayEqualFailureOnExceptionIncludesCheckContents)
-{
- RecordingReporter reporter;
- {
- UnitTest::TestResults testResults_(&reporter);
- const float data[4] = { 0, 1, 2, 3 };
- ThrowingObject obj;
- CHECK_ARRAY_EQUAL (data, obj, 3);
- }
-
- CHECK (std::strstr(reporter.lastFailedMessage, "data"));
- CHECK (std::strstr(reporter.lastFailedMessage, "obj"));
-}
-
-float const* FunctionWithSideEffects2()
-{
- ++g_sideEffect;
- static float const data[] = {1,2,3,4};
- return data;
-}
-
-TEST(CheckArrayCloseDoesNotHaveSideEffectsWhenPassing)
-{
- g_sideEffect = 0;
- {
- UnitTest::TestResults testResults_;
- const float data[] = { 0, 1, 2, 3 };
- CHECK_ARRAY_CLOSE (data, FunctionWithSideEffects2(), 4, 0.01f);
- }
- CHECK_EQUAL (1, g_sideEffect);
-}
-
-TEST(CheckArrayCloseDoesNotHaveSideEffectsWhenFailing)
-{
- g_sideEffect = 0;
- {
- UnitTest::TestResults testResults_;
- const float data[] = { 0, 1, 3, 3 };
- CHECK_ARRAY_CLOSE (data, FunctionWithSideEffects2(), 4, 0.01f);
- }
- CHECK_EQUAL (1, g_sideEffect);
-}
-
-class ThrowingObject2D
-{
-public:
- float* operator[](int) const
- {
- throw "Test throw";
- }
-};
-
-
-TEST(CheckArray2DCloseSucceedsOnEqual)
-{
- bool failure = true;
- {
- RecordingReporter reporter;
- UnitTest::TestResults testResults_(&reporter);
- const float data[2][2] = { {0, 1}, {2, 3} };
- CHECK_ARRAY2D_CLOSE (data, data, 2, 2, 0.01f);
- failure = (testResults_.GetFailureCount() > 0);
- }
-
- CHECK (!failure);
-}
-
-TEST(CheckArray2DCloseFailsOnNotEqual)
-{
- bool failure = false;
- {
- RecordingReporter reporter;
- UnitTest::TestResults testResults_(&reporter);
- int const data1[2][2] = { {0, 1}, {2, 3} };
- int const data2[2][2] = { {0, 1}, {3, 3} };
- CHECK_ARRAY2D_CLOSE (data1, data2, 2, 2, 0.01f);
- failure = (testResults_.GetFailureCount() > 0);
- }
-
- CHECK (failure);
-}
-
-TEST(CheckArray2DCloseFailureIncludesCheckExpectedAndActual)
-{
- RecordingReporter reporter;
- {
- UnitTest::TestResults testResults_(&reporter);
- int const data1[2][2] = { {0, 1}, {2, 3} };
- int const data2[2][2] = { {0, 1}, {3, 3} };
- CHECK_ARRAY2D_CLOSE (data1, data2, 2, 2, 0.01f);
- }
-
- CHECK (std::strstr(reporter.lastFailedMessage, "xpected [ [ 0 1 ] [ 2 3 ] ]"));
- CHECK (std::strstr(reporter.lastFailedMessage, "was [ [ 0 1 ] [ 3 3 ] ]"));
-}
-
-TEST(CheckArray2DCloseFailureContainsCorrectDetails)
-{
- int line = 0;
- RecordingReporter reporter;
- {
- UnitTest::TestResults testResults_(&reporter);
- UnitTest::TestDetails m_details("array2DCloseTest", "array2DCloseSuite", "filename", -1);
- int const data1[2][2] = { {0, 1}, {2, 3} };
- int const data2[2][2] = { {0, 1}, {3, 3} };
- CHECK_ARRAY2D_CLOSE (data1, data2, 2, 2, 0.01f); line = __LINE__;
- }
-
- CHECK_EQUAL("array2DCloseTest", reporter.lastFailedTest);
- CHECK_EQUAL("array2DCloseSuite", reporter.lastFailedSuite);
- CHECK_EQUAL ("filename", reporter.lastFailedFile);
- CHECK_EQUAL (line, reporter.lastFailedLine);
-}
-
-TEST(CheckArray2DCloseFailureBecauseOfExceptionContainsCorrectDetails)
-{
- int line = 0;
- RecordingReporter reporter;
- {
- UnitTest::TestResults testResults_(&reporter);
- UnitTest::TestDetails m_details("array2DCloseTest", "array2DCloseSuite", "filename", -1);
- const float data[2][2] = { {0, 1}, {2, 3} };
- CHECK_ARRAY2D_CLOSE (data, ThrowingObject2D(), 2, 2, 0.01f); line = __LINE__;
- }
-
- CHECK_EQUAL("array2DCloseTest", reporter.lastFailedTest);
- CHECK_EQUAL("array2DCloseSuite", reporter.lastFailedSuite);
- CHECK_EQUAL ("filename", reporter.lastFailedFile);
- CHECK_EQUAL (line, reporter.lastFailedLine);
-}
-
-TEST(CheckArray2DCloseFailureIncludesTolerance)
-{
- RecordingReporter reporter;
- {
- UnitTest::TestResults testResults_(&reporter);
- float const data1[2][2] = { {0, 1}, {2, 3} };
- float const data2[2][2] = { {0, 1}, {3, 3} };
- CHECK_ARRAY2D_CLOSE (data1, data2, 2, 2, 0.01f);
- }
-
- CHECK (std::strstr(reporter.lastFailedMessage, "0.01"));
-}
-
-TEST(CheckArray2DCloseFailsOnException)
-{
- bool failure = false;
- {
- RecordingReporter reporter;
- UnitTest::TestResults testResults_(&reporter);
- const float data[2][2] = { {0, 1}, {2, 3} };
- ThrowingObject2D obj;
- CHECK_ARRAY2D_CLOSE (data, obj, 2, 2, 0.01f);
- failure = (testResults_.GetFailureCount() > 0);
- }
-
- CHECK (failure);
-}
-
-TEST(CheckArray2DCloseFailureOnExceptionIncludesCheckContents)
-{
- RecordingReporter reporter;
- {
- UnitTest::TestResults testResults_(&reporter);
- const float data[2][2] = { {0, 1}, {2, 3} };
- ThrowingObject2D obj;
- CHECK_ARRAY2D_CLOSE (data, obj, 2, 2, 0.01f);
- }
-
- CHECK (std::strstr(reporter.lastFailedMessage, "data"));
- CHECK (std::strstr(reporter.lastFailedMessage, "obj"));
-}
-
-float const* const* FunctionWithSideEffects3()
-{
- ++g_sideEffect;
- static float const data1[] = {0,1};
- static float const data2[] = {2,3};
- static const float* const data[] = {data1, data2};
- return data;
-}
-
-TEST(CheckArray2DCloseDoesNotHaveSideEffectsWhenPassing)
-{
- g_sideEffect = 0;
- {
- UnitTest::TestResults testResults_;
- const float data[2][2] = { {0, 1}, {2, 3} };
- CHECK_ARRAY2D_CLOSE (data, FunctionWithSideEffects3(), 2, 2, 0.01f);
- }
- CHECK_EQUAL (1, g_sideEffect);
-}
-
-TEST(CheckArray2DCloseDoesNotHaveSideEffectsWhenFailing)
-{
- g_sideEffect = 0;
- {
- UnitTest::TestResults testResults_;
- const float data[2][2] = { {0, 1}, {3, 3} };
- CHECK_ARRAY2D_CLOSE (data, FunctionWithSideEffects3(), 2, 2, 0.01f);
- }
- CHECK_EQUAL (1, g_sideEffect);
-}
-
-}
diff --git a/src/testing/UnitTest++/src/tests/TestChecks.cpp b/src/testing/UnitTest++/src/tests/TestChecks.cpp
deleted file mode 100644
index e1d9571..0000000
--- a/src/testing/UnitTest++/src/tests/TestChecks.cpp
+++ /dev/null
@@ -1,290 +0,0 @@
-#include "../UnitTest++.h"
-#include "RecordingReporter.h"
-
-using namespace UnitTest;
-
-
-namespace {
-
-
-TEST(CheckEqualWithUnsignedLong)
-{
- TestResults results;
- unsigned long something = 2;
- CHECK_EQUAL( something, something );
-}
-
-TEST(CheckEqualsWithStringsFailsOnDifferentStrings)
-{
- char txt1[] = "Hello";
- char txt2[] = "Hallo";
- TestResults results;
- CheckEqual(results, txt1, txt2, TestDetails("", "", "", 0));
- CHECK_EQUAL (1, results.GetFailureCount());
-}
-
-char txt1[] = "Hello"; // non-const on purpose so no folding of duplicate data
-char txt2[] = "Hello";
-
-TEST(CheckEqualsWithStringsWorksOnContentsNonConstNonConst)
-{
- char const* const p1 = txt1;
- char const* const p2 = txt2;
- TestResults results;
- CheckEqual(results, p1, p2, TestDetails("", "", "", 0));
- CHECK_EQUAL (0, results.GetFailureCount());
-}
-
-TEST(CheckEqualsWithStringsWorksOnContentsConstConst)
-{
- char* const p1 = txt1;
- char* const p2 = txt2;
- TestResults results;
- CheckEqual(results, p1, p2, TestDetails("", "", "", 0));
- CHECK_EQUAL (0, results.GetFailureCount());
-}
-
-TEST(CheckEqualsWithStringsWorksOnContentsNonConstConst)
-{
- char* const p1 = txt1;
- char const* const p2 = txt2;
- TestResults results;
- CheckEqual(results, p1, p2, TestDetails("", "", "", 0));
- CHECK_EQUAL (0, results.GetFailureCount());
-}
-
-TEST(CheckEqualsWithStringsWorksOnContentsConstNonConst)
-{
- char const* const p1 = txt1;
- char* const p2 = txt2;
- TestResults results;
- CheckEqual(results, p1, p2, TestDetails("", "", "", 0));
- CHECK_EQUAL (0, results.GetFailureCount());
-}
-
-TEST(CheckEqualsWithStringsWorksOnContentsWithALiteral)
-{
- char const* const p1 = txt1;
- TestResults results;
- CheckEqual(results, "Hello", p1, TestDetails("", "", "", 0));
- CHECK_EQUAL (0, results.GetFailureCount());
-}
-
-TEST(CheckEqualFailureIncludesCheckExpectedAndActual)
-{
- RecordingReporter reporter;
- TestResults results(&reporter);
- const int something = 2;
- CheckEqual (results, 1, something, TestDetails("", "", "", 0));
-
- CHECK (std::strstr(reporter.lastFailedMessage, "xpected 1"));
- CHECK (std::strstr(reporter.lastFailedMessage, "was 2"));
-}
-
-TEST(CheckEqualFailureIncludesDetails)
-{
- RecordingReporter reporter;
- TestResults results(&reporter);
- TestDetails const details("mytest", "mysuite", "file.h", 101);
-
- CheckEqual (results, 1, 2, details);
-
- CHECK_EQUAL("mytest", reporter.lastFailedTest);
- CHECK_EQUAL("mysuite", reporter.lastFailedSuite);
- CHECK_EQUAL("file.h", reporter.lastFailedFile);
- CHECK_EQUAL(101, reporter.lastFailedLine);
-}
-
-TEST(CheckCloseTrue)
-{
- TestResults results;
- CheckClose(results, 3.001f, 3.0f, 0.1f, TestDetails("", "", "", 0));
- CHECK_EQUAL (0, results.GetFailureCount());
-}
-
-TEST(CheckCloseFalse)
-{
- TestResults results;
- CheckClose(results, 3.12f, 3.0f, 0.1f, TestDetails("", "", "", 0));
- CHECK_EQUAL (1, results.GetFailureCount());
-}
-
-TEST(CheckCloseWithZeroEpsilonWorksForSameNumber)
-{
- TestResults results;
- CheckClose(results, 0.1f, 0.1f, 0, TestDetails("", "", "", 0));
- CHECK_EQUAL (0, results.GetFailureCount());
-}
-
-TEST(CheckCloseWithNaNFails)
-{
- union
- {
- unsigned int bitpattern;
- float nan;
- };
- bitpattern = 0xFFFFFFFF;
- TestResults results;
- CheckClose(results, 3.0f, nan, 0.1f, TestDetails("", "", "", 0));
- CHECK_EQUAL (1, results.GetFailureCount());
-}
-
-TEST(CheckCloseWithNaNAgainstItselfFails)
-{
- union
- {
- unsigned int bitpattern;
- float nan;
- };
- bitpattern = 0xFFFFFFFF;
- TestResults results;
- CheckClose(results, nan, nan, 0.1f, TestDetails("", "", "", 0));
- CHECK_EQUAL (1, results.GetFailureCount());
-}
-
-TEST(CheckCloseFailureIncludesCheckExpectedAndActual)
-{
- RecordingReporter reporter;
- TestResults results(&reporter);
- const float expected = 0.9f;
- const float actual = 1.1f;
- CheckClose (results, expected, actual, 0.01f, TestDetails("", "", "", 0));
-
- CHECK (std::strstr(reporter.lastFailedMessage, "xpected 0.9"));
- CHECK (std::strstr(reporter.lastFailedMessage, "was 1.1"));
-}
-
-TEST(CheckCloseFailureIncludesTolerance)
-{
- RecordingReporter reporter;
- TestResults results(&reporter);
- CheckClose (results, 2, 3, 0.01f, TestDetails("", "", "", 0));
-
- CHECK (std::strstr(reporter.lastFailedMessage, "0.01"));
-}
-
-TEST(CheckCloseFailureIncludesDetails)
-{
- RecordingReporter reporter;
- TestResults results(&reporter);
- TestDetails const details("mytest", "mysuite", "header.h", 10);
-
- CheckClose (results, 2, 3, 0.01f, details);
-
- CHECK_EQUAL("mytest", reporter.lastFailedTest);
- CHECK_EQUAL("mysuite", reporter.lastFailedSuite);
- CHECK_EQUAL("header.h", reporter.lastFailedFile);
- CHECK_EQUAL(10, reporter.lastFailedLine);
-}
-
-
-TEST(CheckArrayEqualTrue)
-{
- TestResults results;
-
- int const array[3] = { 1, 2, 3 };
- CheckArrayEqual(results, array, array, 3, TestDetails("", "", "", 0));
- CHECK_EQUAL (0, results.GetFailureCount());
-}
-
-TEST(CheckArrayEqualFalse)
-{
- TestResults results;
-
- int const array1[3] = { 1, 2, 3 };
- int const array2[3] = { 1, 2, 2 };
- CheckArrayEqual(results, array1, array2, 3, TestDetails("", "", "", 0));
- CHECK_EQUAL (1, results.GetFailureCount());
-}
-
-TEST(CheckArrayCloseTrue)
-{
- TestResults results;
-
- float const array1[3] = { 1.0f, 1.5f, 2.0f };
- float const array2[3] = { 1.01f, 1.51f, 2.01f };
- CheckArrayClose(results, array1, array2, 3, 0.02f, TestDetails("", "", "", 0));
- CHECK_EQUAL (0, results.GetFailureCount());
-}
-
-TEST(CheckArrayCloseFalse)
-{
- TestResults results;
-
- float const array1[3] = { 1.0f, 1.5f, 2.0f };
- float const array2[3] = { 1.01f, 1.51f, 2.01f };
- CheckArrayClose(results, array1, array2, 3, 0.001f, TestDetails("", "", "", 0));
- CHECK_EQUAL (1, results.GetFailureCount());
-}
-
-TEST(CheckArrayCloseFailureIncludesDetails)
-{
- RecordingReporter reporter;
- TestResults results(&reporter);
- TestDetails const details("arrayCloseTest", "arrayCloseSuite", "file", 1337);
-
- float const array1[3] = { 1.0f, 1.5f, 2.0f };
- float const array2[3] = { 1.01f, 1.51f, 2.01f };
- CheckArrayClose(results, array1, array2, 3, 0.001f, details);
-
- CHECK_EQUAL("arrayCloseTest", reporter.lastFailedTest);
- CHECK_EQUAL("arrayCloseSuite", reporter.lastFailedSuite);
- CHECK_EQUAL("file", reporter.lastFailedFile);
- CHECK_EQUAL(1337, reporter.lastFailedLine);
-}
-
-
-TEST(CheckArray2DCloseTrue)
-{
- TestResults results;
-
- float const array1[3][3] = { { 1.0f, 1.5f, 2.0f },
- { 2.0f, 2.5f, 3.0f },
- { 3.0f, 3.5f, 4.0f } };
- float const array2[3][3] = { { 1.01f, 1.51f, 2.01f },
- { 2.01f, 2.51f, 3.01f },
- { 3.01f, 3.51f, 4.01f } };
- CheckArray2DClose(results, array1, array2, 3, 3, 0.02f, TestDetails("", "", "", 0));
- CHECK_EQUAL (0, results.GetFailureCount());
-}
-
-TEST(CheckArray2DCloseFalse)
-{
- TestResults results;
-
- float const array1[3][3] = { { 1.0f, 1.5f, 2.0f },
- { 2.0f, 2.5f, 3.0f },
- { 3.0f, 3.5f, 4.0f } };
- float const array2[3][3] = { { 1.01f, 1.51f, 2.01f },
- { 2.01f, 2.51f, 3.01f },
- { 3.01f, 3.51f, 4.01f } };
- CheckArray2DClose(results, array1, array2, 3, 3, 0.001f, TestDetails("", "", "", 0));
- CHECK_EQUAL (1, results.GetFailureCount());
-}
-
-TEST(CheckCloseWithDoublesSucceeds)
-{
- CHECK_CLOSE(0.5, 0.5, 0.0001);
-}
-
-TEST(CheckArray2DCloseFailureIncludesDetails)
-{
- RecordingReporter reporter;
- TestResults results(&reporter);
- TestDetails const details("array2DCloseTest", "array2DCloseSuite", "file", 1234);
-
- float const array1[3][3] = { { 1.0f, 1.5f, 2.0f },
- { 2.0f, 2.5f, 3.0f },
- { 3.0f, 3.5f, 4.0f } };
- float const array2[3][3] = { { 1.01f, 1.51f, 2.01f },
- { 2.01f, 2.51f, 3.01f },
- { 3.01f, 3.51f, 4.01f } };
- CheckArray2DClose(results, array1, array2, 3, 3, 0.001f, details);
-
- CHECK_EQUAL("array2DCloseTest", reporter.lastFailedTest);
- CHECK_EQUAL("array2DCloseSuite", reporter.lastFailedSuite);
- CHECK_EQUAL("file", reporter.lastFailedFile);
- CHECK_EQUAL(1234, reporter.lastFailedLine);
-}
-
-}
diff --git a/src/testing/UnitTest++/src/tests/TestDeferredTestReporter.cpp b/src/testing/UnitTest++/src/tests/TestDeferredTestReporter.cpp
deleted file mode 100644
index d076451..0000000
--- a/src/testing/UnitTest++/src/tests/TestDeferredTestReporter.cpp
+++ /dev/null
@@ -1,104 +0,0 @@
-#include "../UnitTest++.h"
-#include "../DeferredTestReporter.h"
-
-#include <string>
-
-namespace UnitTest
-{
-
-struct MockDeferredTestReporter : public DeferredTestReporter
-{
- virtual void ReportSummary(int, int, int, float)
- {
- }
-};
-
-struct DeferredTestReporterFixture
-{
- DeferredTestReporterFixture()
- : testName("UniqueTestName")
- , testSuite("UniqueTestSuite")
- , fileName("filename.h")
- , lineNumber(12)
- , details(testName.c_str(), testSuite.c_str(), fileName.c_str(), lineNumber)
- {
- }
-
- MockDeferredTestReporter reporter;
- std::string const testName;
- std::string const testSuite;
- std::string const fileName;
- int const lineNumber;
- TestDetails const details;
-};
-
-TEST_FIXTURE(DeferredTestReporterFixture, ReportTestStartCreatesANewDeferredTest)
-{
- reporter.ReportTestStart(details);
- CHECK_EQUAL(1, (int)reporter.GetResults().size());
-}
-
-TEST_FIXTURE(DeferredTestReporterFixture, ReportTestStartCapturesTestNameAndSuite)
-{
- reporter.ReportTestStart(details);
-
- DeferredTestResult const& result = reporter.GetResults().at(0);
- CHECK_EQUAL(testName.c_str(), result.testName);
- CHECK_EQUAL(testSuite.c_str(), result.suiteName);
-}
-
-TEST_FIXTURE(DeferredTestReporterFixture, ReportTestEndCapturesTestTime)
-{
- float const elapsed = 123.45f;
- reporter.ReportTestStart(details);
- reporter.ReportTestFinish(details, elapsed);
-
- DeferredTestResult const& result = reporter.GetResults().at(0);
- CHECK_CLOSE(elapsed, result.timeElapsed, 0.0001f);
-}
-
-TEST_FIXTURE(DeferredTestReporterFixture, ReportFailureSavesFailureDetails)
-{
- char const* failure = "failure";
-
- reporter.ReportTestStart(details);
- reporter.ReportFailure(details, failure);
-
- DeferredTestResult const& result = reporter.GetResults().at(0);
- CHECK(result.failed == true);
- CHECK_EQUAL(fileName.c_str(), result.failureFile);
-}
-
-TEST_FIXTURE(DeferredTestReporterFixture, ReportFailureSavesFailureDetailsForMultipleFailures)
-{
- char const* failure1 = "failure 1";
- char const* failure2 = "failure 2";
-
- reporter.ReportTestStart(details);
- reporter.ReportFailure(details, failure1);
- reporter.ReportFailure(details, failure2);
-
- DeferredTestResult const& result = reporter.GetResults().at(0);
- CHECK_EQUAL(2u, result.failures.size());
- CHECK_EQUAL(failure1, result.failures[0].second);
- CHECK_EQUAL(failure2, result.failures[1].second);
-}
-
-TEST_FIXTURE(DeferredTestReporterFixture, DeferredTestReporterTakesCopyOfFailureMessage)
-{
- reporter.ReportTestStart(details);
-
- char failureMessage[128];
- char const* goodStr = "Real failure message";
- char const* badStr = "Bogus failure message";
-
- std::strcpy(failureMessage, goodStr);
- reporter.ReportFailure(details, failureMessage);
- std::strcpy(failureMessage, badStr);
-
- DeferredTestResult const& result = reporter.GetResults().at(0);
- DeferredTestResult::Failure const& failure = result.failures.at(0);
- CHECK_EQUAL(goodStr, failure.second);
-}
-
-}
diff --git a/src/testing/UnitTest++/src/tests/TestMemoryOutStream.cpp b/src/testing/UnitTest++/src/tests/TestMemoryOutStream.cpp
deleted file mode 100644
index 9cd8f9e..0000000
--- a/src/testing/UnitTest++/src/tests/TestMemoryOutStream.cpp
+++ /dev/null
@@ -1,150 +0,0 @@
-#include "../UnitTest++.h"
-
-#include "../MemoryOutStream.h"
-#include <cstring>
-
-using namespace UnitTest;
-
-namespace {
-
-TEST (DefaultIsEmptyString)
-{
- MemoryOutStream const stream;
- CHECK (stream.GetText() != 0);
- CHECK_EQUAL ("", stream.GetText());
-}
-
-TEST (StreamingTextCopiesCharacters)
-{
- MemoryOutStream stream;
- stream << "Lalala";
- CHECK_EQUAL ("Lalala", stream.GetText());
-}
-
-TEST (StreamingMultipleTimesConcatenatesResult)
-{
- MemoryOutStream stream;
- stream << "Bork" << "Foo" << "Bar";
- CHECK_EQUAL ("BorkFooBar", stream.GetText());
-}
-
-TEST (StreamingIntWritesCorrectCharacters)
-{
- MemoryOutStream stream;
- stream << (int)123;
- CHECK_EQUAL ("123", stream.GetText());
-}
-
-TEST (StreamingUnsignedIntWritesCorrectCharacters)
-{
- MemoryOutStream stream;
- stream << (unsigned int)123;
- CHECK_EQUAL ("123", stream.GetText());
-}
-
-TEST (StreamingLongWritesCorrectCharacters)
-{
- MemoryOutStream stream;
- stream << (long)(-123);
- CHECK_EQUAL ("-123", stream.GetText());
-}
-
-TEST (StreamingUnsignedLongWritesCorrectCharacters)
-{
- MemoryOutStream stream;
- stream << (unsigned long)123;
- CHECK_EQUAL ("123", stream.GetText());
-}
-
-TEST (StreamingFloatWritesCorrectCharacters)
-{
- MemoryOutStream stream;
- stream << 3.1415f;
- CHECK (std::strstr(stream.GetText(), "3.1415"));
-}
-
-TEST (StreamingDoubleWritesCorrectCharacters)
-{
- MemoryOutStream stream;
- stream << 3.1415;
- CHECK (std::strstr(stream.GetText(), "3.1415"));
-}
-
-TEST (StreamingPointerWritesCorrectCharacters)
-{
- MemoryOutStream stream;
- int* p = (int*)0x1234;
- stream << p;
- CHECK (std::strstr(stream.GetText(), "1234"));
-}
-
-TEST (StreamingSizeTWritesCorrectCharacters)
-{
- MemoryOutStream stream;
- size_t const s = 53124;
- stream << s;
- CHECK_EQUAL ("53124", stream.GetText());
-}
-
-#ifdef UNITTEST_USE_CUSTOM_STREAMS
-
-TEST (StreamInitialCapacityIsCorrect)
-{
- MemoryOutStream stream(MemoryOutStream::GROW_CHUNK_SIZE);
- CHECK_EQUAL ((int)MemoryOutStream::GROW_CHUNK_SIZE, stream.GetCapacity());
-}
-
-TEST (StreamInitialCapacityIsMultipleOfGrowChunkSize)
-{
- MemoryOutStream stream(MemoryOutStream::GROW_CHUNK_SIZE + 1);
- CHECK_EQUAL ((int)MemoryOutStream::GROW_CHUNK_SIZE * 2, stream.GetCapacity());
-}
-
-
-TEST (ExceedingCapacityGrowsBuffer)
-{
- MemoryOutStream stream(MemoryOutStream::GROW_CHUNK_SIZE);
- stream << "012345678901234567890123456789";
- char const* const oldBuffer = stream.GetText();
- stream << "0123456789";
- CHECK (oldBuffer != stream.GetText());
-}
-
-TEST (ExceedingCapacityGrowsBufferByGrowChunk)
-{
- MemoryOutStream stream(MemoryOutStream::GROW_CHUNK_SIZE);
- stream << "0123456789012345678901234567890123456789";
- CHECK_EQUAL (MemoryOutStream::GROW_CHUNK_SIZE * 2, stream.GetCapacity());
-}
-
-TEST (WritingStringLongerThanCapacityFitsInNewBuffer)
-{
- MemoryOutStream stream(8);
- stream << "0123456789ABCDEF";
- CHECK_EQUAL ("0123456789ABCDEF", stream.GetText());
-}
-
-TEST (WritingIntLongerThanCapacityFitsInNewBuffer)
-{
- MemoryOutStream stream(8);
- stream << "aaaa" << 123456;;
- CHECK_EQUAL ("aaaa123456", stream.GetText());
-}
-
-TEST (WritingFloatLongerThanCapacityFitsInNewBuffer)
-{
- MemoryOutStream stream(8);
- stream << "aaaa" << 123456.0f;;
- CHECK_EQUAL ("aaaa123456.000000f", stream.GetText());
-}
-
-TEST (WritingSizeTLongerThanCapacityFitsInNewBuffer)
-{
- MemoryOutStream stream(8);
- stream << "aaaa" << size_t(32145);
- CHECK_EQUAL ("aaaa32145", stream.GetText());
-}
-
-#endif
-
-}
diff --git a/src/testing/UnitTest++/src/tests/TestTest.cpp b/src/testing/UnitTest++/src/tests/TestTest.cpp
deleted file mode 100644
index a1dff71..0000000
--- a/src/testing/UnitTest++/src/tests/TestTest.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-#include "../UnitTest++.h"
-#include "../TestReporter.h"
-#include "../TimeHelpers.h"
-
-using namespace UnitTest;
-
-namespace {
-
-TEST (PassingTestHasNoFailures)
-{
- class PassingTest : public Test
- {
- public:
- PassingTest() : Test("passing") {}
- virtual void RunImpl(TestResults& testResults_) const
- {
- CHECK(true);
- }
- };
-
- TestResults results;
- PassingTest().Run(results);
- CHECK_EQUAL(0, results.GetFailureCount());
-}
-
-
-TEST (FailingTestHasFailures)
-{
- class FailingTest : public Test
- {
- public:
- FailingTest() : Test("failing") {}
- virtual void RunImpl(TestResults& testResults_) const
- {
- CHECK(false);
- }
- };
-
- TestResults results;
- FailingTest().Run(results);
- CHECK_EQUAL(1, results.GetFailureCount());
-}
-
-
-TEST (ThrowingTestsAreReportedAsFailures)
-{
- class CrashingTest : public Test
- {
- public:
- CrashingTest() : Test("throwing") {}
- virtual void RunImpl(TestResults&) const
- {
- throw "Blah";
- }
- };
-
- TestResults results;
- CrashingTest().Run(results);
- CHECK_EQUAL(1, results.GetFailureCount());
-}
-
-
-#ifndef UNITTEST_MINGW
-TEST (CrashingTestsAreReportedAsFailures)
-{
- class CrashingTest : public Test
- {
- public:
- CrashingTest() : Test("crashing") {}
- virtual void RunImpl(TestResults&) const
- {
- reinterpret_cast< void (*)() >(0)();
- }
- };
-
- TestResults results;
- CrashingTest().Run(results);
- CHECK_EQUAL(1, results.GetFailureCount());
-}
-#endif
-
-TEST (TestWithUnspecifiedSuiteGetsDefaultSuite)
-{
- Test test("test");
- CHECK(test.m_details.suiteName != NULL);
- CHECK_EQUAL("DefaultSuite", test.m_details.suiteName);
-}
-
-TEST (TestReflectsSpecifiedSuiteName)
-{
- Test test("test", "testSuite");
- CHECK(test.m_details.suiteName != NULL);
- CHECK_EQUAL("testSuite", test.m_details.suiteName);
-}
-
-
-}
diff --git a/src/testing/UnitTest++/src/tests/TestTestList.cpp b/src/testing/UnitTest++/src/tests/TestTestList.cpp
deleted file mode 100644
index 1498ad7..0000000
--- a/src/testing/UnitTest++/src/tests/TestTestList.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-#include "../UnitTest++.h"
-#include "../TestList.h"
-
-using namespace UnitTest;
-
-namespace {
-
-
-TEST (TestListIsEmptyByDefault)
-{
- TestList list;
- CHECK (list.GetHead() == 0);
-}
-
-TEST (AddingTestSetsHeadToTest)
-{
- Test test("test");
- TestList list;
- list.Add(&test);
-
- CHECK (list.GetHead() == &test);
- CHECK (test.next == 0);
-}
-
-TEST (AddingSecondTestAddsItToEndOfList)
-{
- Test test1("test1");
- Test test2("test2");
-
- TestList list;
- list.Add(&test1);
- list.Add(&test2);
-
- CHECK (list.GetHead() == &test1);
- CHECK (test1.next == &test2);
- CHECK (test2.next == 0);
-}
-
-TEST (ListAdderAddsTestToList)
-{
- TestList list;
-
- Test test("");
- ListAdder adder(list, &test);
-
- CHECK (list.GetHead() == &test);
- CHECK (test.next == 0);
-}
-
-}
diff --git a/src/testing/UnitTest++/src/tests/TestTestMacros.cpp b/src/testing/UnitTest++/src/tests/TestTestMacros.cpp
deleted file mode 100644
index f9ab3f2..0000000
--- a/src/testing/UnitTest++/src/tests/TestTestMacros.cpp
+++ /dev/null
@@ -1,171 +0,0 @@
-#include "../UnitTest++.h"
-#include "../TestMacros.h"
-#include "../TestList.h"
-#include "../TestResults.h"
-#include "../TestReporter.h"
-#include "RecordingReporter.h"
-
-using namespace UnitTest;
-
-namespace {
-
-TestList list1;
-TEST_EX(DummyTest, list1)
-{
- (void)testResults_;
-}
-
-TEST (TestsAreAddedToTheListThroughMacro)
-{
- CHECK (list1.GetHead() != 0);
- CHECK (list1.GetHead()->next == 0);
-}
-
-struct ThrowingThingie
-{
- ThrowingThingie() : dummy(false)
- {
- if (!dummy)
- throw "Oops";
- }
- bool dummy;
-};
-
-TestList list2;
-TEST_FIXTURE_EX(ThrowingThingie,DummyTestName,list2)
-{
- (void)testResults_;
-}
-
-TEST (ExceptionsInFixtureAreReportedAsHappeningInTheFixture)
-{
- RecordingReporter reporter;
- TestResults result(&reporter);
- list2.GetHead()->Run(result);
-
- CHECK (strstr(reporter.lastFailedMessage, "xception"));
- CHECK (strstr(reporter.lastFailedMessage, "fixture"));
- CHECK (strstr(reporter.lastFailedMessage, "ThrowingThingie"));
-}
-
-struct DummyFixture
-{
- int x;
-};
-
-// We're really testing the macros so we just want them to compile and link
-SUITE(TestSuite1)
-{
-
- TEST(SimilarlyNamedTestsInDifferentSuitesWork)
- {
- (void)testResults_;
- }
-
- TEST_FIXTURE(DummyFixture,SimilarlyNamedFixtureTestsInDifferentSuitesWork)
- {
- (void)testResults_;
- }
-
-}
-
-SUITE(TestSuite2)
-{
-
- TEST(SimilarlyNamedTestsInDifferentSuitesWork)
- {
- (void)testResults_;
- }
-
- TEST_FIXTURE(DummyFixture,SimilarlyNamedFixtureTestsInDifferentSuitesWork)
- {
- (void)testResults_;
- }
-
-}
-
-TestList macroTestList1;
-TEST_EX(MacroTestHelper1,macroTestList1)
-{
- (void)testResults_;
-}
-
-TEST(TestAddedWithTEST_EXMacroGetsDefaultSuite)
-{
- CHECK(macroTestList1.GetHead() != NULL);
- CHECK_EQUAL ("MacroTestHelper1", macroTestList1.GetHead()->m_details.testName);
- CHECK_EQUAL ("DefaultSuite", macroTestList1.GetHead()->m_details.suiteName);
-}
-
-TestList macroTestList2;
-TEST_FIXTURE_EX(DummyFixture,MacroTestHelper2,macroTestList2)
-{
- (void)testResults_;
-}
-
-TEST(TestAddedWithTEST_FIXTURE_EXMacroGetsDefaultSuite)
-{
- CHECK(macroTestList2.GetHead() != NULL);
- CHECK_EQUAL ("MacroTestHelper2", macroTestList2.GetHead()->m_details.testName);
- CHECK_EQUAL ("DefaultSuite", macroTestList2.GetHead()->m_details.suiteName);
-}
-
-struct FixtureCtorThrows
-{
- FixtureCtorThrows() { throw "exception"; }
-};
-
-TestList throwingFixtureTestList1;
-TEST_FIXTURE_EX(FixtureCtorThrows, FixtureCtorThrowsTestName, throwingFixtureTestList1)
-{
- (void)testResults_;
-}
-
-TEST(FixturesWithThrowingCtorsAreFailures)
-{
- CHECK(throwingFixtureTestList1.GetHead() != NULL);
- RecordingReporter reporter;
- TestResults result(&reporter);
- throwingFixtureTestList1.GetHead()->Run(result);
-
- int const failureCount = result.GetFailedTestCount();
- CHECK_EQUAL(1, failureCount);
- CHECK(strstr(reporter.lastFailedMessage, "while constructing fixture"));
-}
-
-struct FixtureDtorThrows
-{
- ~FixtureDtorThrows() { throw "exception"; }
-};
-
-TestList throwingFixtureTestList2;
-TEST_FIXTURE_EX(FixtureDtorThrows, FixtureDtorThrowsTestName, throwingFixtureTestList2)
-{
- (void)testResults_;
-}
-
-TEST(FixturesWithThrowingDtorsAreFailures)
-{
- CHECK(throwingFixtureTestList2.GetHead() != NULL);
- RecordingReporter reporter;
- TestResults result(&reporter);
- throwingFixtureTestList2.GetHead()->Run(result);
-
- int const failureCount = result.GetFailedTestCount();
- CHECK_EQUAL(1, failureCount);
- CHECK(strstr(reporter.lastFailedMessage, "while destroying fixture"));
-}
-
-}
-
-// We're really testing if it's possible to use the same suite in two files
-// to compile and link successfuly (TestTestSuite.cpp has suite with the same name)
-// Note: we are outside of the anonymous namespace
-SUITE(SameTestSuite)
-{
- TEST(DummyTest1)
- {
- (void)testResults_;
- }
-}
-
diff --git a/src/testing/UnitTest++/src/tests/TestTestResults.cpp b/src/testing/UnitTest++/src/tests/TestTestResults.cpp
deleted file mode 100644
index 65efbff..0000000
--- a/src/testing/UnitTest++/src/tests/TestTestResults.cpp
+++ /dev/null
@@ -1,111 +0,0 @@
-#include "../UnitTest++.h"
-#include "../TestResults.h"
-#include "RecordingReporter.h"
-
-using namespace UnitTest;
-
-namespace {
-
-TestDetails const details("testname", "suitename", "filename", 123);
-
-
-TEST(StartsWithNoTestsRun)
-{
- TestResults results;
- CHECK_EQUAL (0, results.GetTotalTestCount());
-}
-
-TEST(RecordsNumbersOfTests)
-{
- TestResults results;
- results.OnTestStart(details);
- results.OnTestStart(details);
- results.OnTestStart(details);
- CHECK_EQUAL(3, results.GetTotalTestCount());
-}
-
-TEST(StartsWithNoTestsFailing)
-{
- TestResults results;
- CHECK_EQUAL (0, results.GetFailureCount());
-}
-
-TEST(RecordsNumberOfFailures)
-{
- TestResults results;
- results.OnTestFailure(details, "");
- results.OnTestFailure(details, "");
- CHECK_EQUAL(2, results.GetFailureCount());
-}
-
-TEST(RecordsNumberOfFailedTests)
-{
- TestResults results;
-
- results.OnTestStart(details);
- results.OnTestFailure(details, "");
- results.OnTestFinish(details, 0);
-
- results.OnTestStart(details);
- results.OnTestFailure(details, "");
- results.OnTestFailure(details, "");
- results.OnTestFailure(details, "");
- results.OnTestFinish(details, 0);
-
- CHECK_EQUAL (2, results.GetFailedTestCount());
-}
-
-TEST(NotifiesReporterOfTestStartWithCorrectInfo)
-{
- RecordingReporter reporter;
- TestResults results(&reporter);
- results.OnTestStart(details);
-
- CHECK_EQUAL (1, reporter.testRunCount);
- CHECK_EQUAL ("suitename", reporter.lastStartedSuite);
- CHECK_EQUAL ("testname", reporter.lastStartedTest);
-}
-
-TEST(NotifiesReporterOfTestFailureWithCorrectInfo)
-{
- RecordingReporter reporter;
- TestResults results(&reporter);
-
- results.OnTestFailure(details, "failurestring");
- CHECK_EQUAL (1, reporter.testFailedCount);
- CHECK_EQUAL ("filename", reporter.lastFailedFile);
- CHECK_EQUAL (123, reporter.lastFailedLine);
- CHECK_EQUAL ("suitename", reporter.lastFailedSuite);
- CHECK_EQUAL ("testname", reporter.lastFailedTest);
- CHECK_EQUAL ("failurestring", reporter.lastFailedMessage);
-}
-
-TEST(NotifiesReporterOfCheckFailureWithCorrectInfo)
-{
- RecordingReporter reporter;
- TestResults results(&reporter);
-
- results.OnTestFailure(details, "failurestring");
- CHECK_EQUAL (1, reporter.testFailedCount);
-
- CHECK_EQUAL ("filename", reporter.lastFailedFile);
- CHECK_EQUAL (123, reporter.lastFailedLine);
- CHECK_EQUAL ("testname", reporter.lastFailedTest);
- CHECK_EQUAL ("suitename", reporter.lastFailedSuite);
- CHECK_EQUAL ("failurestring", reporter.lastFailedMessage);
-}
-
-TEST(NotifiesReporterOfTestEnd)
-{
- RecordingReporter reporter;
- TestResults results(&reporter);
-
- results.OnTestFinish(details, 0.1234f);
- CHECK_EQUAL (1, reporter.testFinishedCount);
- CHECK_EQUAL ("testname", reporter.lastFinishedTest);
- CHECK_EQUAL ("suitename", reporter.lastFinishedSuite);
- CHECK_CLOSE (0.1234f, reporter.lastFinishedTestTime, 0.0001f);
-}
-
-
-}
diff --git a/src/testing/UnitTest++/src/tests/TestTestRunner.cpp b/src/testing/UnitTest++/src/tests/TestTestRunner.cpp
deleted file mode 100644
index 0f49685..0000000
--- a/src/testing/UnitTest++/src/tests/TestTestRunner.cpp
+++ /dev/null
@@ -1,233 +0,0 @@
-#include "../UnitTest++.h"
-#include "RecordingReporter.h"
-#include "../ReportAssert.h"
-#include "../TestList.h"
-#include "../TimeHelpers.h"
-#include "../TimeConstraint.h"
-
-using namespace UnitTest;
-
-namespace
-{
-
-struct MockTest : public Test
-{
- MockTest(char const* testName, bool const success_, bool const assert_, int const count_ = 1)
- : Test(testName)
- , success(success_)
- , asserted(assert_)
- , count(count_)
- {
- }
-
- virtual void RunImpl(TestResults& testResults_) const
- {
- for (int i=0; i < count; ++i)
- {
- if (asserted)
- ReportAssert("desc", "file", 0);
- else if (!success)
- testResults_.OnTestFailure(m_details, "message");
- }
- }
-
- bool const success;
- bool const asserted;
- int const count;
-};
-
-
-struct TestRunnerFixture
-{
- RecordingReporter reporter;
- TestList list;
-};
-
-TEST_FIXTURE(TestRunnerFixture, TestStartIsReportedCorrectly)
-{
- MockTest test("goodtest", true, false);
- list.Add(&test);
-
- RunAllTests(reporter, list, 0);
- CHECK_EQUAL(1, reporter.testRunCount);
- CHECK_EQUAL("goodtest", reporter.lastStartedTest);
-}
-
-TEST_FIXTURE(TestRunnerFixture, TestFinishIsReportedCorrectly)
-{
- MockTest test("goodtest", true, false);
- list.Add(&test);
-
- RunAllTests(reporter, list, 0);
- CHECK_EQUAL(1, reporter.testFinishedCount);
- CHECK_EQUAL("goodtest", reporter.lastFinishedTest);
-}
-
-class SlowTest : public Test
-{
-public:
- SlowTest() : Test("slow", "somesuite", "filename", 123) {}
- virtual void RunImpl(TestResults&) const
- {
- TimeHelpers::SleepMs(20);
- }
-};
-
-TEST_FIXTURE(TestRunnerFixture, TestFinishIsCalledWithCorrectTime)
-{
- SlowTest test;
- list.Add(&test);
-
- RunAllTests(reporter, list, 0);
- CHECK (reporter.lastFinishedTestTime >= 0.005f && reporter.lastFinishedTestTime <= 0.050f);
-}
-
-TEST_FIXTURE(TestRunnerFixture, FailureCountIsZeroWhenNoTestsAreRun)
-{
- CHECK_EQUAL(0, RunAllTests(reporter, list, 0));
- CHECK_EQUAL(0, reporter.testRunCount);
- CHECK_EQUAL(0, reporter.testFailedCount);
-}
-
-TEST_FIXTURE(TestRunnerFixture, CallsReportFailureOncePerFailingTest)
-{
- MockTest test1("test", false, false);
- list.Add(&test1);
- MockTest test2("test", true, false);
- list.Add(&test2);
- MockTest test3("test", false, false);
- list.Add(&test3);
-
- CHECK_EQUAL(2, RunAllTests(reporter, list, 0));
- CHECK_EQUAL(2, reporter.testFailedCount);
-}
-
-TEST_FIXTURE(TestRunnerFixture, TestsThatAssertAreReportedAsFailing)
-{
- MockTest test("test", true, true);
- list.Add(&test);
-
- RunAllTests(reporter, list, 0);
- CHECK_EQUAL(1, reporter.testFailedCount);
-}
-
-
-TEST_FIXTURE(TestRunnerFixture, ReporterNotifiedOfTestCount)
-{
- MockTest test1("test", true, false);
- MockTest test2("test", true, false);
- MockTest test3("test", true, false);
- list.Add(&test1);
- list.Add(&test2);
- list.Add(&test3);
-
- RunAllTests(reporter, list, 0);
- CHECK_EQUAL(3, reporter.summaryTotalTestCount);
-}
-
-TEST_FIXTURE(TestRunnerFixture, ReporterNotifiedOfFailedTests)
-{
- MockTest test1("test", false, false, 2);
- MockTest test2("test", true, false);
- MockTest test3("test", false, false, 3);
- list.Add(&test1);
- list.Add(&test2);
- list.Add(&test3);
-
- RunAllTests(reporter, list, 0);
- CHECK_EQUAL(2, reporter.summaryFailedTestCount);
-}
-
-TEST_FIXTURE(TestRunnerFixture, ReporterNotifiedOfFailures)
-{
- MockTest test1("test", false, false, 2);
- MockTest test2("test", true, false);
- MockTest test3("test", false, false, 3);
- list.Add(&test1);
- list.Add(&test2);
- list.Add(&test3);
-
- RunAllTests(reporter, list, 0);
- CHECK_EQUAL(5, reporter.summaryFailureCount);
-}
-
-TEST_FIXTURE(TestRunnerFixture, SlowTestPassesForHighTimeThreshold)
-{
- SlowTest test;
- list.Add(&test);
- RunAllTests(reporter, list, 0);
- CHECK_EQUAL (0, reporter.testFailedCount);
-}
-
-TEST_FIXTURE(TestRunnerFixture, SlowTestFailsForLowTimeThreshold)
-{
- SlowTest test;
- list.Add(&test);
- RunAllTests(reporter, list, 0, 3);
- CHECK_EQUAL (1, reporter.testFailedCount);
-}
-
-TEST_FIXTURE(TestRunnerFixture, SlowTestHasCorrectFailureInformation)
-{
- SlowTest test;
- list.Add(&test);
- RunAllTests(reporter, list, 0, 3);
- CHECK_EQUAL (test.m_details.testName, reporter.lastFailedTest);
- CHECK (std::strstr(test.m_details.filename, reporter.lastFailedFile));
- CHECK_EQUAL (test.m_details.lineNumber, reporter.lastFailedLine);
- CHECK (std::strstr(reporter.lastFailedMessage, "Global time constraint failed"));
- CHECK (std::strstr(reporter.lastFailedMessage, "3ms"));
-}
-
-TEST_FIXTURE(TestRunnerFixture, SlowTestWithTimeExemptionPasses)
-{
- class SlowExemptedTest : public Test
- {
- public:
- SlowExemptedTest() : Test("slowexempted", "", 0) {}
- virtual void RunImpl(TestResults&) const
- {
- UNITTEST_TIME_CONSTRAINT_EXEMPT();
- TimeHelpers::SleepMs(20);
- }
- };
-
- SlowExemptedTest test;
- list.Add(&test);
- RunAllTests(reporter, list, 0, 3);
- CHECK_EQUAL (0, reporter.testFailedCount);
-}
-
-struct TestSuiteFixture
-{
- TestSuiteFixture()
- : test1("TestInDefaultSuite")
- , test2("TestInOtherSuite", "OtherSuite")
- , test3("SecondTestInDefaultSuite")
- {
- list.Add(&test1);
- list.Add(&test2);
- }
-
- Test test1;
- Test test2;
- Test test3;
- RecordingReporter reporter;
- TestList list;
-};
-
-TEST_FIXTURE(TestSuiteFixture, TestRunnerRunsAllSuitesIfNullSuiteIsPassed)
-{
- RunAllTests(reporter, list, 0);
- CHECK_EQUAL(2, reporter.summaryTotalTestCount);
-}
-
-TEST_FIXTURE(TestSuiteFixture,TestRunnerRunsOnlySpecifiedSuite)
-{
- RunAllTests(reporter, list, "OtherSuite");
- CHECK_EQUAL(1, reporter.summaryTotalTestCount);
- CHECK_EQUAL("TestInOtherSuite", reporter.lastFinishedTest);
-}
-
-
-}
diff --git a/src/testing/UnitTest++/src/tests/TestTestSuite.cpp b/src/testing/UnitTest++/src/tests/TestTestSuite.cpp
deleted file mode 100644
index adb869e..0000000
--- a/src/testing/UnitTest++/src/tests/TestTestSuite.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "../UnitTest++.h"
-
-// We're really testing if it's possible to use the same suite in two files
-// to compile and link successfuly (TestTestSuite.cpp has suite with the same name)
-// Note: we are outside of the anonymous namespace
-SUITE(SameTestSuite)
-{
- TEST(DummyTest2)
- {
- (void)testResults_;
- }
-}
-
diff --git a/src/testing/UnitTest++/src/tests/TestTimeConstraint.cpp b/src/testing/UnitTest++/src/tests/TestTimeConstraint.cpp
deleted file mode 100644
index a84b87e..0000000
--- a/src/testing/UnitTest++/src/tests/TestTimeConstraint.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-#include "../UnitTest++.h"
-#include "../TestResults.h"
-#include "../TimeHelpers.h"
-#include "RecordingReporter.h"
-
-using namespace UnitTest;
-
-namespace
-{
-
-TEST(TimeConstraintSucceedsWithFastTest)
-{
- TestResults result;
- {
- TimeConstraint t(200, result, TestDetails("", "", "", 0));
- TimeHelpers::SleepMs(5);
- }
- CHECK_EQUAL(0, result.GetFailureCount());
-}
-
-TEST(TimeConstraintFailsWithSlowTest)
-{
- TestResults result;
- {
- TimeConstraint t(10, result, TestDetails("", "", "", 0));
- TimeHelpers::SleepMs(20);
- }
- CHECK_EQUAL(1, result.GetFailureCount());
-}
-
-TEST(TimeConstraintFailureIncludesCorrectData)
-{
- RecordingReporter reporter;
- TestResults result(&reporter);
- {
- TestDetails const details("testname", "suitename", "filename", 10);
- TimeConstraint t(10, result, details);
- TimeHelpers::SleepMs(20);
- }
- CHECK(std::strstr(reporter.lastFailedFile, "filename"));
- CHECK_EQUAL(10, reporter.lastFailedLine);
- CHECK(std::strstr(reporter.lastFailedTest, "testname"));
-}
-
-TEST(TimeConstraintFailureIncludesTimeoutInformation)
-{
- RecordingReporter reporter;
- TestResults result(&reporter);
- {
- TimeConstraint t(10, result, TestDetails("", "", "", 0));
- TimeHelpers::SleepMs(20);
- }
- CHECK(std::strstr(reporter.lastFailedMessage, "ime constraint"));
- CHECK(std::strstr(reporter.lastFailedMessage, "under 10ms"));
-}
-
-}
diff --git a/src/testing/UnitTest++/src/tests/TestTimeConstraintMacro.cpp b/src/testing/UnitTest++/src/tests/TestTimeConstraintMacro.cpp
deleted file mode 100644
index 267106c..0000000
--- a/src/testing/UnitTest++/src/tests/TestTimeConstraintMacro.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-#include "../UnitTest++.h"
-#include "../TimeHelpers.h"
-
-#include "RecordingReporter.h"
-
-namespace {
-
-TEST (TimeConstraintMacroQualifiesNamespace)
-{
- // If this compiles without a "using namespace UnitTest;", all is well.
- UNITTEST_TIME_CONSTRAINT(1);
-}
-
-TEST (TimeConstraintMacroUsesCorrectInfo)
-{
- int testLine = 0;
- RecordingReporter reporter;
- {
- UnitTest::TestResults testResults_(&reporter);
- UNITTEST_TIME_CONSTRAINT(10); testLine = __LINE__;
- UnitTest::TimeHelpers::SleepMs(20);
- }
- CHECK_EQUAL (1, reporter.testFailedCount);
- CHECK (std::strstr(reporter.lastFailedFile, __FILE__));
- CHECK_EQUAL (testLine, reporter.lastFailedLine);
- CHECK (std::strstr(reporter.lastFailedTest, "TimeConstraintMacroUsesCorrectInfo"));
-}
-
-}
diff --git a/src/testing/UnitTest++/src/tests/TestUnitTest++.cpp b/src/testing/UnitTest++/src/tests/TestUnitTest++.cpp
deleted file mode 100644
index 95e5b93..0000000
--- a/src/testing/UnitTest++/src/tests/TestUnitTest++.cpp
+++ /dev/null
@@ -1,137 +0,0 @@
-#include "../UnitTest++.h"
-#include "../ReportAssert.h"
-
-#include <vector>
-
-// These are sample tests that show the different features of the framework
-
-namespace {
-
-TEST(ValidCheckSucceeds)
-{
- bool const b = true;
- CHECK(b);
-}
-
-TEST(CheckWorksWithPointers)
-{
- void* p = (void *)0x100;
- CHECK(p);
- CHECK(p != 0);
-}
-
-TEST(ValidCheckEqualSucceeds)
-{
- int const x = 3;
- int const y = 3;
- CHECK_EQUAL(x, y);
-}
-
-TEST(CheckEqualWorksWithPointers)
-{
- void* p = (void *)0;
- CHECK_EQUAL ((void*)0, p);
-}
-
-TEST(ValidCheckCloseSucceeds)
-{
- CHECK_CLOSE(2.0f, 2.001f, 0.01f);
- CHECK_CLOSE(2.001f, 2.0f, 0.01f);
-}
-
-TEST(ArrayCloseSucceeds)
-{
- float const a1[] = {1, 2, 3};
- float const a2[] = {1, 2.01f, 3};
- CHECK_ARRAY_CLOSE (a1, a2, 3, 0.1f);
-}
-
-TEST (CheckArrayCloseWorksWithVectors)
-{
- std::vector< float > a(4);
- for (int i = 0; i < 4; ++i)
- a[i] = (float)i;
-
- CHECK_ARRAY_CLOSE (a, a, (int)a.size(), 0.0001f);
-}
-
-TEST(CheckThrowMacroSucceedsOnCorrectException)
-{
- struct TestException {};
- CHECK_THROW(throw TestException(), TestException);
-}
-
-TEST(CheckAssertSucceeds)
-{
- CHECK_ASSERT(UnitTest::ReportAssert("desc", "file", 0));
-}
-
-TEST(CheckThrowMacroFailsOnMissingException)
-{
- class NoThrowTest : public UnitTest::Test
- {
- public:
- NoThrowTest() : Test("nothrow") {}
- void DontThrow() const
- {
- }
-
- virtual void RunImpl(UnitTest::TestResults& testResults_) const
- {
- CHECK_THROW(DontThrow(), int);
- }
- };
-
- UnitTest::TestResults results;
-
- NoThrowTest const test;
- test.Run(results);
- CHECK_EQUAL(1, results.GetFailureCount());
-}
-
-TEST(CheckThrowMacroFailsOnWrongException)
-{
- class WrongThrowTest : public UnitTest::Test
- {
- public:
- WrongThrowTest() : Test("wrongthrow") {}
- virtual void RunImpl(UnitTest::TestResults& testResults_) const
- {
- CHECK_THROW(throw "oops", int);
- }
- };
-
- UnitTest::TestResults results;
-
- WrongThrowTest const test;
- test.Run(results);
- CHECK_EQUAL(1, results.GetFailureCount());
-}
-
-struct SimpleFixture
-{
- SimpleFixture()
- {
- ++instanceCount;
- }
- ~SimpleFixture()
- {
- --instanceCount;
- }
-
- static int instanceCount;
-};
-
-int SimpleFixture::instanceCount = 0;
-
-TEST_FIXTURE(SimpleFixture, DefaultFixtureCtorIsCalled)
-{
- CHECK(SimpleFixture::instanceCount > 0);
-}
-
-TEST_FIXTURE(SimpleFixture, OnlyOneFixtureAliveAtATime)
-{
- CHECK_EQUAL(1, SimpleFixture::instanceCount);
-}
-
-}
diff --git a/src/testing/UnitTest++/src/tests/TestXmlTestReporter.cpp b/src/testing/UnitTest++/src/tests/TestXmlTestReporter.cpp
deleted file mode 100644
index a63abb8..0000000
--- a/src/testing/UnitTest++/src/tests/TestXmlTestReporter.cpp
+++ /dev/null
@@ -1,183 +0,0 @@
-#include "../UnitTest++.h"
-#include "../XmlTestReporter.h"
-
-#include <sstream>
-
-using namespace UnitTest;
-using std::ostringstream;
-
-namespace
-{
-
-#ifdef UNITTEST_USE_CUSTOM_STREAMS
-
-// Overload to let MemoryOutStream accept std::string
-MemoryOutStream& operator<<(MemoryOutStream& s, const std::string& value)
-{
- s << value.c_str();
- return s;
-}
-
-#endif
-
-struct XmlTestReporterFixture
-{
- XmlTestReporterFixture()
- : reporter(output)
- {
- }
-
- ostringstream output;
- XmlTestReporter reporter;
-};
-
-TEST_FIXTURE(XmlTestReporterFixture, MultipleCharactersAreEscaped)
-{
- TestDetails const details("TestName", "suite", "filename.h", 4321);
-
- reporter.ReportTestStart(details);
- reporter.ReportFailure(details, "\"\"\'\'&&<<>>");
- reporter.ReportTestFinish(details, 0.1f);
- reporter.ReportSummary(1, 2, 3, 0.1f);
-
- char const* expected =
- "<?xml version=\"1.0\"?>"
- "<unittest-results tests=\"1\" failedtests=\"2\" failures=\"3\" time=\"0.1\">"
- "<test suite=\"suite\" name=\"TestName\" time=\"0.1\">"
- "<failure message=\"filename.h(4321) : "
- "&quot;&quot;&apos;&apos;&amp;&amp;&lt;&lt;&gt;&gt;\"/>"
- "</test>"
- "</unittest-results>";
-
- CHECK_EQUAL(expected, output.str());
-}
-
-TEST_FIXTURE(XmlTestReporterFixture, OutputIsCachedUntilReportSummaryIsCalled)
-{
- TestDetails const details("", "", "", 0);
-
- reporter.ReportTestStart(details);
- reporter.ReportFailure(details, "message");
- reporter.ReportTestFinish(details, 1.0F);
- CHECK(output.str().empty());
-
- reporter.ReportSummary(1, 1, 1, 1.0f);
- CHECK(!output.str().empty());
-}
-
-TEST_FIXTURE(XmlTestReporterFixture, EmptyReportSummaryFormat)
-{
- reporter.ReportSummary(0, 0, 0, 0.1f);
-
- const char *expected =
-"<?xml version=\"1.0\"?>"
-"<unittest-results tests=\"0\" failedtests=\"0\" failures=\"0\" time=\"0.1\">"
-"</unittest-results>";
-
- CHECK_EQUAL(expected, output.str());
-}
-
-TEST_FIXTURE(XmlTestReporterFixture, SingleSuccessfulTestReportSummaryFormat)
-{
- TestDetails const details("TestName", "DefaultSuite", "", 0);
-
- reporter.ReportTestStart(details);
- reporter.ReportSummary(1, 0, 0, 0.1f);
-
- const char *expected =
-"<?xml version=\"1.0\"?>"
-"<unittest-results tests=\"1\" failedtests=\"0\" failures=\"0\" time=\"0.1\">"
-"<test suite=\"DefaultSuite\" name=\"TestName\" time=\"0\"/>"
-"</unittest-results>";
-
- CHECK_EQUAL(expected, output.str());
-}
-
-TEST_FIXTURE(XmlTestReporterFixture, SingleFailedTestReportSummaryFormat)
-{
- TestDetails const details("A Test", "suite", "A File", 4321);
-
- reporter.ReportTestStart(details);
- reporter.ReportFailure(details, "A Failure");
- reporter.ReportSummary(1, 1, 1, 0.1f);
-
- const char *expected =
- "<?xml version=\"1.0\"?>"
- "<unittest-results tests=\"1\" failedtests=\"1\" failures=\"1\" time=\"0.1\">"
- "<test suite=\"suite\" name=\"A Test\" time=\"0\">"
- "<failure message=\"A File(4321) : A Failure\"/>"
- "</test>"
- "</unittest-results>";
-
- CHECK_EQUAL(expected, output.str());
-}
-
-TEST_FIXTURE(XmlTestReporterFixture, FailureMessageIsXMLEscaped)
-{
- TestDetails const details("TestName", "suite", "filename.h", 4321);
-
- reporter.ReportTestStart(details);
- reporter.ReportFailure(details, "\"\'&<>");
- reporter.ReportTestFinish(details, 0.1f);
- reporter.ReportSummary(1, 1, 1, 0.1f);
-
- char const* expected =
- "<?xml version=\"1.0\"?>"
- "<unittest-results tests=\"1\" failedtests=\"1\" failures=\"1\" time=\"0.1\">"
- "<test suite=\"suite\" name=\"TestName\" time=\"0.1\">"
- "<failure message=\"filename.h(4321) : &quot;&apos;&amp;&lt;&gt;\"/>"
- "</test>"
- "</unittest-results>";
-
- CHECK_EQUAL(expected, output.str());
-}
-
-TEST_FIXTURE(XmlTestReporterFixture, OneFailureAndOneSuccess)
-{
- TestDetails const failedDetails("FailedTest", "suite", "fail.h", 1);
- reporter.ReportTestStart(failedDetails);
- reporter.ReportFailure(failedDetails, "expected 1 but was 2");
- reporter.ReportTestFinish(failedDetails, 0.1f);
-
- TestDetails const succeededDetails("SucceededTest", "suite", "", 0);
- reporter.ReportTestStart(succeededDetails);
- reporter.ReportTestFinish(succeededDetails, 1.0f);
- reporter.ReportSummary(2, 1, 1, 1.1f);
-
- char const* expected =
- "<?xml version=\"1.0\"?>"
- "<unittest-results tests=\"2\" failedtests=\"1\" failures=\"1\" time=\"1.1\">"
- "<test suite=\"suite\" name=\"FailedTest\" time=\"0.1\">"
- "<failure message=\"fail.h(1) : expected 1 but was 2\"/>"
- "</test>"
- "<test suite=\"suite\" name=\"SucceededTest\" time=\"1\"/>"
- "</unittest-results>";
-
- CHECK_EQUAL(expected, output.str());
-}
-
-TEST_FIXTURE(XmlTestReporterFixture, MultipleFailures)
-{
- TestDetails const failedDetails1("FailedTest", "suite", "fail.h", 1);
- TestDetails const failedDetails2("FailedTest", "suite", "fail.h", 31);
-
- reporter.ReportTestStart(failedDetails1);
- reporter.ReportFailure(failedDetails1, "expected 1 but was 2");
- reporter.ReportFailure(failedDetails2, "expected one but was two");
- reporter.ReportTestFinish(failedDetails1, 0.1f);
-
- reporter.ReportSummary(1, 1, 2, 1.1f);
-
- char const* expected =
- "<?xml version=\"1.0\"?>"
- "<unittest-results tests=\"1\" failedtests=\"1\" failures=\"2\" time=\"1.1\">"
- "<test suite=\"suite\" name=\"FailedTest\" time=\"0.1\">"
- "<failure message=\"fail.h(1) : expected 1 but was 2\"/>"
- "<failure message=\"fail.h(31) : expected one but was two\"/>"
- "</test>"
- "</unittest-results>";
-
- CHECK_EQUAL(expected, output.str());
-}
-
-}
diff --git a/src/testing/test_files/_FILE.lua b/src/testing/test_files/_FILE.lua
deleted file mode 100644
index 54ee3e5..0000000
--- a/src/testing/test_files/_FILE.lua
+++ /dev/null
@@ -1,2 +0,0 @@
--- Return the _FILE global, to ensure that it has been set properly
-return _FILE
diff --git a/src/testing/test_files/dofile.lua b/src/testing/test_files/dofile.lua
deleted file mode 100644
index dac2cde..0000000
--- a/src/testing/test_files/dofile.lua
+++ /dev/null
@@ -1,2 +0,0 @@
--- call another script in a different directory, and see what the current directory is when it runs
-return dofile("nested/getcwd.lua")
diff --git a/src/testing/test_files/dofile_getcwd.lua b/src/testing/test_files/dofile_getcwd.lua
deleted file mode 100644
index defe46d..0000000
--- a/src/testing/test_files/dofile_getcwd.lua
+++ /dev/null
@@ -1,4 +0,0 @@
--- run a script in a subdir, and check the current directory when it returns
--- makes sure that current directory gets restored when a nested script completes
-dofile("nested/getcwd.lua")
-return os.getcwd()
diff --git a/src/testing/test_files/error.lua b/src/testing/test_files/error.lua
deleted file mode 100644
index 64f079c..0000000
--- a/src/testing/test_files/error.lua
+++ /dev/null
@@ -1 +0,0 @@
-error("This script has failed")
diff --git a/src/testing/test_files/getcwd.lua b/src/testing/test_files/getcwd.lua
deleted file mode 100644
index 08556c4..0000000
--- a/src/testing/test_files/getcwd.lua
+++ /dev/null
@@ -1 +0,0 @@
-return os.getcwd()
diff --git a/src/testing/test_files/nested/getcwd.lua b/src/testing/test_files/nested/getcwd.lua
deleted file mode 100644
index 08556c4..0000000
--- a/src/testing/test_files/nested/getcwd.lua
+++ /dev/null
@@ -1 +0,0 @@
-return os.getcwd()
diff --git a/src/testing/test_files/premake4.lua b/src/testing/test_files/premake4.lua
deleted file mode 100644
index 5cf4ea6..0000000
--- a/src/testing/test_files/premake4.lua
+++ /dev/null
@@ -1,3 +0,0 @@
--- Used to make sure functions will look for premake4.lua by default
-script_has_run = true
-return true
diff --git a/src/testing/test_files/true.lua b/src/testing/test_files/true.lua
deleted file mode 100644
index 12c4f08..0000000
--- a/src/testing/test_files/true.lua
+++ /dev/null
@@ -1,2 +0,0 @@
--- Just return a simple value, used to ensure that dofile() works as expected
-return true
diff --git a/src/testing/testing.cpp b/src/testing/testing.cpp
deleted file mode 100644
index 2857432..0000000
--- a/src/testing/testing.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * \file testing.cpp
- * \brief Automated testing framework.
- * \author Copyright (c) 2007-2008 Jason Perkins and the Premake project
- */
-
-#include <cstdio>
-#include "testing.h"
-#include "UnitTest++/src/TestReporterStdout.h"
-
-
-/**
- * Run a particular suite of tests.
- * \param suite The name of the suite to run.
- * \returns OKAY if all tests passed successfully.
- */
-int tests_run_suite(const char* suite)
-{
- UnitTest::TestReporterStdout reporter;
- std::printf("Testing %s...\n", suite);
- return UnitTest::RunAllTests(reporter, UnitTest::Test::GetTestList(), suite);
-}
diff --git a/src/testing/testing.h b/src/testing/testing.h
deleted file mode 100644
index e68c688..0000000
--- a/src/testing/testing.h
+++ /dev/null
@@ -1,9 +0,0 @@
-/**
- * \file testing.h
- * \brief Automated testing framework.
- * \author Copyright (c) 2007-2008 Jason Perkins and the Premake project
- */
-
-#include "UnitTest++/src/UnitTest++.h"
-
-int tests_run_suite(const char* suite);
diff --git a/tests/folder/ok.lua b/tests/folder/ok.lua
new file mode 100644
index 0000000..517f338
--- /dev/null
+++ b/tests/folder/ok.lua
@@ -0,0 +1 @@
+return "ok"
diff --git a/tests/premake4.lua b/tests/premake4.lua
new file mode 100644
index 0000000..f0bc098
--- /dev/null
+++ b/tests/premake4.lua
@@ -0,0 +1,36 @@
+--
+-- tests/premake4.lua
+-- Automated test suite for Premake 4.x
+-- Copyright (c) 2008 Jason Perkins and the Premake project
+--
+
+ dofile("testfx.lua")
+ dofile("test_dofile.lua")
+ dofile("test_file.lua")
+ dofile("test_path.lua")
+ dofile("test_string.lua")
+ dofile("test_table.lua")
+ dofile("test_template.lua")
+ dofile("test_premake.lua")
+ dofile("test_project.lua")
+ dofile("test_functions.lua")
+
+
+
+--
+-- Register a test action
+--
+
+ premake.actions["test"] = {
+ description = "Run the automated test suite",
+
+ execute = function ()
+ passed, failed = test.runall()
+ msg = string.format("%d tests passed, %d failed", passed, failed)
+ if (failed > 0) then
+ error(msg, 0)
+ else
+ print(msg)
+ end
+ end
+ }
diff --git a/tests/run.sh b/tests/run.sh
new file mode 100755
index 0000000..2045884
--- /dev/null
+++ b/tests/run.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+MYCFG=$1
+if [ ! $MYCFG ]; then MYCFG="debug"; fi
+../bin/$MYCFG/premake4 /scripts=../src test
diff --git a/tests/test_dofile.lua b/tests/test_dofile.lua
new file mode 100644
index 0000000..4aaf403
--- /dev/null
+++ b/tests/test_dofile.lua
@@ -0,0 +1,36 @@
+--
+-- tests/test_dofile.lua
+-- Automated test suite for the extended dofile() functions.
+-- Copyright (c) 2008 Jason Perkins and the Premake project
+--
+
+
+ T.dofile = { }
+
+
+ local os_getenv
+
+ function T.dofile.setup()
+ os_getenv = os.getenv
+ end
+
+ function T.dofile.teardown()
+ os.getenv = os_getenv
+ end
+
+
+--
+-- dofile() tests
+--
+
+ function T.dofile.SearchesPath()
+ os.getenv = function() return os.getcwd().."/folder" end
+ result = dofile("ok.lua")
+ test.isequal("ok", result)
+ end
+
+ function T.dofile.SearchesScriptsOption()
+ _OPTIONS["scripts"] = os.getcwd().."/folder"
+ result = dofile("ok.lua")
+ test.isequal("ok", result)
+ end
diff --git a/tests/test_file.lua b/tests/test_file.lua
new file mode 100644
index 0000000..e6b1415
--- /dev/null
+++ b/tests/test_file.lua
@@ -0,0 +1,43 @@
+--
+-- tests/test_os.lua
+-- Automated test suite for the new OS functions.
+-- Copyright (c) 2008 Jason Perkins and the Premake project
+--
+
+
+ T.os = { }
+
+
+--
+-- os.isfile() tests
+--
+
+ function T.os.isfile_ReturnsTrue_OnExistingFile()
+ test.istrue(os.isfile("test_file.lua"))
+ end
+
+ function T.os.isfile_ReturnsFalse_OnNonexistantFile()
+ test.isfalse(os.isfile("no_such_file.lua"))
+ end
+
+
+--
+-- os.pathsearch() tests
+--
+
+ function T.os.pathsearch_ReturnsNil_OnNotFound()
+ test.istrue( os.pathsearch("nosuchfile", "aaa;bbb;ccc") == nil )
+ end
+
+ function T.os.pathsearch_ReturnsPath_OnFound()
+ test.isequal(os.getcwd(), os.pathsearch("test_file.lua", os.getcwd()))
+ end
+
+ function T.os.pathsearch_FindsFile_OnComplexPath()
+ test.isequal(os.getcwd(), os.pathsearch("test_file.lua", "aaa;"..os.getcwd()..";bbb"))
+ end
+
+ function T.os.pathsearch_NilPathsAllowed()
+ test.isequal(os.getcwd(), os.pathsearch("test_file.lua", nil, os.getcwd(), nil))
+ end
+ \ No newline at end of file
diff --git a/tests/test_functions.lua b/tests/test_functions.lua
new file mode 100644
index 0000000..6396223
--- /dev/null
+++ b/tests/test_functions.lua
@@ -0,0 +1,134 @@
+--
+-- tests/test_functions.lua
+-- Automated test suite for the project API.
+-- Copyright (c) 2008 Jason Perkins and the Premake project
+--
+
+
+ T.functions = { }
+
+ local sln
+ function T.functions.setup()
+ sln = solution "MySolution"
+ end
+
+
+--
+-- solution() tests
+--
+
+ function T.functions.solution_SetsCurrentObject()
+ test.istrue(sln == premake.CurrentContainer)
+ end
+
+ function T.functions.solution_SetsName()
+ test.isequal("MySolution", sln.name)
+ end
+
+ function T.functions.solution_SetsLocation()
+ test.isequal(os.getcwd(), sln.location)
+ end
+
+ function T.functions.solution_ReturnsNil_OnNoActiveSolution()
+ premake.CurrentContainer = nil
+ test.isfalse(solution())
+ end
+
+ function T.functions.solutions_ReturnsSolution_OnActiveProject()
+ project("MyProject")
+ test.istrue(sln == solution())
+ end
+
+ function T.functions.solution_OnNewName()
+ local sln2 = solution "MySolution2"
+ test.isfalse(sln == sln2)
+ end
+
+ function T.functions.solution_OnExistingName()
+ local sln2 = solution "MySolution2"
+ test.istrue(sln == solution("MySolution"))
+ end
+
+
+
+--
+-- configuration() tests
+--
+
+ function T.functions.configuration_RaisesError_OnNoContainer()
+ premake.CurrentContainer = nil
+ local fn = function() configuration{"Debug"} end
+ ok, err = pcall(fn)
+ test.isfalse(ok)
+ end
+
+ function T.functions.configuration_SetsCurrentConfiguration()
+ sln = solution("MySolution")
+ cfg = configuration{"Debug"}
+ test.istrue(premake.CurrentConfiguration == cfg)
+ end
+
+ function T.functions.configuration_AddsToContainer()
+ sln = solution("MySolution")
+ cfg = configuration{"Debug"}
+ test.istrue(cfg == sln.blocks[#sln.blocks])
+ end
+
+
+--
+-- project() tests
+--
+
+ function T.functions.project_RaisesError_OnNoSolution()
+ premake.CurrentContainer = nil
+ local fn = function() project("MyProject") end
+ ok, err = pcall(fn)
+ test.isfalse(ok)
+ end
+
+ function T.functions.project_SetsCurrentContainer()
+ prj = project("MyProject")
+ test.istrue(prj == premake.CurrentContainer)
+ end
+
+ function T.functions.project_AddsToSolution()
+ prj = project("MyProject")
+ test.istrue(prj == sln.projects[1])
+ end
+
+ function T.functions.project_SetsName()
+ prj = project("MyProject")
+ test.isequal("MyProject", prj.name)
+ end
+
+ function T.functions.project_SetsLocation()
+ prj = project("MyProject")
+ test.isequal(os.getcwd(), prj.location)
+ end
+
+ function T.functions.project_SetsSolution()
+ prj = project("MyProject")
+ test.istrue(sln == prj.solution)
+ end
+
+ function T.functions.project_SetsConfiguration()
+ prj = project("MyProject")
+ test.istrue(premake.CurrentConfiguration == prj.blocks[1])
+ end
+
+ function T.functions.project_ReturnsNil_OnNoActiveProject()
+ test.isfalse(project())
+ end
+
+ function T.functions.project_OnNewName()
+ local prj = project "MyProject"
+ local prj2 = project "MyProject2"
+ test.isfalse(prj == prj2)
+ end
+
+ function T.functions.project_OnExistingName()
+ local prj = project "MyProject"
+ local prj2 = project "MyProject2"
+ test.istrue(prj == project("MyProject"))
+ end
+
diff --git a/tests/test_path.lua b/tests/test_path.lua
new file mode 100644
index 0000000..5b6931b
--- /dev/null
+++ b/tests/test_path.lua
@@ -0,0 +1,142 @@
+--
+-- tests/test_path.lua
+-- Automated test suite for the path manipulation functions.
+-- Copyright (c) 2008 Jason Perkins and the Premake project
+--
+
+
+ T.path = { }
+
+
+--
+-- path.getabsolute() tests
+--
+
+ function T.path.getabsolute_ReturnsCorrectPath_OnMissingSubdir()
+ local expected = path.translate(os.getcwd(), "/") .. "/a/b/c"
+ test.isequal(expected, path.getabsolute("a/b/c"))
+ end
+
+
+--
+-- path.getbasename() tests
+--
+
+ function T.path.getbasename_ReturnsCorrectName_OnDirAndExtension()
+ test.isequal("filename", path.getbasename("folder/filename.ext"))
+ end
+
+
+--
+-- path.getdirectory() tests
+--
+
+ function T.path.getdirectory_ReturnsEmptyString_OnNoDirectory()
+ test.isequal(".", path.getdirectory("filename.ext"))
+ end
+
+ function T.path.getdirectory_ReturnsDirectory_OnSingleLevelPath()
+ test.isequal("dir0", path.getdirectory("dir0/filename.ext"))
+ end
+
+ function T.path.getdirectory_ReturnsDirectory_OnMultiLeveLPath()
+ test.isequal("dir0/dir1/dir2", path.getdirectory("dir0/dir1/dir2/filename.ext"))
+ end
+
+ function T.path.getdirectory_ReturnsRootPath_OnRootPathOnly()
+ test.isequal("/", path.getdirectory("/filename.ext"))
+ end
+
+
+--
+-- path.getextension() tests
+--
+
+ function T.path.getextension_ReturnsEmptyString_OnNoExtension()
+ test.isequal("", path.getextension("filename"))
+ end
+
+ function T.path.getextension_ReturnsExtension()
+ test.isequal(".txt", path.getextension("filename.txt"))
+ end
+
+ function T.path.getextension_OnMultipleDots()
+ test.isequal(".txt", path.getextension("filename.mod.txt"))
+ end
+
+
+--
+-- path.getrelative() tests
+--
+
+ function T.path.getrelative_ReturnsDot_OnMatchingPaths()
+ test.isequal(".", path.getrelative("/a/b/c", "/a/b/c"))
+ end
+
+ function T.path.getrelative_ReturnsDoubleDot_OnChildToParent()
+ test.isequal("..", path.getrelative("/a/b/c", "/a/b"))
+ end
+
+ function T.path.getrelative_ReturnsDoubleDot_OnSiblingToSibling()
+ test.isequal("../d", path.getrelative("/a/b/c", "/a/b/d"))
+ end
+
+ function T.path.getrelative_ReturnsChildPath_OnParentToChild()
+ test.isequal("d", path.getrelative("/a/b/c", "/a/b/c/d"))
+ end
+
+
+--
+-- path.isabsolute() tests
+--
+
+ function T.path.isabsolute_ReturnsTrue_OnAbsolutePosixPath()
+ test.istrue(path.isabsolute("/a/b/c"))
+ end
+
+ function T.path.isabsolute_ReturnsTrue_OnAbsoluteWindowsPathWithDrive()
+ test.istrue(path.isabsolute("C:/a/b/c"))
+ end
+
+ function T.path.isabsolute_ReturnsFalse_OnRelativePath()
+ test.isfalse(path.isabsolute("a/b/c"))
+ end
+
+
+--
+-- path.join() tests
+--
+
+ function T.path.join_OnValidParts()
+ test.isequal("leading/trailing", path.join("leading", "trailing"))
+ end
+
+ function T.path.join_OnAbsoluteUnixPath()
+ test.isequal("/trailing", path.join("leading", "/trailing"))
+ end
+
+ function T.path.join_OnAbsoluteWindowsPath()
+ test.isequal("C:/trailing", path.join("leading", "C:/trailing"))
+ end
+
+ function T.path.join_OnCurrentDirectory()
+ test.isequal("trailing", path.join(".", "trailing"))
+ end
+
+
+--
+-- path.translate() tests
+--
+
+ function T.path.translate_ReturnsTranslatedPath_OnValidPath()
+ test.isequal("dir/dir/file", path.translate("dir\\dir\\file", "/"))
+ end
+
+ function T.path.translate_ReturnsCorrectSeparator_OnMixedPath()
+ local actual = path.translate("dir\\dir/file")
+ if (os.windows) then
+ test.isequal("dir\\dir\\file", actual)
+ else
+ test.isequal("dir/dir/file", actual)
+ end
+ end
diff --git a/tests/test_premake.lua b/tests/test_premake.lua
new file mode 100644
index 0000000..a10f547
--- /dev/null
+++ b/tests/test_premake.lua
@@ -0,0 +1,33 @@
+--
+-- tests/test_premake.lua
+-- Automated test suite for the Premake support functions.
+-- Copyright (c) 2008 Jason Perkins and the Premake project
+--
+
+
+ T.premake = { }
+
+
+--
+-- premake.checktools() tests
+--
+
+ function T.premake.checktools_SetsDefaultTools()
+ _ACTION = "gmake"
+ premake.checktools()
+ test.isequal("gcc", _OPTIONS.cc)
+ test.isequal("mcs", _OPTIONS.csc)
+ end
+
+
+ function T.premake.checktools_Fails_OnToolMismatch()
+ _ACTION = "gmake"
+ _OPTIONS["cc"] = "xyz"
+ ok, err = premake.checktools()
+ test.isfalse( ok )
+ test.isequal("the GNU Make action does not support /cc=xyz", err)
+ end
+
+
+
+ \ No newline at end of file
diff --git a/tests/test_project.lua b/tests/test_project.lua
new file mode 100644
index 0000000..e2a4a20
--- /dev/null
+++ b/tests/test_project.lua
@@ -0,0 +1,321 @@
+--
+-- tests/test_project.lua
+-- Automated test suite for the project support functions.
+-- Copyright (c) 2008 Jason Perkins and the Premake project
+--
+
+
+ T.project = { }
+
+ local cfg
+ function T.project.setup()
+ _ACTION = "gmake"
+ cfg = { }
+ cfg.location = ""
+ cfg.targetname = "MyPackage"
+ cfg.targetdir = ""
+ end
+
+
+--
+-- project.checkall() tests
+--
+
+ function T.project.checkall_Succeeds_OnValidSession()
+ solution "MySolution"
+ configurations "Default"
+ project "MyProject"
+ kind "ConsoleExe"
+ language "C"
+
+ ok, err = premake.project.checkall()
+ test.istrue( ok )
+ end
+
+
+ function T.project.checkall_Fails_OnNoConfigurations()
+ solution "MySolution"
+ project "MyProject"
+
+ ok, err = premake.project.checkall()
+ test.isfalse( ok )
+ test.isequal("solution 'MySolution' needs configurations", err)
+ end
+
+
+ function T.project.checkall_Fails_OnNoProjectsInSolution()
+ solution "MySolution"
+ configurations "Default"
+
+ ok, err = premake.project.checkall()
+ test.isfalse( ok )
+ test.isequal("solution 'MySolution' needs at least one project", err)
+ end
+
+
+ function T.project.checkall_Fails_OnNoLanguage()
+ solution "MySolution"
+ configurations "Default"
+ project "MyProject"
+ kind "ConsoleExe"
+
+ ok, err = premake.project.checkall()
+ test.isfalse( ok )
+ test.isequal("project 'MyProject' needs a language", err)
+ end
+
+
+ function T.project.checkall_Fails_OnNoKind()
+ solution "MySolution"
+ language "C"
+ configurations "Default"
+ project "MyProject"
+
+ ok, err = premake.project.checkall()
+ test.isfalse( ok )
+ test.isequal("project 'MyProject' needs a kind in configuration 'Default'", err)
+ end
+
+
+ function T.project.checkall_Fails_OnActionUnsupportedLanguage()
+ solution "MySolution"
+ configurations "Default"
+ prj = project "MyProject"
+ kind "ConsoleExe"
+
+ prj.language = "XXX"
+
+ ok, err = premake.project.checkall()
+ test.isfalse(ok)
+ test.isequal("the GNU Make action does not support XXX projects", err)
+ end
+
+
+ function T.project.checkall_Fails_OnActionUnsupportedKind()
+ solution "MySolution"
+ configurations "Default"
+ prj = project "MyProject"
+ language "C"
+
+ prj.kind = "YYY"
+
+ ok, err = premake.project.checkall()
+ test.isfalse(ok)
+ test.isequal("the GNU Make action does not support YYY projects", err)
+ end
+
+
+
+--
+-- project.checkterms() tests
+--
+
+ function T.project.checkterms_ReturnsTrue_OnInclusion()
+ test.istrue( premake.project.checkterms( {'Debug','Windows'}, {'Debug'} ) )
+ end
+
+ function T.project.checkterms_ReturnsTrue_OnCaseMismatch()
+ test.istrue( premake.project.checkterms( {'debug','Windows'}, {'Debug'} ) )
+ end
+
+ function T.project.checkterms_MatchesPatterns()
+ test.istrue( premake.project.checkterms( {'VS2005'}, {'vs200%d'} ) )
+ end
+
+ function T.project.checkterms_ReturnsFalse_OnNoTermsAndKeywords()
+ test.isfalse( premake.project.checkterms( {}, {'Debug'} ) )
+ end
+
+ function T.project.checkterms_ReturnsTrue_OnNoTermsOrKeywords()
+ test.istrue( premake.project.checkterms( {}, {} ) )
+ end
+
+ function T.project.checkterms_ReturnsTrue_OnTermsAndNoKeywords()
+ test.istrue ( premake.project.checkterms( {'Debug'}, {} ) )
+ end
+
+
+--
+-- project.getobject() tests
+--
+
+ function T.project.getobject_RaisesError_OnNoContainer()
+ premake.CurrentContainer = nil
+ c, err = premake.project.getobject("container")
+ test.istrue(c == nil)
+ test.isequal("no active solution or project", err)
+ end
+
+ function T.project.getobject_RaisesError_OnNoActiveSolution()
+ premake.CurrentContainer = { }
+ c, err = premake.project.getobject("solution")
+ test.istrue(c == nil)
+ test.isequal("no active solution", err)
+ end
+
+ function T.project.getobject_RaisesError_OnNoActiveConfig()
+ premake.CurrentConfiguration = nil
+ c, err = premake.project.getobject("config")
+ test.istrue(c == nil)
+ test.isequal("no active solution, project, or configuration", err)
+ end
+
+
+--
+-- project.gettargetfile() tests
+--
+
+ function T.project.gettargetfile_IndexesFieldValues()
+ cfg.implibname = "imports"
+ test.isequal("imports.lib", premake.project.gettargetfile(cfg, "implib", "StaticLib", "windows"))
+ end
+
+ function T.project.gettargetfile_FallsBackToTargetValues()
+ test.isequal("MyPackage", premake.project.gettargetfile(cfg, "implib", "ConsoleExe", "linux"))
+ end
+
+ function T.project.gettargetfile_OnWindowsConsole()
+ test.isequal("MyPackage.exe", premake.project.gettargetfile(cfg, "target", "ConsoleExe", "windows"))
+ end
+
+ function T.project.gettargetfile_OnLinuxConsole()
+ test.isequal("MyPackage", premake.project.gettargetfile(cfg, "target", "ConsoleExe", "linux"))
+ end
+
+ function T.project.gettargetfile_OnMacOSXConsole()
+ test.isequal("MyPackage", premake.project.gettargetfile(cfg, "target", "ConsoleExe", "macosx"))
+ end
+
+ function T.project.gettargetfile_OnBSDConsole()
+ test.isequal("MyPackage", premake.project.gettargetfile(cfg, "target", "ConsoleExe", "bsd"))
+ end
+
+ function T.project.gettargetfile_OnWindowsWindowed()
+ test.isequal("MyPackage.exe", premake.project.gettargetfile(cfg, "target", "WindowedExe", "windows"))
+ end
+
+ function T.project.gettargetfile_OnLinuxWindowed()
+ test.isequal("MyPackage", premake.project.gettargetfile(cfg, "target", "WindowedExe", "linux"))
+ end
+
+ function T.project.gettargetfile_OnMacOSXWindowed()
+ test.isequal("MyPackage.app/Contents/MacOS/MyPackage", premake.project.gettargetfile(cfg, "target", "WindowedExe", "macosx"))
+ end
+
+ function T.project.gettargetfile_OnBSDWindowed()
+ test.isequal("MyPackage", premake.project.gettargetfile(cfg, "target", "WindowedExe", "bsd"))
+ end
+
+ function T.project.gettargetfile_OnWindowsShared()
+ test.isequal("MyPackage.dll", premake.project.gettargetfile(cfg, "target", "SharedLib", "windows"))
+ end
+
+ function T.project.gettargetfile_OnLinuxShared()
+ test.isequal("libMyPackage.so", premake.project.gettargetfile(cfg, "target", "SharedLib", "linux"))
+ end
+
+ function T.project.gettargetfile_OnMacOSXShared()
+ test.isequal("libMyPackage.so", premake.project.gettargetfile(cfg, "target", "SharedLib", "macosx"))
+ end
+
+ function T.project.gettargetfile_OnBSDShared()
+ test.isequal("libMyPackage.so", premake.project.gettargetfile(cfg, "target", "SharedLib", "bsd"))
+ end
+
+ function T.project.gettargetfile_OnWindowsStatic()
+ test.isequal("MyPackage.lib", premake.project.gettargetfile(cfg, "target", "StaticLib", "windows"))
+ end
+
+ function T.project.gettargetfile_OnLinuxStatic()
+ test.isequal("libMyPackage.a", premake.project.gettargetfile(cfg, "target", "StaticLib", "linux"))
+ end
+
+ function T.project.gettargetfile_OnMacOSXStatic()
+ test.isequal("libMyPackage.a", premake.project.gettargetfile(cfg, "target", "StaticLib", "macosx"))
+ end
+
+ function T.project.gettargetfile_OnBSDStatic()
+ test.isequal("libMyPackage.a", premake.project.gettargetfile(cfg, "target", "StaticLib", "bsd"))
+ end
+
+
+
+--
+-- premake.setstring() tests
+--
+
+ function T.project.setstring_Sets_OnNewProperty()
+ premake.CurrentConfiguration = { }
+ premake.project.setstring("config", "myfield", "hello")
+ test.isequal("hello", premake.CurrentConfiguration.myfield)
+ end
+
+ function T.project.setstring_Overwrites_OnExistingProperty()
+ premake.CurrentConfiguration = { }
+ premake.CurrentConfiguration.myfield = "hello"
+ premake.project.setstring("config", "myfield", "goodbye")
+ test.isequal("goodbye", premake.CurrentConfiguration.myfield)
+ end
+
+ function T.project.setstring_RaisesError_OnInvalidValue()
+ premake.CurrentConfiguration = { }
+ ok, err = pcall(function () premake.project.setstring("config", "myfield", "bad", { "Good", "Better", "Best" }) end)
+ test.isfalse(ok)
+ end
+
+ function T.project.setstring_CorrectsCase_OnConstrainedValue()
+ premake.CurrentConfiguration = { }
+ premake.project.setstring("config", "myfield", "better", { "Good", "Better", "Best" })
+ test.isequal("Better", premake.CurrentConfiguration.myfield)
+ end
+
+
+--
+-- premake.setarray() tests
+--
+
+ function T.project.setarray_Inserts_OnStringValue()
+ premake.CurrentConfiguration = { }
+ premake.CurrentConfiguration.myfield = { }
+ premake.project.setarray("config", "myfield", "hello")
+ test.isequal("hello", premake.CurrentConfiguration.myfield[1])
+ end
+
+ function T.project.setarray_Inserts_OnTableValue()
+ premake.CurrentConfiguration = { }
+ premake.CurrentConfiguration.myfield = { }
+ premake.project.setarray("config", "myfield", { "hello", "goodbye" })
+ test.isequal("hello", premake.CurrentConfiguration.myfield[1])
+ test.isequal("goodbye", premake.CurrentConfiguration.myfield[2])
+ end
+
+ function T.project.setarray_Appends_OnNewValues()
+ premake.CurrentConfiguration = { }
+ premake.CurrentConfiguration.myfield = { "hello" }
+ premake.project.setarray("config", "myfield", "goodbye")
+ test.isequal("hello", premake.CurrentConfiguration.myfield[1])
+ test.isequal("goodbye", premake.CurrentConfiguration.myfield[2])
+ end
+
+ function T.project.setarray_FlattensTables()
+ premake.CurrentConfiguration = { }
+ premake.CurrentConfiguration.myfield = { }
+ premake.project.setarray("config", "myfield", { {"hello"}, {"goodbye"} })
+ test.isequal("hello", premake.CurrentConfiguration.myfield[1])
+ test.isequal("goodbye", premake.CurrentConfiguration.myfield[2])
+ end
+
+ function T.project.setarray_RaisesError_OnInvalidValue()
+ premake.CurrentConfiguration = { }
+ premake.CurrentConfiguration.myfield = { }
+ ok, err = pcall(function () premake.project.setarray("config", "myfield", "bad", { "Good", "Better", "Best" }) end)
+ test.isfalse(ok)
+ end
+
+ function T.project.setarray_CorrectsCase_OnConstrainedValue()
+ premake.CurrentConfiguration = { }
+ premake.CurrentConfiguration.myfield = { }
+ premake.project.setarray("config", "myfield", "better", { "Good", "Better", "Best" })
+ test.isequal("Better", premake.CurrentConfiguration.myfield[1])
+ end
+
diff --git a/tests/test_string.lua b/tests/test_string.lua
new file mode 100644
index 0000000..3ce1f1f
--- /dev/null
+++ b/tests/test_string.lua
@@ -0,0 +1,43 @@
+--
+-- tests/test_string.lua
+-- Automated test suite for the new string functions.
+-- Copyright (c) 2008 Jason Perkins and the Premake project
+--
+
+
+ T.string = { }
+
+
+--
+-- string.endswith() tests
+--
+
+ function T.string.endswith_ReturnsTrue_OnMatch()
+ test.istrue(string.endswith("Abcdef", "def"))
+ end
+
+ function T.string.endswith_ReturnsFalse_OnMismatch()
+ test.isfalse(string.endswith("Abcedf", "efg"))
+ end
+
+ function T.string.endswith_ReturnsFalse_OnLongerNeedle()
+ test.isfalse(string.endswith("Abc", "Abcdef"))
+ end
+
+ function T.string.endswith_ReturnsFalse_OnNilHaystack()
+ test.isfalse(string.endswith(nil, "ghi"))
+ end
+
+ function T.string.endswith_ReturnsFalse_OnNilNeedle()
+ test.isfalse(string.endswith("Abc", nil))
+ end
+
+
+
+--
+-- string.explode() tests
+--
+
+ function T.string.explode_ReturnsParts_OnValidCall()
+ test.isequal({"aaa","bbb","ccc"}, string.explode("aaa/bbb/ccc", "/", true))
+ end
diff --git a/tests/test_table.lua b/tests/test_table.lua
new file mode 100644
index 0000000..60b5c47
--- /dev/null
+++ b/tests/test_table.lua
@@ -0,0 +1,33 @@
+--
+-- tests/test_table.lua
+-- Automated test suite for the new table functions.
+-- Copyright (c) 2008 Jason Perkins and the Premake project
+--
+
+
+ T.table = { }
+
+
+--
+-- table.contains() tests
+--
+
+ function T.table.contains_OnContained()
+ t = { "one", "two", "three" }
+ test.istrue( table.contains(t, "two") )
+ end
+
+ function T.table.contains_OnNotContained()
+ t = { "one", "two", "three" }
+ test.isfalse( table.contains(t, "four") )
+ end
+
+
+--
+-- table.implode() tests
+--
+
+ function T.table.implode()
+ t = { "one", "two", "three", "four" }
+ test.isequal("[one], [two], [three], [four]", table.implode(t, "[", "]", ", "))
+ end
diff --git a/tests/test_template.lua b/tests/test_template.lua
new file mode 100644
index 0000000..a11de5f
--- /dev/null
+++ b/tests/test_template.lua
@@ -0,0 +1,45 @@
+--
+-- tests/test_template.lua
+-- Automated test suite for the templating system.
+-- Copyright (c) 2008 Jason Perkins and the Premake project
+--
+
+
+ T.template = { }
+
+--
+-- A test object.
+--
+
+ local obj = { }
+ obj.name = "MyProject"
+
+
+--
+-- template.encode() tests
+--
+
+ function T.template.encode_SimpleString()
+ t = "Hi there"
+ test.isequal("io.write[=[Hi there]=]", premake.template.encode(t))
+ end
+
+ function T.template.encode_TrailingNewline()
+ t = "Line 1\n"
+ test.isequal("io.write[=[Line 1]=]io.write(eol)\n", premake.template.encode(t))
+ end
+
+ function T.template.encode_LeadingNewlines()
+ t = "\nLine 1"
+ test.isequal("io.write(eol)\nio.write[=[Line 1]=]", premake.template.encode(t))
+ end
+
+ function T.template.encode_InlineExpression()
+ t = "Name is <%= this.name %>\nAnother Line"
+ test.isequal("io.write[=[Name is ]=]io.write( this.name )io.write(eol)\nio.write[=[Another Line]=]", premake.template.encode(t))
+ end
+
+ function T.template.encode_InlineStatement()
+ t = "Start\n <% for i=1,10 do %> \n item\n <%end%> \nDone\n"
+ test.isequal("io.write[=[Start]=]io.write(eol)\n for i=1,10 do \nio.write[=[ item]=]io.write(eol)\nend\nio.write[=[Done]=]io.write(eol)\n", premake.template.encode(t))
+ end
diff --git a/tests/testfx.lua b/tests/testfx.lua
new file mode 100644
index 0000000..7cdcce8
--- /dev/null
+++ b/tests/testfx.lua
@@ -0,0 +1,135 @@
+--
+-- tests/testfx.lua
+-- Automated test framework for Premake.
+-- Copyright (c) 2008 Jason Perkins and the Premake project
+--
+
+
+--
+-- Define a namespace for the testing functions
+--
+
+ test = { }
+
+
+--
+--
+
+--
+-- Assertion functions
+--
+
+ function test.fail(format, ...)
+ -- convert nils into something more usefuls
+ for i = 1, arg.n do
+ if (arg[i] == nil) then
+ arg[i] = "(nil)"
+ elseif (type(arg[i]) == "table") then
+ arg[i] = "{" .. table.concat(arg[i], ", ") .. "}"
+ end
+ end
+ error(string.format(format, unpack(arg)), 3)
+ end
+
+
+ function test.filecontains(expected, fn)
+ local f = io.open(fn)
+ local actual = f:read("*a")
+ f:close()
+ if (expected ~= actual) then
+ test.fail("expected %s but was %s", expected, actual)
+ end
+ end
+
+
+ function test.isequal(expected, actual)
+ if (type(expected) == "table") then
+ for k,v in pairs(expected) do
+ if (expected[k] ~= actual[k]) then
+ test.fail("expected %s but was %s", expected, actual)
+ end
+ end
+ else
+ if (expected ~= actual) then
+ test.fail("expected %s but was %s", expected, actual)
+ end
+ end
+ end
+
+
+ function test.isfalse(value)
+ if (value) then
+ test.fail("expected false but was true")
+ end
+ end
+
+
+ function test.isnil(value)
+ if (value ~= nil) then
+ test.fail("expected nil but was " .. tostring(value))
+ end
+ end
+
+
+ function test.istrue(value)
+ if (not value) then
+ test.fail("expected true but was false")
+ end
+ end
+
+
+--
+-- Define a collection for the test suites
+--
+
+ T = { }
+
+
+
+--
+-- Test execution function
+--
+
+ function test.runall()
+ local numpassed = 0
+ local numfailed = 0
+
+ -- HACK: reset the important global state. I'd love to find a
+ -- way to do this automatically; maybe later.
+ local function resetglobals()
+ _ACTION = "test"
+ _ARGS = { }
+ _OPTIONS = { }
+ _SOLUTIONS = { }
+ end
+
+ for suitename,suitetests in pairs(T) do
+ for testname, testfunc in pairs(suitetests) do
+ local setup = suitetests.setup
+ local teardown = suitetests.teardown
+ local ok = true
+
+ resetglobals()
+ if (setup) then
+ ok, err = pcall(setup)
+ end
+ if (ok) then
+ ok, err = pcall(testfunc)
+ end
+ if (ok and teardown) then
+ ok, err = pcall(teardown)
+ end
+
+ if (not ok) then
+ print(string.format("%s.%s: %s", suitename, testname, err))
+ numfailed = numfailed + 1
+ else
+ numpassed = numpassed + 1
+ end
+
+ end
+ end
+
+ return numpassed, numfailed
+ end
+