Test framework - strongly modified by myself... some (actually little) tests.

devel
Justyna Att Ilczuk 2012-11-04 13:18:26 +01:00
parent e8018808e1
commit 924f957a7e
78 changed files with 2563 additions and 13 deletions

View File

@ -18,15 +18,15 @@
<folderInfo id="cdt.managedbuild.config.gnu.cross.exe.debug.1544392496." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.cross.exe.debug.2045041315" name="Cross GCC" superClass="cdt.managedbuild.toolchain.gnu.cross.exe.debug">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.1733237476" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
<builder buildPath="${workspace_loc:/Sencha-lang/Debug}" id="cdt.managedbuild.builder.gnu.cross.2091580062" managedBuildOn="true" name="Gnu Make Builder.Debug" superClass="cdt.managedbuild.builder.gnu.cross"/>
<builder buildPath="${workspace_loc:/Sencha-lang/Debug}" id="cdt.managedbuild.builder.gnu.cross.2091580062" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="cdt.managedbuild.builder.gnu.cross"/>
<tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.1055356392" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.758256537" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/>
<option id="gnu.c.compiler.option.debugging.level.1319397326" superClass="gnu.c.compiler.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.758256537" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/>
<option id="gnu.c.compiler.option.debugging.level.1319397326" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.809384772" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.495732557" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler">
<option id="gnu.cpp.compiler.option.optimization.level.793014755" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
<option id="gnu.cpp.compiler.option.debugging.level.1513381051" superClass="gnu.cpp.compiler.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
<option id="gnu.cpp.compiler.option.optimization.level.793014755" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
<option id="gnu.cpp.compiler.option.debugging.level.1513381051" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.859439950" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.c.linker.693029150" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker"/>
@ -42,6 +42,10 @@
</tool>
</toolChain>
</folderInfo>
<sourceEntries>
<entry excluding="Tests" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Tests"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
@ -111,4 +115,6 @@
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="refreshScope"/>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
</cproject>

View File

View File

@ -0,0 +1,20 @@
!SESSION 2012-11-03 10:00:59.087 -----------------------------------------------
eclipse.buildId=M20120914-1800
java.version=1.7.0_09
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments: -os linux -ws gtk -arch x86_64
!ENTRY org.eclipse.core.resources 4 77 2012-11-03 10:03:21.991
!MESSAGE Invalid project description.
!SUBENTRY 1 unknown 0 0 2012-11-03 10:03:21.991
!MESSAGE OK
!SUBENTRY 1 org.eclipse.core.resources 4 77 2012-11-03 10:03:21.991
!MESSAGE /home/attero/development/sencha-lang overlaps the workspace location: /home/attero/development/sencha-lang/Sencha-lang
!ENTRY org.eclipse.core.resources 4 77 2012-11-03 10:04:05.497
!MESSAGE Invalid project description.
!SUBENTRY 1 unknown 0 0 2012-11-03 10:04:05.497
!MESSAGE OK
!SUBENTRY 1 org.eclipse.core.resources 4 77 2012-11-03 10:04:05.497
!MESSAGE /home/attero/development/sencha-lang overlaps the workspace location: /home/attero/development/sencha-lang/Sencha-lang

View File

@ -0,0 +1 @@
*** SESSION Nov 03, 2012 10:01:56.29 -------------------------------------------

View File

@ -0,0 +1,4 @@
eclipse.preferences.version=1
spelling_locale_initialized=true
useAnnotationsPrefPage=true
useQuickDiffPrefPage=true

View File

@ -0,0 +1,2 @@
eclipse.preferences.version=1
version=1

View File

@ -0,0 +1,14 @@
content_assist_proposals_background=255,255,255
content_assist_proposals_foreground=31,28,27
eclipse.preferences.version=1
fontPropagated=true
org.eclipse.jdt.internal.ui.navigator.layout=2
org.eclipse.jdt.ui.editor.tab.width=
org.eclipse.jdt.ui.formatterprofiles.version=12
org.eclipse.jdt.ui.javadoclocations.migrated=true
org.eclipse.jface.textfont=1|Monospace|10.0|0|GTK|1|;
proposalOrderMigrated=true
spelling_locale_initialized=true
tabWidthPropagated=true
useAnnotationsPrefPage=true
useQuickDiffPrefPage=true

