diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/manifest-roundtrip/buildfile | 3 | ||||
-rw-r--r-- | tests/manifest-roundtrip/driver.cxx | 26 | ||||
-rw-r--r-- | tests/manifest-roundtrip/manifest | 32 | ||||
-rw-r--r-- | tests/manifest-roundtrip/testscript | 78 |
4 files changed, 103 insertions, 36 deletions
diff --git a/tests/manifest-roundtrip/buildfile b/tests/manifest-roundtrip/buildfile index 8056f64..7ddcc1f 100644 --- a/tests/manifest-roundtrip/buildfile +++ b/tests/manifest-roundtrip/buildfile @@ -3,5 +3,4 @@ import libs = libbutl%lib{butl} -exe{driver}: {hxx cxx}{*} $libs -exe{driver}: manifest: test.roundtrip = true +exe{driver}: {hxx cxx}{*} $libs testscript diff --git a/tests/manifest-roundtrip/driver.cxx b/tests/manifest-roundtrip/driver.cxx index 4cf35e9..5dc5862 100644 --- a/tests/manifest-roundtrip/driver.cxx +++ b/tests/manifest-roundtrip/driver.cxx @@ -15,17 +15,39 @@ using namespace std; using namespace butl; +// Usage: argv[0] [-m] +// +// Round-trip a manifest reading it from stdin and printing to stdout. +// +// -m +// Serialize multi-line manifest values using the v2 form. +// int -main () +main (int argc, const char* argv[]) try { + bool multiline_v2 (false); + + for (int i (1); i != argc; ++i) + { + string v (argv[i]); + + if (v == "-m") + multiline_v2 = true; + } + // Read/write in binary mode. // stdin_fdmode (fdstream_mode::binary); stdout_fdmode (fdstream_mode::binary); manifest_parser p (cin, "stdin"); - manifest_serializer s (cout, "stdout"); + + manifest_serializer s (cout, + "stdout", + false /* long_lines */, + {} /* filter */, + multiline_v2); for (bool eom (true), eos (false); !eos; ) { diff --git a/tests/manifest-roundtrip/manifest b/tests/manifest-roundtrip/manifest deleted file mode 100644 index 4926e29..0000000 --- a/tests/manifest-roundtrip/manifest +++ /dev/null @@ -1,32 +0,0 @@ -: 1 -name: libbpkg -version: 1.0.1 -summary: build2 package manager library -license: MIT -tags: c++, package, manager, bpkg -description: A very very very very very very very very very very very very\ - very very very very very very very very very very very very very very very\ - very very long description. -changes:\ -1.0.1 - - Fixed a very very very very very very very very very very very very very\ - very annoying bug. -1.0.0 - - Firts public release - - Lots of really cool features -\ -url: http://www.codesynthesis.com/projects/libstudxml/ -email: build-users@codesynthesis.com; Public mailing list, posts by\ - non-members are allowed but moderated. -package-email: boris@codesynthesis.com; Direct email to the author. -depends: libbutl -depends: * build2 -depends: ?* bpkg -requires: ?* linux | windows -requires: c++11 -: -path: c:\windows\\ -path:\ - -c:\windows\\ -\ diff --git a/tests/manifest-roundtrip/testscript b/tests/manifest-roundtrip/testscript new file mode 100644 index 0000000..91db8b5 --- /dev/null +++ b/tests/manifest-roundtrip/testscript @@ -0,0 +1,78 @@ +# file : tests/manifest-roundtrip/testscript +# license : MIT; see accompanying LICENSE file + +: basics +: +$* <<EOF >>EOF + : 1 + name: libbpkg + version: 1.0.1 + summary: build2 package manager library + license: MIT + tags: c++, package, manager, bpkg + description: A very very very very very very very very very very very very\ + very very very very very very very very very very very very very very very\ + very very long description. + changes:\ + 1.0.1 + - Fixed a very very very very very very very very very very very very very\ + very annoying bug. + 1.0.0 + - Firts public release + - Lots of really cool features + \ + url: http://www.codesynthesis.com/projects/libstudxml/ + email: build-users@codesynthesis.com; Public mailing list, posts by\ + non-members are allowed but moderated. + package-email: boris@codesynthesis.com; Direct email to the author. + depends: libbutl + depends: * build2 + depends: ?* bpkg + requires: ?* linux | windows + requires: c++11 + : + path: c:\windows\\ + path:\ + + c:\windows\\ + \ + EOF + +: multiline-v2 +: +$* -m <<EOF >>EOF + : 1 + name: libbpkg + version: 1.0.1 + summary: build2 package manager library + license: MIT + tags: c++, package, manager, bpkg + description: A very very very very very very very very very very very very\ + very very very very very very very very very very very very very very very\ + very very long description. + changes: + \ + 1.0.1 + - Fixed a very very very very very very very very very very very very very\ + very annoying bug. + 1.0.0 + - Firts public release + - Lots of really cool features + \ + url: http://www.codesynthesis.com/projects/libstudxml/ + email: build-users@codesynthesis.com; Public mailing list, posts by\ + non-members are allowed but moderated. + package-email: boris@codesynthesis.com; Direct email to the author. + depends: libbutl + depends: * build2 + depends: ?* bpkg + requires: ?* linux | windows + requires: c++11 + : + path: c:\windows\\ + path: + \ + + c:\windows\\ + \ + EOF |