Skip to content

Commit

Permalink
mk_packfile_pbc refactor with t/native_pbc/testdata/annotations.pir
Browse files Browse the repository at this point in the history
  • Loading branch information
Reini Urban committed Sep 4, 2012
1 parent 4523d30 commit a035dc0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 21 deletions.
9 changes: 9 additions & 0 deletions t/native_pbc/testdata/annotations.pir
@@ -0,0 +1,9 @@
.sub 'main'
.annotate "file", "annotations.pir"
.annotate "creator", "Parrot Foundation"
.annotate "line", 1
say "Hi"
say "line"
.annotate "line", 2
.return ()
.end
30 changes: 9 additions & 21 deletions tools/dev/mk_packfile_pbc
Expand Up @@ -4,24 +4,12 @@
#
# generate t/native_pbc/*.pbc for testing Packfile* PMCs.

./parrot -o t/native_pbc/integer.pbc -a - <<EOF
.sub main :main
print 0x10203040
.end
EOF
[ $? -le 0 ] && echo "t/native_pbc/integer.pbc updated"
./parrot -o t/native_pbc/number.pbc t/native_pbc/testdata/number.pasm && echo "t/native_pbc/number.pbc updated"
./parrot -o t/native_pbc/string.pbc t/native_pbc/testdata/string.pasm && echo "t/native_pbc/string.pbc updated"

./parrot -o t/native_pbc/annotations.pbc - <<EOF
.sub 'main'
.annotate "file", "annotations.pir"
.annotate "creator", "Parrot Foundation"
.annotate "line", 1
say "Hi"
say "line"
.annotate "line", 2
.return ()
.end
EOF

for type in integer number string
do
./parrot -o t/native_pbc/$type.pbc t/native_pbc/testdata/$type.pasm \
&& echo "t/native_pbc/$type.pbc updated"
done
type=annotations
./parrot -o t/native_pbc/$type.pbc t/native_pbc/testdata/$type.pir \
&& echo "t/native_pbc/$type.pbc updated"
type=

0 comments on commit a035dc0

Please sign in to comment.