← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 2782: 1. Some changes in installation section (Gentoo)

 

------------------------------------------------------------
revno: 2782
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
branch nick: yade
timestamp: Tue 2011-03-15 09:17:29 +0100
message:
  1. Some changes in installation section (Gentoo)
  2. Check tests are now running like --test, returning error code if something went wrong.
modified:
  doc/sphinx/installation.rst
  scripts/test/checks/README
  scripts/test/checks/checkList.py
  scripts/test/checks/checkTestDummy.py
  scripts/test/checks/checkTestTriax.py
  scripts/test/checks/checkWeight.py


--
lp:yade
https://code.launchpad.net/~yade-dev/yade/trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription
=== modified file 'doc/sphinx/installation.rst'
--- doc/sphinx/installation.rst	2011-03-08 13:38:49 +0000
+++ doc/sphinx/installation.rst	2011-03-15 08:17:29 +0000
@@ -94,7 +94,7 @@
 			dev-python/matplotlib dev-db/sqlite dev-python/numpy dev-lang/tk \
 			sci-visualization/gnuplot app-doc/doxygen sci-libs/gts dev-python/pygraphviz \
 			sci-libs/vtk dev-python/scientificpython dev-vcs/bzr dev-vcs/bzrtools dev-cpp/eigen \
-			sys-devel/binutils dev-python/python-xlib dev-python/PyQt4 dev-python/imaging \
+			sys-devel/binutils dev-python/python-xlib x11-libs/qt-gui dev-python/PyQt4 dev-python/imaging \
 			dev-python/sphinx dev-python/imaging dev-python/python-bibtex
 		
 		

=== modified file 'scripts/test/checks/README'
--- scripts/test/checks/README	2011-03-04 20:09:03 +0000
+++ scripts/test/checks/README	2011-03-15 08:17:29 +0000
@@ -8,8 +8,10 @@
 
 4. Since the check tests history will be mostly based on standard output generated by "yade --checks", a meaningfull checkTest should include some "print" command telling if something went wrong. If the script itself fails for some reason and can't generate an output, the log will contain "scriptName failure".
 
-5. An example check test can be found in checkTestTriax.py. It shows results comparison, output, and how to define the path to data files using "checksPath".
-
-6. Users are encouraged to add their own scripts into the scripts/test/checks/ folder. Discussion of some specific checktests design in users question is welcome.
-
-7. A check test should never need more than a few seconds to run. If your typical script needs more, try and reduce the number of element or the number of steps.
+5. If the script defines differences on obtained and awaited data, it should print some useful information about the problem and increase the value of global variable resultStatus. After this occurs, the automatic test will stop the execution with error message.
+
+6. An example check test can be found in checkTestTriax.py. It shows results comparison, output, and how to define the path to data files using "checksPath".
+
+7. Users are encouraged to add their own scripts into the scripts/test/checks/ folder. Discussion of some specific checktests design in users question is welcome.
+
+8. A check test should never need more than a few seconds to run. If your typical script needs more, try and reduce the number of element or the number of steps.

=== modified file 'scripts/test/checks/checkList.py'
--- scripts/test/checks/checkList.py	2011-03-04 20:09:03 +0000
+++ scripts/test/checks/checkList.py	2011-03-15 08:17:29 +0000
@@ -3,13 +3,27 @@
 import yade,math,os,sys
 
 scriptsToRun=os.listdir(checksPath)
+resultStatus = 0
 for script in scriptsToRun:
 	if (script[len(script)-3:]==".py" and not(script=="checkList.py")):
 		try:
 	 		print "###################################"
 			print "running: ",script
 			execfile(checksPath+"/"+script)
+			if (resultStatus):
+				print "Status: FAILURE!!!"
+				break
+			else:
+				print "Status: success"
 			print "___________________________________"
 		except:
 			print script," failure"
+			break
 		O.reset()
+		
+if (resultStatus):
+	print "Some tests are failed!"
+	sys.exit(1)
+else:
+	sys.exit(0)
+

=== modified file 'scripts/test/checks/checkTestDummy.py'
--- scripts/test/checks/checkTestDummy.py	2011-01-19 08:37:26 +0000
+++ scripts/test/checks/checkTestDummy.py	2011-03-15 08:17:29 +0000
@@ -3,5 +3,5 @@
 # A dummy test, just to give an example, and detect possible path problems
 from yade import pack,log,utils,export,plot
 import math,os,sys
-print 'checkTest mechanism success'
+print 'checkTest mechanism'
 

=== modified file 'scripts/test/checks/checkTestTriax.py'
--- scripts/test/checks/checkTestTriax.py	2011-03-04 15:51:30 +0000
+++ scripts/test/checks/checkTestTriax.py	2011-03-15 08:17:29 +0000
@@ -26,7 +26,5 @@
 	print "Triaxial checkTest: difference on peak stress"
 	errors+=1
 
-if errors==0:
-	print "checkTestTriax success"
-else:
-	RuntimeError("Some tests are failed!")
+if (errors):
+	resultStatus +=1	#Test is failed

=== modified file 'scripts/test/checks/checkWeight.py'
--- scripts/test/checks/checkWeight.py	2011-03-04 20:09:03 +0000
+++ scripts/test/checks/checkWeight.py	2011-03-15 08:17:29 +0000
@@ -50,9 +50,6 @@
 print ("Precalculated weight %f" % sphMass)
 print ("Obtained weight %f" % curForce)
 
-if (((sphMass-curForce)/curForce)<tolerance):
-	print "checkWeight test is success"
-else:
-	print "checkWeight test is failed!"
-	RuntimeError()
+if (((sphMass-curForce)/curForce)>tolerance):
+	resultStatus += 1
 


Follow ups