fix execution of network test to correctly load library

This commit is contained in:
Arnaud Bailly 2019-07-28 22:23:26 +02:00
parent f6b746e7ac
commit 75459e7fca
No known key found for this signature in database
GPG Key ID: 389CC2BC5448321E
3 changed files with 4 additions and 11 deletions

View File

@ -5,7 +5,7 @@ import Network.Socket
import Network.Socket.Data
import Network.Socket.Raw
%cg chez libidris_net.dylib
%cg chez libidris_net
runServer : IO (Either String (Port, ThreadID))
runServer = do

View File

@ -55,9 +55,9 @@ clean :
rm -rf $(OBJS) $(LIBTARGET) $(DYLIBTARGET) build
test: build test.c
LD_LIBRARY_PATH=. $(CC) -o network-tests -L. -I. -l$(LIBNAME) test.c
./network-tests
./lib-tests
$(CC) -o network-tests -L. -I. -l$(LIBNAME) test.c
LD_LIBRARY_PATH=. ./network-tests
LD_LIBRARY_PATH=. ./lib-tests
$(OBJS): $(HDRS)

View File

@ -5,12 +5,6 @@
#include "idris_net.h"
void test_eagain() {
int eagain = idrnet_geteagain();
assert(eagain == 35);
}
void test_sockaddr_port_returns_random_port_when_bind_port_is_0() {
int sock = idrnet_socket(AF_INET, 1, 0);
assert(sock > 0);
@ -39,7 +33,6 @@ void test_sockaddr_port_returns_explicitly_assigned_port() {
int main(int argc, char**argv) {
test_eagain();
test_sockaddr_port_returns_explicitly_assigned_port();
test_sockaddr_port_returns_random_port_when_bind_port_is_0();