| | 40 | * With your web browser, sign into your [https://github.com GitHub] account and create a repository named {{{simple}}}. Select the option to automatically create a README file. Copy the URL of the newly created repository to your clipboard. |
| | 41 | * From the command line, {{{cd}}} to a directory suitable for experimentation, clone the newly created repository, and create the library's directory structure: |
| | 42 | {{{ |
| | 43 | git clone git@github.com:Beman/simple.git |
| | 44 | cd simple |
| | 45 | mkdir include |
| | 46 | mkdir test |
| | 47 | cd include |
| | 48 | mkdir boost |
| | 49 | cd boost |
| | 50 | mkdir simple |
| | 51 | }}} |
| | 52 | |
| | 53 | * Using a text editor, create a file named twice.hpp in simple/include/boost/simple: |
| | 54 | {{{ |
| | 55 | #include <string> |
| | 56 | namespace boost { namespace simple { |
| | 57 | inline std::string twice(const std::string& s) |
| | 58 | { |
| | 59 | return s + s; |
| | 60 | } |
| | 61 | }} |
| | 62 | }}} |
| | 63 | |
| | 64 | * {{{cd}}} to simple/test and create a file named twice_test.cpp using a text editor: |
| | 65 | {{{ |
| | 66 | #include <boost/simple/twice.hpp> |
| | 67 | #include <boost/detail/lightweight_test.hpp> |
| | 68 | |
| | 69 | int main() |
| | 70 | { |
| | 71 | BOOST_TEST(boost::simple::twice("foo") == "foofoo"); |
| | 72 | return ::boost::report_errors(); |
| | 73 | } |
| | 74 | }}} |
| | 75 | |
| | 76 | * Also in simple/test, create a file named Jamfile.v2 using a text editor. Be careful to leave spaces between syntax elements as they are required: |
| | 77 | {{{ |
| | 78 | test-suite simple : |
| | 79 | [ run twice_test.cpp ] |
| | 80 | ; |
| | 81 | }}} |
| | 82 | |
| | 83 | |
| | 84 | |
| | 85 | |