View File

@ -0,0 +1,5 @@
PROBLEMS_FILTERS_MIGRATE=true
eclipse.preferences.version=1
platformState=1351933260763
quickStart=false
tipsAndTricks=true

View File

@ -0,0 +1,2 @@
eclipse.preferences.version=1
showIntro=false

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<typeInfoHistroy/>

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<qualifiedTypeNameHistroy/>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<section name="Workbench">
<section name="org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart">
<item value="true" key="group_libraries"/>
<item value="false" key="linkWithEditor"/>
<item value="2" key="layout"/>
<item value="1" key="rootMode"/>
<item value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#x0A;&lt;packageExplorer group_libraries=&quot;1&quot; layout=&quot;2&quot; linkWithEditor=&quot;0&quot; rootMode=&quot;1&quot; workingSetName=&quot;Aggregate for window 1351933312531&quot;&gt;&#x0A;&lt;customFilters userDefinedPatternsEnabled=&quot;false&quot;&gt;&#x0A;&lt;xmlDefinedFilters&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.LibraryFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.LocalTypesFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.StaticsFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.pde.ui.ExternalPluginLibrariesFilter1&quot; isEnabled=&quot;true&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.ClosedProjectsFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.NonSharedProjectsFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.NonJavaElementFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.ContainedLibraryFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.CuAndClassFileFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.NonJavaProjectsFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.internal.ui.PackageExplorer.EmptyInnerPackageFilter&quot; isEnabled=&quot;true&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.PackageDeclarationFilter&quot; isEnabled=&quot;true&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.internal.ui.PackageExplorer.EmptyPackageFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.ImportDeclarationFilter&quot; isEnabled=&quot;true&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.FieldsFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.internal.ui.PackageExplorer.HideInnerClassFilesFilter&quot; isEnabled=&quot;true&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.NonPublicFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer_patternFilterId_.*&quot; isEnabled=&quot;true&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.EmptyLibraryContainerFilter&quot; isEnabled=&quot;true&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.pde.ui.BinaryProjectFilter1&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.SyntheticMembersFilter&quot; isEnabled=&quot;true&quot;/&gt;&#x0A;&lt;/xmlDefinedFilters&gt;&#x0A;&lt;/customFilters&gt;&#x0A;&lt;/packageExplorer&gt;" key="memento"/>
</section>
</section>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<section name="Workbench">
<section name="NewWizardAction">
<item value="org.eclipse.cdt.ui.wizards.NewMakeFromExisting" key="NewWizardSelectionPage.STORE_SELECTED_ID"/>
<list key="NewWizardSelectionPage.STORE_EXPANDED_CATEGORIES_ID">
<item value="org.eclipse.cdt.ui.newCWizards"/>
</list>
</section>
</section>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<section name="Workbench">
<item value="1024" key="introLaunchBar.location"/>
</section>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<section name="Workbench">
<section name="org.eclipse.ui.internal.QuickAccess">
<item value="853" key="dialogWidth"/>
<item value="480" key="dialogHeight"/>
<list key="orderedProviders">
</list>
<list key="textArray">
</list>
<list key="orderedElements">
</list>
<list key="textEntries">
</list>
</section>
<section name="ImportExportAction">
</section>
</section>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<workingSetManager>
<workingSet aggregate="true" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1351933312532_0" label="Window Working Set" name="Aggregate for window 1351933312531"/>
</workingSetManager>

View File

@ -0,0 +1 @@
org.eclipse.core.runtime=1

View File

@ -0,0 +1,2 @@
.metadata/.plugins/org.eclipse.cdt.make.core/specs.d: \
../.metadata/.plugins/org.eclipse.cdt.make.core/specs.c

View File

