Commit graph

71 commits

Author SHA1 Message Date
Stephen 186540e160 make cleanup 2016-11-06 16:27:24 -08:00
Stephen bc08bfda67 Unit testing in CI (#651)
- in appveyor, install clang and cmake in cygwin, enable package upgrades, and build cmocka and enable testing for gcc only
- in `gitignore`, ignore generated cmocka folder
- in travis, use brew in osx to install cmocka, and enable testing for gcc and clang on os x and linux
- in `Makefile`, change to use `uname -s` to determine os type
- make `install-cmocka-linux.sh`, a simple shell script to download and install cmocka on linux
- in `bindings/Makefile`, enable `make -c` to call subdirectory makefiles instead of `cd [dir] && make` and include environment variables for runtime access to generated libraries
- in `samples/Makefile`, change to use `uname -s` to determine os type, remove `clean_bins` from `all` command, and include `Werror` for compile strictness
- in `tests/unit/Makefile`, add `cflags` for compile time access to cmocka headers and library, include execute vars for runtime access to cmocka and unicorn libs
- in `tests/unit/test_tb_x86.c`, comment out assert that would not compile
2016-10-22 00:21:10 +08:00
Andrew Dutcher ea54204952 Tweak some names in a few places, encapsulate the uc_context struct to hide it from users for some reason 2016-10-10 14:04:51 -07:00
Andrew Dutcher 1ab2154fe5 Change save/restore API to have explicit alloc/free functions. Python has explicit save/update functions. 2016-10-07 11:39:42 -07:00
Nguyen Anh Quynh 73577cbcd1 rename uc_regstate_restore to uc_context_restore, uc_context_save to uc_context_save 2016-10-07 10:03:19 +08:00
Nguyen Anh Quynh b7cdbe7a88 Merge branch 'feat/reg_save_restore' of https://github.com/rhelmot/unicorn into rhelmot-feat/reg_save_restore 2016-10-07 09:57:07 +08:00
Stephen 0137a66c61 Update test_hang.c 2016-10-05 10:29:16 -07:00
Stephen f2998f14cd Update test_hang.c 2016-10-05 09:20:36 -07:00
Andrew Dutcher e3b0e52013 Rename save/restore functions to match the style of the rest of the API 2016-09-28 21:21:44 -07:00
Andrew Dutcher 3deb9fdcad Fix save/restore to work while emulation is not active 2016-09-08 14:41:34 -07:00
Andrew Dutcher f2af98942b Added (failing?) test for reg save/restore 2016-08-31 20:25:28 -05:00
Nguyen Anh Quynh 40ea64af19 Merge branch 'feat/xmm_regs' of https://github.com/rhelmot/unicorn into rhelmot-feat/xmm_regs 2016-08-23 06:52:45 +08:00
nnn 64e6fbc480 Fixed printf format specifier 2016-08-20 22:34:14 -07:00
nnn d77fd18915 Fixed multiple bugs in test_x86_rip_bug.c
Fixed format warning in test_hang.c
2016-08-20 22:23:51 -07:00
nnn 4a67727f81 Updated Makefile 2016-08-20 18:47:45 -07:00
Neil 06fc5d1ea9 Add files via upload
Unit Test for Issue #534
2016-08-20 21:35:23 -04:00
Andrew Dutcher b1f03a02f2 Add tests for xmm register read/write 2016-08-14 19:26:32 -07:00
samothtronicien 92f97da49f bit of refactoring 2016-07-31 19:45:46 +02:00
samothtronicien f1041a2615 renamed to test_x86_shl_enter_leave.c 2016-07-31 03:23:00 +02:00
samothtronicien ae8e34173a added tests with enter/leave 2016-07-31 03:19:52 +02:00
samothtronicien 1ecc5abdbc fixed typo: test_x86_shl_pf -> test_x86_shl 2016-07-30 16:44:54 +02:00
samothtronicien 8120b7732e added test_x86_shl_pf to makefile 2016-07-30 16:42:51 +02:00
samothtronicien c1cd06ec52 ported test to C 2016-07-30 16:41:40 +02:00
samothtronicien 6c3eecb2a3 added unit test for x86
This test highlight the issue with the SHL instruction in the form (SHL r, CL), the flags values retrieved in the code hook are not correct.
2016-07-30 04:18:12 +02:00
Nguyen Anh Quynh 6193be73b7 tests: more flexible .gitignore for tests/unit/ 2016-06-16 09:14:32 +08:00
nuko32 9b46a22cd5 final refactoring for test_hang 2016-06-15 20:52:28 +02:00
nuko32 3bec4b2cf1 refactored test_hang and fixed indentations 2016-06-15 20:44:22 +02:00
jndok c6db9febe7 added ARM64 hang test 2016-06-15 19:18:51 +02:00
Zach Riggle 93063d089b Add ASAN build target with UNICORN_ASAN or via './make.sh asan' 2016-04-20 16:16:06 -07:00
Nguyen Anh Quynh ad6bb8c9f8 unit: fix test_hookcounts.c 2016-03-20 01:54:37 +08:00
Nguyen Anh Quynh 0af4baac31 unit: fix warnings in printing uint64_t in test_hookcounts.c 2016-03-17 17:49:22 +08:00
egberts ac21e74641 Issues #465
Pull Request #466
Added one more test case
Fixed two test case into passing (for a total of 3 passing out of 7)
2016-03-16 11:49:25 -07:00
egberts ab5ed15044 Issue #465 - Enhanced test for more scenarios; fixed some semantic bugs. 2016-03-16 10:54:20 -07:00
egberts 347d863365 Issue #465 hook_count_cb doesn't stop at n instructions; unit test file 2015-10-03 22:52:15 -07:00
Nicolas PLANEL 1087ba9dea [query] add UC_QUERY_PAGE_SIZE uc_query helper
Return the current page size used by the current arch.
Useful to call uc_mem_map() with memory/size aligned.

Signed-off-by: Nicolas PLANEL <nplanel@redhat.com>
2016-03-04 15:54:24 +11:00
Nguyen Anh Quynh aabcb95f01 unit: remove ^M from test_x86_soft_paging.c 2016-02-22 14:02:28 +08:00
Nguyen Anh Quynh 2f28f3f210 unit: make test_x86_soft_paging.c compilable. also update .gitignore for its binary 2016-02-22 14:01:00 +08:00
Ramirez57 2ab2b229ce test case: x86 guest paging
Test case for x86 paging using virtual addresses mapped by Unicorn, as well as unmapped.

Attempting to read/write from virtual address ranges unmapped by Unicorn wrongly causes protection faults, even when the virtual address points to read/write regions of Unicorn memory.
2016-02-22 00:03:14 -05:00
Nguyen Anh Quynh 871cdb692f Merge branch 'hook' 2016-02-17 09:37:17 +08:00
coco bfbe91834e two more testcases 2016-02-11 15:02:14 +01:00
Nguyen Anh Quynh a7a1dcc661 uc_hook_add(): add begin & end arguments for all hook types. also update Python binding after this change 2016-02-11 08:02:13 +08:00
Nguyen Anh Quynh 6478a24404 Merge branch 'gdt_idt' of https://github.com/cseagle/unicorn into cseagle-gdt_idt 2016-02-06 17:31:42 +08:00
Chris Eagle 49b9f4f8da uc_x86_mmr type available in qemu/target-i386/unicorn.c 2016-02-04 19:09:41 -08:00
Chris Eagle 59f7bf3be7 file perms 2016-02-04 16:48:27 -08:00
Chris Eagle e59382e030 updated gdtr/idtr/ldtr/tr read/write code 2016-02-04 16:44:52 -08:00
coco 1e13777c91 added memory fuzzer and 2 resulting testcases 2016-02-04 19:57:20 +01:00
Chris Eagle 9977054a15 add support for setting gdtr, idtr, ldtr, and tr programatically 2016-02-03 09:22:29 -08:00
Nguyen Anh Quynh e42aba760f fix a typo in test_tb_x86.c 2016-01-31 14:07:35 +08:00
Nguyen Anh Quynh 32b9deca04 unit: use UC_HOOK_MEM_VALID for test_tb_x86.c 2016-01-31 13:14:11 +08:00
Nguyen Anh Quynh 1fb5416f4a unit: simplify test_tb_x86.c 2016-01-31 13:06:42 +08:00