rteval updates
cover rteval updates
Notable here are the patches to add
--measurement-module MODULE so that you can choose cyclictest or timerlat without modifying the rteval.conf file
The patches that adds
--timerlat-dma_latency USEC
Set /dev/cpu_dma_latency to USEC (set to None to disable) (default: 0)
And finally the addition of pyproject.toml for a modern type of python install. We will still carry setup.py for older distributions.
John
John Kacur (12):
rteval: Fix spelling of 'occurrences' in measurement modules
rteval: Fix typo in comment
rteval: Remove unused function remove_offline
rteval: timerlat: Fix typo in log message
rteval: cyclictest: Fix typo in comment
rteval: rtevalConfig: Remove redundant 'is True' comparison
rteval: Clean up MANIFEST.in and fix newnet.py copyright header
rteval: Add pyproject.toml for modern Python packaging
rteval: Improve argparse implementation and remove manual sys.argv
parsing
rteval: timerlat: Add dma_latency option with default value of 0
rteval: Add --measurement-module command-line argument
rteval: Add unit tests for --measurement-module argument
MANIFEST.in | 3 +- Makefile | 10 ++ pyproject.toml | 58 ++++++ rteval-cmd | 122 +++++++------ rteval/modules/__init__.py | 7 + rteval/modules/measurement/__init__.py | 2 +- rteval/modules/measurement/cyclictest.py | 8 +- rteval/modules/measurement/timerlat.py | 17 +- rteval/rtevalConfig.py | 2 +- rteval/sysinfo/newnet.py | 3 +- run_tests.sh | 89 ++++++++++ setup.py | 6 +- tests/test_measurement_module_selection.py | 195 +++++++++++++++++++++ 13 files changed, 443 insertions(+), 79 deletions(-) create mode 100644 pyproject.toml create mode 100755 run_tests.sh create mode 100755 tests/test_measurement_module_selection.py
Signature · 1 line
2.51.1
PATCH 1/12 rteval: Fix spelling of 'occurrences' in measurement modules
Fixed typo 'occurances' -> 'occurrences' in both cyclictest.py and timerlat.py measurement modules for consistency.
--- rteval/modules/measurement/cyclictest.py | 6 +++--- rteval/modules/measurement/timerlat.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-)
rteval/modules/measurement/cyclictest.py +3 -3
@@ -92,7 +92,7 @@ class RunData: mid = int(self.__numsamples / 2) + 1 # mean, mode, and median - occurances = 0 + occurrences = 0 lastkey = -1 for i in keys: if mid > total and mid <= total + self.__samples[i]:
@@ -104,8 +104,8 @@ class RunData: lastkey = i total += self.__samples[i] total_us += (i * self.__samples[i]) - if self.__samples[i] > occurances: - occurances = self.__samples[i] + if self.__samples[i] > occurrences: + occurrences = self.__samples[i] self.__mode = i self.__mean = float(total_us) / float(self.__numsamples)
rteval/modules/measurement/timerlat.py +3 -3
@@ -84,7 +84,7 @@ class TLRunData: mid = int(self.__numsamples / 2) + 1 # mean, mode and median - occurances = 0 + occurrences = 0 lastkey = -1 for i in keys: if mid > total and mid <= total + self.__samples[i]:
@@ -96,8 +96,8 @@ class TLRunData: lastkey = i total += self.__samples[i] total_us += i * self.__samples[i] - if self.__samples[i] > occurances: - occurances = self.__samples[i] + if self.__samples[i] > occurrences: + occurrences = self.__samples[i] self.__mode = i self.__mean = float(total_us) / float(self.__numsamples)
Signature · 1 line
2.51.1
PATCH 2/12 rteval: Fix typo in comment
In reply to John KacurFixed typo 'summay.xml' -> 'summary.xml' in rteval-cmd comment.
--- rteval-cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
rteval-cmd +1 -1
@@ -68,7 +68,7 @@ def summarize(repfile, xslt): xsltdoc = lxml.etree.parse(xsltfp) xsltprs = lxml.etree.XSLT(xsltdoc) - # Load the summay.xml report - with some simple sanity checks + # Load the summary.xml report - with some simple sanity checks with open(summaryfile, "r") as xmlfp: xmldoc = lxml.etree.parse(xmlfp)
Signature · 1 line
2.51.1
PATCH 3/12 rteval: Remove unused function remove_offline
In reply to John KacurRemove unused function remove_offline()
--- rteval-cmd | 7 ------- 1 file changed, 7 deletions(-)
rteval-cmd +0 -7
@@ -207,13 +207,6 @@ def parse_options(cfg, parser, cmdargs): return cmd_args -def remove_offline(cpulist): - """ return cpulist in collapsed compressed form with only online cpus """ - tmplist = expand_cpulist(cpulist) - tmplist = SysTopology().online_cpulist(tmplist) - return collapse_cpulist(tmplist) - - if __name__ == '__main__': from rteval.sysinfo import dmi
Signature · 1 line
2.51.1
PATCH 4/12 rteval: timerlat: Fix typo in log message
In reply to John KacurFixed typo 'sampples' -> 'samples' in debug log message.
--- rteval/modules/measurement/timerlat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
rteval/modules/measurement/timerlat.py +1 -1
@@ -66,7 +66,7 @@ class TLRunData: """ Calculate statistics """ # Check to see if we have any samples. If there are 1 or 0, return if self.__numsamples <= 1: - self._log(Log.DEBUG, f"skipping {self.__id} ({self.__numsamples} sampples)") + self._log(Log.DEBUG, f"skipping {self.__id} ({self.__numsamples} samples)") self.__mad = 0 self.__stddev = 0 return
Signature · 1 line
2.51.1
PATCH 5/12 rteval: cyclictest: Fix typo in comment
In reply to John KacurFixed typo 'runing' -> 'running' in comment.
--- rteval/modules/measurement/cyclictest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
rteval/modules/measurement/cyclictest.py +1 -1
@@ -270,7 +270,7 @@ class Cyclictest(rtevalModulePrototype): def _WorkloadTask(self): if self.__started: - # Don't restart cyclictest if it is already runing + # Don't restart cyclictest if it is already running return self._log(Log.DEBUG, f'starting with cmd: {" ".join(self.__cmd)}')
Signature · 1 line
2.51.1
PATCH 6/12 rteval: rtevalConfig: Remove redundant 'is True' comparison
In reply to John KacurSimplified boolean check by removing redundant 'is True' comparison. ConfigParsed() already returns a boolean value.
--- rteval/rtevalConfig.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
rteval/rtevalConfig.py +1 -1
@@ -234,7 +234,7 @@ class rtevalConfig: self.__info("no config file") return - if self.ConfigParsed(cfgfile) is True: + if self.ConfigParsed(cfgfile): # Don't try to reread this file if it's already been parsed return
Signature · 1 line
2.51.1
PATCH 7/12 rteval: Clean up MANIFEST.in and fix newnet.py copyright header
In reply to John KacurRemove unnecessary entries from MANIFEST.in (rteval-cmd inclusion and dist/ exclusions) and fix the copyright header in newnet.py (remove duplicate SPDX tag, fix missing email bracket, update year to 2025).
--- MANIFEST.in | 3 +-- rteval/sysinfo/newnet.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)
MANIFEST.in +1 -2
@@ -1,3 +1,2 @@ -include COPYING MANIFEST.in rteval-cmd +include COPYING MANIFEST.in recursive-include doc *.? *.txt -exclude dist/rteval dist/rteval.8.gz
rteval/sysinfo/newnet.py +1 -2
@@ -1,8 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-or-later ''' Module to obtain network information for the rteval report ''' # -# Copyright 2022 John Kacur <[email protected] -# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright 2022 - 2025 John Kacur <[email protected]> # import os
Signature · 1 line
2.51.1
PATCH 8/12 rteval: Add pyproject.toml for modern Python packaging
In reply to John KacurAdd pyproject.toml to support modern PEP 517/518/621 packaging while keeping setup.py for backwards compatibility with older distributions.
The pyproject.toml provides project metadata (name, version, dependencies, authors) and works alongside setup.py which handles script installation (copying rteval-cmd to rteval).
Add John Kacur to the list of authors and set him as the maintainer in both pyproject.toml and setup.py metadata.
Requires Python >=3.10 and setuptools >=61.0.
--- pyproject.toml | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++ rteval-cmd | 2 +- setup.py | 6 ++++-- 3 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 pyproject.toml
pyproject.toml new file +58 -0
@@ -0,0 +1,58 @@ +[build-system] +requires = ["setuptools>=61.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "rteval" +dynamic = ["version"] +description = "Evaluate system performance for Realtime" +readme = {text = """\ +The rteval script is used to judge the behavior of a hardware +platform while running a Realtime Linux kernel under a moderate +to heavy load. + +Provides control logic for starting a system load and then running a +response time measurement utility (cyclictest) for a specified amount +of time. When the run is finished, the sample data from cyclictest is +analyzed for standard statistical measurements (i.e mode, median, range, +mean, variance and standard deviation) and a report is generated. +""", content-type = "text/plain"} +requires-python = ">=3.10" +license = {text = "GPL-2.0-or-later"} +dependencies = [ + "lxml", + "requests", +] +authors = [ + {name = "Clark Williams", email = "[email protected]"}, + {name = "David Sommerseth", email = "[email protected]"}, + {name = "John Kacur", email = "[email protected]"}, +] +maintainers = [ + {name = "John Kacur", email = "[email protected]"}, +] + +[project.urls] +Homepage = "https://git.kernel.org/pub/scm/utils/rteval/rteval.git" + +[tool.setuptools] +packages = [ + "rteval", + "rteval.modules", + "rteval.modules.loads", + "rteval.modules.measurement", + "rteval.sysinfo" +] + +[tool.setuptools.dynamic] +version = {attr = "rteval.version.RTEVAL_VERSION"} + +[tool.setuptools.package-dir] +rteval = "rteval" +"rteval.modules" = "rteval/modules" +"rteval.modules.loads" = "rteval/modules/loads" +"rteval.modules.measurement" = "rteval/modules/measurement" +"rteval.sysinfo" = "rteval/sysinfo" + +[tool.setuptools.package-data] +rteval = ["*.xsl", "rteval.conf"]
rteval-cmd +1 -1
@@ -307,7 +307,7 @@ if __name__ == '__main__': default_kernel_file = ModuleParameters().get('source').get('default') if os.path.exists(tarfl): if rtevcfg.srcdownload == default_kernel_file: - sys.exit("Default kernel already exists, will not download") + sys.exit(f"Default kernel {default_kernel_file} already exists, will not download") prompt = input("Kernel already exists, download and overwrite anyway? (y/n) ") prompt = prompt.lower() if prompt in ('no', 'n'):
setup.py +4 -2
@@ -44,8 +44,10 @@ mangz.close() setup(name="rteval", version = RTEVAL_VERSION, description = "Evaluate system performance for Realtime", - author = "Clark Williams, David Sommerseth", - author_email = "[email protected], [email protected]", + author = "Clark Williams, David Sommerseth, John Kacur", + author_email = "[email protected], [email protected], [email protected]", + maintainer = "John Kacur", + maintainer_email = "[email protected]", url = "https://git.kernel.org/pub/scm/utils/rteval/rteval.git", license = "GPLv2", long_description =
Signature · 1 line
2.51.1
PATCH 9/12 rteval: Improve argparse implementation and remove manual sys.argv parsing
In reply to John KacurThis commit modernizes the argument parsing by using argparse properly and eliminating fragile manual sys.argv manipulation.
Key improvements:
1. Use nargs='+' for -Z/--summarize and -H/--raw-histogram options
- These now properly accept one or more XML files as arguments
- Removed complex manual argument splitting logic (lines 158-174)
- Help text now correctly shows: -Z XMLFILE [XMLFILE ...]
2. Use nargs='?' with const='' for -S/--source-download option
- Simplified handling of optional kernel version argument
- Removed manual sys.argv.count() checks (line 179)
- Default value provided when flag is present without argument
3. Use parse_known_args() for early argument detection
- Config file (-f) detection now uses proper argparse
- Logging flags (-v/-D/-q) detection now uses proper argparse
- Removed all manual sys.argv indexing and counting
4. Return cmd_opts instead of cmd_args from parse_options()
- File arguments now directly accessible via cmd_opts attributes
- Clearer separation between options and file arguments
5. Improved error handling
- argparse provides better error messages for malformed arguments
- Supports both -Z file1 file2 and --summarize=file1 formats
This eliminates 40+ lines of fragile manual parsing code and makes the argument handling more robust and maintainable.
--- rteval-cmd | 93 +++++++++++++++++++++++------------------------------- 1 file changed, 39 insertions(+), 54 deletions(-)
rteval-cmd +39 -54
@@ -124,11 +124,11 @@ def parse_options(cfg, parser, cmdargs): action='store_true', default=rtevcfg.debugging, help=f'turn on debug prints (default: {rtevcfg.debugging})') parser.add_argument("-Z", '--summarize', dest='rteval___summarize', - action='store_true', default=False, - help='summarize an already existing XML report') + nargs='+', default=None, metavar='XMLFILE', + help='summarize one or more already existing XML reports') parser.add_argument("-H", '--raw-histogram', dest='rteval___rawhistogram', - action='store_true', default=False, - help='Generate raw histogram data for an already existing XML report') + nargs='+', default=None, metavar='XMLFILE', + help='Generate raw histogram data for one or more already existing XML reports') parser.add_argument("-f", "--inifile", dest="rteval___inifile", type=str, default=None, metavar="FILE", help="initialization file for configuring loads and behavior")
@@ -144,43 +144,19 @@ def parse_options(cfg, parser, cmdargs): parser.add_argument("-V", "--version", dest="rteval___version", action='store_true', default=False, help='print rteval version and exit') - parser.add_argument("-S", "--source-download", nargs="*", dest="rteval___srcdownload", - type=str, default=None, metavar="KERNEL_VERSION", + parser.add_argument("-S", "--source-download", nargs="?", dest="rteval___srcdownload", + type=str, default=None, const='', metavar="KERNEL_VERSION", help='download a source kernel from kernel.org and exit') parser.add_argument("--noload", dest="rteval___noload", action="store_true", default=False, help="only run the measurements (don't run loads)") - - if not cmdargs: - cmdargs = ["--help"] - - # if -Z/--summarize is specified, add the files to be summarized to cmd_args, and add -Z to cmd_opts - cmd_args = [] - if (sys.argv.count('-Z')+sys.argv.count('--summarize')) > 0: - try: - ind = cmdargs.index('-Z') - except ValueError: - ind = cmdargs.index('--summarize') - cmd_args = cmdargs[ind+1:] - cmdargs = cmdargs[:ind+1] - # if -H/--raw-histogram is specified, add the files to be summarized to cmd_args, and add -H to cmd_opts - elif (sys.argv.count('-H')+sys.argv.count('--raw-histogram')) > 0: - try: - ind = cmdargs.index('-H') - except ValueError: - ind = cmdargs.index('--raw-histogram') - cmd_args = cmdargs[ind+1:] - cmdargs = cmdargs[:ind+1] - cmd_opts = parser.parse_args(args=cmdargs) # if no kernel version was provided for --source-download, set version to default - if (sys.argv.count('-S')+sys.argv.count('--source-download')) > 0: - if cmd_opts.rteval___srcdownload == []: + if cmd_opts.rteval___srcdownload is not None: + if cmd_opts.rteval___srcdownload == '': cmd_opts.rteval___srcdownload = ModuleParameters()["source"]["default"].replace(".tar.xz", "") - else: - cmd_opts.rteval___srcdownload = cmd_opts.rteval___srcdownload[0] if cmd_opts.rteval___version: print(f"rteval version {RTEVAL_VERSION}")
@@ -205,7 +181,7 @@ def parse_options(cfg, parser, cmdargs): # Update the config object with the parsed arguments cfg.UpdateFromOptionParser(cmd_opts) - return cmd_args + return cmd_opts if __name__ == '__main__': from rteval.sysinfo import dmi
@@ -225,13 +201,14 @@ if __name__ == '__main__': # Before really parsing options, see if we have been given a config file in the args # and load it - just so that default values are according to the config file - try: - cfgfile = sys.argv[sys.argv.index('-f')+1] - config.Load(cfgfile) - except IndexError: - # Missing file argument - raise RuntimeError('The -f option requires a file name to the configuration file') - except ValueError: + # Use a minimal parser to extract just the -f option + config_parser = argparse.ArgumentParser(add_help=False) + config_parser.add_argument('-f', '--inifile', dest='inifile') + early_args, _ = config_parser.parse_known_args() + + if early_args.inifile: + config.Load(early_args.inifile) + else: # No configuration file given, load defaults config.Load()
@@ -247,20 +224,29 @@ if __name__ == '__main__': 'sysstat' : 'module'}) # Prepare log levels before loading modules, not to have unwanted log messages + # Use a minimal parser to extract logging-related flags early rtevcfg = config.GetSection('rteval') - if (sys.argv.count('-v')+sys.argv.count('--verbose')) > 0: + log_parser = argparse.ArgumentParser(add_help=False) + log_parser.add_argument('-v', '--verbose', action='store_true') + log_parser.add_argument('-D', '--debug', action='store_true') + log_parser.add_argument('-q', '--quiet', action='store_true') + log_parser.add_argument('--idle-set', action='store_true') + early_args, _ = log_parser.parse_known_args() + + if early_args.verbose: rtevcfg.verbose = True - if (sys.argv.count('-D')+sys.argv.count('--debug')) > 0: + if early_args.debug: rtevcfg.debugging = True - if (sys.argv.count('-q')+sys.argv.count('--quiet')) > 0: + if early_args.quiet: rtevcfg.quiet = True + loglev = (not rtevcfg.quiet and (Log.ERR | Log.WARN)) \ | (rtevcfg.verbose and Log.INFO) \ | (rtevcfg.debugging and Log.DEBUG) logger.SetLogVerbosity(loglev) # check if cpupower is being used - if sys.argv.count('--idle-set') > 0: + if early_args.idle_set: rtevcfg.update({'usingCpupower': True}) # Load modules
@@ -271,7 +257,7 @@ if __name__ == '__main__': parser = argparse.ArgumentParser() loadmods.SetupModuleOptions(parser) measuremods.SetupModuleOptions(parser) - cmd_args = parse_options(config, parser, sys.argv[1:]) + cmd_opts = parse_options(config, parser, sys.argv[1:]) if rtevcfg.noload: if rtevcfg.onlyload:
@@ -371,16 +357,15 @@ if __name__ == '__main__': logger.log(Log.DEBUG, f"workdir: {rtevcfg.workdir}") # if --summarize was specified then just parse the XML, print it and exit - if rtevcfg.summarize or rtevcfg.rawhistogram: - if len(cmd_args) < 1: - raise RuntimeError("Must specify at least one XML file with --summarize!") - - for x in cmd_args: - if rtevcfg.summarize: - summarize(x, rtevcfg.xslt_report) - elif rtevcfg.rawhistogram: - summarize(x, rtevcfg.xslt_histogram) + if cmd_opts.rteval___summarize: + for xmlfile in cmd_opts.rteval___summarize: + summarize(xmlfile, rtevcfg.xslt_report) + sys.exit(0) + # if --raw-histogram was specified then just parse the XML, print it and exit + if cmd_opts.rteval___rawhistogram: + for xmlfile in cmd_opts.rteval___rawhistogram: + summarize(xmlfile, rtevcfg.xslt_histogram) sys.exit(0) if os.getuid() != 0:
Signature · 1 line
2.51.1
PATCH 10/12 rteval: timerlat: Add dma_latency option with default value of 0
In reply to John KacurAdd support for the rtla timerlat --dma-latency option to control /dev/cpu_dma_latency settings. The option is enabled by default with a value of 0 to help reduce latency by preventing deep CPU idle states.
Users can customize the value or disable the option entirely by setting dma_latency to None in the configuration.
--- rteval/modules/measurement/timerlat.py | 9 +++++++++ 1 file changed, 9 insertions(+)
rteval/modules/measurement/timerlat.py +9 -0
@@ -232,6 +232,12 @@ class Timerlat(rtevalModulePrototype): self.__cmd.append(f'-E{self.__buckets}') self.__cmd.append('--no-summary') + # Add dma-latency option if configured (default is 0) + # If dma_latency is explicitly set to None, don't pass the option to rtla + dma_latency = self.__cfg.setdefault('dma_latency', '0') + if dma_latency is not None and str(dma_latency).lower() != 'none': + self.__cmd.append(f'--dma-latency={dma_latency}') + if self.__cfg.stoptrace: self.__cmd.append(f"-T{int(self.__cfg.stoptrace)}")
@@ -523,6 +529,9 @@ def ModuleParameters(): "trace": {"descr": "File to save trace to", "default": None, "metavar": "FILE" }, + "dma_latency": {"descr": "Set /dev/cpu_dma_latency to USEC (set to None to disable)", + "default": "0", + "metavar": "USEC" }, } def create(params, logger):
Signature · 1 line
2.51.1
PATCH 11/12 rteval: Add --measurement-module command-line argument
In reply to John KacurAdd a new command-line argument to select between cyclictest and timerlat measurement modules, overriding the config file setting.
The argument is part of the "Group Options for measurement modules" in the argument parser, making it consistent with other measurement options like --measurement-cpulist and --measurement-run-on-isolcpus.
Usage:
rteval --measurement-module cyclictest
rteval --measurement-module timerlat
Implementation details:
- Added --measurement-module to measurement argument group in rteval/modules/__init__.py (SetupModuleOptions)
- Added early argument parsing in rteval-cmd to apply the override before modules are loaded
- The selected module is enabled while the other is disabled
- Fixed module loading to handle None values when modules are disabled
--- rteval-cmd | 18 ++++++++++++++++++ rteval/modules/__init__.py | 7 +++++++ rteval/modules/measurement/__init__.py | 2 +- 3 files changed, 26 insertions(+), 1 deletion(-)
rteval-cmd +18 -0
@@ -223,6 +223,24 @@ if __name__ == '__main__': 'cyclictest' : 'module', 'sysstat' : 'module'}) + # Check for --measurement-module argument early to override config file + measurement_parser = argparse.ArgumentParser(add_help=False) + measurement_parser.add_argument('--measurement-module', dest='measurement_module', + type=str, choices=['cyclictest', 'timerlat']) + early_args, _ = measurement_parser.parse_known_args() + + if early_args.measurement_module: + # Override measurement config based on command-line argument + msrcfg = config.GetSection('measurement') + # Disable both cyclictest and timerlat first + if 'cyclictest' in msrcfg: + msrcfg.cyclictest = None + if 'timerlat' in msrcfg: + msrcfg.timerlat = None + # Enable the selected measurement module + setattr(msrcfg, early_args.measurement_module, 'module') + logger.log(Log.INFO, f"Using measurement module: {early_args.measurement_module} (from command line)") + # Prepare log levels before loading modules, not to have unwanted log messages # Use a minimal parser to extract logging-related flags early rtevcfg = config.GetSection('rteval')
rteval/modules/__init__.py +7 -0
@@ -303,6 +303,13 @@ reference from the first import""" metavar='IDLESTATE', default=None, help='Idle state depth to set on cpus running measurement modules') + grparser.add_argument('--measurement-module', + dest='measurement___measurement_module', + type=str, + choices=['cyclictest', 'timerlat'], + metavar='MODULE', + default=None, + help='Select measurement module: cyclictest or timerlat (overrides config file)') for (modname, mod) in list(self.__modsloaded.items()): opts = mod.ModuleParameters()
rteval/modules/measurement/__init__.py +1 -1
@@ -24,7 +24,7 @@ class MeasurementModules(RtEvalModules): for m in modcfg: # hope to eventually have different kinds but module is only on # for now (jcw) - if m[1].lower() == 'module': + if m[1] and m[1].lower() == 'module': self._LoadModule(m[0]) def SetupModuleOptions(self, parser):
Signature · 1 line
2.51.1
PATCH 12/12 rteval: Add unit tests for --measurement-module argument
In reply to John KacurAdd comprehensive unit testing infrastructure for the new --measurement-module command-line argument.
Test coverage includes:
- Default config file selection behavior
- Override with cyclictest
- Override with timerlat
- No override when argument not provided
- Invalid module name rejection
- Exclusive module selection (only one enabled)
Testing infrastructure:
- Created tests/ directory following Python conventions
- Added test_measurement_module_selection.py with 6 test cases
- Added run_tests.sh script for automated test execution
- Added Makefile targets: 'make test' and 'make unittest'
- Updated 'make help' to document test targets
All tests pass successfully using Python's unittest framework.
Usage:
make test
./run_tests.sh
python3 tests/test_measurement_module_selection.py
--- Makefile | 10 ++ run_tests.sh | 89 ++++++++++ tests/test_measurement_module_selection.py | 195 +++++++++++++++++++++ 3 files changed, 294 insertions(+) create mode 100755 run_tests.sh create mode 100755 tests/test_measurement_module_selection.py
Makefile +10 -0
@@ -30,6 +30,12 @@ sysreport: [ -d $(HERE)/run ] || mkdir run $(PYTHON) rteval-cmd -D -v --workdir=$(HERE)/run --loaddir=$(HERE)/loadsource --duration=$(D) -i $(HERE)/rteval --sysreport +unittest: + @echo "Running unit tests..." + ./run_tests.sh + +test: unittest + clean: rm -f *~ rteval/*~ rteval/*.py[co] *.tar.bz2 *.tar.gz doc/*~
@@ -66,6 +72,8 @@ help: @echo "rteval Makefile targets:" @echo "" @echo " runit: do a short testrun locally [default]" + @echo " test: run unit tests" + @echo " unittest: run unit tests (same as test)" @echo " tarfile: create the source tarball" @echo " install: install rteval locally" @echo " clean: cleanup generated files"
@@ -82,3 +90,5 @@ tags: .PHONY: cleantags cleantags: rm -f tags + +.PHONY: test unittest
run_tests.sh new file +89 -0
89 lines not on this page · raw message
tests/test_measurement_module_selection.py new file +195 -0
195 lines not on this page · raw message
Signature · 1 line
2.51.1