diff --git a/test_cgi.pl b/test_cgi.pl index e2755f8..b95e96d 100644 --- a/test_cgi.pl +++ b/test_cgi.pl @@ -35,12 +35,14 @@ :- module(test_cgi, [test_cgi/0]). :- asserta(user:file_search_path(foreign, '.')). -:- asserta(user:file_search_path(library, '.')). :- asserta(user:file_search_path(library, '../plunit')). - +:- prolog_load_context(directory, D), + asserta(user:file_search_path(library, D)), + atom_concat(D, '/..', DD), + asserta(user:file_search_path(library, DD)). :- use_module(library(plunit)). -:- use_module(cgi). -:- use_module(uri). +:- use_module(library(cgi)). +:- use_module(library(uri)). test_cgi :- run_tests([ cgi diff --git a/test_memfile.pl b/test_memfile.pl index 6cc2fa7..656a3fc 100644 --- a/test_memfile.pl +++ b/test_memfile.pl @@ -39,7 +39,11 @@ :- asserta(user:file_search_path(foreign, '.')). :- asserta(user:file_search_path(library, '../plunit')). -:- use_module(memfile). +:- prolog_load_context(directory, D), + asserta(user:file_search_path(library, D)), + atom_concat(D, '/..', DD), + asserta(user:file_search_path(library, DD)). +:- use_module(library(memfile)). :- use_module(library(utf8)). :- use_module(library(plunit)). :- use_module(library(debug)). diff --git a/test_process.pl b/test_process.pl index ab6ca10..aef53e1 100644 --- a/test_process.pl +++ b/test_process.pl @@ -42,11 +42,15 @@ :- asserta(user:file_search_path(library, '.')). :- asserta(user:file_search_path(library, '../plunit')). +:- prolog_load_context(directory, D), + asserta(user:file_search_path(library, D)), + atom_concat(D, '/..', DD), + asserta(user:file_search_path(library, DD)). :- use_module(library(plunit)). :- use_module(library(debug)). :- use_module(library(apply)). :- use_module(library(readutil)). -:- use_module(process). +:- use_module(library(process)). test_process :- run_tests([ process_create, @@ -119,9 +123,7 @@ same_file(CWD, Tmp). tmp_dir(Dir) :- - getenv('TEMP', Dir), - !. -tmp_dir('/tmp'). + current_prolog_flag(tmp_dir, Dir). :- end_tests(process_create). diff --git a/test_socket.pl b/test_socket.pl index e01d0c0..aa63d80 100644 --- a/test_socket.pl +++ b/test_socket.pl @@ -41,9 +41,12 @@ :- asserta(user:file_search_path(foreign, '.')). -:- use_module(socket). -:- use_module(user:socket). % debugging -:- use_module(streampool). +:- prolog_load_context(directory, D), + asserta(user:file_search_path(library, D)), + atom_concat(D, '/..', DD), + asserta(user:file_search_path(library, DD)). +:- use_module(library(socket)). +:- use_module(library(streampool)). :- use_module(library(debug)). test_socket :- diff --git a/test_stream.pl b/test_stream.pl index 6335dc9..c18251f 100644 --- a/test_stream.pl +++ b/test_stream.pl @@ -40,9 +40,13 @@ :- asserta(user:file_search_path(library, '.')). :- asserta(user:file_search_path(library, '../plunit')). +:- prolog_load_context(directory, D), + asserta(user:file_search_path(library, D)), + atom_concat(D, '/..', DD), + asserta(user:file_search_path(library, DD)). :- use_module(library(plunit)). :- use_module(library(debug)). -:- use_module(prolog_stream). +:- use_module(library(prolog_stream)). test_stream :- run_tests([ prolog_stream