Commit a51080a7 authored by bernd's avatar bernd
Browse files

Move tests (need to make them run again)

parent fad03aa8
Loading
Loading
Loading
Loading
+15 −12
Original line number Diff line number Diff line
@@ -51,23 +51,26 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
ARCH	  =
DEBARCH   =

SOURCES = 64bit.fs alice-test.fs base64.fs base85.fs bob-test.fs	\
	  client-test.fs client-tests.fs crypto-api.fs debugging.fs	\
	  eve-test.fs hash-table.fs keccak-small.fs kregion.fs n2o.fs	\
TESTS = tests/alice2-msg.fs tests/alice-msg.fs tests/bob-msg.fs		\
	  tests/copy.fs tests/cryptspeed.fs tests/dht.fs		\
	  tests/dht-pop.fs tests/ed25519.fs tests/insdeltest.fs		\
	  tests/keccak.fs tests/keys.fs tests/msg.fs			\
	  tests/teststat.fs tests/threefish.fs tests/vault.fs		\
	  tests/ed25519-table.fs tests/alice-test.fs			\
	  tests/bob-test.fs tests/eve-test.fs tests/client-test.fs	\
	  tests/client-tests.fs tests/server-test.fs			\
	  tests/terminal-test.fs tests/test-keys.fs

SOURCES = 64bit.fs base64.fs base85.fs crypto-api.fs debugging.fs	\
	  hash-table.fs keccak-small.fs kregion.fs n2o.fs		\
	  net2o-addr.fs net2o-classes.fs net2o-cmd.fs			\
	  net2o-connected.fs net2o-connect.fs net2o-crypt.fs		\
	  net2o-dht.fs net2o-err.fs net2o-file.fs net2o.fs		\
	  net2o-ip.fs net2o-helper.fs net2o-keys.fs net2o-log.fs	\
	  net2o-msg.fs net2o-notify.fs net2o-qr.fs net2o-socks.fs	\
	  net2o-tools.fs net2o-vault.fs rng.fs server-test.fs		\
	  termclient.fs terminal-test.fs test-keys.fs xtype.fs		\
	  tests/alice2-msg.fs tests/alice-msg.fs tests/bob-msg.fs	\
	  tests/copy.fs tests/cryptspeed.fs tests/dht.fs		\
	  tests/dht-pop.fs tests/ed25519.fs tests/insdeltest.fs		\
	  tests/keccak.fs tests/keys.fs tests/msg.fs			\
	  tests/teststat.fs tests/threefish.fs tests/vault.fs		\
	  tests/ed25519-table.fs $(FORTHLIB) ed25519-donnalib.fs	\
	  keccaklib.fs threefishlib.fs startn2o.fs doc/net2o-logo.png	\
	  net2o-tools.fs net2o-vault.fs rng.fs termclient.fs xtype.fs	\
	  $(TESTS) $(FORTHLIB) ed25519-donnalib.fs keccaklib.fs		\
	  threefishlib.fs startn2o.fs doc/net2o-logo.png		\
	  net2o-version.fs.in android-net.fs linux-net.fs		\
	  net2o-dhtroot.fs

+0 −1
Original line number Diff line number Diff line
\ net2o tests - client side

require net2o.fs
require client-tests.fs
require test-keys.fs \ we want the test keys - never use this in production!

+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ init-client
"test" connect-nick $!

!time

cmd-args
?nextarg [IF] net2o-host $! [THEN]
?nextarg [IF] s>number drop to net2o-port [THEN]
?nextarg [IF] s>number drop [ELSE] 1 [THEN] c:tests
+7 −4
Original line number Diff line number Diff line
\ Test lib clients

require ./net2o.fs
require ../net2o.fs

UValue test#  0 to test#
1 Value total-tests
@@ -150,18 +150,21 @@ Variable connect-nick "test" connect-nick $!
    init-cache'
    $a $e connect-nick $@ nick>pk ins-ip pk:connect c:test-rest ;

Variable reqdone#
event: ->reqdone -1 reqdone# +! ;

: c:test& ( n -- ) \ in background
    up@ 2 stacksize4 NewTask4 pass >r
    alloc-io ['] c:test catch ?dup-IF
	elit, ->throw drop
    ELSE  elit, connection elit, ->request  THEN  r> event> ;
    ELSE  drop ->reqdone  THEN  r> event> ;

#100 Value req-ms#

: c:tests ( n -- )  dup 0< IF  abs to test#  1  THEN
    dup to total-tests  1 over lshift 1- reqmask !
    dup to total-tests  dup reqdone# !
    0 ?DO  I c:test& req-ms# ms test# 1+ to test#  LOOP
    requests->0 ;
    BEGIN  stop reqdone# @ 0= UNTIL ;

\ lookup for other users

+4 −1
Original line number Diff line number Diff line
@@ -7,7 +7,10 @@ require test-keys.fs \ we want the test keys - never use this in production!
%droprate
\ bg( )else( debug-task )

?nextarg [IF] s>number drop to net2o-port [THEN]
+db no0key( \ )
perm%myself dup to perm%unknown to perm%default

cmd-args ?nextarg [IF] s>number drop to net2o-port [THEN]

i'm test

Loading