Home | History | Annotate | Download | only in linux-kselftest
      1 //
      2 // Copyright (C) 2016 The Android Open Source Project
      3 //
      4 // Licensed under the Apache License, Version 2.0 (the "License");
      5 // you may not use this file except in compliance with the License.
      6 // You may obtain a copy of the License at
      7 //
      8 //      http://www.apache.org/licenses/LICENSE-2.0
      9 //
     10 // Unless required by applicable law or agreed to in writing, software
     11 // distributed under the License is distributed on an "AS IS" BASIS,
     12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13 // See the License for the specific language governing permissions and
     14 // limitations under the License.
     15 //
     16 
     17 cc_defaults {
     18     name: "kselftest_defaults",
     19     cflags: [
     20         // Hacks for bionic compatibility
     21         "-include bionic-compat.h",
     22 
     23         "-Wall",
     24 
     25         // Silence noisy warnings
     26         "-Wno-deprecated",
     27         "-Wno-format",
     28         "-Wno-gnu-designator",
     29         "-Wno-macro-redefined",
     30         "-Wno-missing-field-initializers",
     31         "-Wno-parentheses-equality",
     32         "-Wno-pointer-arith",
     33         "-Wno-sign-compare",
     34         "-Wno-unused-parameter",
     35         "-Wno-shift-negative-value",
     36         "-Wno-switch",
     37         "-Wno-absolute-value",
     38         "-Wno-non-literal-null-conversion",
     39         "-Wno-unused-variable",
     40         "-Wno-unused-parameter",
     41         "-Wno-empty-body",
     42         "-Wno-literal-conversion",
     43         "-Werror",
     44     ],
     45 
     46     local_include_dirs: ["android/include"],
     47     gtest: false,
     48     no_named_install_directory: true,
     49 
     50     test_per_src: true,
     51     arch: {
     52         mips: {
     53             enabled: false,
     54         },
     55         mips64: {
     56             enabled: false,
     57         },
     58     },
     59 }
     60 
     61 // breakpoints test
     62 cc_test {
     63     name: "kselftest_breakpoints_tests",
     64     relative_install_path: "linux-kselftest/breakpoints",
     65     srcs: [
     66         "tools/testing/selftests/breakpoints/step_after_suspend_test.c",
     67     ],
     68     defaults: ["kselftest_defaults"],
     69     arch: {
     70         arm: {
     71             enabled: false,
     72         },
     73         arm64: {
     74             srcs: [
     75                 "tools/testing/selftests/breakpoints/breakpoint_test_arm64.c",
     76             ],
     77         },
     78         x86: {
     79             srcs: [
     80                 "tools/testing/selftests/breakpoints/breakpoint_test.c",
     81             ],
     82         },
     83     },
     84 }
     85 
     86 // capabilities test
     87 cc_test {
     88     name: "kselftest_capabilities_test",
     89     relative_install_path: "linux-kselftest/capabilities",
     90     srcs: [
     91         "tools/testing/selftests/capabilities/test_execve.c",
     92         "tools/testing/selftests/capabilities/validate_cap.c",
     93     ],
     94     defaults: ["kselftest_defaults"],
     95     static_libs: ["libcap-ng"],
     96 }
     97 
     98 // Efivarfs test
     99 cc_test {
    100     name: "kselftest_efivarfs_tests",
    101     relative_install_path: "linux-kselftest/efivarfs",
    102     srcs: [
    103         "tools/testing/selftests/efivarfs/open-unlink.c",
    104         "tools/testing/selftests/efivarfs/create-read.c",
    105     ],
    106     defaults: ["kselftest_defaults"],
    107 }
    108 
    109 // Exec test
    110 cc_test {
    111     name: "kselftest_exec_test",
    112     relative_install_path: "linux-kselftest/exec",
    113     srcs: [
    114         "tools/testing/selftests/exec/execveat.c",
    115     ],
    116     defaults: ["kselftest_defaults"],
    117 }
    118 
    119 // Futex test
    120 cc_test {
    121     name: "kselftest_futex_tests",
    122     relative_install_path: "linux-kselftest/futex/functional",
    123     srcs: [
    124         "tools/testing/selftests/futex/functional/futex_requeue_pi.c",
    125         "tools/testing/selftests/futex/functional/futex_requeue_pi_mismatched_ops.c",
    126         "tools/testing/selftests/futex/functional/futex_requeue_pi_signal_restart.c",
    127         "tools/testing/selftests/futex/functional/futex_wait_private_mapped_file.c",
    128         "tools/testing/selftests/futex/functional/futex_wait_timeout.c",
    129         "tools/testing/selftests/futex/functional/futex_wait_uninitialized_heap.c",
    130         "tools/testing/selftests/futex/functional/futex_wait_wouldblock.c",
    131     ],
    132     local_include_dirs: [
    133         "tools/testing/selftests/futex/include",
    134         "tools/testing/selftests",
    135     ],
    136     cflags: [
    137         "-D_GNU_SOURCE",
    138         "-pthread",
    139     ],
    140     defaults: ["kselftest_defaults"],
    141 }
    142 
    143 // intel_pstate test
    144 cc_test {
    145     name: "kselftest_intel_pstate_tests",
    146     relative_install_path: "linux-kselftest/intel_pstate",
    147     srcs: [
    148         "tools/testing/selftests/intel_pstate/aperf.c",
    149         "tools/testing/selftests/intel_pstate/msr.c",
    150     ],
    151     cflags: [
    152         "-D_GNU_SOURCE",
    153     ],
    154     defaults: ["kselftest_defaults"],
    155     // TODO: test_data: intel_pstate/run.sh
    156 }
    157 
    158 // Kcmp test
    159 cc_test {
    160     name: "kselftest_kcmp_tests",
    161     relative_install_path: "linux-kselftest/kcmp",
    162     srcs: ["tools/testing/selftests/kcmp/kcmp_test.c"],
    163     defaults: ["kselftest_defaults"],
    164 }
    165 
    166 // media_tests test
    167 cc_test {
    168     name: "kselftest_media_tests",
    169     relative_install_path: "linux-kselftest/media_tests",
    170     srcs: [
    171         "tools/testing/selftests/media_tests/media_device_test.c",
    172         "tools/testing/selftests/media_tests/media_device_open.c",
    173         "tools/testing/selftests/media_tests/video_device_test.c",
    174     ],
    175     defaults: ["kselftest_defaults"],
    176 }
    177 
    178 // Membarrier test
    179 cc_test {
    180     name: "kselftest_membarrier_tests",
    181     relative_install_path: "linux-kselftest/membarrier",
    182     srcs: ["tools/testing/selftests/membarrier/membarrier_test.c"],
    183     defaults: ["kselftest_defaults"],
    184 }
    185 
    186 // Mount test
    187 cc_test {
    188     name: "kselftest_mount_tests",
    189     relative_install_path: "linux-kselftest/mount",
    190     srcs: ["tools/testing/selftests/mount/unprivileged-remount-test.c"],
    191     defaults: ["kselftest_defaults"],
    192 }
    193 
    194 // Net test
    195 cc_test {
    196     name: "kselftest_net_tests",
    197     relative_install_path: "linux-kselftest/net",
    198     srcs: [
    199         "tools/testing/selftests/net/socket.c",
    200         "tools/testing/selftests/net/psock_fanout.c",
    201         "tools/testing/selftests/net/psock_tpacket.c",
    202         "tools/testing/selftests/net/reuseport_dualstack.c",
    203         "tools/testing/selftests/net/reuseaddr_conflict.c",
    204     ],
    205     defaults: ["kselftest_defaults"],
    206     // TODO: test_data: net/test_bpf.sh
    207 }
    208 
    209 // Ptrace test
    210 cc_test {
    211     name: "kselftest_ptrace_tests",
    212     relative_install_path: "linux-kselftest/ptrace",
    213     srcs: ["tools/testing/selftests/ptrace/peeksiginfo.c"],
    214     defaults: ["kselftest_defaults"],
    215 }
    216 
    217 // seccomp test
    218 cc_test {
    219     name: "kselftest_seccomp_tests",
    220     relative_install_path: "linux-kselftest/seccomp",
    221     srcs: ["tools/testing/selftests/seccomp/seccomp_bpf.c"],
    222     defaults: ["kselftest_defaults"],
    223 }
    224 
    225 // size test
    226 cc_test {
    227     name: "kselftest_size_test",
    228     relative_install_path: "linux-kselftest/size",
    229     srcs: ["tools/testing/selftests/size/get_size.c"],
    230     defaults: ["kselftest_defaults"],
    231     nocrt: true,
    232 }
    233 
    234 // splice test
    235 cc_test {
    236     name: "kselftest_splice_test",
    237     relative_install_path: "linux-kselftest/splice",
    238     srcs: ["tools/testing/selftests/splice/default_file_splice_read.c"],
    239     defaults: ["kselftest_defaults"],
    240 }
    241 
    242 // Timer test
    243 cc_test {
    244     name: "kselftest_timer_tests",
    245     relative_install_path: "linux-kselftest/timers",
    246     srcs: [
    247         "tools/testing/selftests/timers/adjtick.c",
    248         "tools/testing/selftests/timers/alarmtimer-suspend.c",
    249         "tools/testing/selftests/timers/change_skew.c",
    250         "tools/testing/selftests/timers/clocksource-switch.c",
    251         "tools/testing/selftests/timers/freq-step.c",
    252         "tools/testing/selftests/timers/inconsistency-check.c",
    253         "tools/testing/selftests/timers/leap-a-day.c",
    254         "tools/testing/selftests/timers/leapcrash.c",
    255         "tools/testing/selftests/timers/nanosleep.c",
    256         "tools/testing/selftests/timers/nsleep-lat.c",
    257         "tools/testing/selftests/timers/posix_timers.c",
    258         "tools/testing/selftests/timers/raw_skew.c",
    259         "tools/testing/selftests/timers/rtctest.c",
    260         "tools/testing/selftests/timers/rtctest_setdate.c",
    261         "tools/testing/selftests/timers/set-2038.c",
    262         "tools/testing/selftests/timers/set-tai.c",
    263         "tools/testing/selftests/timers/set-timer-lat.c",
    264         "tools/testing/selftests/timers/set-tz.c",
    265         "tools/testing/selftests/timers/skew_consistency.c",
    266         "tools/testing/selftests/timers/threadtest.c",
    267         "tools/testing/selftests/timers/valid-adjtimex.c",
    268     ],
    269     cflags: [
    270         "-O3",
    271         "-DKTEST",
    272     ],
    273     defaults: ["kselftest_defaults"],
    274 }
    275 
    276 // vdso test
    277 cc_test {
    278     name: "kselftest_vdso_test",
    279     relative_install_path: "linux-kselftest/vDSO",
    280     srcs: [
    281         "tools/testing/selftests/vDSO/parse_vdso.c",
    282         "tools/testing/selftests/vDSO/vdso_test.c",
    283     ],
    284     defaults: ["kselftest_defaults"],
    285     test_per_src: false,
    286 }
    287 
    288 // Vm test
    289 cc_test {
    290     name: "kselftest_vm_tests",
    291     relative_install_path: "linux-kselftest/vm",
    292     srcs: [
    293         "tools/testing/selftests/vm/compaction_test.c",
    294         "tools/testing/selftests/vm/hugepage-mmap.c",
    295         "tools/testing/selftests/vm/hugepage-shm.c",
    296         "tools/testing/selftests/vm/map_hugetlb.c",
    297         "tools/testing/selftests/vm/mlock-random-test.c",
    298         "tools/testing/selftests/vm/mlock2-tests.c",
    299         "tools/testing/selftests/vm/on-fault-limit.c",
    300         "tools/testing/selftests/vm/thuge-gen.c",
    301         "tools/testing/selftests/vm/transhuge-stress.c",
    302     ],
    303     defaults: ["kselftest_defaults"],
    304     static_libs: ["libcap"],
    305 }
    306 
    307 cc_test {
    308     name: "kselftest_vm64_tests",
    309     relative_install_path: "linux-kselftest/vm",
    310     srcs: [
    311         "tools/testing/selftests/vm/virtual_address_range.c",
    312     ],
    313     defaults: ["kselftest_defaults"],
    314     enabled: false,
    315     arch: {
    316         arm64: {
    317             enabled: true,
    318             cflags: ["-D__aarch64__"],
    319         }
    320     }
    321 }
    322 
    323 // x86 test
    324 cc_test {
    325     name: "kselftest_x86_tests",
    326     relative_install_path: "linux-kselftest/x86",
    327     srcs: [
    328         "tools/testing/selftests/x86/single_step_syscall.c",
    329         "tools/testing/selftests/x86/syscall_nt.c",
    330         "tools/testing/selftests/x86/test_mremap_vdso.c",
    331         "tools/testing/selftests/x86/check_initial_reg_state.c",
    332         "tools/testing/selftests/x86/ldt_gdt.c"
    333     ],
    334     arch: {
    335         arm: {
    336             enabled: false,
    337         },
    338         arm64: {
    339             enabled: false,
    340         },
    341         x86: {
    342             srcs: [
    343                 "tools/testing/selftests/x86/sysret_ss_attrs.c",
    344                 //"tools/testing/selftests/x86/entry_from_vm86.c",
    345                 "tools/testing/selftests/x86/syscall_arg_fault.c",
    346                 "tools/testing/selftests/x86/unwind_vdso.c",
    347                 "tools/testing/selftests/x86/test_FCMOV.c",
    348                 "tools/testing/selftests/x86/test_FCOMI.c",
    349                 "tools/testing/selftests/x86/test_FISTTP.c",
    350                 "tools/testing/selftests/x86/vdso_restorer.c",
    351             ],
    352         },
    353     },
    354     cflags: [
    355         "-O2",
    356         "-std=gnu99",
    357         "-pthread",
    358     ],
    359     defaults: ["kselftest_defaults"],
    360 }
    361 
    362 cc_test {
    363     name: "kselftest_x86_ptrace_syscall",
    364     stem: "ptrace_syscall",
    365     relative_install_path: "linux-kselftest/x86",
    366     srcs: [
    367         "tools/testing/selftests/x86/ptrace_syscall.c",
    368         "tools/testing/selftests/x86/raw_syscall_helper_32.S",
    369     ],
    370     cflags: [
    371         "-O2",
    372         "-std=gnu99",
    373         "-pthread",
    374     ],
    375     test_per_src: false,
    376     defaults: ["kselftest_defaults"],
    377     enabled: false,
    378     arch: {
    379         x86: {
    380             enabled: true,
    381         },
    382     },
    383 }
    384 
    385 cc_test {
    386     name: "kselftest_x86_test_syscall_vdso",
    387     stem: "test_syscall_vdso",
    388     relative_install_path: "linux-kselftest/x86",
    389     srcs: [
    390         "tools/testing/selftests/x86/test_syscall_vdso.c",
    391         "tools/testing/selftests/x86/thunks_32.S",
    392     ],
    393     cflags: [
    394         "-O2",
    395         "-std=gnu99",
    396         "-pthread",
    397     ],
    398     test_per_src: false,
    399     defaults: ["kselftest_defaults"],
    400     enabled: false,
    401     arch: {
    402         x86: {
    403             enabled: true,
    404         },
    405     },
    406 }
    407