Bundle all integration tests in single binary

Reduces test build time from ~2m30s to ~30s
This commit is contained in:
RunasSudo 2021-09-10 00:02:52 +10:00
parent 523b039d2a
commit d222207318
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A
17 changed files with 61 additions and 12 deletions

19
tests/main.rs Normal file
View File

@ -0,0 +1,19 @@
/* OpenTally: Open-source election vote counting
* Copyright © 2021 Lee Yingtong Li (RunasSudo)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
mod utils;
mod tests_impl;

View File

@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
mod utils;
use crate::utils;
use opentally::numbers::Rational;
use opentally::stv;

View File

@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
mod utils;
use crate::utils;
use opentally::election::Election;
use opentally::numbers::Rational;

View File

@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
mod utils;
use crate::utils;
use opentally::numbers::Rational;
use opentally::stv;

View File

@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
mod utils;
use crate::utils;
use opentally::numbers::Rational;
use opentally::stv;

View File

@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
mod utils;
use crate::utils;
use opentally::constraints::Constraints;
use opentally::election::{CandidateState, CountState, Election};

View File

@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
mod utils;
use crate::utils;
use opentally::numbers::NativeFloat64;
use opentally::stv;

View File

@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
mod utils;
use crate::utils;
use opentally::numbers::Rational;
use opentally::stv;

View File

@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
mod utils;
use crate::utils;
use opentally::election::{CandidateState, CountState, Election};
use opentally::numbers::{Fixed, NativeFloat64, Number};

View File

@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
mod utils;
use crate::utils;
use opentally::numbers::Rational;
use opentally::stv;

32
tests/tests_impl/mod.rs Normal file
View File

@ -0,0 +1,32 @@
/* OpenTally: Open-source election vote counting
* Copyright © 2021 Lee Yingtong Li (RunasSudo)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
mod act;
mod aec;
mod cambridge;
mod cli;
mod coe;
mod constraints;
mod convert;
mod csm;
mod equal_ranks;
mod ers;
mod meek;
mod minneapolis;
mod prsa;
mod scotland;
mod special_cases;

View File

@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
mod utils;
use crate::utils;
use opentally::numbers::Rational;
use opentally::stv;

View File

@ -15,8 +15,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
mod utils;
use opentally::election::{CandidateState, CountState, Election};
use opentally::numbers::Rational;
use opentally::parser::blt;