=head1 COPYRIGHT AND LICENSE

Copyright (C) 2026 Xiyue Deng <manphiz@gmail.com>

This program is free software: you can redistribute it and/or modify it under
the terms of the SPDX-License-Identifier: GPL-2.0-or-later

=cut

use strict;
use warnings;

use Test::More;
use Getopt::Long;

use FindBin qw($Bin);
use lib "$Bin/lib";
use TestHelper;

my $build_time_test;
GetOptions(
    "build_time_test" => \$build_time_test,
);

foreach my $test_case (get_all_test_cases()) {
    my $tmp_dir = Path::Tiny->tempdir(
        TEMPLATE => "dh-make-elpa_XXXXXX",
    );
    my $work_dir = setup_temp_work_dir($test_case, $tmp_dir);
    run_dh_make_elpa_in_temp_work_dir($work_dir, is_team_package($test_case),
                                      "$Bin/..", $build_time_test);
    my $test_case_name = $test_case->basename;
    ok(check_no_diff($test_case, $work_dir), "$test_case_name");
}

done_testing();
