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