@ -0,0 +1,37 @@
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
CPP_SRCS += \
../.metadata/.plugins/org.eclipse.cdt.make.core/specs.cpp
C_SRCS += \
../.metadata/.plugins/org.eclipse.cdt.make.core/specs.c
OBJS += \
./.metadata/.plugins/org.eclipse.cdt.make.core/specs.o
C_DEPS += \
./.metadata/.plugins/org.eclipse.cdt.make.core/specs.d
CPP_DEPS += \
./.metadata/.plugins/org.eclipse.cdt.make.core/specs.d
# Each subdirectory must supply rules for building sources it contributes
.metadata/.plugins/org.eclipse.cdt.make.core/%.o: ../.metadata/.plugins/org.eclipse.cdt.make.core/%.c
@echo 'Building file: $<'
@echo 'Invoking: Cross GCC Compiler'
gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '
.metadata/.plugins/org.eclipse.cdt.make.core/%.o: ../.metadata/.plugins/org.eclipse.cdt.make.core/%.cpp
@echo 'Building file: $<'
@echo 'Invoking: Cross G++ Compiler'
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,13 @@
Tests/TestLexer.d: ../Tests/TestLexer.cpp ../Tests/TestLexer.h \
../Tests/TestSuite.h ../Tests/minunit.h ../Tests/../Lexer.h \
../Tests/../Token.h
../Tests/TestLexer.h:
../Tests/TestSuite.h:
../Tests/minunit.h:
../Tests/../Lexer.h:
../Tests/../Token.h:

Binary file not shown.

View File

@ -0,0 +1,6 @@
Tests/TestSuite.d: ../Tests/TestSuite.cpp ../Tests/TestSuite.h \
../Tests/minunit.h
../Tests/TestSuite.h:
../Tests/minunit.h:

Binary file not shown.

View File

@ -0,0 +1,27 @@
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
CPP_SRCS += \
../Tests/TestLexer.cpp \
../Tests/TestSuite.cpp
OBJS += \
./Tests/TestLexer.o \
./Tests/TestSuite.o
CPP_DEPS += \
./Tests/TestLexer.d \
./Tests/TestSuite.d
# Each subdirectory must supply rules for building sources it contributes
Tests/%.o: ../Tests/%.cpp
@echo 'Building file: $<'
@echo 'Invoking: Cross G++ Compiler'
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Binary file not shown.

View File

@ -1,7 +1,14 @@
main.d: ../main.cpp ../Token.h ../Lexer.h ../Parser.h
main.d: ../main.cpp ../Token.h ../Lexer.h ../Parser.h \
../Tests/TestLexer.h ../Tests/TestSuite.h ../Tests/minunit.h
../Token.h:
../Lexer.h:
../Parser.h:
../Tests/TestLexer.h:
../Tests/TestSuite.h:
../Tests/minunit.h:

Binary file not shown.

View File

@ -8,6 +8,8 @@ RM := rm -rf
# All of the sources participating in the build are defined here
-include sources.mk
-include Tests/subdir.mk
-include .metadata/.plugins/org.eclipse.cdt.make.core/subdir.mk
-include subdir.mk
-include objects.mk

View File

@ -24,4 +24,6 @@ C_UPPER_DEPS :=
# Every subdirectory with source files must be described here
SUBDIRS := \
. \
Tests \
.metadata/.plugins/org.eclipse.cdt.make.core \

View File

@ -8,7 +8,6 @@ CPP_SRCS += \
../Object.cpp \
../Parser.cpp \
../Token.cpp \
../lexer_tests.cpp \
../main.cpp
OBJS += \
@ -16,7 +15,6 @@ OBJS += \
./Object.o \
./Parser.o \
./Token.o \
./lexer_tests.o \
./main.o
CPP_DEPS += \
@ -24,7 +22,6 @@ CPP_DEPS += \
./Object.d \
./Parser.d \
./Token.d \
./lexer_tests.d \
./main.d

View File

@ -24,12 +24,14 @@ class Lexer
pair<string, Token> parse_token(string line);
type_of_token guess_type(string value);
bool is_keyword(string value);
bool is_punctuation(char c);
bool is_operator(string value );
protected:
private:
bool is_keyword(string value);
bool is_punctuation(char c);
bool is_operator(string value );
vector<string> keywords;
vector<char> punctuation;

View File

@ -0,0 +1,2 @@
.metadata/.plugins/org.eclipse.cdt.make.core/specs.d: \
../.metadata/.plugins/org.eclipse.cdt.make.core/specs.c

