From eebdf078fcbd5b69e0ed70adcb3c6d1d0c50343e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 28 Sep 2021 13:48:18 +0200 Subject: Move runtime tests from cli-tests/ to cli/tests/ --- cli-tests/headings/buildfile | 6 -- cli-tests/headings/testscript | 36 -------- cli-tests/note/buildfile | 6 -- cli-tests/note/testscript | 197 ---------------------------------------- cli-tests/toc/buildfile | 6 -- cli-tests/toc/testscript | 155 ------------------------------- cli/tests/.gitignore | 2 + cli/tests/build/.gitignore | 3 + cli/tests/build/bootstrap.build | 8 ++ cli/tests/build/root.build | 8 ++ cli/tests/buildfile | 4 + cli/tests/headings/buildfile | 8 ++ cli/tests/headings/testscript | 36 ++++++++ cli/tests/note/buildfile | 8 ++ cli/tests/note/testscript | 197 ++++++++++++++++++++++++++++++++++++++++ cli/tests/toc/buildfile | 8 ++ cli/tests/toc/testscript | 155 +++++++++++++++++++++++++++++++ 17 files changed, 437 insertions(+), 406 deletions(-) delete mode 100644 cli-tests/headings/buildfile delete mode 100644 cli-tests/headings/testscript delete mode 100644 cli-tests/note/buildfile delete mode 100644 cli-tests/note/testscript delete mode 100644 cli-tests/toc/buildfile delete mode 100644 cli-tests/toc/testscript create mode 100644 cli/tests/.gitignore create mode 100644 cli/tests/build/.gitignore create mode 100644 cli/tests/build/bootstrap.build create mode 100644 cli/tests/build/root.build create mode 100644 cli/tests/buildfile create mode 100644 cli/tests/headings/buildfile create mode 100644 cli/tests/headings/testscript create mode 100644 cli/tests/note/buildfile create mode 100644 cli/tests/note/testscript create mode 100644 cli/tests/toc/buildfile create mode 100644 cli/tests/toc/testscript diff --git a/cli-tests/headings/buildfile b/cli-tests/headings/buildfile deleted file mode 100644 index af3ae75..0000000 --- a/cli-tests/headings/buildfile +++ /dev/null @@ -1,6 +0,0 @@ -# file : headings/buildfile -# license : MIT; see accompanying LICENSE file - -./: testscript $cli - -testscript{*}: test = $cli diff --git a/cli-tests/headings/testscript b/cli-tests/headings/testscript deleted file mode 100644 index 0efb7ae..0000000 --- a/cli-tests/headings/testscript +++ /dev/null @@ -1,36 +0,0 @@ -# file : headings/testscript -# license : MIT; see accompanying LICENSE file - -: auto-headings -: -: Note that auto-headings break if we split into multiple doc strings. -: -cat <=map.cli; -" -\h1|Heading 1| - -\h|Heading 1.1| - -\h2|Heading 1.1.1| - -\h|Heading 1.2| - -\h2|Heading 1.2.1| - -\h1|Heading 2| -" -EOI -$* --generate-html --stdout map.cli >>EOO -

Heading 1

- -

Heading 1.1

- -

Heading 1.1.1

- -

Heading 1.2

- -

Heading 1.2.1

- -

Heading 2

- -EOO diff --git a/cli-tests/note/buildfile b/cli-tests/note/buildfile deleted file mode 100644 index c8cf49b..0000000 --- a/cli-tests/note/buildfile +++ /dev/null @@ -1,6 +0,0 @@ -# file : note/buildfile -# license : MIT; see accompanying LICENSE file - -./: testscript $cli - -testscript{*}: test = $cli diff --git a/cli-tests/note/testscript b/cli-tests/note/testscript deleted file mode 100644 index 9f00811..0000000 --- a/cli-tests/note/testscript +++ /dev/null @@ -1,197 +0,0 @@ -# file : note/testscript -# license : MIT; see accompanying LICENSE file - -: block-basics -: -cat <=test.cli; -" -Leading paragraph. - -\N|This is a note block one.| - -Interleaving paragraph that is quite long and therefore it may span many -lines in order to make text easy to read. - -\N|This is a note block two that is quite long and therefore it may span many -lines in order to make text easy to read.| - -Trailing paragraph. -" -EOI -$* --generate-html --stdout test.cli >>EOO; -

