Skip to content

Commit

Permalink
Merge pull request #718 from ab9rf/codegen-diagnostics
Browse files Browse the repository at this point in the history
make codegen return a useful errorlevel
  • Loading branch information
myk002 authored May 17, 2024
2 parents 372076c + a641d2f commit b7cfdf8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions codegen.pl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ BEGIN
use StructFields;
use StructType;

my $errorlevel = 0;

my $input_dir = $ARGV[0] || '.';
my $output_dir = $ARGV[1] || 'codegen';

Expand Down Expand Up @@ -75,6 +77,7 @@ BEGIN
};
if ($@) {
print "Error preprocessing type $typename: ".$@;
$errorlevel++;
}
}

Expand All @@ -94,6 +97,7 @@ BEGIN
};
if ($@) {
print 'Error: '.$@."Type $typename in $filename ignored\n";
$errorlevel++;
}
}

Expand Down Expand Up @@ -126,6 +130,7 @@ BEGIN
};
if ($@) {
print 'Error: '.$@."Global $typename in $filename failed\n";
$errorlevel++;
}
}
} "namespace global ";
Expand Down Expand Up @@ -243,3 +248,5 @@ sub replace_file {
}
}
}

exit $errorlevel;

0 comments on commit b7cfdf8

Please sign in to comment.