diff --git a/CMakeLists.txt b/CMakeLists.txt index ca71359d..ef6029aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,7 +77,7 @@ set(HEADERS_COMMON ) -set(TEST_SOURCES test.c test_detail.c test_skipdata.c test_iter.c) +set(TEST_SOURCES test_basic.c test_detail.c test_skipdata.c test_iter.c) ## architecture support if (CAPSTONE_ARM_SUPPORT) diff --git a/Makefile b/Makefile index 9a89128e..b0c6e3f3 100644 --- a/Makefile +++ b/Makefile @@ -429,9 +429,9 @@ dist: git archive --format=zip --prefix=capstone-$(DIST_VERSION)/ $(TAG) > capstone-$(DIST_VERSION).zip -TESTS = test test_detail test_arm test_arm64 test_mips test_ppc test_sparc +TESTS = test_basic test_detail test_arm test_arm64 test_mips test_ppc test_sparc TESTS += test_systemz test_x86 test_xcore test_iter -TESTS += test.static test_detail.static test_arm.static test_arm64.static +TESTS += test_basic.static test_detail.static test_arm.static test_arm64.static TESTS += test_mips.static test_ppc.static test_sparc.static TESTS += test_systemz.static test_x86.static test_xcore.static TESTS += test_skipdata test_skipdata.static test_iter.static diff --git a/bindings/ocaml/Makefile b/bindings/ocaml/Makefile index c9a98447..86e80258 100644 --- a/bindings/ocaml/Makefile +++ b/bindings/ocaml/Makefile @@ -4,8 +4,8 @@ LIB = capstone FLAGS = '-Wall -Wextra -Wwrite-strings' -all: arm_const.cmxa arm64_const.cmxa mips_const.cmxa ppc_const.cmxa sparc_const.cmxa sysz_const.cmxa x86_const.cmxa xcore_const.cmxa arm.cmxa arm64.cmxa mips.cmxa ppc.cmxa x86.cmxa sparc.cmxa systemz.cmxa xcore.cmxa capstone.cmxa test.cmx test_detail.cmx test_x86.cmx test_arm.cmx test_arm64.cmx test_mips.cmx test_ppc.cmx test_sparc.cmx test_systemz.cmx test_xcore.cmx ocaml.o - ocamlopt -o test -ccopt $(FLAGS) ocaml.o capstone.cmx test.cmx -cclib -l$(LIB) +all: arm_const.cmxa arm64_const.cmxa mips_const.cmxa ppc_const.cmxa sparc_const.cmxa sysz_const.cmxa x86_const.cmxa xcore_const.cmxa arm.cmxa arm64.cmxa mips.cmxa ppc.cmxa x86.cmxa sparc.cmxa systemz.cmxa xcore.cmxa capstone.cmxa test_basic.cmx test_detail.cmx test_x86.cmx test_arm.cmx test_arm64.cmx test_mips.cmx test_ppc.cmx test_sparc.cmx test_systemz.cmx test_xcore.cmx ocaml.o + ocamlopt -o test_basic -ccopt $(FLAGS) ocaml.o capstone.cmx test_basic.cmx -cclib -l$(LIB) ocamlopt -o test_detail -ccopt $(FLAGS) capstone.cmx ocaml.o test_detail.cmx -cclib -l$(LIB) ocamlopt -o test_x86 -ccopt $(FLAGS) capstone.cmx ocaml.o x86.cmx x86_const.cmx test_x86.cmx -cclib -l$(LIB) ocamlopt -o test_arm -ccopt $(FLAGS) capstone.cmx ocaml.o arm.cmx arm_const.cmx test_arm.cmx -cclib -l$(LIB) @@ -17,7 +17,7 @@ all: arm_const.cmxa arm64_const.cmxa mips_const.cmxa ppc_const.cmxa sparc_const. ocamlopt -o test_xcore -ccopt $(FLAGS) capstone.cmx ocaml.o xcore.cmx xcore_const.cmx test_xcore.cmx -cclib -l$(LIB) -test.cmx: test.ml +test_basic.cmx: test_basic.ml ocamlopt -ccopt $(FLAGS) -c $< -cclib -l$(LIB) test_detail.cmx: test_detail.ml @@ -255,12 +255,12 @@ xcore_const.cmxa: xcore_const.cmx ocamlopt -ccopt $(FLAGS) -a -o $@ $< clean: - rm -f *.[oa] *.so *.cm[ixoa] *.cmxa *.mli test test_detail test_x86 test_arm test_arm64 test_mips test_ppc test_sparc test_systemz test_xcore + rm -f *.[oa] *.so *.cm[ixoa] *.cmxa *.mli test_basic test_detail test_x86 test_arm test_arm64 test_mips test_ppc test_sparc test_systemz test_xcore gen_const: cd .. && python const_generator.py ocaml -TESTS = test test_detail test_arm test_arm64 test_mips test_ppc +TESTS = test_basic test_detail test_arm test_arm64 test_mips test_ppc TESTS += test_sparc test_systemz test_x86 test_xcore check: @for t in $(TESTS); do \ diff --git a/bindings/ocaml/README b/bindings/ocaml/README index 7e20a87f..e395232a 100644 --- a/bindings/ocaml/README +++ b/bindings/ocaml/README @@ -8,7 +8,7 @@ To compile Ocaml binding, simply run "make" on the command line. This directory also contains some test code to show how to use Capstone API. -- test.ml +- test_basic.ml This code shows the most simple form of API where we only want to get basic information out of disassembled instruction, such as address, mnemonic and operand string. diff --git a/bindings/ocaml/test.ml b/bindings/ocaml/test_basic.ml similarity index 100% rename from bindings/ocaml/test.ml rename to bindings/ocaml/test_basic.ml diff --git a/bindings/python/BUILDING.txt b/bindings/python/BUILDING.txt index 5c100aab..fbac83a2 100644 --- a/bindings/python/BUILDING.txt +++ b/bindings/python/BUILDING.txt @@ -53,13 +53,13 @@ 4. This directory contains some test code to show how to use the Capstone API. -- test.py +- test_basic.py This code shows the most simple form of API where we only want to get basic information out of disassembled instruction, such as address, mnemonic and operand string. - test_lite.py - Similarly to test.py, but this code shows how to use disasm_lite(), a lighter + Similarly to test_basic.py, but this code shows how to use disasm_lite(), a lighter method to disassemble binary. Unlike disasm() API (used by test.py), which returns CsInsn objects, this API just returns tuples of (address, size, mnemonic, op_str). diff --git a/bindings/python/Makefile b/bindings/python/Makefile index 2eab3b79..747d5fc7 100644 --- a/bindings/python/Makefile +++ b/bindings/python/Makefile @@ -64,7 +64,7 @@ clean: rm -f MANIFEST -TESTS = test.py test_detail.py test_arm.py test_arm64.py test_mips.py test_ppc.py +TESTS = test_basic.py test_detail.py test_arm.py test_arm64.py test_mips.py test_ppc.py TESTS += test_sparc.py test_systemz.py test_x86.py test_xcore.py test_skipdata.py check: @for t in $(TESTS); do \ diff --git a/bindings/python/test_all.py b/bindings/python/test_all.py index fcc443d9..1f26a035 100755 --- a/bindings/python/test_all.py +++ b/bindings/python/test_all.py @@ -1,10 +1,10 @@ #!/usr/bin/env python -import test, test_arm, test_arm64, test_detail, test_lite, test_mips, test_ppc, \ +import test_basic, test_arm, test_arm64, test_detail, test_lite, test_mips, test_ppc, \ test_x86, test_skipdata, test_sparc, test_systemz -test.test_class() +test_basic.test_class() test_arm.test_class() test_arm64.test_class() test_detail.test_class() diff --git a/bindings/python/test.py b/bindings/python/test_basic.py similarity index 100% rename from bindings/python/test.py rename to bindings/python/test_basic.py diff --git a/msvc/capstone.sln b/msvc/capstone.sln index 4cd79c6e..6fa25cc4 100644 --- a/msvc/capstone.sln +++ b/msvc/capstone.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "capstone_static", "capstone_static\capstone_static.vcxproj", "{5B01D900-2359-44CA-9914-6B0C6AFB7BE7}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test", "test\test.vcxproj", "{B291E0D9-4B39-4AF8-971D-A015B78D54A1}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_basic", "test_basic\test_basic.vcxproj", "{B291E0D9-4B39-4AF8-971D-A015B78D54A1}" ProjectSection(ProjectDependencies) = postProject {5B01D900-2359-44CA-9914-6B0C6AFB7BE7} = {5B01D900-2359-44CA-9914-6B0C6AFB7BE7} EndProjectSection diff --git a/msvc/test/test.vcxproj b/msvc/test_basic/test_basic.vcxproj similarity index 98% rename from msvc/test/test.vcxproj rename to msvc/test_basic/test_basic.vcxproj index a26852ba..37a320fb 100644 --- a/msvc/test/test.vcxproj +++ b/msvc/test_basic/test_basic.vcxproj @@ -22,7 +22,7 @@ {B291E0D9-4B39-4AF8-971D-A015B78D54A1} Win32Proj capstonetest - test + test_basic @@ -156,7 +156,7 @@ - + diff --git a/tests/Makefile b/tests/Makefile index 8d0b9476..f674d35b 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -64,7 +64,7 @@ endif .PHONY: all clean -SOURCES = test.c test_detail.c test_skipdata.c test_iter.c +SOURCES = test_basic.c test_detail.c test_skipdata.c test_iter.c ifneq (,$(findstring arm,$(CAPSTONE_ARCHS))) SOURCES += test_arm.c endif diff --git a/tests/test.c b/tests/test_basic.c similarity index 100% rename from tests/test.c rename to tests/test_basic.c diff --git a/xcode/Capstone.xcodeproj/project.pbxproj b/xcode/Capstone.xcodeproj/project.pbxproj index 5bd6c688..bb844db7 100644 --- a/xcode/Capstone.xcodeproj/project.pbxproj +++ b/xcode/Capstone.xcodeproj/project.pbxproj @@ -18,7 +18,7 @@ DC474EF719DDEAFA00BCA449 /* test_systemz.c in Sources */ = {isa = PBXBuildFile; fileRef = DC474E7319DDEA9500BCA449 /* test_systemz.c */; }; DC474EF819DDEAFD00BCA449 /* test_x86.c in Sources */ = {isa = PBXBuildFile; fileRef = DC474E7419DDEA9500BCA449 /* test_x86.c */; }; DC474EF919DDEB0000BCA449 /* test_xcore.c in Sources */ = {isa = PBXBuildFile; fileRef = DC474E7519DDEA9500BCA449 /* test_xcore.c */; }; - DC474EFA19DDEB0200BCA449 /* test.c in Sources */ = {isa = PBXBuildFile; fileRef = DC474E7619DDEA9500BCA449 /* test.c */; }; + DC474EFA19DDEB0200BCA449 /* test_basic.c in Sources */ = {isa = PBXBuildFile; fileRef = DC474E7619DDEA9500BCA449 /* test_basic.c */; }; DC474EFB19DDEB1100BCA449 /* libcapstone.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DCFE23BD19DDCC2D00EF8EA9 /* libcapstone.a */; }; DC474EFD19DDEB1A00BCA449 /* libcapstone.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DCFE23BD19DDCC2D00EF8EA9 /* libcapstone.a */; }; DC474EFE19DDEB1C00BCA449 /* libcapstone.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DCFE23BD19DDCC2D00EF8EA9 /* libcapstone.a */; }; @@ -282,7 +282,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - DC474E6419DDEA5F00BCA449 /* test */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = test; sourceTree = BUILT_PRODUCTS_DIR; }; + DC474E6419DDEA5F00BCA449 /* test_basic */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = test; sourceTree = BUILT_PRODUCTS_DIR; }; DC474E6C19DDEA9500BCA449 /* test_arm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = test_arm.c; path = ../tests/test_arm.c; sourceTree = ""; }; DC474E6D19DDEA9500BCA449 /* test_arm64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = test_arm64.c; path = ../tests/test_arm64.c; sourceTree = ""; }; DC474E6E19DDEA9500BCA449 /* test_detail.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = test_detail.c; path = ../tests/test_detail.c; sourceTree = ""; }; @@ -293,7 +293,7 @@ DC474E7319DDEA9500BCA449 /* test_systemz.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = test_systemz.c; path = ../tests/test_systemz.c; sourceTree = ""; }; DC474E7419DDEA9500BCA449 /* test_x86.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = test_x86.c; path = ../tests/test_x86.c; sourceTree = ""; }; DC474E7519DDEA9500BCA449 /* test_xcore.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = test_xcore.c; path = ../tests/test_xcore.c; sourceTree = ""; }; - DC474E7619DDEA9500BCA449 /* test.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = test.c; path = ../tests/test.c; sourceTree = ""; }; + DC474E7619DDEA9500BCA449 /* test_basic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = test_basic.c; path = ../tests/test_basic.c; sourceTree = ""; }; DC474E8619DDEAA200BCA449 /* test_arm */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = test_arm; sourceTree = BUILT_PRODUCTS_DIR; }; DC474E9119DDEAA700BCA449 /* test_detail */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = test_detail; sourceTree = BUILT_PRODUCTS_DIR; }; DC474E9C19DDEAAC00BCA449 /* test_mips */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = test_mips; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -576,7 +576,7 @@ DC474E6B19DDEA8600BCA449 /* tests */ = { isa = PBXGroup; children = ( - DC474E7619DDEA9500BCA449 /* test.c */, + DC474E7619DDEA9500BCA449 /* test_basic.c */, DC474E6C19DDEA9500BCA449 /* test_arm.c */, DC474E6D19DDEA9500BCA449 /* test_arm64.c */, DC474E6E19DDEA9500BCA449 /* test_detail.c */, @@ -633,7 +633,7 @@ children = ( DCFE23BD19DDCC2D00EF8EA9 /* libcapstone.a */, DCFE23CD19DDCC9500EF8EA9 /* libcapstone.dylib */, - DC474E6419DDEA5F00BCA449 /* test */, + DC474E6419DDEA5F00BCA449 /* test_basic */, DC474E8619DDEAA200BCA449 /* test_arm */, DC474E9119DDEAA700BCA449 /* test_detail */, DC474E9C19DDEAAC00BCA449 /* test_mips */, @@ -890,9 +890,9 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ - DC474E6319DDEA5F00BCA449 /* test */ = { + DC474E6319DDEA5F00BCA449 /* test_basic */ = { isa = PBXNativeTarget; - buildConfigurationList = DC474E6A19DDEA5F00BCA449 /* Build configuration list for PBXNativeTarget "test" */; + buildConfigurationList = DC474E6A19DDEA5F00BCA449 /* Build configuration list for PBXNativeTarget "test_basic" */; buildPhases = ( DC474E6019DDEA5F00BCA449 /* Sources */, DC474E6119DDEA5F00BCA449 /* Frameworks */, @@ -902,9 +902,9 @@ ); dependencies = ( ); - name = test; - productName = test; - productReference = DC474E6419DDEA5F00BCA449 /* test */; + name = test_basic; + productName = test_basic; + productReference = DC474E6419DDEA5F00BCA449 /* test_basic */; productType = "com.apple.product-type.tool"; }; DC474E8519DDEAA200BCA449 /* test_arm */ = { @@ -1216,7 +1216,7 @@ DCFE23BC19DDCC2D00EF8EA9 /* CapstoneStatic */, DCFE23CC19DDCC9500EF8EA9 /* CapstoneDynamic */, DC474F6719DE6F3B00BCA449 /* CapstoneFramework */, - DC474E6319DDEA5F00BCA449 /* test */, + DC474E6319DDEA5F00BCA449 /* test_basic */, DC474E8519DDEAA200BCA449 /* test_arm */, DC474EE919DDEAE400BCA449 /* test_arm64 */, DC474E9019DDEAA700BCA449 /* test_detail */, @@ -1247,7 +1247,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - DC474EFA19DDEB0200BCA449 /* test.c in Sources */, + DC474EFA19DDEB0200BCA449 /* test_basic.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2885,7 +2885,7 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - DC474E6A19DDEA5F00BCA449 /* Build configuration list for PBXNativeTarget "test" */ = { + DC474E6A19DDEA5F00BCA449 /* Build configuration list for PBXNativeTarget "test_basic" */ = { isa = XCConfigurationList; buildConfigurations = ( DC474E6819DDEA5F00BCA449 /* Debug */, diff --git a/xcode/Capstone.xcodeproj/xcshareddata/xcschemes/Tests.xcscheme b/xcode/Capstone.xcodeproj/xcshareddata/xcschemes/Tests.xcscheme index 80089c47..fa2e1c47 100644 --- a/xcode/Capstone.xcodeproj/xcshareddata/xcschemes/Tests.xcscheme +++ b/xcode/Capstone.xcodeproj/xcshareddata/xcschemes/Tests.xcscheme @@ -15,8 +15,8 @@ @@ -177,37 +177,40 @@ + shouldUseLaunchSchemeArgsEnv = "YES"> + + @@ -215,17 +218,17 @@