- find-file-doc-comments.pl: new file - data.py: Add database to store doc-comment locations - script.sh: Add parse-docs subcommand - update.py: - Add code to process doc comments - Update some variable names in hopes of reducing confusion - query.py: - Add code to report doc comments - Update some variable names in hopes of reducing confusion Also: - t/TestEnvironment.pm: Add find_doc attribute - t/interact.pl: Don't die if update.py fails - t/TestHelpers.pm: Permit checking specific sections of query.py output - t/300: update regexes per the preceding - gitignore tags (ctags output) and .cache (api_test.py output)
53 lines
1.9 KiB
Perl
Executable file
53 lines
1.9 KiB
Perl
Executable file
#!/usr/bin/env perl
|
|
# t/interact.pl: Open a shell on a DB of the files in tree/ .
|
|
#
|
|
# Copyright (c) 2020 Christopher White, <cxwembedded@gmail.com>.
|
|
#
|
|
# Elixir is free software; you can redistribute it and/or modify
|
|
# it under the terms of the GNU Affero General Public License as published by
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# Elixir is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU Affero General Public License for more details.
|
|
# # You should have received a copy of the GNU Affero General Public License
|
|
# along with Elixir. If not, see <http://www.gnu.org/licenses/>.
|
|
#
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
#
|
|
# This file uses core Perl modules only.
|
|
|
|
use FindBin '$Bin';
|
|
use lib $Bin;
|
|
|
|
use TestEnvironment;
|
|
use TestHelpers;
|
|
|
|
# ===========================================================================
|
|
# Main
|
|
|
|
# These two lines are all that's required to set up for a test.
|
|
my $tenv = TestEnvironment->new;
|
|
$tenv->build_repo(sibling_abs_path('tree')); # dies on error
|
|
eval { $tenv->build_db; };
|
|
warn "Could not update database: $@" if $@;
|
|
$tenv->update_env;
|
|
|
|
print($tenv->report);
|
|
|
|
# Make some convenient symlinks
|
|
chdir($tenv->lxr_repo_dir);
|
|
system(qw(ln -s), $tenv->script_sh, 'script.sh') == 0
|
|
or warn "error creating ./script.sh: $? $!";
|
|
system(qw(ln -s), $tenv->update_py, 'update.py') == 0
|
|
or warn "error creating ./update.py: $? $!";
|
|
system(qw(ln -s), $tenv->query_py, 'query.py') == 0
|
|
or warn "error creating ./query.py: $? $!";
|
|
system(qw(ln -s), $tenv->find_doc, 'find-file-doc-comments.pl') == 0
|
|
or warn "error creating ./find-file-doc-comments.pl: $? $!";
|
|
|
|
print("Exit when done, and the repository and database will be removed.\n");
|
|
my $retval = system($ENV{SHELL} || 'sh');
|
|
exit $retval>>8;
|