Test framework - strongly modified by myself... some (actually little) tests.
parent
e8018808e1
commit
924f957a7e
|
@ -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>
|
||||
|
|
|
@ -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
|
|
@ -0,0 +1 @@
|
|||
*** SESSION Nov 03, 2012 10:01:56.29 -------------------------------------------
|
|
@ -0,0 +1 @@
|
|||
|
|
@ -0,0 +1 @@
|
|||
|
|
@ -0,0 +1 @@
|
|||
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,4 @@
|
|||
eclipse.preferences.version=1
|
||||
spelling_locale_initialized=true
|
||||
useAnnotationsPrefPage=true
|
||||
useQuickDiffPrefPage=true
|
|
@ -0,0 +1,2 @@
|
|||
eclipse.preferences.version=1
|
||||
version=1
|
|
@ -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
|
|
@ -0,0 +1,5 @@
|
|||
PROBLEMS_FILTERS_MIGRATE=true
|
||||
eclipse.preferences.version=1
|
||||
platformState=1351933260763
|
||||
quickStart=false
|
||||
tipsAndTricks=true
|
|
@ -0,0 +1,2 @@
|
|||
eclipse.preferences.version=1
|
||||
showIntro=false
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,2 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<typeInfoHistroy/>
|
|
@ -0,0 +1,2 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<qualifiedTypeNameHistroy/>
|
|
@ -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="<?xml version="1.0" encoding="UTF-8"?>
<packageExplorer group_libraries="1" layout="2" linkWithEditor="0" rootMode="1" workingSetName="Aggregate for window 1351933312531">
<customFilters userDefinedPatternsEnabled="false">
<xmlDefinedFilters>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.LibraryFilter" isEnabled="false"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.LocalTypesFilter" isEnabled="false"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.StaticsFilter" isEnabled="false"/>
<child filterId="org.eclipse.pde.ui.ExternalPluginLibrariesFilter1" isEnabled="true"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.ClosedProjectsFilter" isEnabled="false"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.NonSharedProjectsFilter" isEnabled="false"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.NonJavaElementFilter" isEnabled="false"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.ContainedLibraryFilter" isEnabled="false"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.CuAndClassFileFilter" isEnabled="false"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.NonJavaProjectsFilter" isEnabled="false"/>
<child filterId="org.eclipse.jdt.internal.ui.PackageExplorer.EmptyInnerPackageFilter" isEnabled="true"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.PackageDeclarationFilter" isEnabled="true"/>
<child filterId="org.eclipse.jdt.internal.ui.PackageExplorer.EmptyPackageFilter" isEnabled="false"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.ImportDeclarationFilter" isEnabled="true"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.FieldsFilter" isEnabled="false"/>
<child filterId="org.eclipse.jdt.internal.ui.PackageExplorer.HideInnerClassFilesFilter" isEnabled="true"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.NonPublicFilter" isEnabled="false"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer_patternFilterId_.*" isEnabled="true"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.EmptyLibraryContainerFilter" isEnabled="true"/>
<child filterId="org.eclipse.pde.ui.BinaryProjectFilter1" isEnabled="false"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.SyntheticMembersFilter" isEnabled="true"/>
</xmlDefinedFilters>
</customFilters>
</packageExplorer>" key="memento"/>
|
||||
</section>
|
||||
</section>
|
|
@ -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>
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<section name="Workbench">
|
||||
<item value="1024" key="introLaunchBar.location"/>
|
||||
</section>
|
|
@ -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>
|
|
@ -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>
|
|
@ -0,0 +1 @@
|
|||
org.eclipse.core.runtime=1
|
|
@ -0,0 +1,2 @@
|
|||
.metadata/.plugins/org.eclipse.cdt.make.core/specs.d: \
|
||||
../.metadata/.plugins/org.eclipse.cdt.make.core/specs.c
|
Binary file not shown.
|
@ -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.
|
@ -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.
|
@ -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.
|
@ -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.
|
@ -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.
|
@ -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
|
||||
|
||||
|
|
|
@ -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 \
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
.metadata/.plugins/org.eclipse.cdt.make.core/specs.d: \
|
||||
../.metadata/.plugins/org.eclipse.cdt.make.core/specs.c
|
Binary file not shown.
|
@ -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 ' '
|
||||
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
Lexer.d: ../Lexer.cpp ../Lexer.h ../Token.h
|
||||
|
||||
../Lexer.h:
|
||||
|
||||
../Token.h:
|
Binary file not shown.
|
@ -0,0 +1,3 @@
|
|||
Object.d: ../Object.cpp ../Object.h
|
||||
|
||||
../Object.h:
|
Binary file not shown.
|
@ -0,0 +1,5 @@
|
|||
Parser.d: ../Parser.cpp ../Parser.h ../Token.h
|
||||
|
||||
../Parser.h:
|
||||
|
||||
../Token.h:
|
Binary file not shown.
Binary file not shown.
|
@ -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.
|
@ -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.
|
@ -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 ' '
|
||||
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
Token.d: ../Token.cpp ../Token.h
|
||||
|
||||
../Token.h:
|
Binary file not shown.
|
@ -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:
|
Binary file not shown.
|
@ -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
|
|
@ -0,0 +1,8 @@
|
|||
################################################################################
|
||||
# Automatically-generated file. Do not edit!
|
||||
################################################################################
|
||||
|
||||
USER_OBJS :=
|
||||
|
||||
LIBS :=
|
||||
|
|
@ -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 \
|
||||
|
|
@ -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 ' '
|
||||
|
||||
|
|
@ -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 "";
|
||||
}
|
|
@ -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_ */
|
|
@ -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;
|
||||
}
|
|
@ -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_ */
|
|
@ -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_ */
|
|
@ -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_ */
|
|
@ -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_ */
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue