aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/init.testscript4
-rw-r--r--tests/new.testscript52
-rw-r--r--tests/release.testscript22
3 files changed, 66 insertions, 12 deletions
diff --git a/tests/init.testscript b/tests/init.testscript
index 4b4c8c7..002f2b2 100644
--- a/tests/init.testscript
+++ b/tests/init.testscript
@@ -135,7 +135,9 @@ deinit += -d prj
#
mkdir --no-cleanup prj/prj.pkg;
- mv prj/prj prj/build prj/buildfile prj/manifest prj/.gitignore prj/prj.pkg/;
+ mv prj/prj prj/build prj/buildfile prj/manifest prj/README.md \
+ prj/.gitignore prj/prj.pkg/;
+
mv prj/prj.pkg prj/prj;
cat <<EOI >=prj/packages.manifest;
diff --git a/tests/new.testscript b/tests/new.testscript
index 17f26a7..8a6ff65 100644
--- a/tests/new.testscript
+++ b/tests/new.testscript
@@ -98,6 +98,50 @@ status += -d prj
EOE
}
+ : exe-readme
+ :
+ {
+ : add
+ :
+ {
+ $* foo 2>>/"EOE" &foo/***;
+ created new executable project foo in $~/foo/
+ EOE
+
+ test -f foo/README.md;
+
+ cat foo/manifest >>~%EOE%;
+ %.+
+ description-file: README.md
+ %.+
+ EOE
+
+ cat foo/buildfile >>~%EOE%;
+ %.*
+ %.+ doc\{README.md\}.*%
+ %.*
+ EOE
+
+ $build foo/ $cxx 2>>~%EOE%
+ %(c\+\+|ld) .+%{2}
+ EOE
+ }
+
+ : omit
+ :
+ {
+ $* -t exe,no-readme foo 2>>/"EOE" &foo/***;
+ created new executable project foo in $~/foo/
+ EOE
+
+ test -f foo/README.md == 1;
+
+ $build foo/ $cxx 2>>~%EOE%
+ %(c\+\+|ld) .+%{2}
+ EOE
+ }
+ }
+
: lib-no-version
:
{
@@ -198,6 +242,10 @@ status += -d prj
created new empty project prj in $~/prj/
EOE
+ # While at it, test that README.md is created.
+ #
+ test -f prj/README.md;
+
$* --package -t lib libprj -d prj 2>>/"EOE";
created new library package libprj in $~/prj/libprj/
EOE
@@ -252,6 +300,10 @@ status += -d prj
created new library source subdirectory libprj in $~/prj/libprj/
EOE
+ # While at it, test that README.md is not created.
+ #
+ test -f prj/libprj/README.md == 1;
+
$build prj/ $cxx 2>>~%EOE%
%(c\+\+|ar|ld) .+%{6}
EOE
diff --git a/tests/release.testscript b/tests/release.testscript
index fc10ff7..0715280 100644
--- a/tests/release.testscript
+++ b/tests/release.testscript
@@ -87,7 +87,7 @@ log2 = $gp2 log '--pretty=format:"%d %s"'
%.*
name: prj
version: 0.2.0-a.0.z
- summary: prj executable
+ summary: prj C++ executable
%.*
EOO
}
@@ -452,23 +452,23 @@ log2 = $gp2 log '--pretty=format:"%d %s"'
{
$clone_root_repos;
- echo 'description-file: README' >+ prj/manifest;
- $gp commit -a -m 'Add description';
+ rm prj/README.md;
+ $gp commit -a -m 'Remove description';
$* 2>>~%EOE% != 0;
- %error: unable to read .+README referenced by description-file manifest value in .+manifest: .+%
+ %error: unable to read .+README\.md referenced by description-file manifest value in .+manifest: .+%
EOE
- touch prj/README;
- $gp add README;
- $gp commit -m 'Add README file';
+ touch prj/README.md;
+ $gp add README.md;
+ $gp commit -m 'Add README.md file';
$* 2>>~%EOE% != 0;
- %error: description-file manifest value in .+manifest references empty file .+README%
+ %error: description-file manifest value in .+manifest references empty file .+README.md%
EOE
- echo '.' >= prj/README;
- $gp commit -a -m 'Fill README file';
+ echo '.' >= prj/README.md;
+ $gp commit -a -m 'Fill README.md file';
$*
}
@@ -897,7 +897,7 @@ log2 = $gp2 log '--pretty=format:"%d %s"'
%.*
name: prj
version: 0.2.0-a.0.z
- summary: prj executable
+ summary: prj C++ executable
%.*
EOO