commandline session $cat array.pl #!/usr/bin/perl use strict; use warnings; my @colors = (“red”,”green”,”blue”); print “@colors”; print “n”; $perl array.pl red green blue $vim array.pl $cat array.pl #!/usr/bin/perl use strict; use warnings; my @colors = (“red”,”green”,”blue”); print “@colors”; print “n”; print $color[0]; print “n”; $perl array.pl Global symbol “@color” requires explicit package name at array.pl line …
Monthly Archives: March 2013
Perl TESTING for gcc compiler option related
commandline session $cat testgcc.pl #!/usr/bin/perl -w use Test::More tests => 2 ; my $result; system “gcc unsigned.c”; $result = `./a.out`; #print $result; ok ($result lt 0); system “gcc -funsigned-char unsigned.c”; $result = `./a.out`; #print $result; ok ($result gt 0); $cat unsigned.c #include int main(void) { char c = -10; printf(“%d”,c); return 0; } $perl testgcc.pl …
Continue reading “Perl TESTING for gcc compiler option related”
PERL TESTING Print only ok/not ok
commandline session $cat test5.pl #!/usr/bin/perl use strict; use warnings; my $result; $result = `/usr/bin/concalc 1 + 1`; print $result; if ( $result == 1 ) { print “okn”; } else { print “not okn”; } $result = `/usr/bin/concalc 2 + 2`; if ( $result == 4 ) { print “okn”; } else { print “not …
Perl Testing using system function
commandline session $cat test4.pl #!/usr/bin/perl use strict; use warnings; system “echo 1 > 1”; print “n”; system “echo 2 > 2”; print “n”; system “echo hello”; print “n”; $perl test4.pl hello $cat 1 1 $cat 2 2 $
TEST WITH Perl extension for ICalendar date objects
commandline session $cat test3.pl #!/usr/bin/perl -w use Test::Simple tests => 2; use Date::ICal; my $ical = Date::ICal->new; # create an object ok( defined $ical ); # check that we got something ok( $ical->isa(‘Date::ICal’) ); # and it’s the right class $perl test3.pl 1..2 ok 1 ok 2 $
TESTING WITH Perl
commandline session $perl test1.pl 1..1 ok 1 $cat test1.pl #!/usr/bin/perl -w print “1..1n”; print 1 + 1 == 2 ? “ok 1n” : “not ok 1n”; $perl 1+1 $perl -e No code specified for -e. $perl -d Loading DB routines from perl5db.pl version 1.33 Editor support available. Enter h or `h h’ for help, or …
Linux KERNEL TESTING asynctest TINKER ON PYTHON SHELL
$python Python 2.7.3 (default, Jun 15 2012, 15:26:07) [GCC 4.7.0] on linux2 Type “help”, “copyright”, “credits” or “license” for more information. >>> from autotest.client import utils, test >>> x = utils.AsyncJob(“sleep 1 && echo hi && sleep 1 && echo hi && sleep 1 && echo hi && sleep 1”) DEBUG:root:Running ‘sleep 1 && echo …
Continue reading “Linux KERNEL TESTING asynctest TINKER ON PYTHON SHELL”
Linux KERNEL TESTING asynctest
commandline session $sudo autotest-local run asynctest/ 18:58:57 INFO | Writing results to /usr/local/lib/python2.7/dist-packages/autotest/client/results/default 18:58:58 INFO | START —- —- timestamp=13625710038 localtime=Mar 06 18:58:58 18:58:58 INFO | START asynctest asynctest timestamp=13625710038 localtime=Mar 06 18:58:58 18:59:00 INFO | Process 1 stdout is now hi 18:59:00 INFO | hi 18:59:00 INFO | 18:59:02 INFO | Process 1 result …
R Plotting a Function Curve
commandline session > curve(x^3 – 5*x, from=-4, to=4) > png(file=”RcurveA.png”) > curve(x^3 – 5*x, from=-4, to=4) > dev.off() null device 1 > png(file=”RcurveB.png”) > curve(x^3 – 5*x, from=-4, to=0) > dev.off() null device 1 > png(file=”RcurveC.png”) > curve(x^3 – 5*x, from=10, to=50) > dev.off() null device 1 >
Linux KERNEL TESTING signaltest
ABOUT Signal(IPC) Signals are a limited form of inter-process communication (IPC), typically used in Unix, Unix-like, and other POSIX-compliant operating systems. A signal is an asynchronous notification sent to a process or to a specific thread within the same process in order to notify it of an event that occurred. Signals originated in 1970s Bell …