import "EDA"
import "md5"
import "Project"
-import "PathBox"
Test dummy; // FIXME ugly hack
bool valid = true;
char* configName = null;//"release";
- defaultCompiler = MakeDefaultCompiler("Default", true);
+ if(false) //noGlobalSettings)
+ {
+ defaultCompiler = MakeDefaultCompiler("Default", true);
+ delete ideSettings;
+ }
+ else
+ {
+ char * compiler = getenv("COMPILER");
+ if(!compiler) compiler = "Default";
+
+// TODO: Command line option to choose between the two
+// or a command line option to not use global settings
+//defaultCompiler = MakeDefaultCompiler();
+ defaultCompiler = ideSettings.GetCompilerConfig(compiler);
+// possible TODO: use the workspace to select the active compiler
+// TODO: option to specify compiler name when using global settings
+ }
defaultCompiler.eccCommand = "ecc -nolinenumbers";
if(FileExists(epjPath).isFile)
strlwr(extension);
if(!strcmp(extension, ProjectExtension))
{
- project = LoadProject(epjPath);
+ project = LoadProject(epjPath, "Debug");
if(project)
{
ProjectConfig defaultConfig = null;
}
}
if(valid)
- project.GenerateMakefile(makePath, false, "");
+ {
+ project.GenerateCrossPlatformMk();
+ project.GenerateCompilerCf(defaultCompiler);
+ project.GenerateMakefile(makePath, false, null, project.config);
+ }
delete defaultConfig;
delete project;
{
Array<TestRun> runs { };
Row tRow { tbl = dbindex("Runs",testAndTime) };
- for(tRow.Find(dbfield("Runs",test),middle,nil,t); !tRow.nil; tRow.Next())
+ for(tRow.Find(dbfield("Runs",test),middle,nil,t); !tRow.nil; tRow.Find(dbfield("Runs", test), next, nil, t)) //Next())
runs.Add(tRow.sysID);
delete tRow;
return runs;
{
Array<OutputFile> files { };
RowOutputFiles tRow { tbl = dbindex("OutputFiles",run) };
- for(tRow.Find(dbfield("OutputFiles",run),middle,nil,t); !tRow.nil; tRow.Next())
+ for(tRow.Find(dbfield("OutputFiles",run),middle,nil,t); !tRow.nil; tRow.Find(dbfield("OutputFiles", run), next, nil, t)) //tRow.Next())
{
if(t != tRow.run)
break;
}
}
-class TestSuiteApp : GuiApplication
-{
- DataSource ds { driver = /*"SQLite"*/"EDB" };
- TestSuiteApp()
- {
- db = database_open(ds, "TestSuite");
- }
- ~TestSuiteApp()
- {
- Array<OutputFile> files;
- Array<TestRun> runs;
- RowTests tests { };
- RowRuns rRuns { };
- RowOutputFiles rFiles { };
- while(tests.Next())
- {
- Test t = (Test)tests.id;
- runs = AccessMacros::allTestRuns(t);
- for(run : runs)
- {
- if(!run.save)
- {
- if(t.reference == run)
- {
- t.reference = null;
- }
- files = AccessMacros::allOutputFiles(run);
- for(file : files)
- {
- rFiles.sysID=file;
- rFiles.Delete();
- }
- rRuns.sysID=run;
- rRuns.Delete();
- }
- }
- }
- delete tests;
- delete rRuns;
- delete rFiles;
- delete db;
- delete ds;
- }
-}
-
class TestSuiteGlobalSettings : GlobalAppSettings
{
settingsName = "testSuite";
delete diffTool;
delete testDB_file;
GetGlobalValue("Tools","diff", singleString, &diffTool);
- GetGlobalValue("Tests","list", singleString, $testDB_file);
+ GetGlobalValue("Tests","list", singleString, &testDB_file);
CloseAndMonitor();
}
}
char epjName[MAX_LOCATION];
char * filePath = t.filePath;
+ /*
StripLastDirectory(filePath, testFolder);
PathCat(testFolder, "release");
MakeDir(testFolder);
+ */
StripLastDirectory(filePath, testFolder);
GetLastDirectory(filePath, epjName);
strcpy(makefileOut, testFolder);
- PathCat(makefileOut, "makefile.test");
+ 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);
int BuildTest(TestRun run)
{
DualPipe makePipe;
- int makeSuccess;
+ int makeSuccess = -1;
char makefileOut[MAX_LOCATION];
char * filePath = run.test.filePath;
char oldDir[MAX_LOCATION];
GetWorkingDir(oldDir, sizeof(oldDir));
ChangeWorkingDir(makefileOut);
- PathCat(makefileOut, "makefile.test");
+ PathCat(makefileOut, "project-testingSuite.Makefile");
//Execute("make -f %s clean", makefileOut);
- makePipe = DualPipeOpenf({ output = true },"make -f %s clean", makefileOut);
+ makePipe = DualPipeOpenf({ output = true },"%s -f %s clean", defaultCompiler.makeCommand, makefileOut);
+ if(makePipe)
{
TempFile f { };
char makeBuffer[1024];
f.Write(makeBuffer, 1, count);
}
run.makeOutput = f;
+ delete makePipe;
}
- delete makePipe;
- makePipe = DualPipeOpenf({ output = true },"make -f %s", makefileOut);
+ makePipe = DualPipeOpenf({ output = true },"%s -f %s", defaultCompiler.makeCommand, makefileOut);
+ if(makePipe)
{
TempFile f { };
char makeBuffer[1024];
f.Write(makeBuffer, 1, count);
}
run.makeOutput = f;
+ //makePipe.Wait();
+ ChangeWorkingDir(oldDir);
+ makeSuccess = makePipe.GetExitCode();
+ run.makeReturnValue = makeSuccess;
+ delete makePipe;
}
- //makePipe.Wait();
- ChangeWorkingDir(oldDir);
- makeSuccess = makePipe.GetExitCode();
- run.makeReturnValue = makeSuccess;
return makeSuccess;
}
void AddOutputFiles(TestRun run)
FileListing fl;
char * filePath = run.test.filePath;
StripLastDirectory(filePath, testFolder);
- PathCat(testFolder, "release");
+
+ // TODO: Get from config
+ PathCat(testFolder, "obj/release.win32");
fl = { testFolder, extensions = "c, ec, sym, imp" }; // ["c", "ec", "sym", "imp"] perhaps?
while(fl.Find())
dt.DiffDir(outputsReference, outputsLatest);
}
}
- testListBox.NotifySelect(this, testListBox, testListBox.currentRow, mods);
+ testListBox.NotifySelect(this, testListBox, testListBox.currentRow, mods);
}
return true;
}
TestSuiteWindow theTestSuiteWindow { };
TestSuiteGlobalSettings theGlobalSettings { };
+
+class TestSuiteApp : GuiApplication
+{
+ DataSource ds { driver = /*"SQLite" */"EDB" };
+ TestSuiteApp()
+ {
+ //File f { };
+ //f.OnSerialize(0);
+ db = database_open(ds, "TestSuite");
+ }
+ ~TestSuiteApp()
+ {
+ Array<OutputFile> files;
+ Array<TestRun> runs;
+ RowTests tests { };
+ RowRuns rRuns { };
+ RowOutputFiles rFiles { };
+ while(tests.Next())
+ {
+ Test t = (Test)tests.id;
+ runs = AccessMacros::allTestRuns(t);
+ for(run : runs)
+ {
+ if(!run.save)
+ {
+ if(t.reference == run)
+ {
+ t.reference = null;
+ }
+ files = AccessMacros::allOutputFiles(run);
+ for(file : files)
+ {
+ rFiles.sysID=file;
+ rFiles.Delete();
+ }
+ rRuns.sysID=run;
+ rRuns.Delete();
+ }
+ }
+ }
+ delete tests;
+ delete rRuns;
+ delete rFiles;
+ delete db;
+ delete ds;
+ }
+
+ bool Init()
+ {
+ settingsContainer.Load();
+ delete settingsContainer;
+ return true;
+ }
+}