Commit 2ee249ce authored by Jonathan Hanks's avatar Jonathan Hanks

Added gitlab CI. Updated completions, readme.

Added probe to the completion list.
parent c852524f
Pipeline #45959 passed with stage
in 9 minutes and 46 seconds
#------------------------------------------------------------------------
# gitlab-runner exec docker --timeout 7200 pages --docker-volumes ${HOME}/Sources/GDS/nds/nds2-test-blobs:/replay_data <target>
variables:
DOCKER_DRIVER: overlay
BRANCH: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
COMMIT: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
NIGHTLY: $CI_REGISTRY_IMAGE:nightly
TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
stages:
- build-and-test
before_script:
- ulimit -S -c 0
#========================================================================
# A N C H O R S
#========================================================================
#------------------------------------------------------------------------
# images
#------------------------------------------------------------------------
.template-image-deb-buster: &image-deb-buster
image: debian:buster
.template-image-deb-stretch: &image-deb-stretch
image: ligo/base:stretch
.template-image-deb-jessie: &image-deb-jessie
image: ligo/base:jessie
#------------------------------------------------------------------------
# Debian
#------------------------------------------------------------------------
.deb:build: &deb-build-and-test
script:
#--------------------------------------------------------------------
# First update package list and then ...
# Extract the build dependencies and get them installed
#--------------------------------------------------------------------
- apt-get update
- apt-get install -y build-essential cmake libboost-dev libpstreams-dev
- rm -rf ${CI_PROJECT_DIR}/cmake-build
- mkdir ${CI_PROJECT_DIR}/cmake-build
- cd ${CI_PROJECT_DIR}/cmake-build
- cmake -DCMAKE_INSTALL_PREFIX=/usr ..
- cmake --build . -- VERBOSE=1
- ctest
- DESTDIR=${CI_PROJECT_DIR}/cmake-build/t cmake --build . --target install
artifacts:
expire_in: 1h
paths:
- cmake-build/t
only:
- pushes
- schedules
ligo-channel-completion:buster:
stage: build-and-test
<<: *image-deb-buster
<<: *deb-build-and-test
ligo-channel-completion:stretch:
stage: build-and-test
<<: *image-deb-stretch
<<: *deb-build-and-test
ligo-channel-completion:jessie:
stage: build-and-test
<<: *image-deb-jessie
<<: *deb-build-and-test
\ No newline at end of file
......@@ -6,7 +6,7 @@ every line is a single channel name. The file must be sorted.
The path to the files is set via the 'EPICS_CHAN_LIST' and 'NDS_CHAN_LIST' environment variables.
As the names imply the database are for EPICS channels or Daq/NDS channels. This split is needed
As the names imply the database are for EPICS channels or DAQ/NDS channels. This split is needed
as in the LIGO control room there are > 500k channels, with roughly half are available only as EPICS channels.
By specifically supporting EPICS channels then non-daq channels like string records can be completed against
for caget/caput/...
......@@ -18,7 +18,7 @@ directly takes the database on the command line.
<pre>
# assuming that the channel database is
# located at db.txt.
channel_completion -d db.txt -r > tmpfile
ligo_channel_completion -d db.txt -r > tmpfile
mv tmpfile db.txt
</pre>
......@@ -26,6 +26,7 @@ Requirements:
* A C++11 compliant compiler.
* CMake 3+
* Boost iterator library
* pstreams library
Debian requirements:
* build-essential
......
......@@ -8,6 +8,7 @@ set (COMPLETE_THESE_EPICS_COMMANDS
caget
caput
camonitor
probe
)
set(COMPLETE_NDS_COMMAND_REGISTRATION)
......
......@@ -44,14 +44,15 @@ public:
other.fd_ = -1;
}
temporary_fd operator=( const temporary_fd& other ) = delete;
temporary_fd
operator=( temporary_fd&& other )
temporary_fd&
operator=( temporary_fd&& other ) noexcept
{
unlink( );
fd_ = other.fd_;
name_ = std::move( other.name_ );
other.fd_ = -1;
other.name_.clear( );
return *this;
};
~temporary_fd( )
......
......@@ -52,14 +52,15 @@ public:
other.fd_ = -1;
}
temporary_fd operator=( const temporary_fd& other ) = delete;
temporary_fd
operator=( temporary_fd&& other )
temporary_fd&
operator=( temporary_fd&& other ) noexcept
{
unlink( );
fd_ = other.fd_;
name_ = std::move( other.name_ );
other.fd_ = -1;
other.name_.clear( );
return *this;
};
~temporary_fd( )
......@@ -142,14 +143,6 @@ private:
std::string name_;
};
std::string
readsome( std::istream& is )
{
char buffer[ 100 ];
auto count = is.readsome( buffer, sizeof( buffer ) );
return std::string( buffer, count );
}
void
run_test( const std::vector< std::string >& input,
const std::vector< std::string >& extra_args,
......@@ -202,7 +195,7 @@ TEST_CASE( "You can run the test program" )
{
std::vector< std::string > args;
args.push_back( test_program_name );
args.push_back( "H1:" );
args.emplace_back( "H1:" );
redi::ipstream prog( test_program_name, args );
REQUIRE( prog.is_open( ) );
......@@ -219,7 +212,7 @@ TEST_CASE( "You can run the test program" )
prog.close( );
REQUIRE( prog.rdbuf( )->exited( ) );
REQUIRE( prog.rdbuf( )->status( ) == 0 );
REQUIRE( choices.size( ) == 0 );
REQUIRE( choices.empty( ) );
}
TEST_CASE( "Basic completion behavior with an specified database no input" )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment