diff --git a/CMakeLists.txt b/CMakeLists.txt index 09881459c..886c754af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -307,7 +307,7 @@ if(BUILD_TESTING) COMMAND hl ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test/threads.hl ) add_test(NAME uvsample.hl - COMMAND hl ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test/uvsample.hl + COMMAND hl ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test/uvsample.hl 6001 ) add_test(NAME hello COMMAND hello @@ -316,7 +316,7 @@ if(BUILD_TESTING) COMMAND threads ) add_test(NAME uvsample - COMMAND uvsample + COMMAND uvsample 6002 ) add_test(NAME version COMMAND hl --version diff --git a/other/uvsample/UVSample.hx b/other/uvsample/UVSample.hx index 9587177dc..9916d098b 100644 --- a/other/uvsample/UVSample.hx +++ b/other/uvsample/UVSample.hx @@ -37,11 +37,11 @@ class UVSample { */ var host = new sys.net.Host("localhost"); - var port = 6001; + var port = Std.parseInt(Sys.args()[0]); var totR = 0, totW = 0, totRB = 0; - log("Starting server"); + log('Starting server on port ${port}'); tcp.bind(host, port); tcp.listen(5, function() {