mirror of
https://gitlab.com/splashmapper/splash.git
synced 2026-02-12 23:10:49 +01:00
49 lines
1.3 KiB
C++
49 lines
1.3 KiB
C++
/*
|
|
* Copyright (C) 2021 Splash authors
|
|
*
|
|
* This file is part of Splash.
|
|
*
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* Splash 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 Splash. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#include <doctest.h>
|
|
|
|
#include <chrono>
|
|
#include <iostream>
|
|
#include <thread>
|
|
|
|
#include "./config.h"
|
|
|
|
#if HAVE_LINUX
|
|
#include "./utils/subprocess.h"
|
|
|
|
using namespace Splash::Utils;
|
|
|
|
/*************/
|
|
TEST_CASE("Testing Subprocess")
|
|
{
|
|
{
|
|
auto process = Subprocess("sleep", "1");
|
|
std::this_thread::sleep_for(std::chrono::seconds(2));
|
|
CHECK_EQ(process.isRunning(), false);
|
|
}
|
|
|
|
{
|
|
auto process = Subprocess("sleep", "2");
|
|
std::this_thread::sleep_for(std::chrono::seconds(1));
|
|
CHECK_EQ(process.isRunning(), true);
|
|
}
|
|
}
|
|
#endif // HAVE_LINUX
|