View File

@ -0,0 +1,37 @@
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
CPP_SRCS += \
../.metadata/.plugins/org.eclipse.cdt.make.core/specs.cpp
C_SRCS += \
../.metadata/.plugins/org.eclipse.cdt.make.core/specs.c
OBJS += \
./.metadata/.plugins/org.eclipse.cdt.make.core/specs.o
C_DEPS += \
./.metadata/.plugins/org.eclipse.cdt.make.core/specs.d
CPP_DEPS += \
./.metadata/.plugins/org.eclipse.cdt.make.core/specs.d
# Each subdirectory must supply rules for building sources it contributes
.metadata/.plugins/org.eclipse.cdt.make.core/%.o: ../.metadata/.plugins/org.eclipse.cdt.make.core/%.c
@echo 'Building file: $<'
@echo 'Invoking: Cross GCC Compiler'
gcc -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '
.metadata/.plugins/org.eclipse.cdt.make.core/%.o: ../.metadata/.plugins/org.eclipse.cdt.make.core/%.cpp
@echo 'Building file: $<'
@echo 'Invoking: Cross G++ Compiler'
g++ -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

View File

@ -0,0 +1,5 @@
Lexer.d: ../Lexer.cpp ../Lexer.h ../Token.h
../Lexer.h:
../Token.h:

BIN
Sencha-lang/Release/Lexer.o Normal file

Binary file not shown.

View File

@ -0,0 +1,3 @@
Object.d: ../Object.cpp ../Object.h
../Object.h:

Binary file not shown.

View File

@ -0,0 +1,5 @@
Parser.d: ../Parser.cpp ../Parser.h ../Token.h
../Parser.h:
../Token.h:

Binary file not shown.

BIN
Sencha-lang/Release/Sencha-lang Executable file

Binary file not shown.

View File

@ -0,0 +1,13 @@
Tests/TestLexer.d: ../Tests/TestLexer.cpp ../Tests/TestLexer.h \
../Tests/TestSuite.h ../Tests/minunit.h ../Tests/../Lexer.h \
../Tests/../Token.h
../Tests/TestLexer.h:
../Tests/TestSuite.h:
../Tests/minunit.h:
../Tests/../Lexer.h:
../Tests/../Token.h:

Binary file not shown.

View File

@ -0,0 +1,6 @@
Tests/TestSuite.d: ../Tests/TestSuite.cpp ../Tests/TestSuite.h \
../Tests/minunit.h
../Tests/TestSuite.h:
../Tests/minunit.h:

Binary file not shown.

View File

@ -0,0 +1,27 @@
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
CPP_SRCS += \
../Tests/TestLexer.cpp \
../Tests/TestSuite.cpp
OBJS += \
./Tests/TestLexer.o \
./Tests/TestSuite.o
CPP_DEPS += \
./Tests/TestLexer.d \
./Tests/TestSuite.d
# Each subdirectory must supply rules for building sources it contributes
Tests/%.o: ../Tests/%.cpp
@echo 'Building file: $<'
@echo 'Invoking: Cross G++ Compiler'
g++ -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

View File

@ -0,0 +1,3 @@
Token.d: ../Token.cpp ../Token.h
../Token.h:

BIN
Sencha-lang/Release/Token.o Normal file

Binary file not shown.

View File

@ -0,0 +1,14 @@
main.d: ../main.cpp ../Token.h ../Lexer.h ../Parser.h \
../Tests/TestLexer.h ../Tests/TestSuite.h ../Tests/minunit.h
../Token.h:
../Lexer.h:
../Parser.h:
../Tests/TestLexer.h:
../Tests/TestSuite.h:
../Tests/minunit.h:

BIN
Sencha-lang/Release/main.o Normal file

Binary file not shown.

View File

