nih-at / libzip

A C library for reading, creating, and modifying zip archives.
https://libzip.org/
Other
855 stars 275 forks source link

macOS many tests filed #266

Closed grylem closed 3 years ago

grylem commented 3 years ago

Describe the Bug Many tests filed 58% tests passed, 61 tests failed out of 145

To Reproduce make test

libzip Version 1.80

Operating System macOS Apple clang version 13.0.0 (clang-1300.0.29.3) and earlier

0-wiz-0 commented 3 years ago

You'll need to provide more details. https://github.com/nih-at/libzip/runs/3731512619?check_suite_focus=true has

100% tests passed, 0 tests failed out of 145

Total Test time (real) =  59.29 sec

The following tests did not run:
     47 - encryption-nonrandom-aes128.test (Skipped)
     48 - encryption-nonrandom-aes192.test (Skipped)
     49 - encryption-nonrandom-aes256.test (Skipped)
     50 - encryption-nonrandom-pkware.test (Skipped)
    100 - preload.test (Skipped)
grylem commented 3 years ago

The following tests did not run: 24 - clone-fs-add.test (Skipped) 25 - clone-fs-delete.test (Skipped) 26 - clone-fs-replace.test (Skipped) 47 - encryption-nonrandom-aes128.test (Skipped) 48 - encryption-nonrandom-aes192.test (Skipped) 49 - encryption-nonrandom-aes256.test (Skipped) 50 - encryption-nonrandom-pkware.test (Skipped) 100 - preload.test (Skipped)

The following tests FAILED: 3 - add_from_file.test (Failed) 4 - add_from_file_duplicate.test (Failed) 5 - add_from_file_twice_duplicate.test (Failed) 6 - add_from_file_unchange.test (Failed) 7 - add_from_filep.test (Failed) 9 - add_from_zip_closed.test (Failed) 10 - add_from_zip_deflated.test (Failed) 11 - add_from_zip_deflated2.test (Failed) 12 - add_from_zip_partial_deflated.test (Failed) 13 - add_from_zip_partial_stored.test (Failed) 14 - add_from_zip_stored.test (Failed) 19 - cancel_45.test (Failed) 20 - cancel_90.test (Failed) 21 - clone-buffer-add.test (Failed) 22 - clone-buffer-delete.test (Failed) 23 - clone-buffer-replace.test (Failed) 27 - cm-default.test (Failed) 29 - decrypt-correct-password-aes128.test (Failed) 30 - decrypt-correct-password-aes192.test (Failed) 31 - decrypt-correct-password-aes256.test (Failed) 32 - decrypt-correct-password-pkware-2.test (Failed) 33 - decrypt-correct-password-pkware.test (Failed) 34 - decrypt-no-password-aes256.test (Failed) 35 - decrypt-wrong-password-aes128.test (Failed) 36 - decrypt-wrong-password-aes192.test (Failed) 37 - decrypt-wrong-password-aes256.test (Failed) 38 - decrypt-wrong-password-pkware-2.test (Failed) 39 - decrypt-wrong-password-pkware.test (Failed) 41 - delete_invalid.test (Failed) 46 - encrypt.test (Failed) 51 - encryption-remove.test (Failed) 52 - encryption-stat.test (Failed) 60 - extra_field_align.test (Failed) 63 - extra_set.test (Failed) 74 - junk_at_end.test (Failed) 75 - junk_at_start.test (Failed) 77 - open_cons_extrabytes.test (Failed) 79 - open_empty_2.test (Failed) 80 - open_extrabytes.test (Failed) 81 - open_file_count.test (Failed) 82 - open_filename_duplicate.test (Failed) 83 - open_filename_duplicate_consistency.test (Failed) 84 - open_filename_duplicate_empty.test (Failed) 85 - open_filename_duplicate_empty_consistency.test (Failed) 87 - open_incons.test (Failed) 88 - open_many_fail.test (Failed) 90 - open_multidisk.test (Failed) 93 - open_nonarchive.test (Failed) 96 - open_too_short.test (Failed) 101 - progress.test (Failed) 102 - rename_ascii.test (Failed) 107 - rename_utf8.test (Failed) 108 - rename_utf8_encmismatch.test (Failed) 128 - set_file_dostime.test (Failed) 129 - set_file_mtime.test (Failed) 133 - stat_index_fileorder.test (Failed) 134 - stat_index_streamed.test (Failed) 135 - stat_index_streamed_zip64.test (Failed) 140 - stat_index_zip64.test (Failed) 141 - utf-8-standardization.test (Failed) 144 - zip64_stored_creation.test (Failed)

dillof commented 3 years ago

On my macOS development system and on the build system from GitHub there are no test failures.

Therefore, we need more information about your build system to figure out why they are failing for you.

grylem commented 3 years ago

Therefore, we need more information about your build system to figure out why they are failing for you.

What information is needed? I tried on two different systems (Intel x86 and Apple Silicon) but with the same result. Сan you provide me a static binary?

grylem commented 3 years ago

I found where the problem is change path for diff to /usr/bin/diff in NiHTest.pm and now: 100% tests passed, 0 tests failed out of 145

dillof commented 3 years ago

Could you see which version of diff caused the failure? type diff or which diff should tell you where it's installed and diff --version or diff -h might tell us which it is.

grylem commented 3 years ago

default version for macOS Big Sur which -a diff /usr/bin/diff

/usr/bin/diff --version diff (GNU diffutils) 2.8.1

0-wiz-0 commented 3 years ago

Well, that is the diff that works. but what is the one that doesn't?

dillof commented 3 years ago

Hm, that doesn't seem right. If the default diff was /usr/bin/diff, then why would explicitly using /usr/bin/diff fix the tests? I don't think that runtest picked up that version of diff.

grylem commented 3 years ago

maybe not define the path to the diff. I did a test again - without absolute path to diff many tests filed. On old version macOS High Sierra works fine without modifcation path for diff.

grylem commented 3 years ago

It is very strange the problem occurs only when used CMake GUI if used cmake from cli all works fine.

dillof commented 3 years ago

Sounds like the CMake GUI is using a different diff that is incompatible. Maybe you can change that somewhere in it’s settings.