From c14949b75587f694efcb974089aabe86d6e3e1b6 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Wed, 29 Aug 2018 13:28:31 +0200 Subject: [PATCH] cleanup and fix page control test app --- lazproj/cedast_loader.pas | 100 ------------------ lazproj/coedit_d_projects.prjgroup | 13 --- lazproj/{test => }/pagecontrol/.gitignore | 0 .../{test => }/pagecontrol/pagecontrol.lpi | 24 ++++- .../{test => }/pagecontrol/pagecontrol.lpr | 0 .../pagecontrol/pagecontroltester.lfm | 5 +- .../pagecontrol/pagecontroltester.pas | 10 +- lazproj/test/coeditproj/cleaner.coedit | 32 ------ .../test/coeditproj/googlesearchdlang.coedit | 22 ---- .../test/coeditproj/mixin_errfile_data.coedit | 20 ---- lazproj/test/coeditproj/post.bat | 2 - lazproj/test/coeditproj/pre.bat | 2 - lazproj/test/coeditproj/test.coedit | 47 -------- lazproj/test/src/barclass.d | 19 ---- lazproj/test/src/cleaner.d | 86 --------------- lazproj/test/src/customFoldBug.d | 20 ---- lazproj/test/src/expandSymString.d | 42 -------- lazproj/test/src/fooclass.d | 16 --- lazproj/test/src/googlesearch.d | 21 ---- .../src/interactive.command.interpreter.d | 44 -------- lazproj/test/src/main.d | 33 ------ lazproj/test/src/message_demangle.d | 16 --- lazproj/test/src/mixin_errfile_data.txt | 1 - lazproj/test/src/mixin_errfile_main.d | 10 -- lazproj/test/src/runnable_console.d | 26 ----- lazproj/test/src/runnable_firstline_flags.d | 19 ---- lazproj/test/src/runnable_input_handling.d | 14 --- 27 files changed, 28 insertions(+), 616 deletions(-) delete mode 100644 lazproj/cedast_loader.pas delete mode 100644 lazproj/coedit_d_projects.prjgroup rename lazproj/{test => }/pagecontrol/.gitignore (100%) rename lazproj/{test => }/pagecontrol/pagecontrol.lpi (54%) rename lazproj/{test => }/pagecontrol/pagecontrol.lpr (100%) rename lazproj/{test => }/pagecontrol/pagecontroltester.lfm (54%) rename lazproj/{test => }/pagecontrol/pagecontroltester.pas (81%) delete mode 100644 lazproj/test/coeditproj/cleaner.coedit delete mode 100644 lazproj/test/coeditproj/googlesearchdlang.coedit delete mode 100644 lazproj/test/coeditproj/mixin_errfile_data.coedit delete mode 100644 lazproj/test/coeditproj/post.bat delete mode 100644 lazproj/test/coeditproj/pre.bat delete mode 100644 lazproj/test/coeditproj/test.coedit delete mode 100644 lazproj/test/src/barclass.d delete mode 100644 lazproj/test/src/cleaner.d delete mode 100644 lazproj/test/src/customFoldBug.d delete mode 100644 lazproj/test/src/expandSymString.d delete mode 100644 lazproj/test/src/fooclass.d delete mode 100644 lazproj/test/src/googlesearch.d delete mode 100644 lazproj/test/src/interactive.command.interpreter.d delete mode 100644 lazproj/test/src/main.d delete mode 100644 lazproj/test/src/message_demangle.d delete mode 100644 lazproj/test/src/mixin_errfile_data.txt delete mode 100644 lazproj/test/src/mixin_errfile_main.d delete mode 100644 lazproj/test/src/runnable_console.d delete mode 100644 lazproj/test/src/runnable_firstline_flags.d delete mode 100644 lazproj/test/src/runnable_input_handling.d diff --git a/lazproj/cedast_loader.pas b/lazproj/cedast_loader.pas deleted file mode 100644 index 5f10d646..00000000 --- a/lazproj/cedast_loader.pas +++ /dev/null @@ -1,100 +0,0 @@ -program cedast_loader; - -{$MODE OBJFPC} - -uses dynlibs, classes, sysutils; - -type - - TAstHandle = NativeInt; - - TAstNotification = procedure(param: pointer); cdecl; - - {$Z1} - - TSerializationFormat = (json, pas); - - TNewAst = function(param: Pointer; clbck: TAstNotification): TAstHandle; cdecl; - TDeleteAst = procedure(tok: TAstHandle); cdecl; - - TScanFile = procedure(tok: TAstHandle; filename: PChar); cdecl; - TScanBuffer = procedure(tok: TAstHandle; buffer: PByte; len: NativeUint); cdecl; - - - TModuleName = function(tok: TAstHandle): PChar; cdecl; - TSymbolList = function(tok: TAstHandle; var len: NativeUint ; fmt: TSerializationFormat): PByte; cdecl; - - - -var - dast: TLibHandle; - newAst: TNewAst; - deleteast: TDeleteAst; - scanFile: TScanFile; - scanBuffer: TScanBuffer; - moduleName: TModuleName; - symbolList: TSymbolList; - hdl: TAstHandle; - len: NativeUint = 0; - ptr: PByte; - done: boolean; - -const - testModule = 'module a.b.c.d.e.f.g.h; import std.stdio; uint a; struct F{long c;}'; - -procedure notif(param: Pointer); cdecl; -begin - done := true; -end; - - -begin - - dast := LoadLibrary('cedast'); - if dast = NilHandle then - writeln('dast invalid handle') - else begin - - newAst := TNewAst(GetProcAddress(dast, 'newAst')); - if newAst = nil then writeln('invalid newAst proc ptr') - else hdl := newAst(nil, @notif); - - scanFile := TScanFile(GetProcAddress(dast, 'scanFile')); - if scanFile = nil then writeln('invalid scanfile proc ptr') - else begin - done := false; - scanFile(hdl, PChar('exception in call')); - while not done do sleep(20); - end; - - scanBuffer := TScanBuffer(GetProcAddress(dast, 'scanBuffer')); - if scanBuffer = nil then writeln('invalid scanBuffer proc ptr') - else begin - done := false; - scanBuffer(hdl, @testModule[1], length(testModule)); - while not done do sleep(20); - end; - - moduleName := TModuleName(GetProcAddress(dast, 'moduleName')); - if moduleName = nil then writeln('invalid moduleName proc ptr') - else if hdl <> 0 then writeln(moduleName(hdl)); - - symbolList := TSymbolList(GetProcAddress(dast, 'symbolList')); - if symbolList = nil then writeln('invalid symbolList proc ptr') - else if hdl <> 0 then with TMemoryStream.Create do try - ptr := symbolList(hdl, len, TSerializationFormat.json); - write(ptr^, len); - SaveToFile('testsymlist.txt'); - finally - free; - end; - - deleteAst := TDeleteAst(GetProcAddress(dast, 'deleteAst')); - if deleteAst = nil then writeln('invalid deleteAst proc ptr') - else deleteAst(hdl); - - end; - - readln; -end. - diff --git a/lazproj/coedit_d_projects.prjgroup b/lazproj/coedit_d_projects.prjgroup deleted file mode 100644 index a71c58b5..00000000 --- a/lazproj/coedit_d_projects.prjgroup +++ /dev/null @@ -1,13 +0,0 @@ -object _1: TProjectGroup - items = < - item - filename = '..\cesyms\cesyms_libman.coedit' - end - item - filename = '..\cetodo\cetodo_libman.coedit' - end - item - filename = '..\cesetup\cesetup.coedit' - end> - index = 0 -end diff --git a/lazproj/test/pagecontrol/.gitignore b/lazproj/pagecontrol/.gitignore similarity index 100% rename from lazproj/test/pagecontrol/.gitignore rename to lazproj/pagecontrol/.gitignore diff --git a/lazproj/test/pagecontrol/pagecontrol.lpi b/lazproj/pagecontrol/pagecontrol.lpi similarity index 54% rename from lazproj/test/pagecontrol/pagecontrol.lpi rename to lazproj/pagecontrol/pagecontrol.lpi index b20c9d17..dad9b244 100644 --- a/lazproj/test/pagecontrol/pagecontrol.lpi +++ b/lazproj/pagecontrol/pagecontrol.lpi @@ -1,20 +1,34 @@ - + <ResourceType Value="res"/> <UseXPManifest Value="True"/> + <Resources Count="15"> + <Resource_0 FileName="../../icons/file/document_add.png" Type="RCDATA" ResourceName="DOCUMENT_ADD"/> + <Resource_1 FileName="../../icons/file/document_add24.png" Type="RCDATA" ResourceName="DOCUMENT_ADD24"/> + <Resource_2 FileName="../../icons/file/document_add32.png" Type="RCDATA" ResourceName="DOCUMENT_ADD32"/> + <Resource_3 FileName="../../icons/file/document_back.png" Type="RCDATA" ResourceName="DOCUMENT_BACK"/> + <Resource_4 FileName="../../icons/file/document_back24.png" Type="RCDATA" ResourceName="DOCUMENT_BACK24"/> + <Resource_5 FileName="../../icons/file/document_back32.png" Type="RCDATA" ResourceName="DOCUMENT_BACK32"/> + <Resource_6 FileName="../../icons/file/document_delete.png" Type="RCDATA" ResourceName="DOCUMENT_DELETE"/> + <Resource_7 FileName="../../icons/file/document_delete24.png" Type="RCDATA" ResourceName="DOCUMENT_DELETE24"/> + <Resource_8 FileName="../../icons/file/document_delete32.png" Type="RCDATA" ResourceName="DOCUMENT_DELETE32"/> + <Resource_9 FileName="../../icons/file/document_next.png" Type="RCDATA" ResourceName="DOCUMENT_NEXT"/> + <Resource_10 FileName="../../icons/file/document_next24.png" Type="RCDATA" ResourceName="DOCUMENT_NEXT24"/> + <Resource_11 FileName="../../icons/file/document_next32.png" Type="RCDATA" ResourceName="DOCUMENT_NEXT32"/> + <Resource_12 FileName="../../icons/other/splitter.png" Type="RCDATA" ResourceName="SPLITTER"/> + <Resource_13 FileName="../../icons/other/splitter24.png" Type="RCDATA" ResourceName="SPLITTER24"/> + <Resource_14 FileName="../../icons/other/splitter32.png" Type="RCDATA" ResourceName="SPLITTER32"/> + </Resources> </General> <i18n> <EnableI18N LFM="False"/> </i18n> - <VersionInfo> - <StringTable ProductVersion=""/> - </VersionInfo> <BuildModes Count="1"> <Item1 Name="Default" Default="True"/> </BuildModes> @@ -52,7 +66,7 @@ </Target> <SearchPaths> <IncludeFiles Value="$(ProjOutDir)"/> - <OtherUnitFiles Value="../../../src"/> + <OtherUnitFiles Value="../../src"/> <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> </SearchPaths> <Parsing> diff --git a/lazproj/test/pagecontrol/pagecontrol.lpr b/lazproj/pagecontrol/pagecontrol.lpr similarity index 100% rename from lazproj/test/pagecontrol/pagecontrol.lpr rename to lazproj/pagecontrol/pagecontrol.lpr diff --git a/lazproj/test/pagecontrol/pagecontroltester.lfm b/lazproj/pagecontrol/pagecontroltester.lfm similarity index 54% rename from lazproj/test/pagecontrol/pagecontroltester.lfm rename to lazproj/pagecontrol/pagecontroltester.lfm index f054374f..db0badb1 100644 --- a/lazproj/test/pagecontrol/pagecontroltester.lfm +++ b/lazproj/pagecontrol/pagecontroltester.lfm @@ -4,5 +4,8 @@ object Form1: TForm1 Top = 193 Width = 819 Caption = 'Form1' - LCLVersion = '1.4.4.0' + ClientHeight = 317 + ClientWidth = 819 + LCLVersion = '1.8.4.0' + Visible = False end diff --git a/lazproj/test/pagecontrol/pagecontroltester.pas b/lazproj/pagecontrol/pagecontroltester.pas similarity index 81% rename from lazproj/test/pagecontrol/pagecontroltester.pas rename to lazproj/pagecontrol/pagecontroltester.pas index 82ac37ca..df90e83a 100644 --- a/lazproj/test/pagecontrol/pagecontroltester.pas +++ b/lazproj/pagecontrol/pagecontroltester.pas @@ -32,11 +32,11 @@ begin fPageControl.Align := alClient; fPageControl.onChanged:=@pageControlChanged; - AssignPng(fPageControl.closeButton.Glyph, 'document_delete'); - AssignPng(fPageControl.addButton.Glyph, 'document_add'); - AssignPng(fPageControl.moveLeftButton.Glyph, 'document_back'); - AssignPng(fPageControl.moveRightButton.Glyph, 'document_next'); - AssignPng(fPageControl.splitButton.Glyph, 'splitter'); + AssignPng(fPageControl.closeButton.Glyph, 'DOCUMENT_DELETE'); + AssignPng(fPageControl.addButton.Glyph, 'DOCUMENT_ADD'); + AssignPng(fPageControl.moveLeftButton.Glyph, 'DOCUMENT_BACK'); + AssignPng(fPageControl.moveRightButton.Glyph, 'DOCUMENT_NEXT'); + AssignPng(fPageControl.splitButton.Glyph, 'SPLITTER'); end; procedure TForm1.pageControlChanged(sender: TObject); diff --git a/lazproj/test/coeditproj/cleaner.coedit b/lazproj/test/coeditproj/cleaner.coedit deleted file mode 100644 index cf021ca8..00000000 --- a/lazproj/test/coeditproj/cleaner.coedit +++ /dev/null @@ -1,32 +0,0 @@ -object CurrentProject: TCEProject - OptionsCollection = < - item - name = 'release' - outputOptions.inlining = True - outputOptions.noBoundsCheck = False - outputOptions.boundsCheck = offAlways - outputOptions.optimizations = True - outputOptions.release = True - pathsOptions.outputFilename = '<CAP>cleaner.exe' - preBuildProcess.options = [] - preBuildProcess.showWindow = swoNone - postBuildProcess.executable = '<CAP>cleaner.exe' - postBuildProcess.options = [poUsePipes, poStderrToOutPut] - postBuildProcess.parameters.Strings = ( - '-e' - '.tmp,.res' - '-f' - 'afile.file,anotherfile.hji' - '-p' - '<CAP>' - '-r' - ) - postBuildProcess.showWindow = swoHIDE - runOptions.options = [] - runOptions.showWindow = swoNone - end> - Sources.Strings = ( - '..\src\cleaner.d' - ) - ConfigurationIndex = 0 -end diff --git a/lazproj/test/coeditproj/googlesearchdlang.coedit b/lazproj/test/coeditproj/googlesearchdlang.coedit deleted file mode 100644 index 9bf08a0e..00000000 --- a/lazproj/test/coeditproj/googlesearchdlang.coedit +++ /dev/null @@ -1,22 +0,0 @@ -object CurrentProject: TCEProject - OptionsCollection = < - item - name = 'release' - outputOptions.inlining = True - outputOptions.noBoundsCheck = False - outputOptions.boundsCheck = offAlways - outputOptions.optimizations = True - outputOptions.release = True - pathsOptions.outputFilename = '<CAP>googlesearch' - preBuildProcess.options = [] - preBuildProcess.showWindow = swoNone - postBuildProcess.options = [] - postBuildProcess.showWindow = swoNone - runOptions.options = [] - runOptions.showWindow = swoNone - end> - Sources.Strings = ( - '..\src\googlesearch.d' - ) - ConfigurationIndex = 0 -end diff --git a/lazproj/test/coeditproj/mixin_errfile_data.coedit b/lazproj/test/coeditproj/mixin_errfile_data.coedit deleted file mode 100644 index c3023d21..00000000 --- a/lazproj/test/coeditproj/mixin_errfile_data.coedit +++ /dev/null @@ -1,20 +0,0 @@ -object CurrentProject: TCEProject - OptionsCollection = < - item - name = 'release' - outputOptions.boundsCheck = offAlways - pathsOptions.Imports.Strings = ( - '..\src\' - ) - preBuildProcess.options = [] - preBuildProcess.showWindow = swoNone - postBuildProcess.options = [] - postBuildProcess.showWindow = swoNone - runOptions.options = [poUsePipes, poStderrToOutPut] - runOptions.showWindow = swoNone - end> - Sources.Strings = ( - '..\src\mixin_errfile_main.d' - ) - ConfigurationIndex = 0 -end diff --git a/lazproj/test/coeditproj/post.bat b/lazproj/test/coeditproj/post.bat deleted file mode 100644 index ca62f993..00000000 --- a/lazproj/test/coeditproj/post.bat +++ /dev/null @@ -1,2 +0,0 @@ -echo 'has compiled' -pause \ No newline at end of file diff --git a/lazproj/test/coeditproj/pre.bat b/lazproj/test/coeditproj/pre.bat deleted file mode 100644 index b52cd74f..00000000 --- a/lazproj/test/coeditproj/pre.bat +++ /dev/null @@ -1,2 +0,0 @@ -echo 'will compile' -pause \ No newline at end of file diff --git a/lazproj/test/coeditproj/test.coedit b/lazproj/test/coeditproj/test.coedit deleted file mode 100644 index bf54ed2f..00000000 --- a/lazproj/test/coeditproj/test.coedit +++ /dev/null @@ -1,47 +0,0 @@ -object _1: TCENativeProject - OptionsCollection = < - item - name = 'default' - documentationOptions.generateDocumentation = True - documentationOptions.DocumentationDirectory = '../doc' - debugingOptions.debug = True - debugingOptions.debugIdentifiers.Strings = ( - 'a' - 'b' - ) - debugingOptions.debugLevel = 2 - messagesOptions.additionalWarnings = True - outputOptions.boundsCheck = onAlways - outputOptions.unittest = True - outputOptions.versionIdentifiers.Strings = ( - 'revision_1' - ) - pathsOptions.outputFilename = '../output/main' - preBuildProcess.workingDirectory = '<CPP>' - preBuildProcess.options = [poWaitOnExit] - postBuildProcess.workingDirectory = '<CPP>' - postBuildProcess.options = [poWaitOnExit] - end - item - name = 'alternative' - documentationOptions.generateDocumentation = True - documentationOptions.DocumentationDirectory = '../doc' - debugingOptions.debug = True - debugingOptions.debugLevel = 3 - messagesOptions.additionalWarnings = True - outputOptions.inlining = True - outputOptions.boundsCheck = onAlways - outputOptions.optimizations = True - outputOptions.unittest = True - outputOptions.versionIdentifiers.Strings = ( - 'revision_2' - ) - pathsOptions.outputFilename = '../output/main' - end> - Sources.Strings = ( - '../src/main.d' - '../src/barclass.d' - '../src/fooclass.d' - ) - ConfigurationIndex = 0 -end diff --git a/lazproj/test/src/barclass.d b/lazproj/test/src/barclass.d deleted file mode 100644 index 27a58666..00000000 --- a/lazproj/test/src/barclass.d +++ /dev/null @@ -1,19 +0,0 @@ -module barclass; - -import std.stdio; - -class Bar{ - this(){ - version(revision_1) writeln("bar says: revision 1"); - version(revision_2) writeln("bar says: revision 2"); - version(unittest) writeln("bar says: unittest"); - debug writeln("bar says: debug"); - debug(0) writeln("bar says: debug level < 1"); - debug(1) writeln("bar says: debug level < 2"); - debug(2) writeln("bar says: debug level < 3"); - debug(3) writeln("bar says: debug level < 4"); - debug(a) writeln("bar says: debug ident a"); - debug(b) writeln("bar says: debug ident b"); - debug(c) writeln("bar says: debug ident c"); - } -} diff --git a/lazproj/test/src/cleaner.d b/lazproj/test/src/cleaner.d deleted file mode 100644 index 595e5c9f..00000000 --- a/lazproj/test/src/cleaner.d +++ /dev/null @@ -1,86 +0,0 @@ -module cleaner; - -import std.stdio; -import std.path; -import std.file; -import std.getopt; -import std.array; - -/* - -as a runnable, input query line: - - -e ".ext1,.ext2" -f "file.ext,file.ext" -p "rootPath" -r - -or as a post-build process, parameter list: - - -e - ".ext1,.ext2" - -f - "file.ext,file.ext" - -p - "rootPath" - -r - -*/ -void main(string args[]) -{ - bool recursive; - string path; - string userexts; - string userfiles; - string exts[]; - string files[]; - - exts ~= [".obj", ".o"]; - - getopt(args, config.passThrough, - "e|ext", &userexts, - "f|files", &userfiles, - "p|path", &path, - "r|recursive", &recursive - ); - - if (!exists(path) || path.length == 0) - return; - - if (userexts.length != 0) - { - auto itms = split(userexts, ','); - foreach(itm; itms) - if (itm.length > 1 && itm[0] == '.') - exts ~= itm; - } - - if (userfiles.length != 0) - { - auto itms = split(userfiles, ','); - foreach(itm; itms) - if (itm.length > 0) - files ~= itm; - } - - void clean(in string currroot) - { - DirIterator entries = dirEntries(currroot, SpanMode.shallow); - - foreach(entry; entries) - { - scope(failure){} - - if (!isDir(entry)) - { - foreach(trg_ext; exts) - if (entry.extension == trg_ext) - std.file.remove(entry); - foreach(trg_file; files) - if (entry.name == trg_file) - std.file.remove(entry); - - } - else if (recursive) - clean(entry); - } - } - clean(path); -} diff --git a/lazproj/test/src/customFoldBug.d b/lazproj/test/src/customFoldBug.d deleted file mode 100644 index b2912942..00000000 --- a/lazproj/test/src/customFoldBug.d +++ /dev/null @@ -1,20 +0,0 @@ -module runnable; - -import std.stdio; - -void main(string args[]) -{ - - if(true){ - - - // region start ----+ - - - } - - - // region end ---- - - -} diff --git a/lazproj/test/src/expandSymString.d b/lazproj/test/src/expandSymString.d deleted file mode 100644 index 6b063b3a..00000000 --- a/lazproj/test/src/expandSymString.d +++ /dev/null @@ -1,42 +0,0 @@ -module expandSymString; - -import std.stdio; -import std.getopt; - -/* -pass: - -"--a=<CAF>" "--b=<CAP>" "--c=<CFF>" "--d=<CFP>" "--e=<CI>" "--f=<CPF>" "--g=<CPP>" "--h=<CPR>" "--i=<CPN>" "--j=<CPO>" "--k=<CPFS>" "--l=<CPCD>" - -as parameters in "Run, Compile and Run file..." -*/ - -void main(string[] args) -{ - auto opt2symbol = [ - // coedit - 'a' : "CoeditApplicationFile..: ", - 'b' : "CoeditApplicationPath..: ", - // file - 'c' : "currentFileFilename....: ", - 'd' : "CurrentFilePath........: ", - 'e' : "CurrentIdentifier......: ", - // project - 'f' : "CurrentProjectFile.....: ", - 'g' : "CurrentProjectPath.....: ", - 'h' : "CurrentProjectRoot.....: ", - 'i' : "CurrentProjectName.....: ", - 'j' : "CurrentProjectOutput...: ", - 'k' : "CurrentProjectFiles....: ", - 'l' : "CurrentProjectCommonSourceDirectory....: " - ]; - - string expanded; - foreach (c; 'a'..'z') - { - expanded = ""; - getopt(args, std.getopt.config.passThrough, c, &expanded); - if (expanded.length) - writeln(opt2symbol[c], expanded); - } -} diff --git a/lazproj/test/src/fooclass.d b/lazproj/test/src/fooclass.d deleted file mode 100644 index 59a6a07f..00000000 --- a/lazproj/test/src/fooclass.d +++ /dev/null @@ -1,16 +0,0 @@ -module fooclass; - -import std.stdio; - -class Foo{ - this(){ - version(revision_1) writeln("foo says: revision 1"); - version(revision_2) writeln("foo says: revision 2"); - version(unittest) writeln("foo says: unittest"); - debug writeln("foo says: debug"); - debug(0) writeln("foo says: debug level < 1"); - debug(1) writeln("foo says: debug level < 2"); - debug(2) writeln("foo says: debug level < 3"); - debug(3) writeln("foo says: debug level < 4"); - } -} diff --git a/lazproj/test/src/googlesearch.d b/lazproj/test/src/googlesearch.d deleted file mode 100644 index ffa84fc2..00000000 --- a/lazproj/test/src/googlesearch.d +++ /dev/null @@ -1,21 +0,0 @@ -module googlesearch; - -/* -Coedit custom tool: -search some help about the current identifier. -executable: <CAP>\googlesearch.exe -parameters: <CI> -*/ - -static const string prefix = "http://www.google.com/search?q=\"dlang.org+"; -static const string suffix = "&btnI=Im+Feeling+Lucky"; - -void main(string args[]) -{ - if (args.length == 1) - return; - - auto url = prefix ~ args[1]~ suffix; - import std.process: browse; - browse(url); -} diff --git a/lazproj/test/src/interactive.command.interpreter.d b/lazproj/test/src/interactive.command.interpreter.d deleted file mode 100644 index d3909387..00000000 --- a/lazproj/test/src/interactive.command.interpreter.d +++ /dev/null @@ -1,44 +0,0 @@ -module interactive.command.interpreter; - -import std.stdio; -import std.array; - -string[] arguments; -string command; -void function()[string] dispatcher; - -static this(){ - dispatcher["hello"] = &hello; - dispatcher["showargs"] = &showArgs; -} - -void showArgs(){ - foreach(arg;arguments) writeln(arg); -} -void hello(){ - writeln("hello world"); -} - -void main(string args[]) -{ - string input; - while (true) - { - input = readln; - if (input == "exit\n") return; - // split command and args - auto s = split(input); - if (s.length){ - command = s[0]; - if (s.length > 1) - arguments = s[1..$]; - else - arguments.length = 0; - if (command in dispatcher) - dispatcher[command](); - else - writeln("unrecognized command: ", command); - stdout.flush; - } - } -} diff --git a/lazproj/test/src/main.d b/lazproj/test/src/main.d deleted file mode 100644 index 9276bbf2..00000000 --- a/lazproj/test/src/main.d +++ /dev/null @@ -1,33 +0,0 @@ -/* -Test: -- prj save/load -- prj compile/run -- multiples sources -- relative paths -- various switches -*/ - -module main; - -import std.stdio; -import fooclass; -import barclass; - -void main(string[] args) -{ - auto foo = new Foo; - auto bar = new Bar; - - scope(exit) - { - delete foo; - delete bar; - } - // if not UsePipes in RunOptions - // then: - readln; - // (input is passed thru the new console) - - // else: input is not handled so readln will hang Coedit until - // the new process is manually killed -} diff --git a/lazproj/test/src/message_demangle.d b/lazproj/test/src/message_demangle.d deleted file mode 100644 index e59dc894..00000000 --- a/lazproj/test/src/message_demangle.d +++ /dev/null @@ -1,16 +0,0 @@ -module runnable; - -import std.stdio; - -/* -- Compile file & run. -- select containing mangled symbols -- message context menu, click Demangle selection -*/ - -void main(string[] args) -{ - "_D2rt4util7console8__assertFiZv".writeln; - "random initial junk _D2rt4util7console8__assertFiZv random trailer".writeln; - "multiple _D2rt4util7console8__assertFiZv occurrences _D2rt4util7console8__assertFiZv".writeln; -} diff --git a/lazproj/test/src/mixin_errfile_data.txt b/lazproj/test/src/mixin_errfile_data.txt deleted file mode 100644 index fa21a576..00000000 --- a/lazproj/test/src/mixin_errfile_data.txt +++ /dev/null @@ -1 +0,0 @@ -writeln("hello runnable module); diff --git a/lazproj/test/src/mixin_errfile_main.d b/lazproj/test/src/mixin_errfile_main.d deleted file mode 100644 index 1b79df3a..00000000 --- a/lazproj/test/src/mixin_errfile_main.d +++ /dev/null @@ -1,10 +0,0 @@ -module runnable; - -import std.stdio; - -void main(string args[]) -{ - // purpose: test if error message in mixed content could be clicked - // => no, the filename from where the data come is not passed - mixin(import("mixin_errfile_data.txt")); -} diff --git a/lazproj/test/src/runnable_console.d b/lazproj/test/src/runnable_console.d deleted file mode 100644 index fe541fe9..00000000 --- a/lazproj/test/src/runnable_console.d +++ /dev/null @@ -1,26 +0,0 @@ -module console; - -/* - The most simple console wrappr'. - - usage: - ------ - - Use Coedit menu, Compile and Run file to execute. - - use the "Process input widget to pass" commands. - - Don't forget that the Messages widget restricts the item count. - - type "exit" and press SEND to quit. -*/ -void main(string args[]) -{ - import std.process; - // - string prgname; - version(Windows) - prgname = "cmd"; - /*else - version(linux) prgname = "xterm";*/ - else - assert(0, "unsupported target"); - // - prgname.spawnProcess.wait; -} diff --git a/lazproj/test/src/runnable_firstline_flags.d b/lazproj/test/src/runnable_firstline_flags.d deleted file mode 100644 index 089f441b..00000000 --- a/lazproj/test/src/runnable_firstline_flags.d +++ /dev/null @@ -1,19 +0,0 @@ -#!runnable-flags: -version=a -version=b -module runnable; - -/* - -compile fine and run, feature #36: -- see specs at https://github.com/BBasile/Coedit/issues/36 -- dmd switches can be passed in the script line -- dups are automatically eliminated. - -*/ - -import std.stdio; - -void main(string[] args) -{ - version(a) "a".writeln; - version(b) "b".writeln; -} diff --git a/lazproj/test/src/runnable_input_handling.d b/lazproj/test/src/runnable_input_handling.d deleted file mode 100644 index da9d1c0b..00000000 --- a/lazproj/test/src/runnable_input_handling.d +++ /dev/null @@ -1,14 +0,0 @@ -module runnable; - -import std.stdio; - -void main(string args[]) -{ - writeln("use <<Process input>> widget to continue: just click 'Send'"); - stdout.flush; - readln; - writeln("type <kbd>ENTER</kbd> in the field"); - stdout.flush; - readln; - writeln("it was not possible when the process was declared as a local variable..."); -}