mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-11 09:03:40 +02:00
2018-08-10 Fred Gleason <fredg@paravelsystems.com>
* Changed installation location of caed(8), ripcd(8), rdcatchd(8) and rdrepld(8) from '@prefix@/bin' to '@prefix@/sbin'. * Removed code to detach from controlling terminal after startup from caed(8), ripcd(8), rdcatchd(8) and rdrepld(8). * Removed code to manage dropbox instances from rdcatchd(8). * Removed code to start service daemons automatically from user modules. * Added rdservice(8).
This commit is contained in:
@@ -32,6 +32,7 @@ noinst_PROGRAMS = audio_convert_test\
|
||||
audio_peaks_test\
|
||||
datedecode_test\
|
||||
db_charset_test\
|
||||
getpids_test\
|
||||
log_unlink_test\
|
||||
mcast_recv_test\
|
||||
rdxml_parse_test\
|
||||
@@ -61,6 +62,9 @@ datedecode_test_LDADD = @LIB_RDLIBS@ @LIBVORBIS@ @QT4_LIBS@ -lQt3Support
|
||||
dist_db_charset_test_SOURCES = db_charset_test.cpp db_charset_test.h
|
||||
db_charset_test_LDADD = @LIB_RDLIBS@ @LIBVORBIS@ @QT4_LIBS@ -lQt3Support
|
||||
|
||||
dist_getpids_test_SOURCES = getpids_test.cpp getpids_test.h
|
||||
getpids_test_LDADD = @LIB_RDLIBS@ @LIBVORBIS@ @QT4_LIBS@ -lQt3Support
|
||||
|
||||
dist_log_unlink_test_SOURCES = log_unlink_test.cpp log_unlink_test.h
|
||||
nodist_log_unlink_test_SOURCES = moc_log_unlink_test.cpp
|
||||
log_unlink_test_LDADD = @LIB_RDLIBS@ @LIBVORBIS@ @QT4_LIBS@ -lQt3Support
|
||||
|
79
tests/getpids_test.cpp
Normal file
79
tests/getpids_test.cpp
Normal file
@@ -0,0 +1,79 @@
|
||||
// getpids_test.cpp
|
||||
//
|
||||
// Test the Rivendell RDGetPids() function.
|
||||
//
|
||||
// (C) Copyright 2018 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
// published by the Free Software Foundation.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public
|
||||
// License along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <qapplication.h>
|
||||
#include <qvariant.h>
|
||||
|
||||
#include <rdcmd_switch.h>
|
||||
#include <rdconf.h>
|
||||
#include <rddatedecode.h>
|
||||
#include <rddb.h>
|
||||
|
||||
#include "getpids_test.h"
|
||||
|
||||
MainObject::MainObject(QObject *parent)
|
||||
:QObject(parent)
|
||||
{
|
||||
QString program="";
|
||||
QList<pid_t> pids;
|
||||
|
||||
//
|
||||
// Read Command Options
|
||||
//
|
||||
RDCmdSwitch *cmd=
|
||||
new RDCmdSwitch(qApp->argc(),qApp->argv(),"getpids_test",
|
||||
GETPIDS_TEST_USAGE);
|
||||
for(unsigned i=0;i<cmd->keys();i++) {
|
||||
if(cmd->key(i)=="--program") {
|
||||
program=cmd->value(i);
|
||||
cmd->setProcessed(i,true);
|
||||
}
|
||||
if(!cmd->processed(i)) {
|
||||
fprintf(stderr,"getpids_test: unknown option \"%s\"\n",
|
||||
(const char *)cmd->value(i));
|
||||
exit(256);
|
||||
}
|
||||
}
|
||||
if(program.isEmpty()) {
|
||||
fprintf(stderr,
|
||||
"getpids_test: you must specify a --program\n");
|
||||
exit(256);
|
||||
}
|
||||
|
||||
pids=RDGetPids(program);
|
||||
|
||||
printf("Found PIDS:\n");
|
||||
for(int i=0;i<pids.size();i++) {
|
||||
printf("%d\n",pids[i]);
|
||||
}
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
int main(int argc,char *argv[])
|
||||
{
|
||||
QApplication a(argc,argv,false);
|
||||
new MainObject();
|
||||
return a.exec();
|
||||
}
|
35
tests/getpids_test.h
Normal file
35
tests/getpids_test.h
Normal file
@@ -0,0 +1,35 @@
|
||||
// getpids_test.h
|
||||
//
|
||||
// Test the Rivendell RDGetPids() function.
|
||||
//
|
||||
// (C) Copyright 2018 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
// published by the Free Software Foundation.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public
|
||||
// License along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
|
||||
#ifndef GETPIDS_TEST_H
|
||||
#define GETPIDS_TEST_H
|
||||
|
||||
#include <qobject.h>
|
||||
|
||||
#define GETPIDS_TEST_USAGE "[options]\n\nTest the Rivendell RDGetPids() function\n\nOptions are:\n--program=<pathname>\n Full path to the program to look for\n\n"
|
||||
|
||||
class MainObject : public QObject
|
||||
{
|
||||
public:
|
||||
MainObject(QObject *parent=0);
|
||||
};
|
||||
|
||||
|
||||
#endif // GETPIDS_TEST_H
|
Reference in New Issue
Block a user