|
From: Andre R. <and...@us...> - 2006-02-18 09:09:50
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/suites/fUnit/testSuperStress In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24711/testSuperStress Modified Files: Tag: fUnit_Suite-branch testSys Log Message: First steps towards testing sys verbs properly on Mac OS X. Index: testSys =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/suites/fUnit/testSuperStress/Attic/testSys,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** testSys 22 Aug 2005 00:41:19 -0000 1.1.2.1 --- testSys 18 Feb 2006 09:09:45 -0000 1.1.2.2 *************** *** 1,3 **** FrontierVcsFile:1:scpt:suites.fUnit.testSuperStress.testSys ! on testSys () { Çtest the sys verbs local (f, path, minappsize); path = Frontier.getProgramPath (); f = file.fileFromPath (path); assert(sys.appIsRunning(f), "sys.appIsRunning is broken."); Çif !(user.prefs.name == "Wesley Felter" && sys.os() == osWinNT) assertEqual(sys.getAppPath (f), path, "sys.getAppPath is broken."); if (sys.os() == osMacOS) { assert(sys.appIsIACAware (path), "sys.appIsIACAware is broken."); if Frontier.isRuntime () { minappsize = 500} else { minappsize = 4760}; Çif (user.prefs.name != "Wesley Felter") Çif sys.getMinAppSize (path) != minappsize // * 1024 ÇscriptError ("sys.getMinAppSize is broken.") Çwrite Win equivalents to following tests sys.bringAppToFront ("Finder"); assertEqual(sys.frontmostApp (), "Finder", "sys.bringAppToFront or sys.frontmostApp is broken")}; sys.bringAppToFront (f); assertEqual(sys.frontmostApp (), f, "sys.bringAppToFront or sys.frontmostApp is broken")} \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:suites.fUnit.testSuperStress.testSys ! on testSys () { Çtest the sys verbs ÇTO DO: ÇOn Carbon, check "Frontier" as well as "Frontier.app", both should work local (frontierPath = Frontier.getProgramPath ()); local (frontierAppName = file.fileFromPath (frontierPath)); if system.environment.isCarbon { Ç2006-02-18 aradke: fix appname for packages local (appExtension = ".app" + file.getPathChar ()); if frontierAppName endsWith appExtension { frontierAppName = string.mid (frontierAppName, 1, string.length (frontierAppName) - string.length (appExtension))}}; assert(sys.appIsRunning(frontierAppName), "sys.appIsRunning is broken."); local (appPath = sys.getAppPath (frontierAppName)); if system.environment.isCarbon { Ç2006-02-18 aradke: sys.getAppPath returns the full path to the executable in a package, need to strip anything after the foo.app folder before the comparison local (appExtension = ".app" + file.getPathChar ()); if appPath contains appExtension { loop { appPath = file.folderFromPath (appPath); if appPath endsWith appExtension { break}}}}; assertEqual(appPath, frontierPath, "sys.getAppPath is broken."); if system.environment.isMac { Çif (user.prefs.name != "Wesley Felter") Çif Frontier.isRuntime () Çminappsize = 500 Çelse Çminappsize = 4760 Çif sys.getMinAppSize (path) != minappsize // * 1024 ÇscriptError ("sys.getMinAppSize is broken.") sys.bringAppToFront ("Finder"); assertEqual(sys.frontmostApp (), "Finder", "sys.bringAppToFront or sys.frontmostApp is broken"); if system.environment.isMacOsClassic { Ç2006-02-18 aradke: sys.appIsIACAware needs to be upraded for OS X to read from the datafork if the app is a package assert(sys.appIsIACAware (frontierPath), "sys.appIsIACAware is broken.")}}; if system.environment.isWindows { //2006-02-18 by aradke: still need to test on Windows sys.bringAppToFront ("explorer.exe"); assertEqual(sys.frontmostApp (), "explorer.exe", "sys.bringAppToFront or sys.frontmostApp is broken")}; sys.bringAppToFront (frontierAppName); assertEqual(sys.frontmostApp (), frontierAppName, "sys.bringAppToFront or sys.frontmostApp is broken")}; bundle { //debug code fUnit.runners.run (parentOf(this^), testCaseToRun: this)} \ No newline at end of file |