mirror of
https://github.com/jedisct1/libsodium.git
synced 2024-12-24 04:25:10 -07:00
Mount the current dir as /test-data (nodefs) for testing Javascript code
This commit is contained in:
parent
d0eab9323f
commit
df1a75858c
@ -10,6 +10,10 @@
|
|||||||
|
|
||||||
#include "sodium.h"
|
#include "sodium.h"
|
||||||
|
|
||||||
|
#ifdef __EMSCRIPTEN__
|
||||||
|
# undef TEST_SRCDIR
|
||||||
|
# define TEST_SRCDIR "/test-data"
|
||||||
|
#endif
|
||||||
#ifndef TEST_SRCDIR
|
#ifndef TEST_SRCDIR
|
||||||
# define TEST_SRCDIR "."
|
# define TEST_SRCDIR "."
|
||||||
#endif
|
#endif
|
||||||
|
@ -28,10 +28,12 @@ Module['preRun'].push(function(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
FS.init();
|
FS.init();
|
||||||
|
FS.mkdir('/test-data');
|
||||||
|
FS.mount(NODEFS, { root: '.' }, '/test');
|
||||||
FS.analyzePath('/dev/random').exists && FS.unlink('/dev/random');
|
FS.analyzePath('/dev/random').exists && FS.unlink('/dev/random');
|
||||||
FS.analyzePath('/dev/urandom') && FS.unlink('/dev/urandom');
|
FS.analyzePath('/dev/urandom') && FS.unlink('/dev/urandom');
|
||||||
var devFolder = FS.findObject('/dev') ||
|
var devFolder = FS.findObject('/dev') ||
|
||||||
Module['FS_createFolder']('/', 'dev', true, true);
|
Module['FS_createFolder']('/', 'dev', true, true);
|
||||||
Module['FS_createDevice'](devFolder, 'random', randombyte);
|
Module['FS_createDevice'](devFolder, 'random', randombyte);
|
||||||
Module['FS_createDevice'](devFolder, 'urandom', randombyte);
|
Module['FS_createDevice'](devFolder, 'urandom', randombyte);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user