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/breakpoint_test.c",
     67         "tools/testing/selftests/breakpoints/step_after_suspend_test.c",
     68     ],
     69     defaults: ["kselftest_defaults"],
     70     arch: {
     71         arm: {
     72             enabled: false,
     73         },
     74         arm64: {
     75             enabled: false,
     76         },
     77     },
     78 }
     79 
     80 // Efivarfs test
     81 cc_test {
     82     name: "kselftest_efivarfs_tests",
     83     relative_install_path: "linux-kselftest/efivarfs",
     84     srcs: [
     85         "tools/testing/selftests/efivarfs/open-unlink.c",
     86         "tools/testing/selftests/efivarfs/create-read.c",
     87     ],
     88     defaults: ["kselftest_defaults"],
     89     // TODO: test_data: efivarfs/efivarfs.sh
     90 }
     91 
     92 // Futex test
     93 cc_test {
     94     name: "kselftest_futex_tests",
     95     relative_install_path: "linux-kselftest/futex/functional",
     96     srcs: [
     97         "tools/testing/selftests/futex/functional/futex_wait_timeout.c",
     98         "tools/testing/selftests/futex/functional/futex_wait_wouldblock.c",
     99         "tools/testing/selftests/futex/functional/futex_requeue_pi_mismatched_ops.c",
    100         "tools/testing/selftests/futex/functional/futex_wait_uninitialized_heap.c",
    101         "tools/testing/selftests/futex/functional/futex_wait_private_mapped_file.c",
    102     ],
    103     local_include_dirs: [
    104         "tools/testing/selftests/futex/include",
    105         "tools/testing/selftests",
    106     ],
    107     cflags: [
    108         "-D_GNU_SOURCE",
    109         "-pthread",
    110     ],
    111     defaults: ["kselftest_defaults"],
    112 }
    113 
    114 // intel_pstate test
    115 cc_test {
    116     name: "kselftest_intel_pstate_tests",
    117     relative_install_path: "linux-kselftest/intel_pstate",
    118     srcs: [
    119         "tools/testing/selftests/intel_pstate/aperf.c",
    120         "tools/testing/selftests/intel_pstate/msr.c",
    121     ],
    122     cflags: [
    123         "-D_GNU_SOURCE",
    124     ],
    125     defaults: ["kselftest_defaults"],
    126     // TODO: test_data: intel_pstate/run.sh
    127 }
    128 
    129 // Kcmp test
    130 cc_test {
    131     name: "kselftest_kcmp_tests",
    132     relative_install_path: "linux-kselftest/kcmp",
    133     srcs: ["tools/testing/selftests/kcmp/kcmp_test.c"],
    134     defaults: ["kselftest_defaults"],
    135 }
    136 
    137 // media_tests test
    138 cc_test {
    139     name: "kselftest_media_tests",
    140     relative_install_path: "linux-kselftest/media_tests",
    141     srcs: [
    142         "tools/testing/selftests/media_tests/media_device_test.c",
    143         "tools/testing/selftests/media_tests/media_device_open.c",
    144         "tools/testing/selftests/media_tests/video_device_test.c",
    145     ],
    146     defaults: ["kselftest_defaults"],
    147 }
    148 
    149 // Membarrier test
    150 cc_test {
    151     name: "kselftest_membarrier_tests",
    152     relative_install_path: "linux-kselftest/membarrier",
    153     srcs: ["tools/testing/selftests/membarrier/membarrier_test.c"],
    154     defaults: ["kselftest_defaults"],
    155 }
    156 
    157 // Mount test
    158 cc_test {
    159     name: "kselftest_mount_tests",
    160     relative_install_path: "linux-kselftest/mount",
    161     srcs: ["tools/testing/selftests/mount/unprivileged-remount-test.c"],
    162     defaults: ["kselftest_defaults"],
    163 }
    164 
    165 // Net test
    166 cc_test {
    167     name: "kselftest_net_tests",
    168     relative_install_path: "linux-kselftest/net",
    169     srcs: [
    170         "tools/testing/selftests/net/socket.c",
    171         "tools/testing/selftests/net/psock_fanout.c",
    172         "tools/testing/selftests/net/psock_tpacket.c",
    173         "tools/testing/selftests/net/reuseport_dualstack.c",
    174     ],
    175     defaults: ["kselftest_defaults"],
    176     // TODO: test_data: net/test_bpf.sh
    177 }
    178 
    179 // Ptrace test
    180 cc_test {
    181     name: "kselftest_ptrace_tests",
    182     relative_install_path: "linux-kselftest/ptrace",
    183     srcs: ["tools/testing/selftests/ptrace/peeksiginfo.c"],
    184     defaults: ["kselftest_defaults"],
    185 }
    186 
    187 // seccomp test
    188 cc_test {
    189     name: "kselftest_seccomp_tests",
    190     relative_install_path: "linux-kselftest/seccomp",
    191     srcs: ["tools/testing/selftests/seccomp/seccomp_bpf.c"],
    192     defaults: ["kselftest_defaults"],
    193 }
    194 
    195 // Timer test
    196 cc_test {
    197     name: "kselftest_timer_tests",
    198     relative_install_path: "linux-kselftest/timers",
    199     srcs: [
    200         "tools/testing/selftests/timers/posix_timers.c",
    201         "tools/testing/selftests/timers/nanosleep.c",
    202         "tools/testing/selftests/timers/nsleep-lat.c",
    203         "tools/testing/selftests/timers/set-timer-lat.c",
    204         "tools/testing/selftests/timers/inconsistency-check.c",
    205         "tools/testing/selftests/timers/raw_skew.c",
    206         "tools/testing/selftests/timers/threadtest.c",
    207         "tools/testing/selftests/timers/rtctest.c",
    208         "tools/testing/selftests/timers/alarmtimer-suspend.c",
    209         "tools/testing/selftests/timers/valid-adjtimex.c",
    210         "tools/testing/selftests/timers/adjtick.c",
    211         "tools/testing/selftests/timers/change_skew.c",
    212         "tools/testing/selftests/timers/skew_consistency.c",
    213         "tools/testing/selftests/timers/clocksource-switch.c",
    214         "tools/testing/selftests/timers/leap-a-day.c",
    215         "tools/testing/selftests/timers/leapcrash.c",
    216         "tools/testing/selftests/timers/set-tai.c",
    217         "tools/testing/selftests/timers/set-2038.c",
    218         "tools/testing/selftests/timers/set-tz.c",
    219     ],
    220     cflags: [
    221         "-O3",
    222         "-DKTEST",
    223     ],
    224     defaults: ["kselftest_defaults"],
    225 }
    226 
    227 // Vm test
    228 cc_test {
    229     name: "kselftest_vm_tests",
    230     relative_install_path: "linux-kselftest/vm",
    231     srcs: [
    232         "tools/testing/selftests/vm/compaction_test.c",
    233         "tools/testing/selftests/vm/hugepage-mmap.c",
    234         "tools/testing/selftests/vm/hugepage-shm.c",
    235         "tools/testing/selftests/vm/map_hugetlb.c",
    236         "tools/testing/selftests/vm/mlock2-tests.c",
    237         "tools/testing/selftests/vm/on-fault-limit.c",
    238         "tools/testing/selftests/vm/transhuge-stress.c",
    239     ],
    240     defaults: ["kselftest_defaults"],
    241 }
    242 
    243 // x86 test
    244 cc_test {
    245     name: "kselftest_x86_tests",
    246     relative_install_path: "linux-kselftest/x86",
    247     srcs: [
    248         "tools/testing/selftests/x86/single_step_syscall.c",
    249         "tools/testing/selftests/x86/syscall_nt.c",
    250         "tools/testing/selftests/x86/test_mremap_vdso.c",
    251         "tools/testing/selftests/x86/check_initial_reg_state.c",
    252         "tools/testing/selftests/x86/ldt_gdt.c"
    253     ],
    254     arch: {
    255         arm: {
    256             enabled: false,
    257         },
    258         arm64: {
    259             enabled: false,
    260         },
    261         x86: {
    262             srcs: [
    263                 "tools/testing/selftests/x86/sysret_ss_attrs.c",
    264                 //"tools/testing/selftests/x86/entry_from_vm86.c",
    265                 "tools/testing/selftests/x86/syscall_arg_fault.c",
    266                 "tools/testing/selftests/x86/unwind_vdso.c",
    267                 "tools/testing/selftests/x86/test_FCMOV.c",
    268                 "tools/testing/selftests/x86/test_FCOMI.c",
    269                 "tools/testing/selftests/x86/test_FISTTP.c",
    270                 "tools/testing/selftests/x86/vdso_restorer.c",
    271             ],
    272         },
    273     },
    274     cflags: [
    275         "-O2",
    276         "-std=gnu99",
    277         "-pthread",
    278     ],
    279     defaults: ["kselftest_defaults"],
    280 }
    281 
    282 cc_test {
    283     name: "kselftest_x86_ptrace_syscall",
    284     stem: "ptrace_syscall",
    285     relative_install_path: "linux-kselftest/x86",
    286     srcs: [
    287         "tools/testing/selftests/x86/ptrace_syscall.c",
    288         "tools/testing/selftests/x86/raw_syscall_helper_32.S",
    289     ],
    290     cflags: [
    291         "-O2",
    292         "-std=gnu99",
    293         "-pthread",
    294     ],
    295     test_per_src: false,
    296     defaults: ["kselftest_defaults"],
    297     enabled: false,
    298     arch: {
    299         x86: {
    300             enabled: true,
    301         },
    302     },
    303 }
    304 
    305 cc_test {
    306     name: "kselftest_x86_test_syscall_vdso",
    307     stem: "test_syscall_vdso",
    308     relative_install_path: "linux-kselftest/x86",
    309     srcs: [
    310         "tools/testing/selftests/x86/test_syscall_vdso.c",
    311         "tools/testing/selftests/x86/thunks_32.S",
    312     ],
    313     cflags: [
    314         "-O2",
    315         "-std=gnu99",
    316         "-pthread",
    317     ],
    318     test_per_src: false,
    319     defaults: ["kselftest_defaults"],
    320     enabled: false,
    321     arch: {
    322         x86: {
    323             enabled: true,
    324         },
    325     },
    326 }
    327