From 01f19205f2c742d0882957f0b8fa6ca80276cf44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Marqu=C3=ADnez=20Ferr=C3=A1ndiz?= Date: Thu, 21 Sep 2023 19:05:36 +0200 Subject: [PATCH] cmake: Allow running the uvsample tests in parallel (#518) Since they were using the same port they failed when running in parallel --- CMakeLists.txt | 4 ++-- other/uvsample/UVSample.hx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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() {