1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-07-17 14:27:11 +02:00
Files
.github
bin
module
vendor
CPR
ConcurrentQueue
Fmt
MaxmindDB
.github
bin
dev-bin
clang-format-all.sh
make-man-pages.pl
ppa-release.sh
regen-win32-test-projs.pl
release.sh
valgrind-all.pl
doc
include
projects
src
t
.gitignore
.gitmodules
.perltidyrc
AUTHORS
CMakeLists.txt
Changes.md
LICENSE
Makefile.am
NOTICE
README.dev.md
README.md
bootstrap
c_flag_overrides.cmake
common.mk
configure.ac
cxx_flag_overrides.cmake
POCO
PUGIXML
SAJSON
SimpleIni
Squirrel
TinyDir
ZMQ
xxHash
CMakeLists.txt
.gitignore
.gitmodules
CMakeLists.txt
LICENSE
README.md
SqMod/vendor/MaxmindDB/dev-bin/regen-win32-test-projs.pl
Sandu Liviu Catalin fd2a1de107 Backport MaxmindDB.
2021-01-31 18:48:31 +02:00

55 lines
1.1 KiB
Perl

#!/usr/bin/env perl
use strict;
use warnings;
use FindBin qw( $Bin );
use Data::UUID;
use File::Slurp qw( read_file write_file );
use Path::Iterator::Rule;
sub main {
my $rule = Path::Iterator::Rule->new;
$rule->file->name(qr/_t.c$/);
my $ug = Data::UUID->new;
my $template = read_file("$Bin/../projects/test.vcxproj.template");
my @names;
for my $file ( $rule->all("$Bin/../t/") ) {
my ($name) = $file =~ /(\w*)_t.c$/;
next unless $name;
next if $name eq 'threads';
push @names, $name;
my $project = $template;
$project =~ s/%TESTNAME%/$name/g;
my $uuid = $ug->to_string( $ug->create );
$project =~ s/%UUID%/$uuid/g;
write_file( "$Bin/../projects/VS12-tests/$name.vcxproj", $project );
}
_modify_yml(@names);
}
sub _modify_yml {
my @names = @_;
my $exe_block = join "\n",
map { " - .\\projects\\VS12\\Debug\\test_${_}.exe" } @names;
my $file = "$Bin/../appveyor.yml";
my $config = read_file($file);
$config =~ s/(#EXES).*?(#ENDEXES)/$1\n$exe_block\n $2/s;
write_file( $file, $config );
}
main();