autobuild: Add test for cross-compilation infrastructure
authorUri Simchoni <urisimchoni@gmail.com>
Mon, 4 May 2015 07:21:53 +0000 (10:21 +0300)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 20 May 2015 12:10:05 +0000 (14:10 +0200)
With added option to generate cross-answers by cross-execute script,
a test is added to verify that at least for tested build environments,
the infrastructure is self-consistent.

The test runs samba configuration in three modes:
1. Native
2. Cross compile with cross-execute, using the build machine as its own
   target
3. Cross compile with cross-answers, using the answers generated in
   step 2

The build environments created by the three processes are then tested to
be equal.

Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed May 20 14:10:05 CEST 2015 on sn-devel-104

script/autobuild.py

index b2303f7b7363694dedd349412b02bf80fa6ae1dd..c697aad9bfc494a8bbc9ad90646883318a878733 100755 (executable)
@@ -23,6 +23,7 @@ cleanup_list = []
 builddirs = {
     "ctdb"    : "ctdb",
     "samba"  : ".",
+    "samba-xc" : ".",
     "samba-ctdb" : ".",
     "samba-libs"  : ".",
     "ldb"     : "lib/ldb",
@@ -36,7 +37,9 @@ builddirs = {
     "retry"   : "."
     }
 
-defaulttasks = [ "ctdb", "samba", "samba-ctdb", "samba-libs", "ldb", "tdb", "talloc", "replace", "tevent", "pidl" ]
+defaulttasks = [ "ctdb", "samba", "samba-xc", "samba-ctdb", "samba-libs", "ldb", "tdb", "talloc", "replace", "tevent", "pidl" ]
+
+samba_configure_params = " --picky-developer ${PREFIX} --with-profiling-data"
 
 tasks = {
     "ctdb" : [ ("random-sleep", "../script/random-sleep.sh 60 600", "text/plain"),
@@ -48,13 +51,22 @@ tasks = {
                ("clean", "make clean", "text/plain") ],
 
     # We have 'test' before 'install' because, 'test' should work without 'install'
-    "samba" : [ ("configure", "./configure.developer --picky-developer ${PREFIX} --with-selftest-prefix=./bin/ab  --with-profiling-data", "text/plain"),
+    "samba" : [ ("configure", "./configure.developer --with-selftest-prefix=./bin/ab" + samba_configure_params, "text/plain"),
                 ("make", "make -j", "text/plain"),
                 ("test", "make test FAIL_IMMEDIATELY=1", "text/plain"),
                 ("install", "make install", "text/plain"),
                 ("check-clean-tree", "script/clean-source-tree.sh", "text/plain"),
                 ("clean", "make clean", "text/plain") ],
 
+    # Test cross-compile infrastructure
+    "samba-xc" : [ ("configure-native", "./configure.developer --with-selftest-prefix=./bin/ab" + samba_configure_params, "text/plain"),
+                   ("configure-cross-execute", "./configure.developer -b ./bin-xe --cross-compile --cross-execute=script/identity_cc.sh" \
+                    " --cross-answers=./bin-xe/cross-answers.txt --with-selftest-prefix=./bin-xe/ab" + samba_configure_params, "text/plain"),
+                   ("configure-cross-answers", "./configure.developer -b ./bin-xa --cross-compile" \
+                    " --cross-answers=./bin-xe/cross-answers.txt --with-selftest-prefix=./bin-xa/ab" + samba_configure_params, "text/plain"),
+                   ("compare-results", "script/compare_cc_results.py ./bin/c4che/default.cache.py ./bin-xe/c4che/default.cache.py ./bin-xa/c4che/default.cache.py", "text/plain")],
+
+
     "samba-ctdb" : [ ("random-sleep", "script/random-sleep.sh 60 600", "text/plain"),
 
                      # make sure we have tdb around:
@@ -519,7 +531,7 @@ A summary of the autobuild process is here:
 
   %s/autobuild.log
 ''' % (platform.node(), failed_task, errstr, log_base)
-    
+
     if failed_task != 'rebase':
         text += '''
 You can see logs of the failed task here: