- #1250 Support out-of-tree test runs (thanks to Jakub Wilk).
This commit is contained in:
Paul Beckingham
2013-04-13 15:02:50 -04:00
parent 5cfd7b0cc6
commit 09f577536a
9 changed files with 43 additions and 15 deletions

View File

@@ -145,9 +145,9 @@ add_subdirectory (src/shell)
add_subdirectory (doc)
add_subdirectory (i18n)
add_subdirectory (scripts)
if (EXISTS test)
if (EXISTS ${CMAKE_SOURCE_DIR}/test)
add_subdirectory (test EXCLUDE_FROM_ALL)
endif (EXISTS test)
endif (EXISTS ${CMAKE_SOURCE_DIR}/test)
if (EXISTS performance)
add_subdirectory (performance EXCLUDE_FROM_ALL)
endif (EXISTS performance)

View File

@@ -10,6 +10,7 @@ Features
Gill).
+ #1227 A new 'verify_l10n' utility ensures the localizations are in sync (thanks to
Wim Schuermann).
+ #1250 Support out-of-tree test runs (thanks to Jakub Wilk).
+ Stores un-synched transactions in <data.location>/backlog.data.
+ Adds a new 'synchronize' command to sync data with a task server.
+ Adds a new 'sync' verbosity token, which will reminds when a backlog builds

View File

@@ -12,17 +12,29 @@ set (test_SRCS autocomplete.t color.t config.t date.t directory.t dom.t
width.t json_test)
message ("-- Configuring run_all")
set (TESTBLOB "*.t")
if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
set (TESTBLOB "./*.t")
if (CYGWIN)
set (TESTBLOB "*.t *.t.exe")
set (TESTBLOB "./*.t ./*.t.exe")
endif (CYGWIN)
else (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
set (TESTBLOB "${CMAKE_SOURCE_DIR}/test/*.t ${CMAKE_BINARY_DIR}/test/*.t")
if (CYGWIN)
set (TESTBLOB "${CMAKE_SOURCE_DIR}/test/*.t ${CMAKE_BINARY_DIR}/test/*.t.exe")
endif (CYGWIN)
endif (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
configure_file (
${CMAKE_SOURCE_DIR}/test/run_all.in
${CMAKE_SOURCE_DIR}/test/run_all)
run_all.in
run_all)
add_custom_target (test ./run_all --verbose
DEPENDS ${test_SRCS} task_executable
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/test)
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/test)
add_custom_target (build_tests DEPENDS ${test_SRCS}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/test)

View File

@@ -41,10 +41,13 @@ if (open my $fh, '>', 'bug.rc')
ok (-r 'bug.rc', 'Created bug.rc');
}
my $source_dir = $0;
$source_dir =~ s{[^/]+$}{..};
# Copy task.sh and make substitutions & additions needed for testing.
if (open my $target, '>', 'task.sh')
{
if (open my $source, '<', '../scripts/bash/task.sh')
if (open my $source, '<', "$source_dir/scripts/bash/task.sh")
{
while (<$source>)
{

View File

@@ -30,6 +30,9 @@ use strict;
use warnings;
use Test::More tests => 22;
my $source_dir = $0;
$source_dir =~ s{[^/]+$}{..};
# Create the rc file.
if (open my $fh, '>', 'export.rc')
{
@@ -44,7 +47,7 @@ if (open my $fh, '>', 'export.rc')
qx{../src/task rc:export.rc add priority:H project:A one 2>&1};
qx{../src/task rc:export.rc add +tag1 +tag2 two 2>&1};
my $output = qx{../src/task rc:export.rc export | ../scripts/add-ons/export-yaml.pl > ./export.txt 2>&1};
my $output = qx{../src/task rc:export.rc export | $source_dir/scripts/add-ons/export-yaml.pl > ./export.txt 2>&1};
my @lines;
if (open my $fh, '<', './export.txt')
{

View File

@@ -30,6 +30,9 @@ use strict;
use warnings;
use Test::More tests => 26;
my $source_dir = $0;
$source_dir =~ s{[^/]+$}{..};
# Create the rc file.
if (open my $fh, '>', 'import.rc')
{
@@ -64,7 +67,7 @@ if (open my $fh, '>', 'import.txt')
}
# Convert todo.sh --> task JSON.
qx{../scripts/add-ons/import-todo.sh.pl <import.txt >import.json 2>&1};
qx{$source_dir/scripts/add-ons/import-todo.sh.pl <import.txt >import.json 2>&1};
# Import the JSON.
my $output = qx{../src/task rc:import.rc import import.json 2>&1};

View File

@@ -30,6 +30,9 @@ use strict;
use warnings;
use Test::More tests => 16;
my $source_dir = $0;
$source_dir =~ s{[^/]+$}{..};
# Create the rc file.
if (open my $fh, '>', 'import.rc')
{
@@ -71,7 +74,7 @@ EOF
}
# Convert YAML --> task JSON.
qx{../scripts/add-ons/import-yaml.pl <import.txt >import.json 2>&1};
qx{$source_dir/scripts/add-ons/import-yaml.pl <import.txt >import.json 2>&1};
# Import the JSON.
my $output = qx{../src/task rc:import.rc import import.json 2>&1 >/dev/null};
@@ -123,7 +126,7 @@ EOF
}
# Convert YAML --> task JSON.
qx{../scripts/add-ons/import-yaml.pl <import.txt >import.json 2>&1};
qx{$source_dir/scripts/add-ons/import-yaml.pl <import.txt >import.json 2>&1};
# Import the JSON.
$output = qx{../src/task rc:import.rc import import.json 2>&1 >/dev/null};

View File

@@ -30,7 +30,10 @@ use strict;
use warnings;
use Test::More;
my @files = glob "./json/*.json";
my $source_dir = $0;
$source_dir =~ s{[^/]+$}{..};
my @files = glob "$source_dir/test/json/*.json";
plan tests => scalar @files;
my $output;

View File

@@ -5,7 +5,7 @@ then
for i in ${TESTBLOB}
do
echo '#' $i
./$i > test.log 2>&1
$i > test.log 2>&1
while read LINE
do
echo $LINE
@@ -37,7 +37,7 @@ else
COUNT=`expr $COUNT + 1`
fi
./$i >> all.log 2>&1
$i >> all.log 2>&1
done
if [ $BAR -eq 1 ]; then