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