Skip to content

Commit

Permalink
Rename test.c to test_basic.c with corresponding executable name chan…
Browse files Browse the repository at this point in the history
…ge. (capstone-engine#923)

* Rename test.c to test_basic.c with corresponding executable name change.

* Fix Makefile, tests/Makefile to comprehend renamed test program. See issue capstone-engine#922

* Fix XCode project to comprehend renamed test program.  See issue capstone-engine#922

* Rename python test.py to test_basic.py to parallel C test name.  See issue capstone-engine#922

* Rename ocaml test.ml to test_basic.ml to parallel C test name.  See issue capstone-engine#922

* Fix MSVC project definitions to comprehend renamed test program.  See issue capstone-engine#922
  • Loading branch information
nbriggs authored and aquynh committed May 11, 2017
1 parent 7b4e870 commit ce3f0d0
Show file tree
Hide file tree
Showing 15 changed files with 46 additions and 43 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions bindings/ocaml/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion bindings/ocaml/README
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions bindings/python/BUILDING.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
2 changes: 1 addition & 1 deletion bindings/python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions bindings/python/test_all.py
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion msvc/capstone.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions msvc/test/test.vcxproj → msvc/test_basic/test_basic.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<ProjectGuid>{B291E0D9-4B39-4AF8-971D-A015B78D54A1}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>capstonetest</RootNamespace>
<ProjectName>test</ProjectName>
<ProjectName>test_basic</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
Expand Down Expand Up @@ -156,7 +156,7 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\tests\test.c" />
<ClCompile Include="..\..\tests\test_basic.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
2 changes: 1 addition & 1 deletion tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
26 changes: 13 additions & 13 deletions xcode/Capstone.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */; };
Expand Down Expand Up @@ -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 = "<group>"; };
DC474E6D19DDEA9500BCA449 /* test_arm64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = test_arm64.c; path = ../tests/test_arm64.c; sourceTree = "<group>"; };
DC474E6E19DDEA9500BCA449 /* test_detail.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = test_detail.c; path = ../tests/test_detail.c; sourceTree = "<group>"; };
Expand All @@ -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 = "<group>"; };
DC474E7419DDEA9500BCA449 /* test_x86.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = test_x86.c; path = ../tests/test_x86.c; sourceTree = "<group>"; };
DC474E7519DDEA9500BCA449 /* test_xcore.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = test_xcore.c; path = ../tests/test_xcore.c; sourceTree = "<group>"; };
DC474E7619DDEA9500BCA449 /* test.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = test.c; path = ../tests/test.c; sourceTree = "<group>"; };
DC474E7619DDEA9500BCA449 /* test_basic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = test_basic.c; path = ../tests/test_basic.c; sourceTree = "<group>"; };
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; };
Expand Down Expand Up @@ -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 */,
Expand Down Expand Up @@ -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 */,
Expand Down Expand Up @@ -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 */,
Expand All @@ -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 */ = {
Expand Down Expand Up @@ -1216,7 +1216,7 @@
DCFE23BC19DDCC2D00EF8EA9 /* CapstoneStatic */,
DCFE23CC19DDCC9500EF8EA9 /* CapstoneDynamic */,
DC474F6719DE6F3B00BCA449 /* CapstoneFramework */,
DC474E6319DDEA5F00BCA449 /* test */,
DC474E6319DDEA5F00BCA449 /* test_basic */,
DC474E8519DDEAA200BCA449 /* test_arm */,
DC474EE919DDEAE400BCA449 /* test_arm64 */,
DC474E9019DDEAA700BCA449 /* test_detail */,
Expand Down Expand Up @@ -1247,7 +1247,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
DC474EFA19DDEB0200BCA449 /* test.c in Sources */,
DC474EFA19DDEB0200BCA449 /* test_basic.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -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 */,
Expand Down
27 changes: 15 additions & 12 deletions xcode/Capstone.xcodeproj/xcshareddata/xcschemes/Tests.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DC474E6319DDEA5F00BCA449"
BuildableName = "test"
BlueprintName = "test"
BuildableName = "test_basic"
BlueprintName = "test_basic"
ReferencedContainer = "container:Capstone.xcodeproj">
</BuildableReference>
</BuildActionEntry>
Expand Down Expand Up @@ -177,55 +177,58 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DC474E6319DDEA5F00BCA449"
BuildableName = "test"
BlueprintName = "test"
BuildableName = "test_basic"
BlueprintName = "test_basic"
ReferencedContainer = "container:Capstone.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DC474E6319DDEA5F00BCA449"
BuildableName = "test"
BlueprintName = "test"
BuildableName = "test_basic"
BlueprintName = "test_basic"
ReferencedContainer = "container:Capstone.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DC474E6319DDEA5F00BCA449"
BuildableName = "test"
BlueprintName = "test"
BuildableName = "test_basic"
BlueprintName = "test_basic"
ReferencedContainer = "container:Capstone.xcodeproj">
</BuildableReference>
</MacroExpansion>
Expand Down

0 comments on commit ce3f0d0

Please sign in to comment.