Skip to content

Commit

Permalink
Fix Travis and AppVeyor builds. Fix version of meson project.
Browse files Browse the repository at this point in the history
  • Loading branch information
schveiguy committed Jul 26, 2020
1 parent be771da commit ed34eab
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ addons:
- libssl-dev
- pkg-config
- zlib1g-dev
- ninja-build
# - ninja-build
- python3
- python3-pip
- python3-setuptools
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
project('io', 'd', default_options: ['optimization=3'], version: '0.2.5', license: 'BSL-1.0' )
project('io', 'd', default_options: ['optimization=3'], version: '0.3.0', license: 'BSL-1.0' )
common_project_arguments = ['-release'] #, '--d-debug'
add_project_arguments(common_project_arguments, language: 'd')

Expand Down
2 changes: 1 addition & 1 deletion src/std/io/driver/package.d
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ version(Windows)
STD_OUTPUT_HANDLE,
STD_ERROR_HANDLE,
];
return GetStdHandle(handles[fd]);
return () @trusted { return GetStdHandle(handles[fd]); }();
}
}
else version(Posix)
Expand Down
3 changes: 2 additions & 1 deletion src/std/io/file.d
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ private:
}

auto f = File("temp.txt", mode!"w");
scope(exit) remove("temp.txt");
f = use(f.move);
f = File("temp.txt", Mode.read);
ubyte[4] buf;
Expand All @@ -417,7 +418,7 @@ private:
f.read(a[], b[]);
assert(a[] == [4, 5]);
assert(b[] == [6, 7]);
remove("temp.txt");
//remove("temp.txt");
}

version (unittest) private void remove(in char[] path) @trusted @nogc
Expand Down
1 change: 0 additions & 1 deletion src/std/io/net/socket.d
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,6 @@ struct Socket
auto s = this.s;
auto cod = this.closeOnDestroy;
this.s = Driver.SOCKET.INVALID;
this.s = Driver.SOCKET.INVALID;
return Socket(s, cod);
}

Expand Down
7 changes: 4 additions & 3 deletions src/std/io/package.d
Original file line number Diff line number Diff line change
Expand Up @@ -205,16 +205,17 @@ IOObject!IO ioObject(IO)(IO io)
/// takes and interface
static ubyte[] consume(scope Input input, return ubyte[] buf) @safe
{

return buf[0 .. input.read(buf)];
}

ubyte[4] ping = ['p', 'i', 'n', 'g'];

File("temp.txt", mode!"w").write(ping[]);
File("UT_1.txt", mode!"w").write(ping[]);
scope (exit)
remove("temp.txt");
remove("UT_1.txt");

auto file = ioObject(File("temp.txt"));
auto file = ioObject(File("UT_1.txt"));
ubyte[4] buf;
assert(consume(file, buf[]) == ping[]);

Expand Down
2 changes: 1 addition & 1 deletion travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fi
case "${BUILD_TOOL}" in
meson)
pip3 install --user --upgrade pip
pip install --user --upgrade meson
pip install --user --upgrade meson ninja
meson builddir -Drun_test=true
ninja -C builddir test
;;
Expand Down

0 comments on commit ed34eab

Please sign in to comment.