summaryrefslogtreecommitdiffstats
path: root/tools/build/rtems-testsuite-autostuff
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2017-04-04 08:11:24 +1000
committerChris Johns <chrisj@rtems.org>2017-04-04 08:24:22 +1000
commit258bda306ba25741624488d24a2785c055a9fab0 (patch)
tree66301d9e50cf6dbc08539b441cab8b41ffe2f895 /tools/build/rtems-testsuite-autostuff
parentbsp/qoriq: Fix L1 cache flush (diff)
downloadrtems-258bda306ba25741624488d24a2785c055a9fab0.tar.bz2
testsuite: Add a common test configuration. Fix configure.ac and Makefile.am errors.
- Add a top level test configuration file for test states that are common to all BSPs. This saves adding a test configuration (tcfg) file for every BSP. - Add the test states 'user-input' and 'benchmark'. This lets 'rtems-test' stop the test rather than waiting for a timeout or letting a benchmark run without the user asking for it to run. - Implement rtems-test-check in Python to make it faster. The shell script had grown to a point it was noticably slowing the build down. - Fix the configure.ac and Makefile.am files for a number of the test directories. The files are difficiult to keep in sync with the number of tests and mistakes can happen such as tests being left out of the build. The test fsrofs01 is an example. Also a there was a mix of SUBDIRS and _SUBDIRS being used and only _SUBDIRS should be used. - Fix the test fsrofs01 so it compiles. Closes #2963.
Diffstat (limited to '')
-rwxr-xr-xtools/build/rtems-testsuite-autostuff49
1 files changed, 49 insertions, 0 deletions
diff --git a/tools/build/rtems-testsuite-autostuff b/tools/build/rtems-testsuite-autostuff
new file mode 100755
index 0000000000..8f298bac3c
--- /dev/null
+++ b/tools/build/rtems-testsuite-autostuff
@@ -0,0 +1,49 @@
+#! /usr/bin/env python
+
+#
+# Copyright 2017 Chris Johns <chrisj@rtems.org>
+# All rights reserved
+#
+
+#
+# Create the testsuite's configure.am and Makefile.am from the directories
+# found. This does not handle any conditional functionality that may be needed.
+#
+
+from __future__ import print_function
+import os
+import os.path
+import sys
+
+def eprint(*args, **kwargs):
+ print(*args, file = sys.stderr, **kwargs)
+
+def die(*args, **kwargs):
+ print(*args, file = sys.stderr, **kwargs)
+ sys.exit(1)
+
+if len(sys.argv) != 2:
+ die('error: just provide the path to the test directory')
+
+testdir = sys.argv[1]
+
+if not os.path.exists(testdir):
+ die('error: not found: %s' % (testdir))
+if not os.path.isdir(testdir):
+ die('error: not a directory: %s' % (testdir))
+
+excludes = ['autom4te.cache']
+
+tests = sorted([t for t in os.listdir(testdir)
+ if os.path.isdir(os.path.join(testdir, t)) \
+ and t not in excludes \
+ and os.path.exists(os.path.join(testdir, t, 'Makefile.am'))])
+
+configure = ['AC_CONFIG_FILES([Makefile'] + ['%s/Makefile' % (t) for t in tests] + ['])']
+makefile = ['_SUBDIRS ='] + ['_SUBDIRS += %s' % (t) for t in tests]
+
+print(os.linesep.join(configure))
+print()
+print(os.linesep.join(makefile))
+
+sys.exit(0)