forked from cory/tildefriends
No more secrets in ~/.config, and speed up some tests.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4002 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
44
src/tests.c
44
src/tests.c
@ -22,7 +22,7 @@ static void _test_nop(const tf_test_options_t* options)
|
||||
fclose(file);
|
||||
|
||||
char command[256];
|
||||
snprintf(command, sizeof(command), "%s run --ssb-port=0 -s out/test.js", options->exe_path);
|
||||
snprintf(command, sizeof(command), "%s run --ssb-port=0 --db-path=:memory: -s out/test.js", options->exe_path);
|
||||
printf("%s\n", command);
|
||||
int result = system(command);
|
||||
(void)result;
|
||||
@ -53,7 +53,7 @@ static void _test_child(const tf_test_options_t* options)
|
||||
fclose(file);
|
||||
|
||||
char command[256];
|
||||
snprintf(command, sizeof(command), "%s run --ssb-port=0 -s out/test.js", options->exe_path);
|
||||
snprintf(command, sizeof(command), "%s run --ssb-port=0 --db-path=:memory: -s out/test.js", options->exe_path);
|
||||
printf("%s\n", command);
|
||||
int result = system(command);
|
||||
(void)result;
|
||||
@ -95,7 +95,7 @@ static void _test_promise(const tf_test_options_t* options)
|
||||
fclose(file);
|
||||
|
||||
char command[256];
|
||||
snprintf(command, sizeof(command), "%s run --ssb-port=0 -s out/test.js", options->exe_path);
|
||||
snprintf(command, sizeof(command), "%s run --ssb-port=0 --db-path=:memory: -s out/test.js", options->exe_path);
|
||||
printf("%s\n", command);
|
||||
int result = system(command);
|
||||
(void)result;
|
||||
@ -141,7 +141,7 @@ static void _test_promise_remote_throw(const tf_test_options_t* options)
|
||||
fclose(file);
|
||||
|
||||
char command[256];
|
||||
snprintf(command, sizeof(command), "%s run --ssb-port=0 -s out/test.js", options->exe_path);
|
||||
snprintf(command, sizeof(command), "%s run --ssb-port=0 --db-path=:memory: -s out/test.js", options->exe_path);
|
||||
printf("%s\n", command);
|
||||
int result = system(command);
|
||||
(void)result;
|
||||
@ -189,7 +189,7 @@ static void _test_promise_remote_reject(const tf_test_options_t* options)
|
||||
fclose(file);
|
||||
|
||||
char command[256];
|
||||
snprintf(command, sizeof(command), "%s run --ssb-port=0 -s out/test.js", options->exe_path);
|
||||
snprintf(command, sizeof(command), "%s run --ssb-port=0 --db-path=:memory: -s out/test.js", options->exe_path);
|
||||
printf("%s\n", command);
|
||||
int result = system(command);
|
||||
(void)result;
|
||||
@ -235,7 +235,7 @@ static void _test_database(const tf_test_options_t* options)
|
||||
unlink("out/testdb.sqlite");
|
||||
|
||||
char command[256];
|
||||
snprintf(command, sizeof(command), "%s run --ssb-port=0 --db-path=out/testdb.sqlite -s out/test.js", options->exe_path);
|
||||
snprintf(command, sizeof(command), "%s run --ssb-port=0 --db-path=:memory: --db-path=out/testdb.sqlite -s out/test.js", options->exe_path);
|
||||
printf("%s\n", command);
|
||||
int result = system(command);
|
||||
printf("returned %d\n", WEXITSTATUS(result));
|
||||
@ -256,7 +256,7 @@ static void _test_this(const tf_test_options_t* options)
|
||||
fclose(file);
|
||||
|
||||
char command[256];
|
||||
snprintf(command, sizeof(command), "%s run --ssb-port=0 -s out/test.js", options->exe_path);
|
||||
snprintf(command, sizeof(command), "%s run --ssb-port=0 --db-path=:memory: -s out/test.js", options->exe_path);
|
||||
printf("%s\n", command);
|
||||
int result = system(command);
|
||||
printf("returned %d\n", WEXITSTATUS(result));
|
||||
@ -289,7 +289,7 @@ static void _test_await(const tf_test_options_t* options)
|
||||
fclose(file);
|
||||
|
||||
char command[256];
|
||||
snprintf(command, sizeof(command), "%s run --ssb-port=0 -s out/test.js", options->exe_path);
|
||||
snprintf(command, sizeof(command), "%s run --ssb-port=0 --db-path=:memory: -s out/test.js", options->exe_path);
|
||||
printf("%s\n", command);
|
||||
int result = system(command);
|
||||
printf("returned %d\n", WEXITSTATUS(result));
|
||||
@ -325,14 +325,14 @@ static void _test_import(const tf_test_options_t* options)
|
||||
fclose(file);
|
||||
|
||||
char command[256];
|
||||
snprintf(command, sizeof(command), "%s run --ssb-port=0 -s out/test.js", options->exe_path);
|
||||
snprintf(command, sizeof(command), "%s run --ssb-port=0 --db-path=:memory: -s out/test.js", options->exe_path);
|
||||
printf("%s\n", command);
|
||||
int result = system(command);
|
||||
printf("returned %d\n", WEXITSTATUS(result));
|
||||
assert(WIFEXITED(result));
|
||||
assert(WEXITSTATUS(result) == 0);
|
||||
|
||||
snprintf(command, sizeof(command), "%s run --ssb-port=0 -s out/bad.js", options->exe_path);
|
||||
snprintf(command, sizeof(command), "%s run --ssb-port=0 --db-path=:memory: -s out/bad.js", options->exe_path);
|
||||
printf("%s\n", command);
|
||||
result = system(command);
|
||||
printf("returned %d\n", WEXITSTATUS(result));
|
||||
@ -355,7 +355,7 @@ static void _test_exit(const tf_test_options_t* options)
|
||||
fclose(file);
|
||||
|
||||
char command[256];
|
||||
snprintf(command, sizeof(command), "%s run --ssb-port=0 -s out/test.js", options->exe_path);
|
||||
snprintf(command, sizeof(command), "%s run --ssb-port=0 --db-path=:memory: -s out/test.js", options->exe_path);
|
||||
printf("%s\n", command);
|
||||
int result = system(command);
|
||||
printf("returned %d\n", WEXITSTATUS(result));
|
||||
@ -375,7 +375,7 @@ static void _test_icu(const tf_test_options_t* options)
|
||||
fclose(file);
|
||||
|
||||
char command[256];
|
||||
snprintf(command, sizeof(command), "%s run --ssb-port=0 -s out/test.js", options->exe_path);
|
||||
snprintf(command, sizeof(command), "%s run --ssb-port=0 --db-path=:memory: -s out/test.js", options->exe_path);
|
||||
printf("%s\n", command);
|
||||
int result = system(command);
|
||||
printf("returned %d\n", WEXITSTATUS(result));
|
||||
@ -427,7 +427,7 @@ static void _test_uint8array(const tf_test_options_t* options)
|
||||
fclose(file);
|
||||
|
||||
char command[256];
|
||||
snprintf(command, sizeof(command), "%s run --ssb-port=0 -s out/test.js", options->exe_path);
|
||||
snprintf(command, sizeof(command), "%s run --ssb-port=0 --db-path=:memory: -s out/test.js", options->exe_path);
|
||||
printf("%s\n", command);
|
||||
int result = system(command);
|
||||
printf("returned %d\n", WEXITSTATUS(result));
|
||||
@ -453,14 +453,14 @@ static void _test_socket(const tf_test_options_t* options)
|
||||
"print('noDelay', s.noDelay);\n"
|
||||
"s.noDelay = true;\n"
|
||||
"s.connect('www.unprompted.com', 80).then(function() {\n"
|
||||
" print('connected', s.isConnected);\n"
|
||||
" print('connected', 'www.unprompted.com', 80, s.isConnected);\n"
|
||||
" print(s.peerName);\n"
|
||||
" s.read(function(data) {\n"
|
||||
" print('read', data ? data.length : null);\n"
|
||||
" });\n"
|
||||
" s.write('GET / HTTP/1.0\\r\\n\\r\\n');\n"
|
||||
"}).then(function() {\n"
|
||||
" print('closed');\n"
|
||||
"}).then(function(e) {\n"
|
||||
" print('closed 1');\n"
|
||||
"});\n"
|
||||
"\n"
|
||||
"var s2 = new Socket();\n"
|
||||
@ -473,7 +473,7 @@ static void _test_socket(const tf_test_options_t* options)
|
||||
"print('noDelay', s2.noDelay);\n"
|
||||
"s2.noDelay = true;\n"
|
||||
"s2.connect('www.unprompted.com', 443).then(function() {\n"
|
||||
" print('connected');\n"
|
||||
" print('connected', 'www.unprompted.com', 443);\n"
|
||||
" s2.read(function(data) {\n"
|
||||
" print('read', data ? data.length : null);\n"
|
||||
" });\n"
|
||||
@ -498,7 +498,7 @@ static void _test_socket(const tf_test_options_t* options)
|
||||
"print('noDelay', s3.noDelay);\n"
|
||||
"s3.noDelay = true;\n"
|
||||
"s3.connect('0.0.0.0', 443).then(function() {\n"
|
||||
" print('connected');\n"
|
||||
" print('connected', '0.0.0.0', 443);\n"
|
||||
" s3.read(function(data) {\n"
|
||||
" print('read', data ? data.length : null);\n"
|
||||
" });\n"
|
||||
@ -516,7 +516,7 @@ static void _test_socket(const tf_test_options_t* options)
|
||||
fclose(file);
|
||||
|
||||
char command[256];
|
||||
snprintf(command, sizeof(command), "%s run --ssb-port=0 -s out/test.js", options->exe_path);
|
||||
snprintf(command, sizeof(command), "%s run --ssb-port=0 --db-path=:memory: -s out/test.js", options->exe_path);
|
||||
printf("%s\n", command);
|
||||
int result = system(command);
|
||||
printf("returned %d\n", WEXITSTATUS(result));
|
||||
@ -575,7 +575,7 @@ static void _test_file(const tf_test_options_t* options)
|
||||
fclose(file);
|
||||
|
||||
char command[256];
|
||||
snprintf(command, sizeof(command), "%s run --ssb-port=0 -s out/test.js", options->exe_path);
|
||||
snprintf(command, sizeof(command), "%s run --ssb-port=0 --db-path=:memory: -s out/test.js", options->exe_path);
|
||||
printf("%s\n", command);
|
||||
int result = system(command);
|
||||
printf("returned %d\n", WEXITSTATUS(result));
|
||||
@ -607,7 +607,7 @@ static void _test_sign(const tf_test_options_t* options)
|
||||
fclose(file);
|
||||
|
||||
char command[256];
|
||||
snprintf(command, sizeof(command), "%s run --ssb-port=0 -s out/test.js", options->exe_path);
|
||||
snprintf(command, sizeof(command), "%s run --ssb-port=0 --db-path=:memory: -s out/test.js", options->exe_path);
|
||||
printf("%s\n", command);
|
||||
int result = system(command);
|
||||
printf("returned %d\n", WEXITSTATUS(result));
|
||||
@ -630,7 +630,7 @@ static void _test_b64(const tf_test_options_t* options)
|
||||
fclose(file);
|
||||
|
||||
char command[256];
|
||||
snprintf(command, sizeof(command), "%s run --ssb-port=0 -s out/test.js", options->exe_path);
|
||||
snprintf(command, sizeof(command), "%s run --ssb-port=0 --db-path=:memory: -s out/test.js", options->exe_path);
|
||||
printf("%s\n", command);
|
||||
int result = system(command);
|
||||
printf("returned %d\n", WEXITSTATUS(result));
|
||||
|
Reference in New Issue
Block a user