diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..4b57724 --- /dev/null +++ b/test.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +set -eux + +if [ ! -d build ] +then + ./build.sh +fi + +perl -MTest::Harness -e '$$Test::Harness::verbose=1; runtests @ARGV;' tests/*.t.pl diff --git a/tests/benchmark-reverse.pl b/tests/benchmark-reverse.pl index 1ba214c..e91b08f 100755 --- a/tests/benchmark-reverse.pl +++ b/tests/benchmark-reverse.pl @@ -12,7 +12,7 @@ sub mount_encfs_reverse { my $c = shift; my $opts = shift; - my $cmdline = "./encfs/encfs --extpass=\"echo test\" --standard $p $c --reverse $opts 2>&1 > /dev/null"; + my $cmdline = "./build/encfs --extpass=\"echo test\" --standard $p $c --reverse $opts 2>&1 > /dev/null"; # print "mounting encfs: $cmdline\n"; my $status = system($cmdline); if ( $status != 0 ) { die("command returned error: $status"); } diff --git a/tests/benchmark.pl b/tests/benchmark.pl index f67f30d..8355065 100755 --- a/tests/benchmark.pl +++ b/tests/benchmark.pl @@ -35,7 +35,7 @@ sub mount_encfs { mkdir($p); delete $ENV{"ENCFS6_CONFIG"}; - system("./encfs/encfs --extpass=\"echo test\" --standard $c $p > /dev/null"); + system("./build/encfs --extpass=\"echo test\" --standard $c $p > /dev/null"); waitForFile("$c/.encfs6.xml") or die("Control file not created"); print "# encfs mounted on $p\n"; @@ -156,7 +156,6 @@ sub main { if ( $> != 0 ) { print("This test must be run as root!\n"); - exit(2); } dl_linuxgz(); diff --git a/tests/normal.t.pl b/tests/normal.t.pl index cf586f3..99e18b7 100755 --- a/tests/normal.t.pl +++ b/tests/normal.t.pl @@ -2,7 +2,7 @@ # Test EncFS normal and paranoid mode -use Test::More tests => 103; +use Test::More tests => 102; use File::Path; use File::Copy; use File::Temp; @@ -261,7 +261,7 @@ sub checkContents sub encName { my $plain = shift; - my $enc = qx(./encfs/encfsctl encode --extpass="echo test" $raw $plain); + my $enc = qx(./build/encfsctl encode --extpass="echo test" $raw $plain); chomp($enc); return $enc; } @@ -304,7 +304,7 @@ sub mount mkdir($crypt) || BAIL_OUT("Could not create $crypt: $!"); delete $ENV{"ENCFS6_CONFIG"}; - my $cmdline = "./encfs/encfs --extpass=\"echo test\" $args $raw $crypt 2>&1"; + my $cmdline = "./build/encfs --extpass=\"echo test\" $args $raw $crypt 2>&1"; # This makes sure we get to see stderr ^ my $status = system($cmdline); ok( $status == 0, "encfs command returns 0") || BAIL_OUT(""); diff --git a/tests/reverse.t.pl b/tests/reverse.t.pl index a8405a0..9e359bc 100755 --- a/tests/reverse.t.pl +++ b/tests/reverse.t.pl @@ -46,11 +46,11 @@ sub cleanup sub mount { delete $ENV{"ENCFS6_CONFIG"}; - system("./encfs/encfs --extpass=\"echo test\" --standard $plain $ciphertext --reverse --nocache"); + system("./build/encfs --extpass=\"echo test\" --standard $plain $ciphertext --reverse --nocache"); ok(waitForFile("$plain/.encfs6.xml"), "plain .encfs6.xml exists") or BAIL_OUT("'$plain/.encfs6.xml'"); my $e = encName(".encfs6.xml"); ok(waitForFile("$ciphertext/$e"), "encrypted .encfs6.xml exists") or BAIL_OUT("'$ciphertext/$e'"); - system("ENCFS6_CONFIG=$plain/.encfs6.xml ./encfs/encfs --nocache --extpass=\"echo test\" $ciphertext $decrypted"); + system("ENCFS6_CONFIG=$plain/.encfs6.xml ./build/encfs --nocache --extpass=\"echo test\" $ciphertext $decrypted"); ok(waitForFile("$decrypted/.encfs6.xml"), "decrypted .encfs6.xml exists") or BAIL_OUT("'$decrypted/.encfs6.xml'"); } @@ -60,7 +60,7 @@ sub mount sub encName { my $name = shift; - my $enc = qx(ENCFS6_CONFIG=$plain/.encfs6.xml ./encfs/encfsctl encode --extpass="echo test" $ciphertext $name); + my $enc = qx(ENCFS6_CONFIG=$plain/.encfs6.xml ./build/encfsctl encode --extpass="echo test" $ciphertext $name); chomp($enc); return $enc; }