Skip to content

Commit 3d692cf

Browse files
Document library support (#552)
* Add forum links (#550) * Add dod * Work * Work
1 parent ab4b053 commit 3d692cf

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

building/config.json

+7
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,13 @@
829829
"title": "The Test Runner Interface",
830830
"blurb": ""
831831
},
832+
{
833+
"uuid": "0ab39b58-771e-42dc-aac9-e531bf43034e",
834+
"slug": "tooling/test-runners/libraries",
835+
"path": "building/tooling/test-runners/libraries.md",
836+
"title": "Libraries",
837+
"blurb": ""
838+
},
832839
{
833840
"uuid": "a9cf4712-9022-4bd2-83aa-55cbdfd62374",
834841
"slug": "tooling/lines-of-code-counter",

building/tooling/test-runners/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ You can use the following documents to learn more about building a test runner:
2323
- [creating a Test Runner from scratch](/docs/building/tooling/test-runners/creating-from-scratch)
2424
- [The Test Runner interface](/docs/building/tooling/test-runners/interface)
2525
- [How to build a Docker image with Docker for local testing and deployment](/docs/building/tooling/test-runners/docker)
26+
- [When and how to support libraries](/docs/building/tooling/test-runners/libraries)
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Libraries
2+
3+
Exercism aims to teach [fluency](/docs/using/product/fluency) in the syntax, idioms, and the standard library of the language.
4+
This explicitly does _not_ mention external (non built-in) libraries, as that falls under _proficiency_.
5+
Exercises must thus, with few exceptions, be solvable without using libraries.
6+
7+
## Reasons to support libraries
8+
9+
There are couple of reasons why a track might still want to support libraries:
10+
11+
1. The language has a (very) minimal standard library.
12+
An example of such a language is Rust.
13+
2. The library adds testing functionality.
14+
An example is a library that adds support for property-based testing.
15+
3. The exercise can only be solved using a library.
16+
An example of such an exercise is the [lens-person exercise](https://exercism.org/exercises/lens-person), which in most languages can only be solved using a library.
17+
18+
## Supporting libraries in the test runner
19+
20+
As the test runner does not have access to the internet whilst running, it is not possible to download libraries at run time.
21+
The **only** solution to this problem is to install/download libraries at build time, where you _do_ have access to the internet.
22+
In practice, this means you'll need to install/download libraries within the Dockerfile.
23+
24+
As an example, the [Prolog test runner's Dockerfile](https://github.com/exercism/prolog-test-runner/blob/ed7447a7518ede6ee3405e649f50aaec828e318b/Dockerfile) installs the `date_time` library:
25+
26+
```dockerfile
27+
RUN swipl pack install date_time -y
28+
```
29+
30+
## Documentation
31+
32+
If your track supports libraries, this should be documented in a [track doc](/docs/building/tracks/docs).
33+
Please also link to this document (using its full URL) from the [`exercises/shared/.docs/help.md` document](/docs/building/tracks/shared-files#file-help-md).

0 commit comments

Comments
 (0)