• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

exercism/cpp: Exercism exercises in C++.

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

exercism/cpp

开源软件地址:

https://github.com/exercism/cpp

开源编程语言:

C++ 99.7%

开源软件介绍:

C++

Exercism Exercises in C++

Contributing Guide

Please see the contributing guide

The most useful way to start contributing to this track is to review Pull Requests and/or some of the open track issues. There are not many active contributors, so anyone reviewing PRs or Issues, even just to +1 someone elses opinion, is appreciated.

Adding an exercise

Here is a list of things that need to be done to add an exercise to this track.

  1. Add the exercise under the exercises/ directory.
  2. Create your test suite based on the canonical tests in the problem specifications repo, and add a comment at the top of the test suite noting the version of the test suite it implements.
  3. Create an example solution and name the files example.cpp and example.h. example.cpp is optional but encouraged.
  4. Add the test to the list in the root CMakeLists.txt file.
  5. Add the test to the config.json file. The configlet can help generate a unique UUID. You can download configlet using the script in bin/fetch-configlet.
  6. Add at least one topic for the exercise in the config.json file. Check the available topics in TOPICS.txt.
  7. Use the configlet tool to generate the README for your exercise.
  8. Try to match the formatting used in the other tests as closely as possible.

Testing an exercise

The Exercism build system has two unusual constraints. First, example solutions must be named example.h and example.cpp; this prevents Exercism from sending these files to the student. Second, student solutions must be named <exercise>.h and <exercise>.cpp, for example anagram.h and anagram.cpp.

The current CMake build system navigates this with an unusual approach: it copies all example solutions from the exercises/ tree to an alternate directory (which is ignored by git), renames the solutions as if they were student exercises, and runs a complete build in this new directory.

Maintainers can largely ignore the alternate exercise directory if they recopy their example solution before running a build. Re-running CMake will recopy all exercise files.

For example, a maintainer can copy, configure, compile, and test all exercises by running the following from the root directory:

cmake . && make

For an individual exercise, in this example anagram, the maintainer should edit:

exercises/anagram/example.h
exercises/anagram/example.cpp
exercises/anagram/anagram_test.cpp

Then copy, configure, compile, and test with:

cmake . && make test_anagram



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
jbeder/yaml-cpp: A YAML parser and emitter in C++发布时间:2022-04-20
下一篇:
CppCon/CppCon2014: Speaker materials from CppCon 2014发布时间:2022-04-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap