Pārlūkot izejas kodu

termine script tests

olivier.massot 9 gadi atpakaļ
vecāks
revīzija
8763149267
4 mainītis faili ar 66 papildinājumiem un 76 dzēšanām
  1. BIN
      tests/initial/project0.zip
  2. 2 76
      tests/readme.md
  3. 59 0
      tests/run_tests.bat
  4. 5 0
      tests/update_registry.py

BIN
tests/initial/project0.zip


+ 2 - 76
tests/readme.md

@@ -63,7 +63,7 @@ Le répertoire `.\work\source` est créé
 
 * Le dossier `.\work\source` est copié vers `.\results\source_1`
 
-> `copy .\works\source .\results\source1`
+> `xcopy .\works\source .\results\source1`
 
 #### Contrôle des résultats
 
@@ -142,79 +142,5 @@ De plus, on peut vérifier les résultats dans le répertoire .\results:
 
 ## Commande batch
 
-	@echo off
-
-	echo clean the directories (if they exist)
-	if exist .\work del /f /s /q .\work
-	if exist .\results del /f /s /q .\results
-	
-	echo make the directories (if they do not)
-	if not exist .\work md .\work
-	if exist .\results md .\results
-
-	echo unpack openaccess.accda if it does not exist in ..\
-	if not exist ..\OpenAccess.accda unzip ..\initial\OpenAccess.zip
-
-	echo prepare files
-	unzip .\initial\project0.zip -d .\work
-	unzip .\initial\db.zip -d .\work
-	unzip .\initial\empty_project.zip -d .\work
-	
-	echo ** tests: step 1 **
-
-	echo run the test_export macro
-	.\work\project0.accdb" /X test_export
-	
-	echo control existence of zipped app
-	python assert_exists.py .\work\project0.zip
-
-	echo clean sources
-	del .\work\source\modules\test_methods.bas
-	del .\work\source\macros\test_export.bas
-	del .\work\source\macros\test_import.bas
-
-	echo copy source to results
-	copy .\works\source .\results\source1
-
-	echo control the result
-	python compare.py .\results\source1 .\reference\source
-
-	echo ** tests: step 2 **
-
-	echo run import in empty_project.accdb
-	"C:\Program Files\Microsoft Office\Office14\MSACCESS.EXE" "C:\APPLIS_PARC\OpenAccess\tests\work\empty_project.accdb" /X test_import
-
-	echo copy to results
-	copy .\work\empty_project.accdb .\results\result1.accdb
-
-	echo control existence of backup
-	python assert_exists.py .\work\empty_project.accdb.old
-
-	echo run import in project0.accdb
-	"C:\Program Files\Microsoft Office\Office14\MSACCESS.EXE" "C:\APPLIS_PARC\OpenAccess\tests\work\project0.accdb" /X test_import
-
-	echo copy to results
-	copy .\work\project0.accdb .\results\result2.accdb
-
-	echo control existence of backup
-	python assert_exists.py .\work\project0.accdb.old
-
-	echo ** tests : step 3 **
-
-	echo make sources from result1.accdb
-	.\results\result1.accdb /X test_export
-	move .\results\source .\results\source2
-	echo control result
-	python compare.py .\results\source2 .\reference\source
-
-	echo make sources from result3.accdb
-	.\results\result2.accdb /X test_export
-	move .\results\source .\results\source3
-	echo control result
-	python compare.py .\results\source3 .\reference\source	
-
-	echo ** end **
-
-	pause
-
+Voir [http://codebox/dev/OpenAccess/blob/master/tests/run_tests.bat](run_tests.bat)
 

+ 59 - 0
tests/run_tests.bat

@@ -0,0 +1,59 @@
+@echo off
+cd .\tests
+
+echo clean the directories (if they exist)
+if exist .\work del /f /s /q .\work
+if exist .\results del /f /s /q .\results
+	
+echo make the directories (if they do not)
+if not exist .\work md .\work
+if not exist .\results md .\results
+
+echo unpack openaccess.accda if it does not exist in ..\
+if not exist ..\OpenAccess.accda unzip ..\OpenAccess.zip
+
+echo prepare files
+unzip .\initial\project0.zip -d .\work
+unzip .\initial\db.zip -d .\work
+unzip .\initial\empty_project.zip -d .\work
+
+echo ** tests: step 1 **
+
+echo run the test_export macro
+.\work\project0.accdb /X test_export
+
+echo control existence of zipped app
+python assert_exists.py .\work\project0.zip
+
+echo clean sources
+del .\work\source\modules\test_methods.bas
+del .\work\source\macros\test_export.bas
+del .\work\source\macros\test_import.bas
+
+echo copy source to results
+xcopy .\works\source .\results\source1
+
+echo control the result
+python compare.py .\results\source1 .\reference\source
+
+echo ** tests: step 2 **
+
+echo run import in empty_project.accdb
+.\work\empty_project.accdb /X test_import
+
+echo copy to results
+copy .\work\empty_project.accdb .\results\result1.accdb
+
+echo control existence of backup
+python assert_exists.py .\work\empty_project.accdb.old
+
+echo run import in project0.accdb
+.\work\project0.accdb /X test_import
+
+echo copy to results
+copy .\work\project0.accdb .\results\result2.accdb
+
+echo control existence of backup
+python assert_exists.py .\work\project0.accdb.old
+
+echo ** end **

+ 5 - 0
tests/update_registry.py

@@ -0,0 +1,5 @@
+'''
+Created on 23 nov. 2016
+
+@author: olivier.massot
+'''