Leading paragraph.

- -
-

This is a note block one.

-
- -

Interleaving paragraph that is quite long and therefore it may span many - lines in order to make text easy to read.

- -
-

This is a note block two that is quite long and therefore it may span - many lines in order to make text easy to read.

-
- -

Trailing paragraph.

- -EOO - $* --generate-txt --stdout test.cli >>EOO -Leading paragraph. - -| This is a note block one. - -Interleaving paragraph that is quite long and therefore it may span many lines -in order to make text easy to read. - -| This is a note block two that is quite long and therefore it may span many -| lines in order to make text easy to read. - -Trailing paragraph. -EOO - - -: block-multi-para -: -cat <=test.cli; -" -\N| -This is a note para one that is quite long and therefore it may span many -lines in order to make text easy to read. - -This is a note para two. -| -" -EOI -$* --generate-html --stdout test.cli >>EOO; -
-

This is a note para one that is quite long and therefore it may span many - lines in order to make text easy to read.

- -

This is a note para two.

-
- -EOO -$* --generate-txt --stdout test.cli >>EOO -| This is a note para one that is quite long and therefore it may span many -| lines in order to make text easy to read. -| -| This is a note para two. -EOO - -: block-pre -: -cat <=test.cli; -" - -\N| -This is a note para one. - -\ -And this is a -pre-formatter text fragment. -\ - -| -" -EOI -$* --generate-html --stdout test.cli >>EOO; -
-

This is a note para one.

- -
And this is a
-pre-formatter text fragment.
-
- -EOO -$* --generate-txt --stdout test.cli >>EOO -| This is a note para one. -| -| And this is a -| pre-formatter text fragment. -EOO - -# This is not yet supported (see txt_wrap_lines()). -# -#\ -: block-list -: -cat <=test.cli; -" -\N|This is a note para one followed by a list. - -\ul| - -\li|This is a list item that is quite long and therefore it may span many -lines in order to make text easy to read.||| -" -EOI -$* --generate-html --stdout test.cli >>EOO; -EOO -$* --generate-txt --stdout test.cli >>EOO -EOO -#\ - -: block-in-list -: -cat <=test.cli; -" -\ul| - -\li|Normal text para. - -\N|This is a note para one that is quite long and therefore it may span many -lines in order to make text easy to read.||| -" -EOI -$* --generate-html --stdout test.cli >>EOO; -
    -
  • Normal text para. - -
    -

    This is a note para one that is quite long and therefore it may span many - lines in order to make text easy to read.

    -
  • -
- -EOO -$* --generate-txt --stdout test.cli >>EOO -* Normal text para. - - | This is a note para one that is quite long and therefore it may span many - | lines in order to make text easy to read. -EOO - - -: span-basics -: -cat <=test.cli; -" -This is normal text. \N{This is a note.} And this is normal text again. -" -EOI -$* --generate-html --stdout test.cli >>EOO; -

This is normal text. This is a note. And this - is normal text again.

- -EOO - $* --generate-txt --stdout test.cli >>EOO -This is normal text. [Note: This is a note.] And this is normal text again. -EOO - - -: span-nested-link -: -cat <=test.cli; -" -\N{This is a note with a \l{https://example.com link} inside.} -" -EOI -$* --generate-html --stdout test.cli >>EOO; -

This is a note with a link inside.

