I ended up creating the following project structure: . ├── dub.sdl ├── dub.selections.json ├── source │ ├── arcam_protocol.d │ └── main.d ├── tests │ └── integration_tests.d └── test_support └── mock_avr850 └── main.d
with the following Dub control file: name "arcamclient" description "arcamclient is a Rust/gtk-rs/GTK+ desktop application to control an Arcam amplifier over the Ethernet connection." authors "Russel Winder" copyright "Copyright © 2020 Russel Winder." license "GPL-3.0" targetType "executable" targetPath "bin" configuration "application" { } configuration "unittest" { targetName "arcamclient_test" dependency "unit-threaded" version="*" mainSourceFile "bin/ut.d" excludedSourceFiles "source/main.d" preBuildCommands "$DUB run --compiler=$$DC unit-threaded -c gen_ut_main -- -f bin/ut.d -d $DUB" preBuildCommands "$DUB build arcamclient:mock_avr850" importPaths "tests" sourcePaths "tests" } subPackage { name "mock_avr850" targetName "mock_avr850" targetType "executable" targetPath "bin" sourcePaths "source" "test_support/mock_avr850" importPaths "source" "test_support/mock_avr850" excludedSourceFiles "source/main.d" } This seems a bit more sensible that what I have been able to achieve with Rust, but is still second rate compared to how easy things are using Python. Now I discover Python, Rust, and Go have far nicer abstractions for writing Internet code than D does. Does D really not have a TcpListener abstraction? To date all I can get is: std.socket.SocketOSException@std/socket.d(2792): Unable to bind socket: Bad file descriptor when trying to open a TCP server on 127.0.0.1:50000, with Python, Rust, or Go it all worked first time. This is really sad given D has so many advantages over Rust. :-( -- Russel. =========================================== Dr Russel Winder t: +44 20 7585 2200 41 Buckmaster Road m: +44 7770 465 077 London SW11 1EN, UK w: www.russel.org.uk
signature.asc
Description: This is a digitally signed message part