Feature #1250
- #1250 Support out-of-tree test runs (thanks to Jakub Wilk).
This commit is contained in:
@@ -145,9 +145,9 @@ add_subdirectory (src/shell)
|
|||||||
add_subdirectory (doc)
|
add_subdirectory (doc)
|
||||||
add_subdirectory (i18n)
|
add_subdirectory (i18n)
|
||||||
add_subdirectory (scripts)
|
add_subdirectory (scripts)
|
||||||
if (EXISTS test)
|
if (EXISTS ${CMAKE_SOURCE_DIR}/test)
|
||||||
add_subdirectory (test EXCLUDE_FROM_ALL)
|
add_subdirectory (test EXCLUDE_FROM_ALL)
|
||||||
endif (EXISTS test)
|
endif (EXISTS ${CMAKE_SOURCE_DIR}/test)
|
||||||
if (EXISTS performance)
|
if (EXISTS performance)
|
||||||
add_subdirectory (performance EXCLUDE_FROM_ALL)
|
add_subdirectory (performance EXCLUDE_FROM_ALL)
|
||||||
endif (EXISTS performance)
|
endif (EXISTS performance)
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ Features
|
|||||||
Gill).
|
Gill).
|
||||||
+ #1227 A new 'verify_l10n' utility ensures the localizations are in sync (thanks to
|
+ #1227 A new 'verify_l10n' utility ensures the localizations are in sync (thanks to
|
||||||
Wim Schuermann).
|
Wim Schuermann).
|
||||||
|
+ #1250 Support out-of-tree test runs (thanks to Jakub Wilk).
|
||||||
+ Stores un-synched transactions in <data.location>/backlog.data.
|
+ Stores un-synched transactions in <data.location>/backlog.data.
|
||||||
+ Adds a new 'synchronize' command to sync data with a task server.
|
+ 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
|
+ Adds a new 'sync' verbosity token, which will reminds when a backlog builds
|
||||||
|
|||||||
@@ -12,17 +12,29 @@ set (test_SRCS autocomplete.t color.t config.t date.t directory.t dom.t
|
|||||||
width.t json_test)
|
width.t json_test)
|
||||||
|
|
||||||
message ("-- Configuring run_all")
|
message ("-- Configuring run_all")
|
||||||
set (TESTBLOB "*.t")
|
if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
|
||||||
|
|
||||||
|
set (TESTBLOB "./*.t")
|
||||||
if (CYGWIN)
|
if (CYGWIN)
|
||||||
set (TESTBLOB "*.t *.t.exe")
|
set (TESTBLOB "./*.t ./*.t.exe")
|
||||||
endif (CYGWIN)
|
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 (
|
configure_file (
|
||||||
${CMAKE_SOURCE_DIR}/test/run_all.in
|
run_all.in
|
||||||
${CMAKE_SOURCE_DIR}/test/run_all)
|
run_all)
|
||||||
|
|
||||||
add_custom_target (test ./run_all --verbose
|
add_custom_target (test ./run_all --verbose
|
||||||
DEPENDS ${test_SRCS} task_executable
|
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}
|
add_custom_target (build_tests DEPENDS ${test_SRCS}
|
||||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/test)
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/test)
|
||||||
|
|||||||
@@ -41,10 +41,13 @@ if (open my $fh, '>', 'bug.rc')
|
|||||||
ok (-r 'bug.rc', 'Created 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.
|
# Copy task.sh and make substitutions & additions needed for testing.
|
||||||
if (open my $target, '>', 'task.sh')
|
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>)
|
while (<$source>)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -30,6 +30,9 @@ use strict;
|
|||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 22;
|
use Test::More tests => 22;
|
||||||
|
|
||||||
|
my $source_dir = $0;
|
||||||
|
$source_dir =~ s{[^/]+$}{..};
|
||||||
|
|
||||||
# Create the rc file.
|
# Create the rc file.
|
||||||
if (open my $fh, '>', 'export.rc')
|
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 priority:H project:A one 2>&1};
|
||||||
qx{../src/task rc:export.rc add +tag1 +tag2 two 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;
|
my @lines;
|
||||||
if (open my $fh, '<', './export.txt')
|
if (open my $fh, '<', './export.txt')
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -30,6 +30,9 @@ use strict;
|
|||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 26;
|
use Test::More tests => 26;
|
||||||
|
|
||||||
|
my $source_dir = $0;
|
||||||
|
$source_dir =~ s{[^/]+$}{..};
|
||||||
|
|
||||||
# Create the rc file.
|
# Create the rc file.
|
||||||
if (open my $fh, '>', 'import.rc')
|
if (open my $fh, '>', 'import.rc')
|
||||||
{
|
{
|
||||||
@@ -64,7 +67,7 @@ if (open my $fh, '>', 'import.txt')
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Convert todo.sh --> task JSON.
|
# 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.
|
# Import the JSON.
|
||||||
my $output = qx{../src/task rc:import.rc import import.json 2>&1};
|
my $output = qx{../src/task rc:import.rc import import.json 2>&1};
|
||||||
|
|||||||
@@ -30,6 +30,9 @@ use strict;
|
|||||||
use warnings;
|
use warnings;
|
||||||
use Test::More tests => 16;
|
use Test::More tests => 16;
|
||||||
|
|
||||||
|
my $source_dir = $0;
|
||||||
|
$source_dir =~ s{[^/]+$}{..};
|
||||||
|
|
||||||
# Create the rc file.
|
# Create the rc file.
|
||||||
if (open my $fh, '>', 'import.rc')
|
if (open my $fh, '>', 'import.rc')
|
||||||
{
|
{
|
||||||
@@ -71,7 +74,7 @@ EOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Convert YAML --> task JSON.
|
# 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.
|
# Import the JSON.
|
||||||
my $output = qx{../src/task rc:import.rc import import.json 2>&1 >/dev/null};
|
my $output = qx{../src/task rc:import.rc import import.json 2>&1 >/dev/null};
|
||||||
@@ -123,7 +126,7 @@ EOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Convert YAML --> task JSON.
|
# 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.
|
# Import the JSON.
|
||||||
$output = qx{../src/task rc:import.rc import import.json 2>&1 >/dev/null};
|
$output = qx{../src/task rc:import.rc import import.json 2>&1 >/dev/null};
|
||||||
|
|||||||
@@ -30,7 +30,10 @@ use strict;
|
|||||||
use warnings;
|
use warnings;
|
||||||
use Test::More;
|
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;
|
plan tests => scalar @files;
|
||||||
|
|
||||||
my $output;
|
my $output;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ then
|
|||||||
for i in ${TESTBLOB}
|
for i in ${TESTBLOB}
|
||||||
do
|
do
|
||||||
echo '#' $i
|
echo '#' $i
|
||||||
./$i > test.log 2>&1
|
$i > test.log 2>&1
|
||||||
while read LINE
|
while read LINE
|
||||||
do
|
do
|
||||||
echo $LINE
|
echo $LINE
|
||||||
@@ -37,7 +37,7 @@ else
|
|||||||
COUNT=`expr $COUNT + 1`
|
COUNT=`expr $COUNT + 1`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./$i >> all.log 2>&1
|
$i >> all.log 2>&1
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ $BAR -eq 1 ]; then
|
if [ $BAR -eq 1 ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user