Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ensembl
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
ensembl
Commits
7662f2c7
Commit
7662f2c7
authored
6 years ago
by
Magali Ruffier
Browse files
Options
Downloads
Patches
Plain Diff
ENSCORESW-2827
: minimal test on xref config validity
parent
e065a3e4
No related branches found
No related tags found
4 merge requests
!342
Feature/schema update 96
,
!278
ENSCORESW-2827: minimal test on xref config validity
,
!342
Feature/schema update 96
,
!278
ENSCORESW-2827: minimal test on xref config validity
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/t/xrefs.t
+50
-0
50 additions, 0 deletions
modules/t/xrefs.t
with
50 additions
and
0 deletions
modules/t/xrefs.t
0 → 100644
+
50
−
0
View file @
7662f2c7
# Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
# Copyright [2016-2018] EMBL-European Bioinformatics Institute
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
use
strict
;
use
warnings
;
use
Cwd
;
use
File::
Spec
;
use
File::
Basename
qw/dirname/
;
use
File::
Temp
;
use
Test::
More
;
use
Test::
Warnings
;
#chdir into the file's target & request cwd() which should be fully resolved now.
#then go back
my
$file_dir
=
dirname
(
__FILE__
);
my
$original_dir
=
cwd
();
chdir
(
$file_dir
);
my
$cur_dir
=
cwd
();
chdir
(
$original_dir
);
my
$root
=
File::
Spec
->
catdir
(
$cur_dir
,
File::
Spec
->
updir
(),
File::
Spec
->
updir
());
my
$script
=
File::
Spec
->
catfile
(
$root
,
"
misc-scripts/xref_mapping/xref_config2sql.pl
");
my
$config
=
File::
Spec
->
catfile
(
$root
,
"
misc-scripts/xref_mapping/xref_config.ini
");
my
$tmpdir
=
File::
Temp
->
newdir
();
my
$dirname
=
$tmpdir
->
dirname
;
my
$tmpfile
=
File::
Temp
->
new
(
DIR
=>
$dirname
,
SUFFIX
=>
"
.txt
");
my
$cmd
=
"
perl
$script
$config
>
$tmpfile
";
system
(
$cmd
);
my
$content
=
do
{
local
(
@ARGV
,
$/
)
=
$tmpfile
;
<>
};
# Test the file was written in entirety
like
(
$content
,
qr/FINISHED SUCCESSFULLY/
,
"
Config was parsed successfully
");
done_testing
();
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment