Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Apply patch from whiteknight++ with some tweaks, fixes #6

  • Loading branch information...
commit f0aedc16123ba0717992ee813a41ef6165651518 1 parent 82ea85a
@leto leto authored
Showing with 29 additions and 15 deletions.
  1. +14 −0 Makefile
  2. +8 −9 t/harness
  3. +7 −6 t/winxed/001_load.t
View
14 Makefile
@@ -1,4 +1,18 @@
+all: build
+
+build: nci pbclib
+
+test: build
+ parrot-nqp t/harness
+
+pbclib: src/Git2/Common.winxed src/Git2/Repository.winxed src/git2.pir
+ winxed -c -o src/Git2/Common.pir src/Git2/Common.winxed
+ parrot -o src/Git2/Common.pbc src/Git2/Common.pir
+ winxed -c -o src/Git2/Repository.pir src/Git2/Repository.winxed
+ parrot -o src/Git2/Repository.pbc src/Git2/Repository.pir
+ parrot -o src/git2.pbc src/git2.pir
+
nci:
echo '# THIS FILE IS GENERATED, edit ./bin/header2nci.pl to make changes here' > src/git2.nci ; \
echo "[package]\nGit\n\n[lib]\n\nlibgit2.so\n\n[defs]\n" >> src/git2.nci ; \
View
17 t/harness
@@ -1,11 +1,10 @@
#! parrot-nqp
-INIT { pir::load_bytecode('rosella/harness.pbc'); }
-my $factory := Rosella::construct(Rosella::Harness::TestRun::Factory);
-$factory.add_test_dirs("PIR", "t/pir", :recurse(1));
-$factory.add_test_dirs("Winxed", "t/winxed", :recurse(1));
-my $testrun := $factory.create();
+my $rosella := pir::load_bytecode__ps('rosella/core.pbc');
+Rosella::initialize_rosella("harness");
my $harness := Rosella::construct(Rosella::Harness);
-my $testview := $harness.default_view();
-$testview.add_run($testrun, 0);
-$harness.run([$testrun], $testview);
-$testview.show_results();
+
+$harness.add_test_dirs("PIR", "t/pir", :recurse(1)).setup_test_run;
+$harness.add_test_dirs("Winxed", "t/winxed", :recurse(1)).setup_test_run;
+
+$harness.run();
+$harness.show_results;
View
13 t/winxed/001_load.t
@@ -19,12 +19,12 @@ class Test_git2_repository_open {
function test_new_branch() {
var branch = new Git2.Branch;
- self.assert.instance_of(branch, 'Git2::Branch');
+ self.assert.instance_of(branch, class Git2.Branch);
}
function test_new_repo() {
var repo = new Git2.Repository;
- self.assert.instance_of(repo, 'Git2::Repository');
+ self.assert.instance_of(repo, class Git2.Repository);
}
function test_cstring() {
@@ -56,20 +56,21 @@ class Test_git2_repository_open {
var git_index = new Git2.Index;
var rc = -1;
- //self.assert.instance_of(git_index, 'Git2::Index');
+ self.assert.instance_of(git_index, class Git2.Index);
+ // We actually want to pass repo.alloc() but Winxed won't let us
+ // This intermittently coredumps Parrot
git_repository_open(repo, cstring(".git"));
- // this coredumps parrot
rc = git_repository_index(git_index);
- self.assert.instance_of(git_index, 'Git2::Index');
+ self.assert.instance_of(git_index, class Git2.Index);
self.assert.equal(rc,0);
}
function git_index() {
var git_index = new Git2.Index;
- self.assert.instance_of(git_index, 'Git2::Index');
+ self.assert.instance_of(git_index, class Git2.Index);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.