-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdoit.test
executable file
·27 lines (23 loc) · 1.23 KB
/
doit.test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/perl
#
use strict;
use warnings;
my $debug_level = shift @ARGV || 0;
my $is_fixed = shift @ARGV || 0;
$is_fixed and unshift @ARGV, "-is_float 0";
my $other_args = join( " ", @ARGV );
my $prog = "test_basic";
#my $opt = ($debug_level <= 0) ? "3" : "0";
my $opt = 0;
my $CFLAGS = "-std=c++17 -Wextra -Wstrict-aliasing -pedantic -Werror -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wmissing-include-dirs -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-promo -Wstrict-overflow=5 -Wswitch-default -Wundef -O${opt} -g -DDEBUG_LEVEL=${debug_level}";
`uname` !~ /Darwin/ and $CFLAGS .= " -Wno-shift-negative-value -Wno-strict-overflow -Wno-maybe-uninitialized -Wno-logical-op -Wstrict-null-sentinel -DNO_FMT_LL";
`uname` =~ /Darwin/ and $CFLAGS .= " -Wno-shift-negative-value -Wno-c++14-binary-literal -ferror-limit=10";
system( "rm -f ${prog}.o ${prog} Cordic.o" );
system( "g++ -g -o ${prog}.o ${CFLAGS} -c ${prog}.cpp" ) == 0 or die "ERROR: compile failed\n";
system( "g++ -g -o ${prog} ${prog}.o -lm" ) == 0 or die "ERROR: link failed\n";
my $cmd = "./${prog} ${other_args}";
print "$cmd\n";
if ( system( $cmd ) != 0 ) {
die "ERROR: run failed\n";
}
exit 0;