- -EOO -$* --generate-txt --stdout test.cli >>EOO -[Note: This is a note with a link (https://example.com) inside.] -EOO diff --git a/cli-tests/toc/buildfile b/cli-tests/toc/buildfile deleted file mode 100644 index 3be6359..0000000 --- a/cli-tests/toc/buildfile +++ /dev/null @@ -1,6 +0,0 @@ -# file : toc/buildfile -# license : MIT; see accompanying LICENSE file - -./: testscript $cli - -testscript{*}: test = $cli diff --git a/cli-tests/toc/testscript b/cli-tests/toc/testscript deleted file mode 100644 index 70e9065..0000000 --- a/cli-tests/toc/testscript +++ /dev/null @@ -1,155 +0,0 @@ -# file : toc/testscript -# license : MIT; see accompanying LICENSE file - -: toc -: -cat <=toc.cli; -"\h1|Table of Contents|" -"\$TOC$" - -" -\h0#preface|Preface| - -This document describes something awesome. - -\h#about-document|About This Document| - -And this document is also awesome. - -\h#more-information|More Information| - -It is so awesome that no further information will be required." - -" -\H#part1|PART I| - -Start of part one. - -\h1#intro|Introduction| - -Beginning of the first chapter. - -\h#arch-flow|Architecture and Workflow| - -Some basics. - -\h#benefits|Benefits| - -You will like them. - -\h1#hello|Hello World| - -Beginning of the second chapter. - -\h#hell-setup|Setup| - -More basics. - -\h#hello-compile|Compiling| - -How to build the example - -\h2#hello-compile-gcc|Compiling with GCC| - -GCC. For Clang see \l{#hello-compile-clang Compiling with Clang}. - -\h2#hello-compile-clang|Compiling with Clang| - -Clang. For GCC see \l{#hello-compile-gcc Compiling with GCC}. - -\h#hello-conclusion|Conclusion| - -Some remarks. -" -EOI -$* --generate-html --stdout toc.cli >>EOO -

Table of Contents

- - - - - - -
Preface - - - -
About -This Document
More -Information
-
PART I
1Introduction - - - -
1.1Architecture and -Workflow
1.2Benefits
-
2Hello World - - - - -
2.1Setup
2.2Compiling - - - -
2.2.1Compiling with -GCC
2.2.2Compiling -with Clang
-
2.3Conclusion
-
- -

Preface

- -

This document describes something awesome.

- -

About This Document

- -

And this document is also awesome.

- -

More Information

- -

It is so awesome that no further information will be required.

- -

PART I

- -

Start of part one.

- -

1 Introduction

- -

Beginning of the first chapter.

- -

1.1 Architecture and Workflow

- -

Some basics.

- -

1.2 Benefits

- -

You will like them.

- -

2 Hello World

- -

Beginning of the second chapter.

- -

2.1 Setup

- -

More basics.

- -

2.2 Compiling

- -

How to build the example

- -

2.2.1 Compiling with GCC

- -

GCC. For Clang see Compiling with - Clang.

- -

2.2.2 Compiling with Clang

- -

Clang. For GCC see Compiling with - GCC.

- -

2.3 Conclusion

- -

Some remarks.

- -EOO diff --git a/cli/tests/.gitignore b/cli/tests/.gitignore new file mode 100644 index 0000000..d4a788b --- /dev/null +++ b/cli/tests/.gitignore @@ -0,0 +1,2 @@ +test +test-* diff --git a/cli/tests/build/.gitignore b/cli/tests/build/.gitignore new file mode 100644 index 0000000..4a730a3 --- /dev/null +++ b/cli/tests/build/.gitignore @@ -0,0 +1,3 @@ +config.build +root/ +bootstrap/ diff --git a/cli/tests/build/bootstrap.build b/cli/tests/build/bootstrap.build new file mode 100644 index 0000000..bb305a2 --- /dev/null +++ b/cli/tests/build/bootstrap.build @@ -0,0 +1,8 @@ +# file : tests/build/bootstrap.build +# license : MIT; see accompanying LICENSE file + +project = + +using config +using dist +using test diff --git a/cli/tests/build/root.build b/cli/tests/build/root.build new file mode 100644 index 0000000..cb9ba03 --- /dev/null +++ b/cli/tests/build/root.build @@ -0,0 +1,8 @@ +# file : tests/build/root.build +# license : MIT; see accompanying LICENSE file + +# Configure C++ module and specify the test target for cross-testing. +# +using cxx.config + +test.target = $cxx.target diff --git a/cli/tests/buildfile b/cli/tests/buildfile new file mode 100644 index 0000000..556ed55 --- /dev/null +++ b/cli/tests/buildfile @@ -0,0 +1,4 @@ +# file : tests/buildfile +# license : MIT; see accompanying LICENSE file + +./: {*/ -build/} diff --git a/cli/tests/headings/buildfile b/cli/tests/headings/buildfile new file mode 100644 index 0000000..aa665c7 --- /dev/null +++ b/cli/tests/headings/buildfile @@ -0,0 +1,8 @@ +# file : tests/headings/buildfile +# license : MIT; see accompanying LICENSE file + +import! [metadata] cli = cli%exe{cli} + +./: testscript $cli + +testscript{*}: test = $cli diff --git a/cli/tests/headings/testscript b/cli/tests/headings/testscript new file mode 100644 index 0000000..163ba5f --- /dev/null +++ b/cli/tests/headings/testscript @@ -0,0 +1,36 @@ +# file : tests/headings/testscript +# license : MIT; see accompanying LICENSE file + +: auto-headings +: +: Note that auto-headings break if we split into multiple doc strings. +: +cat <=map.cli; +" +\h1|Heading 1| + +\h|Heading 1.1| + +\h2|Heading 1.1.1| + +\h|Heading 1.2| + +\h2|Heading 1.2.1| + +\h1|Heading 2| +" +EOI +$* --generate-html --stdout map.cli >>EOO +

Heading 1

+ +

Heading 1.1

+ +

Heading 1.1.1

+ +

Heading 1.2

+ +

Heading 1.2.1

+ +

Heading 2

+ +EOO diff --git a/cli/tests/note/buildfile b/cli/tests/note/buildfile new file mode 100644 index 0000000..b35a911 --- /dev/null +++ b/cli/tests/note/buildfile @@ -0,0 +1,8 @@ +# file : tests/note/buildfile +# license : MIT; see accompanying LICENSE file + +import! [metadata] cli = cli%exe{cli} + +./: testscript $cli + +testscript{*}: test = $cli diff --git a/cli/tests/note/testscript b/cli/tests/note/testscript new file mode 100644 index 0000000..52bcecc --- /dev/null +++ b/cli/tests/note/testscript @@ -0,0 +1,197 @@ +# file : tests/note/testscript +# license : MIT; see accompanying LICENSE file + +: block-basics +: +cat <=test.cli; +" +Leading paragraph. + +\N|This is a note block one.| + +Interleaving paragraph that is quite long and therefore it may span many +lines in order to make text easy to read. + +\N|This is a note block two that is quite long and therefore it may span many +lines in order to make text easy to read.| + +Trailing paragraph. +" +EOI +$* --generate-html --stdout test.cli >>EOO; +

Leading paragraph.

+ +
+

This is a note block one.

+
+ +

Interleaving paragraph that is quite long and therefore it may span many + lines in order to make text easy to read.

+ +
+

This is a note block two that is quite long and therefore it may span + many lines in order to make text easy to read.

+
+ +

Trailing paragraph.

+ +EOO + $* --generate-txt --stdout test.cli >>EOO +Leading paragraph. + +| This is a note block one. + +Interleaving paragraph that is quite long and therefore it may span many lines +in order to make text easy to read. + +| This is a note block two that is quite long and therefore it may span many +| lines in order to make text easy to read. + +Trailing paragraph. +EOO + + +: block-multi-para +: +cat <=test.cli; +" +\N| +This is a note para one that is quite long and therefore it may span many +lines in order to make text easy to read. + +This is a note para two. +| +" +EOI +$* --generate-html --stdout test.cli >>EOO; +
+

This is a note para one that is quite long and therefore it may span many + lines in order to make text easy to read.

+ +

This is a note para two.

+
+ +EOO +$* --generate-txt --stdout test.cli >>EOO +| This is a note para one that is quite long and therefore it may span many +| lines in order to make text easy to read. +| +| This is a note para two. +EOO + +: block-pre +: +cat <=test.cli; +" + +\N| +This is a note para one. + +\ +And this is a +pre-formatter text fragment. +\ + +| +" +EOI +$* --generate-html --stdout test.cli >>EOO; +
+

This is a note para one.

+ +
And this is a
+pre-formatter text fragment.
+
+ +EOO +$* --generate-txt --stdout test.cli >>EOO +| This is a note para one. +| +| And this is a +| pre-formatter text fragment. +EOO + +# This is not yet supported (see txt_wrap_lines()). +# +#\ +: block-list +: +cat <=test.cli; +" +\N|This is a note para one followed by a list. + +\ul| + +\li|This is a list item that is quite long and therefore it may span many +lines in order to make text easy to read.||| +" +EOI +$* --generate-html --stdout test.cli >>EOO; +EOO +$* --generate-txt --stdout test.cli >>EOO +EOO +#\ + +: block-in-list +: +cat <=test.cli; +" +\ul| + +\li|Normal text para. + +\N|This is a note para one that is quite long and therefore it may span many +lines in order to make text easy to read.||| +" +EOI +$* --generate-html --stdout test.cli >>EOO; +
    +
  • Normal text para. + +
    +

    This is a note para one that is quite long and therefore it may span many + lines in order to make text easy to read.

    +
  • +
+ +EOO +$* --generate-txt --stdout test.cli >>EOO +* Normal text para. + + | This is a note para one that is quite long and therefore it may span many + | lines in order to make text easy to read. +EOO + + +: span-basics +: +cat <=test.cli; +" +This is normal text. \N{This is a note.} And this is normal text again. +" +EOI +$* --generate-html --stdout test.cli >>EOO; +

This is normal text. This is a note. And this + is normal text again.

+ +EOO + $* --generate-txt --stdout test.cli >>EOO +This is normal text. [Note: This is a note.] And this is normal text again. +EOO + + +: span-nested-link +: +cat <=test.cli; +" +\N{This is a note with a \l{https://example.com link} inside.} +" +EOI +$* --generate-html --stdout test.cli >>EOO; +

This is a note with a link inside.

+ +EOO +$* --generate-txt --stdout test.cli >>EOO +[Note: This is a note with a link (https://example.com) inside.] +EOO diff --git a/cli/tests/toc/buildfile b/cli/tests/toc/buildfile new file mode 100644 index 0000000..50a9ec0 --- /dev/null +++ b/cli/tests/toc/buildfile @@ -0,0 +1,8 @@ +# file : tests/toc/buildfile +# license : MIT; see accompanying LICENSE file + +import! [metadata] cli = cli%exe{cli} + +./: testscript $cli + +testscript{*}: test = $cli diff --git a/cli/tests/toc/testscript b/cli/tests/toc/testscript new file mode 100644 index 0000000..6b3ff3e --- /dev/null +++ b/cli/tests/toc/testscript @@ -0,0 +1,155 @@ +# file : tests/toc/testscript +# license : MIT; see accompanying LICENSE file + +: toc +: +cat <=toc.cli; +"\h1|Table of Contents|" +"\$TOC$" + +" +\h0#preface|Preface| + +This document describes something awesome. + +\h#about-document|About This Document| + +And this document is also awesome. + +\h#more-information|More Information| + +It is so awesome that no further information will be required." + +" +\H#part1|PART I| + +Start of part one. + +\h1#intro|Introduction| + +Beginning of the first chapter. + +\h#arch-flow|Architecture and Workflow| + +Some basics. + +\h#benefits|Benefits| + +You will like them. + +\h1#hello|Hello World| + +Beginning of the second chapter. + +\h#hell-setup|Setup| + +More basics. + +\h#hello-compile|Compiling| + +How to build the example + +\h2#hello-compile-gcc|Compiling with GCC| + +GCC. For Clang see \l{#hello-compile-clang Compiling with Clang}. + +\h2#hello-compile-clang|Compiling with Clang| + +Clang. For GCC see \l{#hello-compile-gcc Compiling with GCC}. + +\h#hello-conclusion|Conclusion| + +Some remarks. +" +EOI +$* --generate-html --stdout toc.cli >>EOO +

Table of Contents

+ + + + + + +
Preface + + + +
About +This Document
More +Information
+
PART I
1Introduction + + + +
1.1Architecture and +Workflow
1.2Benefits
+
2Hello World + + + + +
2.1Setup
2.2Compiling + + + +
2.2.1Compiling with +GCC
2.2.2Compiling +with Clang
+
2.3Conclusion
+
+ +

Preface

+ +

This document describes something awesome.

+ +

About This Document

+ +

And this document is also awesome.

+ +

More Information

+ +

It is so awesome that no further information will be required.

+ +

PART I

+ +

Start of part one.

+ +

1 Introduction

+ +

Beginning of the first chapter.

+ +

1.1 Architecture and Workflow

+ +

Some basics.

+ +

1.2 Benefits

+ +

You will like them.

+ +

2 Hello World

+ +

Beginning of the second chapter.

+ +

2.1 Setup

+ +

More basics.

+ +

2.2 Compiling

+ +

How to build the example

+ +

2.2.1 Compiling with GCC

+ +

GCC. For Clang see Compiling with + Clang.

+ +

2.2.2 Compiling with Clang

+ +

Clang. For GCC see Compiling with + GCC.

+ +

2.3 Conclusion

+ +

Some remarks.

+ +EOO -- cgit v1.1