taucmdr.cli.commands.tests.test_initialize module

Test functions.

Functions used for unit tests of initialize.py.

class taucmdr.cli.commands.tests.test_initialize.DarwinInitializeTest(methodName='runTest')[source]

Bases: DarwinTestCase

Unit tests for taucmdr initialize on macOS

_classSetupFailed = False
_class_cleanups = []
test_measurements()[source]
class taucmdr.cli.commands.tests.test_initialize.InitializeTest(methodName='runTest')[source]

Bases: TestCase

Unit tests for taucmdr initialize

_classSetupFailed = False
_class_cleanups = []
test_bare()[source]
test_h_arg()[source]
test_help_arg()[source]
test_init_below_project()[source]
test_initialize()[source]
class taucmdr.cli.commands.tests.test_initialize.PathTauTest(methodName='runTest')[source]

Bases: TestCase

Tests for the TAU on PATH that tau initialize suggests instead of building its own.

_classSetupFailed = False
_class_cleanups = []
_path_tau(argv: list[str]) → tuple[list[str], str][source]

Put a Spack-style TAU on PATH and parse argv.

The TAU’s <prefix>/bin and <prefix>/lib are links into <prefix>/x86_64, as Spack makes them.

Returns:

The makefiles tau initialize would suggest, and the real path of the TAU’s one makefile.

Return type:

tuple

test_hint_logged()[source]

The suggested makefiles are listed with the command that uses one.

test_suggested()[source]

With the default --tau download, the makefiles of the TAU on PATH are suggested.

test_tau_chosen()[source]

Nothing is suggested when the command line already chooses a TAU.

class taucmdr.cli.commands.tests.test_initialize.PopulateProjectTest(methodName='runTest')[source]

Bases: TestCase

Tests for which default measurements tau initialize creates and selects.

The command objects and storage are mocked so only the decision logic runs; nothing is created and TAU is not built. The instrumentation flags are passed explicitly because their parser defaults depend on the host OS.

_ARGV = ['--project-name', 'proj1', '--target-name', 'targ1', '--application-name', 'app1', '--source-inst', 'automatic', '--compiler-inst', 'fallback']
_classSetupFailed = False
_class_cleanups = []
_populate(argv, binutils='download', target_os=<taucmdr.cf.platforms.OperatingSystem object>)[source]

Run _populate_project() and return (measurement args by name, selected measurement name).

test_all_measurements()[source]

Sampling, source, compiler, and trace measurements are all created; sampling is selected.

test_darwin_target_ignores_binutils()[source]

A Darwin target never uses binutils, so its absence keeps sampling and compiler instrumentation.

test_trace_only()[source]

Profiling disabled: no baseline, only the trace measurement, which is selected.

test_without_binutils()[source]

No binutils: sampling and compiler instrumentation are disabled but source instrumentation stays.

test_without_compiler_instrumentation()[source]

Disabling compiler instrumentation drops only the compiler-inst measurement.

test_without_instrumentation()[source]

Without sampling or instrumentation only the baseline exists, and it is selected.