- Previously uncommitted and new fixes
import "md5"
import "Project"
import "md5"
import "Project"
+IDESettings ideSettings;
+
+IDESettingsContainer settingsContainer
+{
+ dataOwner = &ideSettings;
+ dataClass = class(IDESettings);
+};
+
+IDEConfigHolder ideConfig { };
+
Test dummy; // FIXME ugly hack
GlobalSettings globalSettings { };
Test dummy; // FIXME ugly hack
GlobalSettings globalSettings { };
{Color {digest[9] , digest[10], digest[11]}, 0.6f},
{Color {digest[12], digest[13], digest[14]}, 0.8f},
{Color {digest[15], digest[0] , digest[1] }, 1.0f}};
{Color {digest[9] , digest[10], digest[11]}, 0.6f},
{Color {digest[12], digest[13], digest[14]}, 0.8f},
{Color {digest[15], digest[0] , digest[1] }, 1.0f}};
surface.Gradient(keys, 6, 0, horizontal, x+1, y+1, x+34, y+14);
surface.Rectangle(x+1,y+1,x+34,y+14);
}
surface.Gradient(keys, 6, 0, horizontal, x+1, y+1, x+34, y+14);
surface.Rectangle(x+1,y+1,x+34,y+14);
}
{
channel.ReadData(digest,16);
}
{
channel.ReadData(digest,16);
}
{
set {
TempFile hashTemp { };
{
set {
TempFile hashTemp { };
uint size;
MD5_CTX ctx;
MD5Init(&ctx);
uint size;
MD5_CTX ctx;
MD5Init(&ctx);
- size = hashTemp.GetSize();
+ size = (uint)hashTemp.GetSize();
MD5Update(&ctx, hashTemp.buffer, size);
MD5Final(digest, &ctx);
}
MD5Update(&ctx, hashTemp.buffer, size);
MD5Final(digest, &ctx);
}
delete files;
}
// TOFIX: When this is commented out, no warning at conversion but conversion not acting as such!!
delete files;
}
// TOFIX: When this is commented out, no warning at conversion but conversion not acting as such!!
- char * compiler = getenv("COMPILER");
+ const char * compiler = getenv("COMPILER");
if(!compiler) compiler = "Default";
// TODO: Command line option to choose between the two
if(!compiler) compiler = "Default";
// TODO: Command line option to choose between the two
-// or a command line option to not use global settings
+// or a command line option to not use global settings
//defaultCompiler = MakeDefaultCompiler();
//defaultCompiler = MakeDefaultCompiler();
- defaultCompiler = ideSettings.GetCompilerConfig(compiler);
+ defaultCompiler = ideConfig.compilers.GetCompilerConfig(compiler);
// possible TODO: use the workspace to select the active compiler
// TODO: option to specify compiler name when using global settings
}
// possible TODO: use the workspace to select the active compiler
// TODO: option to specify compiler name when using global settings
}
- printf("Error: There are no Project configurations.\n", configName);
+ printf("Error: There are no Project configurations.\n");
- // we don't need to create a config to compile a config-less project, do we?
+ // we don't need to create a config to compile a config-less project, do we?
/*
char targetName[MAX_FILENAME];
GetLastDirectory(epjPath, targetName);
/*
char targetName[MAX_FILENAME];
GetLastDirectory(epjPath, targetName);
- project.GenerateCrossPlatformMk();
- project.GenerateCompilerCf(defaultCompiler);
+ project.GenerateCrossPlatformMk(null);
+ project.GenerateCompilerCf(defaultCompiler, true);
project.GenerateMakefile(makePath, false, null, project.config);
}
project.GenerateMakefile(makePath, false, null, project.config);
}
{
TestRun id "id";
File makeOutput "makeOutput";
{
TestRun id "id";
File makeOutput "makeOutput";
- bool makeReturnValue "makeReturnValue";
+ int makeReturnValue "makeReturnValue";
Test test "test";
TimeStamp time "time";
bool save "save";
Test test "test";
TimeStamp time "time";
bool save "save";
+ public SettingsIOResult Load()
- if(GlobalAppSettings::Load())
+ SettingsIOResult result = GlobalAppSettings::Load();
+ if(result == success)
{
delete diffTool;
delete testDB_file;
{
delete diffTool;
delete testDB_file;
GetGlobalValue("Tests","list", singleString, &testDB_file);
CloseAndMonitor();
}
GetGlobalValue("Tests","list", singleString, &testDB_file);
CloseAndMonitor();
}
+
+ public SettingsIOResult Save()
- if(GlobalAppSettings::Save())
+ SettingsIOResult result = GlobalAppSettings::Save();
+ if(result == success)
{
PutGlobalValue("Tools","diff", singleString, diffTool);
PutGlobalValue("Tests","list", singleString, testDB_file);
CloseAndMonitor();
}
{
PutGlobalValue("Tools","diff", singleString, diffTool);
PutGlobalValue("Tests","list", singleString, testDB_file);
CloseAndMonitor();
}
{
char origDir[MAX_LOCATION];
char newDir[MAX_LOCATION];
{
char origDir[MAX_LOCATION];
char newDir[MAX_LOCATION];
uint Main()
{
DualPipe diff;
uint Main()
{
DualPipe diff;
{
DeleteFile(flOrig.path);
}
{
DeleteFile(flOrig.path);
}
while(flNew.Find())
{
DeleteFile(flNew.path);
}
while(flNew.Find())
{
DeleteFile(flNew.path);
}
{
//char origDir[MAX_LOCATION];
//char newDir[MAX_LOCATION];
{
//char origDir[MAX_LOCATION];
//char newDir[MAX_LOCATION];
- char tmpname[MAX_LOCATION];
-
CreateTemporaryDir(origDir, "TestSuiteOrigDir");
CreateTemporaryDir(newDir,"TestSuiteNewDir");
CreateTemporaryDir(origDir, "TestSuiteOrigDir");
CreateTemporaryDir(newDir,"TestSuiteNewDir");
{
int GenerateMakefile(Test t)
{
{
int GenerateMakefile(Test t)
{
+ //DualPipe epj2makePipe;
char testFolder[MAX_LOCATION];
char makefileOut[MAX_LOCATION];
char epjName[MAX_LOCATION];
char * filePath = t.filePath;
char testFolder[MAX_LOCATION];
char makefileOut[MAX_LOCATION];
char epjName[MAX_LOCATION];
char * filePath = t.filePath;
/*
StripLastDirectory(filePath, testFolder);
PathCat(testFolder, "release");
MakeDir(testFolder);
*/
/*
StripLastDirectory(filePath, testFolder);
PathCat(testFolder, "release");
MakeDir(testFolder);
*/
StripLastDirectory(filePath, testFolder);
GetLastDirectory(filePath, epjName);
strcpy(makefileOut, testFolder);
PathCat(makefileOut, "project-testingSuite.Makefile");
StripLastDirectory(filePath, testFolder);
GetLastDirectory(filePath, epjName);
strcpy(makefileOut, testFolder);
PathCat(makefileOut, "project-testingSuite.Makefile");
// epj2makePipe = DualPipeOpenf({ output = true },"epj2make -l /usr/ecere/lib -o %s %s > /dev/null", makefileOut, t.filePath);
//epj2makePipe = DualPipeOpenf({ output = true },"epj2make -cpp cpp -l /usr/ecere/lib -o %s %s", makefileOut, filePath);
//epj2makePipe.Wait();
// epj2makePipe = DualPipeOpenf({ output = true },"epj2make -l /usr/ecere/lib -o %s %s > /dev/null", makefileOut, t.filePath);
//epj2makePipe = DualPipeOpenf({ output = true },"epj2make -cpp cpp -l /usr/ecere/lib -o %s %s", makefileOut, filePath);
//epj2makePipe.Wait();
//return epj2makePipe.GetExitCode();
return 0;
}
//return epj2makePipe.GetExitCode();
return 0;
}
char* Copy2Temp(File f, String tmpPath)
{
File tmp;
char* Copy2Temp(File f, String tmpPath)
{
File tmp;
tmp = CreateTemporaryFile(tmpFilename, tmpPath);
CopyFile(f, tmp);
tmp.Flush();
tmp = CreateTemporaryFile(tmpFilename, tmpPath);
CopyFile(f, tmp);
tmp.Flush();
+ return CopyString(tmpFilename);
int BuildTest(TestRun run)
{
DualPipe makePipe;
int BuildTest(TestRun run)
{
DualPipe makePipe;
GetWorkingDir(oldDir, sizeof(oldDir));
ChangeWorkingDir(makefileOut);
PathCat(makefileOut, "project-testingSuite.Makefile");
GetWorkingDir(oldDir, sizeof(oldDir));
ChangeWorkingDir(makefileOut);
PathCat(makefileOut, "project-testingSuite.Makefile");
//Execute("make -f %s clean", makefileOut);
makePipe = DualPipeOpenf({ output = true },"%s -f %s clean", defaultCompiler.makeCommand, makefileOut);
//Execute("make -f %s clean", makefileOut);
makePipe = DualPipeOpenf({ output = true },"%s -f %s clean", defaultCompiler.makeCommand, makefileOut);
{
TempFile f { };
char makeBuffer[1024];
{
TempFile f { };
char makeBuffer[1024];
uint count;
while(!makePipe.Eof())
{
uint count;
while(!makePipe.Eof())
{
{
TempFile f { };
char makeBuffer[1024];
{
TempFile f { };
char makeBuffer[1024];
uint count;
while(!makePipe.Eof())
{
uint count;
while(!makePipe.Eof())
{
// TODO: Get from config
PathCat(testFolder, "obj/release.win32");
// TODO: Get from config
PathCat(testFolder, "obj/release.win32");
fl = { testFolder, extensions = "c, ec, sym, imp" }; // ["c", "ec", "sym", "imp"] perhaps?
while(fl.Find())
{
fl = { testFolder, extensions = "c, ec, sym, imp" }; // ["c", "ec", "sym", "imp"] perhaps?
while(fl.Find())
{
char extension[MAX_LOCATION];
DateTime rightNow { };
f = FileOpen(fl.path, read);
char extension[MAX_LOCATION];
DateTime rightNow { };
f = FileOpen(fl.path, read);
of.Add();
of.id = of.sysID;
of.outputFile = f;
of.Add();
of.id = of.sysID;
of.outputFile = f;
uint count = input.Read(buffer, 1, sizeof(buffer));
if(count)
{
uint count = input.Read(buffer, 1, sizeof(buffer));
if(count)
{
- int yo = output.Write(buffer, 1, count);
+ output.Write(buffer, 1, count);
}
}
}
class RelativeTimeStamp : TimeStamp
{
}
}
}
class RelativeTimeStamp : TimeStamp
{
- char * OnGetString(char * tempString, void * fieldData, bool * needClass)
+ const char * OnGetString(char * tempString, void * fieldData, bool * needClass)
DateTime dt { };
TimeStamp rightNow;
dt.GetLocalTime();
DateTime dt { };
TimeStamp rightNow;
dt.GetLocalTime();
success, failure;
void OnDisplay(Surface surface,
int x, int y, int width,
success, failure;
void OnDisplay(Surface surface,
int x, int y, int width,
- TrumpDialog trumpDialog,
Alignment alignment,
DataDisplayFlags flags)
{
Alignment alignment,
DataDisplayFlags flags)
{
BitmapResource makeSuccess { ":check.png" , window = this };
BitmapResource makeFailure { ":x.png", window = this };
BitmapResource makeSuccess { ":check.png" , window = this };
BitmapResource makeFailure { ":x.png", window = this };
TestSuiteWindow()
{
testListBox.AddField(fieldName);
testListBox.AddField(fieldActive);
TestSuiteWindow()
{
testListBox.AddField(fieldName);
testListBox.AddField(fieldActive);
runsListBox.AddField(fieldBuildStatus);
runsListBox.AddField(fieldAuraColor);
runsListBox.AddField(fieldRun);
runsListBox.AddField(fieldBuildStatus);
runsListBox.AddField(fieldAuraColor);
runsListBox.AddField(fieldRun);
- void NewTest(RowTests tRow, char* testName, char* testFilePath)
+ void NewTest(RowTests tRow, const char * testName, const char * testFilePath)
{
tRow.Add();
tRow.id = tRow.sysID;
{
tRow.Add();
tRow.id = tRow.sysID;
{
// do we also delete all runs and files associated with this test?
RowTests tRow { };
{
// do we also delete all runs and files associated with this test?
RowTests tRow { };
+ tRow.sysID=(uint)row.tag;
tRow.Delete();
delete tRow; // won't be needed in the (distant?) future :-)
testListBox.DeleteRow(row);
tRow.Delete();
delete tRow; // won't be needed in the (distant?) future :-)
testListBox.DeleteRow(row);
DataField fieldName { width = 140, header = "Name" , dataType = class(char*), editable = true };
DataField fieldActive { width = 40, header = "Active", dataType = class(bool) };
DataField fieldName { width = 140, header = "Name" , dataType = class(char*), editable = true };
DataField fieldActive { width = 40, header = "Active", dataType = class(bool) };
bool NotifyChanged(ListBox testListBox, DataRow row)
{
RowTests tRow { };
bool NotifyChanged(ListBox testListBox, DataRow row)
{
RowTests tRow { };
+ tRow.sysID=(uint)row.tag;
tRow.name = row.GetData(fieldName);
tRow.active = row.GetData(fieldActive);
delete tRow;
tRow.name = row.GetData(fieldName);
tRow.active = row.GetData(fieldActive);
delete tRow;
{ // show test runs
Test t;
Array<TestRun> runs;
{ // show test runs
Test t;
Array<TestRun> runs;
- runs = amacs.allTestRuns(t);
+ runs = AccessMacros::allTestRuns(t);
runsListBox.Clear();
for(tr : runs)
{
runsListBox.Clear();
for(tr : runs)
{
DataField fieldBuildStatus { width = 40, dataType = class(BuildStatus), header = "Make" };
DataField fieldAuraColor { width = 40, dataType = class(MD5Digest), header = "Aura" };
DataField fieldRun { width = 120, dataType = class(RelativeTimeStamp), header = "Run" };
DataField fieldBuildStatus { width = 40, dataType = class(BuildStatus), header = "Make" };
DataField fieldAuraColor { width = 40, dataType = class(MD5Digest), header = "Aura" };
DataField fieldRun { width = 120, dataType = class(RelativeTimeStamp), header = "Run" };
{
testListBox.SelectRow(row);
}
{
testListBox.SelectRow(row);
}
DateTime rightNow { };
RowRuns runs { };
TestRun run;
DateTime rightNow { };
RowRuns runs { };
TestRun run;
bool OnCreate()
{
globalSettings.Load();
bool OnCreate()
{
globalSettings.Load();
if(!run.save)
{
if(t.reference == run)
if(!run.save)
{
if(t.reference == run)
- {
- t.reference = null;
- }
files = AccessMacros::allOutputFiles(run);
for(file : files)
{
files = AccessMacros::allOutputFiles(run);
for(file : files)
{
bool Init()
{
settingsContainer.Load();
bool Init()
{
settingsContainer.Load();
+ ideConfig.compilers.read(settingsContainer);
delete settingsContainer;
return true;
}
delete settingsContainer;
return true;
}
{
"Folder" : "project",
"Files" : [
{
"Folder" : "project",
"Files" : [
- "/sdk/ide/src/project/Project.ec",
- "/sdk/ide/src/project/ProjectConfig.ec",
- "/sdk/ide/src/project/ProjectNode.ec"
+ "$(ECERE_SDK_SRC)/ide/src/project/Project.ec",
+ "$(ECERE_SDK_SRC)/ide/src/project/ProjectConfig.ec",
+ "$(ECERE_SDK_SRC)/ide/src/project/ProjectNode.ec"
- "/sdk/extras/md5.ec",
- "../../sdk/ide/src/IDESettings.ec",
- "../../sdk/extras/gui/controls/StringsBox.ec",
- "../../sdk/ide/src/OldIDESettings.ec",
- "../../sdk/extras/types/DynamicString.ec"
+ "$(ECERE_SDK_SRC)/extras/md5.ec",
+ "$(ECERE_SDK_SRC)/ide/src/IDESettings.ec",
+ "$(ECERE_SDK_SRC)/extras/gui/controls/StringsBox.ec",
+ "$(ECERE_SDK_SRC)/ide/src/OldIDESettings.ec",
+ "$(ECERE_SDK_SRC)/extras/types/DynamicString.ec"
- "testSuite.ec",
- "TODO.txt"
],
"ResourcesPath" : "",
"Resources" : [
"res/check.png",
"res/x.png",
],
"ResourcesPath" : "",
"Resources" : [
"res/check.png",
"res/x.png",
- "../../sdk/crossplatform.mk"
+ "$(ECERE_SDK_SRC)/crossplatform.mk"