Implement "Bail out!" parsing
[tapir.git] / setup.pir
blob05cdc799d6620265ba77907ac2143ab1b5a11903
1 #!/usr/bin/env parrot
2 # Copyright (C) 2009, Jonathan "Duke" Leto
4 =head1 NAME
6 setup.pir - Setup, build, test and install Tapir
8 =head1 DESCRIPTION
10 No Configure step, no Makefile generated.
12 See F<runtime/parrot/library/distutils.pir>.
14 =head1 USAGE
16     $ parrot setup.pir build
17     $ parrot setup.pir test
18     $ sudo parrot setup.pir install
20 =cut
22 .sub 'main' :main
23     .param pmc args
24     $S0 = shift args
25     load_bytecode 'distutils.pbc'
27     .const 'Sub' test = 'test'
28     register_step('test', test)
30     $P0 = new 'Hash'
31     $P0['name'] = 'tapir'
32     $P0['abstract'] = 'Fast TAP Harness written in PIR'
33     $P0['authority'] = 'http://github.com/leto'
34     $P0['description'] = 'Fast TAP Harness written in PIR'
35     $P1 = split ';', 'TAP;harness;testing'
36     $P0['keywords'] = $P1
37     $P0['license_type'] = 'Artistic License 2.0'
38     $P0['license_uri'] = 'http://www.perlfoundation.org/artistic_license_2_0'
39     $P0['copyright_holder'] = "Jonathan \"Duke\" Leto"
40     $P0['checkout_uri'] = 'git://github.com/leto/tapir.git'
41     $P0['browser_uri'] = 'http://github.com/leto/tapir'
42     $P0['project_uri'] = 'http://github.com/leto/tapir'
44     # build
45     $P2 = new 'Hash'
46     $P3 = split "\n", <<'SOURCES'
47 t/harness.pir
48 lib/Tapir/Parser.pir
49 lib/Tapir/Stream.pir
50 SOURCES
51     $S0 = pop $P3
52     $P2['tapir.pbc'] = $P3
53     $P0['pbc_pir'] = $P2
55     $P5 = new 'Hash'
56     $P5['parrot-tapir'] = 'tapir.pbc'
57     $P0['exe_pbc'] = $P5
58     $P0['installable_pbc'] = $P5
60     .tailcall setup(args :flat, $P0 :flat :named)
61 .end
63 .sub 'test' :anon
64     .param pmc kv :slurpy :named
65     run_step('build', kv :flat :named)
67     .local pmc config
68     config = get_config()
69     $S0 = config['osname']
70     .local string cmd
71     unless $S0 == 'MSWin32' goto L1
72     cmd = 'tapir.exe'
73     goto L2
74   L1:
75     cmd = './tapir'
76   L2:
77     cmd .= ' t/*.t'
78     system(cmd, 1 :named('verbose'))
79 .end
81 # Local Variables:
82 #   mode: pir
83 #   fill-column: 100
84 # End:
85 # vim: expandtab shiftwidth=4 ft=pir: