Skip to content

Commit

Permalink
cmake: Allow running the uvsample tests in parallel (#518)
Browse files Browse the repository at this point in the history
Since they were using the same port they failed when running in parallel
  • Loading branch information
jaimeMF authored Sep 21, 2023
1 parent be64c2c commit 01f1920
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions other/uvsample/UVSample.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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() {

Expand Down

0 comments on commit 01f1920

Please sign in to comment.