diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2016-05-21 17:16:13 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2016-05-31 19:04:33 +0300 |
commit | 9a1351808c7443a65f876d2b7808ebdea7d9c814 (patch) | |
tree | 80fedb517a43c64762bb71fa690c90a40824be33 /tests/manifest-roundtrip | |
parent | 057a5d5d435d53166d1b8751748a9ba0a317bee3 (diff) |
Port to MinGW
Diffstat (limited to 'tests/manifest-roundtrip')
-rw-r--r-- | tests/manifest-roundtrip/buildfile | 4 | ||||
-rw-r--r-- | tests/manifest-roundtrip/driver.cxx | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/tests/manifest-roundtrip/buildfile b/tests/manifest-roundtrip/buildfile index a830a01..793f955 100644 --- a/tests/manifest-roundtrip/buildfile +++ b/tests/manifest-roundtrip/buildfile @@ -2,7 +2,9 @@ # copyright : Copyright (c) 2014-2016 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file -exe{driver}: cxx{driver} ../../bpkg/lib{bpkg} +import libs += libbutl%lib{butl} + +exe{driver}: cxx{driver} ../../bpkg/lib{bpkg} $libs exe{driver}: test.roundtrip = manifest include ../../bpkg/ diff --git a/tests/manifest-roundtrip/driver.cxx b/tests/manifest-roundtrip/driver.cxx index 917dc50..4f9a965 100644 --- a/tests/manifest-roundtrip/driver.cxx +++ b/tests/manifest-roundtrip/driver.cxx @@ -2,13 +2,17 @@ // copyright : Copyright (c) 2014-2016 Code Synthesis Ltd // license : MIT; see accompanying LICENSE file +#include <cassert> #include <fstream> #include <iostream> +#include <butl/fdstream> // stdout_mode() + #include <bpkg/manifest-parser> #include <bpkg/manifest-serializer> using namespace std; +using namespace butl; using namespace bpkg; int @@ -24,9 +28,11 @@ main (int argc, char* argv[]) { ifstream ifs; ifs.exceptions (ifstream::badbit | ifstream::failbit); - ifs.open (argv[1], ifstream::in | ifstream::binary); + ifs.open (argv[1]); manifest_parser p (ifs, argv[1]); + + stdout_fdmode (fdtranslate::binary); // Write in binary mode. manifest_serializer s (cout, "stdout"); for (bool eom (true), eos (false); !eos; ) |