2021-04-16 17:18:09 -04:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2021 by Savoir-faire Linux
|
|
|
|
* Author: Albert Babí Oller <albert.babi@savoirfairelinux.com>
|
|
|
|
* Author: Mingrui Zhang <mingrui.zhang@savoirfairelinux.com>
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* 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, see <https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "globaltestenvironment.h"
|
|
|
|
|
|
|
|
#include <QApplication>
|
2021-05-07 10:38:19 -04:00
|
|
|
#include <QStandardPaths>
|
|
|
|
|
2021-06-15 11:13:22 -04:00
|
|
|
TestEnvironment globalEnv;
|
2021-04-16 17:18:09 -04:00
|
|
|
|
|
|
|
int
|
|
|
|
main(int argc, char* argv[])
|
|
|
|
{
|
Rename dring to jamid, ring to jami.
Automated via the following command:
$ git grep -l dring | grep -v '.ts$' | xargs sed -i
's/dring/jamid/g'
$ git ls-files | xargs sed -i 's,bin/jamid.lib,bin/jami.lib,g'
$ git ls-files | xargs sed -i 's,src/jamid,src/jami,g'
$ git ls-files | xargs sed -i 's,-mutejamid,-mutejami,g'
$ git checkout docker
Change-Id: I030209b60817372f866055daadb4d0a1c1e2e9df
2021-06-09 11:51:06 -04:00
|
|
|
// Remove "-mutejami" from argv, as quick_test_main_with_setup() will
|
2021-04-16 17:18:09 -04:00
|
|
|
// fail if given an invalid command-line argument.
|
|
|
|
auto end = std::remove_if(argv + 1, argv + argc, [](char* argv) {
|
Rename dring to jamid, ring to jami.
Automated via the following command:
$ git grep -l dring | grep -v '.ts$' | xargs sed -i
's/dring/jamid/g'
$ git ls-files | xargs sed -i 's,bin/jamid.lib,bin/jami.lib,g'
$ git ls-files | xargs sed -i 's,src/jamid,src/jami,g'
$ git ls-files | xargs sed -i 's,-mutejamid,-mutejami,g'
$ git checkout docker
Change-Id: I030209b60817372f866055daadb4d0a1c1e2e9df
2021-06-09 11:51:06 -04:00
|
|
|
return (strcmp(argv, "-mutejami") == 0);
|
2021-04-16 17:18:09 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
if (end != argv + argc) {
|
2021-06-15 11:13:22 -04:00
|
|
|
globalEnv.muteDring = true;
|
2021-04-16 17:18:09 -04:00
|
|
|
|
|
|
|
// Adjust the argument count.
|
|
|
|
argc = std::distance(argv, end);
|
|
|
|
}
|
|
|
|
|
2021-05-07 10:38:19 -04:00
|
|
|
QStandardPaths::setTestModeEnabled(true);
|
|
|
|
|
2021-04-16 17:18:09 -04:00
|
|
|
QApplication a(argc, argv);
|
|
|
|
a.processEvents();
|
2021-06-15 11:13:22 -04:00
|
|
|
|
2021-04-16 17:18:09 -04:00
|
|
|
::testing::InitGoogleTest(&argc, argv);
|
2021-06-15 11:13:22 -04:00
|
|
|
globalEnv.SetUp();
|
|
|
|
auto result = RUN_ALL_TESTS();
|
|
|
|
globalEnv.TearDown();
|
|
|
|
|
|
|
|
return result;
|
2021-04-16 17:18:09 -04:00
|
|
|
}
|