Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tests-pl/issue_delete_directory.pl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@

main :-
call_cleanup(
(setenv("TARGET_DIRECTORY", "delete_directory_test"),
(setenv("SHELL", "/bin/sh"),
setenv("TARGET_DIRECTORY", "delete_directory_test"),
shell("mkdir delete_directory_test", 0),
check),
shell("test -d delete_directory_test && rmdir delete_directory_test || true", 0)
Expand Down
3 changes: 2 additions & 1 deletion tests-pl/issue_delete_file.pl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@

main :-
call_cleanup(
(setenv("TARGET_FILE", "delete_file_test"),
(setenv("SHELL", "/bin/sh"),
setenv("TARGET_FILE", "delete_file_test"),
shell("touch delete_file_test", 0),
check),
shell("test -e delete_file_test && rm delete_file_test || true", 0)
Expand Down
3 changes: 2 additions & 1 deletion tests-pl/issue_directory_files.pl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
main :-
path_segments(Path, ["directory_files_test_parent", "directory_files_test_file"]),
call_cleanup(
(setenv("TARGET_DIRECTORY", "directory_files_test_parent"),
(setenv("SHELL", "/bin/sh"),
setenv("TARGET_DIRECTORY", "directory_files_test_parent"),
shell("test -d directory_files_test_parent || mkdir directory_files_test_parent", 0),
append(["test -e ", Path, " || touch ", Path], Cmd),
shell(Cmd, 0),
Expand Down
3 changes: 2 additions & 1 deletion tests-pl/issue_file_copy.pl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@

main :-
call_cleanup(
(setenv("SOURCE", "file_copy_test_source"),
(setenv("SHELL", "/bin/sh"),
setenv("SOURCE", "file_copy_test_source"),
setenv("DESTINATION", "file_copy_test_destination"),
shell("touch file_copy_test_source", 0),
check),
Expand Down
3 changes: 2 additions & 1 deletion tests-pl/issue_file_exists.pl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

main :-
call_cleanup(
(setenv("TARGET_FILE", "file_exists_test"),
(setenv("SHELL", "/bin/sh"),
setenv("TARGET_FILE", "file_exists_test"),
shell("touch file_exists_test", 0),
check),
shell("rm -f file_exists_test", 0)
Expand Down
3 changes: 2 additions & 1 deletion tests-pl/issue_file_size.pl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@

main :-
call_cleanup(
(setenv("TARGET_FILE", "file_size_test"),
(setenv("SHELL", "/bin/sh"),
setenv("TARGET_FILE", "file_size_test"),
shell("echo '1' > file_size_test", 0),
check),
shell("rm -f file_size_test", 0)
Expand Down
3 changes: 2 additions & 1 deletion tests-pl/issue_file_time.pl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

main :-
call_cleanup(
(setenv("TARGET_FILE", "file_time_test"),
(setenv("SHELL", "/bin/sh"),
setenv("TARGET_FILE", "file_time_test"),
shell("touch file_time_test", 0),
findall(T, check(T), Ts),
length(Ts, 3)),
Expand Down
3 changes: 2 additions & 1 deletion tests-pl/issue_make_directory.pl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@

main :-
call_cleanup(
(setenv("TARGET_DIRECTORY", "make_directory_test"),
(setenv("SHELL", "/bin/sh"),
setenv("TARGET_DIRECTORY", "make_directory_test"),
check),
shell("test -d make_directory_test && rmdir make_directory_test || true", 0)
).
Expand Down
3 changes: 2 additions & 1 deletion tests-pl/issue_make_directory_path.pl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@

main :-
call_cleanup(
(setenv("TARGET_DIRECTORY", "make_directory_test/subdir"),
(setenv("SHELL", "/bin/sh"),
setenv("TARGET_DIRECTORY", "make_directory_test/subdir"),
check),
(shell("test -d make_directory_test/subdir && rmdir make_directory_test/subdir || true", 0),
shell("test -d make_directory_test && rmdir make_directory_test || true", 0))
Expand Down
3 changes: 2 additions & 1 deletion tests-pl/issue_path_canonical.pl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
main :-
path_segments(Path, ["path_canonical_test", "..", "path_canonical_test"]),
call_cleanup(
(setenv("TARGET_PATH", Path),
(setenv("SHELL", "/bin/sh"),
setenv("TARGET_PATH", Path),
shell("mkdir path_canonical_test", 0),
check),
shell("test -d path_canonical_test && rmdir path_canonical_test || true", 0)
Expand Down
3 changes: 2 additions & 1 deletion tests-pl/issue_rename_file.pl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@

main :-
call_cleanup(
(setenv("SOURCE", "rename_file_test"),
(setenv("SHELL", "/bin/sh"),
setenv("SOURCE", "rename_file_test"),
setenv("DESTINATION", "rename_file_test_renamed"),
shell("touch rename_file_test", 0),
check),
Expand Down
44 changes: 44 additions & 0 deletions tests/scryer/issues.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,21 @@ fn issue2725_dcg_without_module() {
#[serial]
#[test]
#[cfg_attr(miri, ignore = "it takes too long to run")]
#[cfg_attr(
not(unix),
ignore = "uses shell/2 and it's not portable outside of POSIX"
)]
fn issue_delete_directory() {
load_module_test("tests-pl/issue_delete_directory.pl", "directory_deleted");
}

#[serial]
#[test]
#[cfg_attr(miri, ignore = "it takes too long to run")]
#[cfg_attr(
not(unix),
ignore = "uses shell/2 and it's not portable outside of POSIX"
)]
fn issue_delete_file() {
load_module_test("tests-pl/issue_delete_file.pl", "file_deleted");
}
Expand All @@ -76,48 +84,76 @@ fn issue_directory_exists() {
#[serial]
#[test]
#[cfg_attr(miri, ignore = "it takes too long to run")]
#[cfg_attr(
not(unix),
ignore = "uses shell/2 and it's not portable outside of POSIX"
)]
fn issue_directory_files() {
load_module_test("tests-pl/issue_directory_files.pl", "1");
}

#[serial]
#[test]
#[cfg_attr(miri, ignore = "it takes too long to run")]
#[cfg_attr(
not(unix),
ignore = "uses shell/2 and it's not portable outside of POSIX"
)]
fn issue_file_copy() {
load_module_test("tests-pl/issue_file_copy.pl", "file_copied");
}

#[serial]
#[test]
#[cfg_attr(miri, ignore = "it takes too long to run")]
#[cfg_attr(
not(unix),
ignore = "uses shell/2 and it's not portable outside of POSIX"
)]
fn issue_file_exists() {
load_module_test("tests-pl/issue_file_exists.pl", "");
}

#[serial]
#[test]
#[cfg_attr(miri, ignore = "it takes too long to run")]
#[cfg_attr(
not(unix),
ignore = "uses shell/2 and it's not portable outside of POSIX"
)]
fn issue_file_size() {
load_module_test("tests-pl/issue_file_size.pl", "");
}

#[serial]
#[test]
#[cfg_attr(miri, ignore = "it takes too long to run")]
#[cfg_attr(
not(unix),
ignore = "uses shell/2 and it's not portable outside of POSIX"
)]
fn issue_file_time() {
load_module_test("tests-pl/issue_file_time.pl", "");
}

#[serial]
#[test]
#[cfg_attr(miri, ignore = "it takes too long to run")]
#[cfg_attr(
not(unix),
ignore = "uses shell/2 and it's not portable outside of POSIX"
)]
fn issue_make_directory() {
load_module_test("tests-pl/issue_make_directory.pl", "directory_made");
}

#[serial]
#[test]
#[cfg_attr(miri, ignore = "it takes too long to run")]
#[cfg_attr(
not(unix),
ignore = "uses shell/2 and it's not portable outside of POSIX"
)]
fn issue_make_directory_path() {
load_module_test(
"tests-pl/issue_make_directory_path.pl",
Expand All @@ -128,13 +164,21 @@ fn issue_make_directory_path() {
#[serial]
#[test]
#[cfg_attr(miri, ignore = "it takes too long to run")]
#[cfg_attr(
not(unix),
ignore = "uses shell/2 and it's not portable outside of POSIX"
)]
fn issue_path_canonical() {
load_module_test("tests-pl/issue_path_canonical.pl", "path_canonicalized");
}

#[serial]
#[test]
#[cfg_attr(miri, ignore = "it takes too long to run")]
#[cfg_attr(
not(unix),
ignore = "uses shell/2 and it's not portable outside of POSIX"
)]
fn issue_rename_file() {
load_module_test("tests-pl/issue_rename_file.pl", "file_renamed");
}
Expand Down
Loading