summaryrefslogtreecommitdiff
path: root/reference.md-disabled
blob: 25e41890e7890d2af4f4f35fb1395f6aea751c56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80

# Introduction

This document describes how we guard against accidental breaking
changes in Subplot by running it against a curated set of subplot
documents.

# Subplot

## Produce a PDF

~~~scenario
given an installed subplot
given a clone of https://gitlab.com/subplot/subplot.git in src at 96371571338767e776f7de583ddbea4512ceeba1
when I docgen subplot.md to test.pdf, in src
then file src/test.pdf exists
~~~

## Produce HTML page

~~~scenario
given an installed subplot
given a clone of https://gitlab.com/subplot/subplot.git in src at 96371571338767e776f7de583ddbea4512ceeba1
when I docgen subplot.md to test.html, in src
when I run, in src, subplot docgen subplot.md -o subplot.html
then file src/test.html exists
~~~

## Generate and run test program

~~~scenario
given an installed subplot
given file run_test.sh
given a clone of https://gitlab.com/subplot/subplot.git in src at 96371571338767e776f7de583ddbea4512ceeba1
when I run, in src, subplot codegen subplot.md -o test-inner.py
when I run bash run_test.sh
then command is successful
~~~

~~~{#run_test.sh .file .sh}
#!/bin/bash

set -euo pipefail

N=100

if python3 src/test-inner.py --log test-inner.log --env "PATH=$PATH" --env SUBPLOT_DIR=/
then
    exit=0
else
    exit="$?"
fi

if [ "$exit" != 0 ]
then
    # Failure. Show end of inner log file.

    echo "last $N lines of test-inner.log:"
    tail "-n$N" test-inner.log | sed 's/^/    /'
fi

exit "$exit"
~~~


---
title: Test Subplot against reference subplots
author: The Subplot project
bindings:
- reference.yaml
- subplot.yaml
- lib/runcmd.yaml
- lib/files.yaml
impls:
  python:
    - reference.py
    - subplot.py
    - lib/files.py
    - lib/runcmd.py
...