summaryrefslogtreecommitdiff
path: root/lib/spack/spack/test/cmd/arch.py
blob: 80f7195fd5d9220f28deb95405008437804d54bd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

from spack.main import SpackCommand

arch = SpackCommand("arch")


def test_arch():
    """Sanity check ``spack arch`` to make sure it works."""

    arch()
    arch("-f")
    arch("--frontend")
    arch("-b")
    arch("--backend")


def test_arch_platform():
    """Sanity check ``spack arch --platform`` to make sure it works."""

    arch("-p")
    arch("--platform")
    arch("-f", "-p")
    arch("-b", "-p")


def test_arch_operating_system():
    """Sanity check ``spack arch --operating-system`` to make sure it works."""

    arch("-o")
    arch("--operating-system")
    arch("-f", "-o")
    arch("-b", "-o")


def test_arch_target():
    """Sanity check ``spack arch --target`` to make sure it works."""

    arch("-t")
    arch("--target")
    arch("-f", "-t")
    arch("-b", "-t")


def test_display_targets():
    arch("--known-targets")