Skip to content

Instantly share code, notes, and snippets.

@clairvy
Created March 23, 2010 08:12
Show Gist options
  • Select an option

  • Save clairvy/340936 to your computer and use it in GitHub Desktop.

Select an option

Save clairvy/340936 to your computer and use it in GitHub Desktop.
You can test 'make test PROVE=prove'.
then you can get bellow:
$ make test
prove ./test.pl
./test.pl .. ok
All tests successful.
Files=1, Tests=3, 0 wallclock secs ( 0.03 usr 0.01 sys + 0.05 cusr 0.04 csys = 0.13 CPU)
Result: PASS
#!/usr/bin/env python
import hello
if __name__ == '__main__' :
print hello.greetings()
print hello.greed.greetings()
#!/usr/bin/env python
import hello
def greetings():
return "greeding..Oops!"
if __name__ == '__main__' :
print hello.greetings()
print greetings()
#!/usr/bin/env python
import greed
def greetings():
return "Hello"
if __name__ == '__main__' :
print greetings()
print greed.greetings()
PROVE = prove-5.10
do :
./aa.py
test : testpl testpy
testpl :
$(PROVE) ./test.pl
testpy :
./test.py
clean :
$(RM) $(RMF) *.pyc
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More 'no_plan';
my $expected = <<'EOL';
Hello
greeding..Oops!
EOL
is(`./aa.py`, $expected);
is(`./hello.py`, $expected);
is(`./greed.py`, $expected);
#!/usr/bin/env python
import unittest
import hello
class MyTestCase(unittest.TestCase):
def test_hello(self):
self.assertEqual(hello.greetings(), "Hello")
def test_greed(self):
self.assertEqual(hello.greed.greetings(), "greeding..Oops!")
if __name__ == '__main__':
unittest.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment