xref: /freebsd/tests/Kyuafile (revision 6ef644f5)
1e2197f80SRui Paulo--
2e2197f80SRui Paulo-- Copyright 2011 Google Inc.
3e2197f80SRui Paulo-- All rights reserved.
4e2197f80SRui Paulo--
5e2197f80SRui Paulo-- Redistribution and use in source and binary forms, with or without
6e2197f80SRui Paulo-- modification, are permitted provided that the following conditions are
7e2197f80SRui Paulo-- met:
8e2197f80SRui Paulo--
9e2197f80SRui Paulo-- * Redistributions of source code must retain the above copyright
10e2197f80SRui Paulo--   notice, this list of conditions and the following disclaimer.
11e2197f80SRui Paulo-- * Redistributions in binary form must reproduce the above copyright
12e2197f80SRui Paulo--   notice, this list of conditions and the following disclaimer in the
13e2197f80SRui Paulo--   documentation and/or other materials provided with the distribution.
14e2197f80SRui Paulo-- * Neither the name of Google Inc. nor the names of its contributors
15e2197f80SRui Paulo--   may be used to endorse or promote products derived from this software
16e2197f80SRui Paulo--   without specific prior written permission.
17e2197f80SRui Paulo--
18e2197f80SRui Paulo-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19e2197f80SRui Paulo-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20e2197f80SRui Paulo-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21e2197f80SRui Paulo-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22e2197f80SRui Paulo-- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23e2197f80SRui Paulo-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24e2197f80SRui Paulo-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25e2197f80SRui Paulo-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26e2197f80SRui Paulo-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27e2197f80SRui Paulo-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28e2197f80SRui Paulo-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29e2197f80SRui Paulo
30e2197f80SRui Paulo-- Automatically recurses into any subdirectory that holds a Kyuafile.
31e2197f80SRui Paulo-- As such, this Kyuafile is suitable for installation into the root of
32e2197f80SRui Paulo-- the tests hierarchy as well as into any other subdirectory that needs
33e2197f80SRui Paulo-- "auto-discovery" of tests.
34e2197f80SRui Paulo--
35e2197f80SRui Paulo-- This file is based on the Kyuafile.top sample file distributed in the
36e2197f80SRui Paulo-- kyua-cli package.
37e2197f80SRui Paulo
38e2197f80SRui Paulosyntax(2)
39e2197f80SRui Paulo
40e2197f80SRui Paulolocal directory = fs.dirname(current_kyuafile())
41e2197f80SRui Paulofor file in fs.files(directory) do
42e2197f80SRui Paulo    if file == "." or file == ".." then
43e2197f80SRui Paulo        -- Skip these special entries.
44e2197f80SRui Paulo    else
45e2197f80SRui Paulo        local kyuafile_relative = fs.join(file, "Kyuafile")
46e2197f80SRui Paulo        local kyuafile_absolute = fs.join(directory, kyuafile_relative)
47e2197f80SRui Paulo        if fs.exists(kyuafile_absolute) then
48e2197f80SRui Paulo            include(kyuafile_relative)
49e2197f80SRui Paulo        end
50e2197f80SRui Paulo    end
51e2197f80SRui Pauloend
52