@ -0,0 +1,60 @@
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
-include ../makefile.init
RM := rm -rf
# All of the sources participating in the build are defined here
-include sources.mk
-include Tests/subdir.mk
-include .metadata/.plugins/org.eclipse.cdt.make.core/subdir.mk
-include subdir.mk
-include objects.mk
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(C++_DEPS)),)
-include $(C++_DEPS)
endif
ifneq ($(strip $(C_DEPS)),)
-include $(C_DEPS)
endif
ifneq ($(strip $(CC_DEPS)),)
-include $(CC_DEPS)
endif
ifneq ($(strip $(CPP_DEPS)),)
-include $(CPP_DEPS)
endif
ifneq ($(strip $(CXX_DEPS)),)
-include $(CXX_DEPS)
endif
ifneq ($(strip $(C_UPPER_DEPS)),)
-include $(C_UPPER_DEPS)
endif
endif
-include ../makefile.defs
# Add inputs and outputs from these tool invocations to the build variables
# All Target
all: Sencha-lang
# Tool invocations
Sencha-lang: $(OBJS) $(USER_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: Cross G++ Linker'
g++ -o "Sencha-lang" $(OBJS) $(USER_OBJS) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '
# Other Targets
clean:
-$(RM) $(C++_DEPS)$(OBJS)$(C_DEPS)$(CC_DEPS)$(CPP_DEPS)$(EXECUTABLES)$(CXX_DEPS)$(C_UPPER_DEPS) Sencha-lang
-@echo ' '
.PHONY: all clean dependents
.SECONDARY:
-include ../makefile.targets

View File

@ -0,0 +1,8 @@
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
USER_OBJS :=
LIBS :=

View File

@ -0,0 +1,29 @@
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
O_SRCS :=
CPP_SRCS :=
C_UPPER_SRCS :=
C_SRCS :=
S_UPPER_SRCS :=
OBJ_SRCS :=
ASM_SRCS :=
CXX_SRCS :=
C++_SRCS :=
CC_SRCS :=
C++_DEPS :=
OBJS :=
C_DEPS :=
CC_DEPS :=
CPP_DEPS :=
EXECUTABLES :=
CXX_DEPS :=
C_UPPER_DEPS :=
# Every subdirectory with source files must be described here
SUBDIRS := \
. \
Tests \
.metadata/.plugins/org.eclipse.cdt.make.core \

View File

@ -0,0 +1,36 @@
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
CPP_SRCS += \
../Lexer.cpp \
../Object.cpp \
../Parser.cpp \
../Token.cpp \
../main.cpp
OBJS += \
./Lexer.o \
./Object.o \
./Parser.o \
./Token.o \
./main.o
CPP_DEPS += \
./Lexer.d \
./Object.d \
./Parser.d \
./Token.d \
./main.d
# Each subdirectory must supply rules for building sources it contributes
%.o: ../%.cpp
@echo 'Building file: $<'
@echo 'Invoking: Cross G++ Compiler'
g++ -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

View File

@ -0,0 +1,52 @@
/*
* TestLexer.cpp
*
* Created on: Nov 4, 2012
* Author: attero
*/
#include "TestLexer.h"
#include "../Lexer.h"
TestLexer::TestLexer() {
// TODO Auto-generated constructor stub
}
TestLexer::~TestLexer() {
// TODO Auto-generated destructor stub
}
std::string TestLexer::all_tests()
{
std::string test_report = "";
mu_run_test(test_searching_keyword_for_not_keyword);
mu_run_test(test_fake);
mu_run_test(test_searching_keyword);
return test_report;
}
std::string TestLexer::test_fake()
{
mu_assert("1 == 1", 1 == 1);
return "";
}
std::string TestLexer::test_searching_keyword_for_not_keyword()
{
Lexer lexer;
mu_assert("Balloon is treated as a keyword.", !lexer.is_keyword("Balloon"));
return "";
}
std::string TestLexer::test_searching_keyword()
{
Lexer lexer;
mu_assert("\"while\" isn't treated as keyword.", lexer.is_keyword("while"));
return "";
}

View File

@ -0,0 +1,23 @@
/*
* TestLexer.h
*
* Created on: Nov 4, 2012
* Author: attero
*/
#ifndef TESTLEXER_H_
#define TESTLEXER_H_
#include "TestSuite.h"
class TestLexer : public TestSuite {
public:
TestLexer();
virtual ~TestLexer();
std::string test_searching_keyword_for_not_keyword();
std::string test_searching_keyword();
virtual std::string all_tests();
std::string test_fake();
};
#endif /* TESTLEXER_H_ */

View File

@ -0,0 +1,45 @@
/*
* TestSuite.cpp
*
* Created on: Nov 4, 2012
* Author: attero
*/
#include "TestSuite.h"
TestSuite::TestSuite() {
// TODO Auto-generated constructor stub
tests_passed = 0;
tests_failed = 0;
tests = 0;
}
TestSuite::~TestSuite() {
// TODO Auto-generated destructor stub
}
std::string TestSuite::all_tests()
{
return "";
}
void TestSuite::run_tests()
{
std::string result = all_tests();
if(result != "")
{
std::cout << "\x1b[00;31mSOME TESTS DIDN\'T PASS\x1b[00;00m" << std::endl; //Sets color to red
std::cout << result << std::endl;
}
else
{
std::cout << "\x1b[00;32mALL TESTS PASSED\x1b[00;00m\n" << std::endl; //Sets color to green
}
std::cout << tests_passed << " TESTS PASSED\n";
std::cout << tests_failed << " TESTS FAILED\n";
std::cout << "ALL TESTS: " << tests << std::endl;
}

View File

@ -0,0 +1,28 @@
/*
* TestSuite.h
*
* Created on: Nov 4, 2012
* Author: attero
*/
#ifndef TESTSUITE_H_
#define TESTSUITE_H_
#include <string>
#include "minunit.h"
#include <iostream>
class TestSuite {
public:
int tests_passed;
int tests_failed;
int tests;
void run_tests();
virtual std::string all_tests();
TestSuite();
virtual ~TestSuite();
};
#endif /* TESTSUITE_H_ */

View File

@ -0,0 +1,19 @@
/*
* minunit.h
*
* Created on: Nov 2, 2012
* Author: attero
*/
#ifndef MINUNIT_H_
#define MINUNIT_H_
#define mu_assert(message, test) do { if (!(test)) return message; } while (0)
#define mu_run_test(test) do { std::string message = test(); tests++;\
if (message != ""){ tests_failed++; \
test_report += "in " #test ": " + message + "\n";}\
else tests_passed++;} while (0)
extern int tests_run;
#endif /* MINUNIT_H_ */

View File

@ -0,0 +1,52 @@
/*
* tests_for_lexer.h
*
* Created on: Nov 4, 2012
* Author: attero
*/
#ifndef TESTS_FOR_LEXER_H_
#define TESTS_FOR_LEXER_H_
#include <cstdio>
#include "minunit.h"
#include "../Lexer.h"
#include <string>
/*
static char* test_searching_keyword_for_not_keyword()
{
Lexer lexer;
mu_assert("Balloon is treated as a keyword.", !lexer.is_keyword("Balloon"));
return 0;
}
static char* test_searching_keyword()
{
Lexer lexer;
mu_assert("\"while\" isn't treated as keyword.", lexer.is_keyword("while"));
return 0;
}
static char* all_lexer_tests()
{
mu_run_test(test_searching_keyword_for_not_keyword);
mu_run_test(test_searching_keyword);
return 0;
}
void run_lexer_tests()
{
char* result = all_lexer_tests();
if(result != 0)
{
::printf("%s\n", result);
}
else
{
::printf("ALL TESTS PASSED\n");
}
//::printf("Test run: %d\n", test_run);
}*/
#endif /* TESTS_FOR_LEXER_H_ */

View File

@ -0,0 +1,14 @@
/*
* tests_for_parser.h
*
* Created on: Nov 4, 2012
* Author: attero
*/
#ifndef TESTS_FOR_PARSER_H_
#define TESTS_FOR_PARSER_H_
#endif /* TESTS_FOR_PARSER_H_ */

View File

@ -3,6 +3,7 @@
#include "Token.h"
#include "Lexer.h"
#include "Parser.h"
#include "Tests/TestLexer.h"
using namespace std;
@ -52,7 +53,11 @@ void test_parser()
int main()
{
cout << "Hello world!" << endl;
test_parser();
int test_run = 0;
TestLexer test_l;
test_l.run_tests();
//test_parser();
//test_lexer();
return 0;
}