• Andrii Nakryiko's avatar
    selftests/bpf: Teach test_progs to cd into subdir · 0b6e71c3
    Andrii Nakryiko authored
    We are building a bunch of "flavors" of test_progs, e.g., w/ alu32 flag
    for Clang when building BPF object. test_progs setup is relying on
    having all the BPF object files and extra resources to be available in
    current working directory, though. But we actually build all these files
    into a separate sub-directory. Next set of patches establishes
    convention of naming "flavored" test_progs (and test runner binaries in
    general) as test_progs-flavor (e.g., test_progs-alu32), for each such
    extra flavor. This patch teaches test_progs binary to automatically
    detect its own extra flavor based on its argv[0], and if present, to
    change current directory to a flavor-specific subdirectory.
    Signed-off-by: default avatarAndrii Nakryiko <andriin@fb.com>
    Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
    Link: https://lore.kernel.org/bpf/20191016060051.2024182-2-andriin@fb.com
    0b6e71c3
test_progs.c 12.2 KB