mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-24 19:49:29 +02:00
pastojs: fixed tests
git-svn-id: trunk@40584 -
This commit is contained in:
parent
65fdc04dc3
commit
89e66cd2fc
@ -1084,8 +1084,8 @@ procedure TPas2jsCompilerFile.CreateConverter;
|
|||||||
begin
|
begin
|
||||||
if FConverter<>nil then exit;
|
if FConverter<>nil then exit;
|
||||||
FConverter:=TPasToJSConverter.Create;
|
FConverter:=TPasToJSConverter.Create;
|
||||||
FConverter.Options:=GetInitialConverterOptions;
|
|
||||||
FConverter.Globals:=Compiler.ConverterGlobals;
|
FConverter.Globals:=Compiler.ConverterGlobals;
|
||||||
|
FConverter.Options:=GetInitialConverterOptions;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPas2jsCompilerFile.OnResolverCheckSrcName(const Element: TPasElement);
|
procedure TPas2jsCompilerFile.OnResolverCheckSrcName(const Element: TPasElement);
|
||||||
|
@ -1259,6 +1259,7 @@ end;
|
|||||||
procedure TTestConverter.SetUp;
|
procedure TTestConverter.SetUp;
|
||||||
begin
|
begin
|
||||||
FConverter:=TPasToJSConverter.Create;
|
FConverter:=TPasToJSConverter.Create;
|
||||||
|
FConverter.Globals:=TPasToJSConverterGlobals.Create(FConverter);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TTestConverter.TearDown;
|
procedure TTestConverter.TearDown;
|
||||||
|
@ -444,8 +444,8 @@ begin
|
|||||||
FInitialFlags.ModeSwitches:=Scanner.CurrentModeSwitches;
|
FInitialFlags.ModeSwitches:=Scanner.CurrentModeSwitches;
|
||||||
FInitialFlags.BoolSwitches:=Scanner.CurrentBoolSwitches;
|
FInitialFlags.BoolSwitches:=Scanner.CurrentBoolSwitches;
|
||||||
FInitialFlags.ConverterOptions:=Converter.Options;
|
FInitialFlags.ConverterOptions:=Converter.Options;
|
||||||
FInitialFlags.TargetPlatform:=Converter.TargetPlatform;
|
FInitialFlags.TargetPlatform:=Converter.Globals.TargetPlatform;
|
||||||
FInitialFlags.TargetProcessor:=Converter.TargetProcessor;
|
FInitialFlags.TargetProcessor:=Converter.Globals.TargetProcessor;
|
||||||
// ToDo: defines
|
// ToDo: defines
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -1197,6 +1197,7 @@ function TCustomTestModule.CreateConverter: TPasToJSConverter;
|
|||||||
begin
|
begin
|
||||||
Result:=TPasToJSConverter.Create;
|
Result:=TPasToJSConverter.Create;
|
||||||
Result.Options:=co_tcmodules;
|
Result.Options:=co_tcmodules;
|
||||||
|
Result.Globals:=TPasToJSConverterGlobals.Create(Result);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomTestModule.InitScanner(aScanner: TPas2jsPasScanner);
|
procedure TCustomTestModule.InitScanner(aScanner: TPas2jsPasScanner);
|
||||||
|
@ -552,7 +552,7 @@ begin
|
|||||||
ExpectedSrc:=LinesToStr([
|
ExpectedSrc:=LinesToStr([
|
||||||
UTF8BOM+'rtl.module("system",[],function () {',
|
UTF8BOM+'rtl.module("system",[],function () {',
|
||||||
' "use strict";',
|
' "use strict";',
|
||||||
' rtl.checkVersion(10101);',
|
' rtl.checkVersion(10301);',
|
||||||
' var $mod = this;',
|
' var $mod = this;',
|
||||||
'});']);
|
'});']);
|
||||||
if not CheckSrcDiff(ExpectedSrc,aFile.Source,s) then
|
if not CheckSrcDiff(ExpectedSrc,aFile.Source,s) then
|
||||||
|
@ -209,7 +209,7 @@ procedure TCustomTestCLI.SetWorkDir(const AValue: string);
|
|||||||
var
|
var
|
||||||
NewValue: String;
|
NewValue: String;
|
||||||
begin
|
begin
|
||||||
NewValue:=IncludeTrailingPathDelimiter(ResolveDots(AValue));
|
NewValue:=IncludeTrailingPathDelimiter(ExpandFileNamePJ(ResolveDots(AValue)));
|
||||||
if FWorkDir=NewValue then Exit;
|
if FWorkDir=NewValue then Exit;
|
||||||
FWorkDir:=NewValue;
|
FWorkDir:=NewValue;
|
||||||
end;
|
end;
|
||||||
@ -228,6 +228,7 @@ begin
|
|||||||
CompilerExe:='/usr/bin/pas2js';
|
CompilerExe:='/usr/bin/pas2js';
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
FCompiler:=TTestCompiler.Create;
|
FCompiler:=TTestCompiler.Create;
|
||||||
|
//FCompiler.ConfigSupport:=TPas2JSFileConfigSupport.Create(FCompiler);
|
||||||
Compiler.Log.OnLog:=@DoLog;
|
Compiler.Log.OnLog:=@DoLog;
|
||||||
Compiler.FileCache.OnReadDirectory:=@OnReadDirectory;
|
Compiler.FileCache.OnReadDirectory:=@OnReadDirectory;
|
||||||
Compiler.FileCache.OnReadFile:=@OnReadFile;
|
Compiler.FileCache.OnReadFile:=@OnReadFile;
|
||||||
|
@ -76,6 +76,7 @@
|
|||||||
<Unit9>
|
<Unit9>
|
||||||
<Filename Value="tcunitsearch.pas"/>
|
<Filename Value="tcunitsearch.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
|
<UnitName Value="TCUnitSearch"/>
|
||||||
</Unit9>
|
</Unit9>
|
||||||
<Unit10>
|
<Unit10>
|
||||||
<Filename Value="tcprecompile.pas"/>
|
<Filename Value="tcprecompile.pas"/>
|
||||||
|
Loading…
Reference in New Issue
Block a user