Minimal #define test

This commit is contained in:
Jeremiah Orians 2021-11-21 17:20:32 -05:00
parent 16948fbd9c
commit a0ac86f679
No known key found for this signature in database
GPG Key ID: 6B3A3F198708F894
4 changed files with 57 additions and 0 deletions

View File

@ -53,6 +53,7 @@ results:
# tests
test: M2-Mesoplanet
./test/test0000/run_test.sh
./test/test0001/run_test.sh
# sha256sum -c test/test.answers

View File

@ -0,0 +1 @@
ba1d093813d679dacfe729dab1bdb8d11df35ff85b7d476ed23738972842157d test/test0001/tmp/return.c

23
test/test0001/return.c Normal file
View File

@ -0,0 +1,23 @@
/* Copyright (C) 2016 Jeremiah Orians
* This file is part of M2-Planet.
*
* M2-Planet 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.
*
* M2-Planet 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 M2-Planet. If not, see <http://www.gnu.org/licenses/>.
*/
#define answer 42
int main()
{
return answer;
}

32
test/test0001/run_test.sh Executable file
View File

@ -0,0 +1,32 @@
#! /bin/sh
## Copyright (C) 2017 Jeremiah Orians
## Copyright (C) 2020-2021 deesix <deesix@tuta.io>
## This file is part of M2-Planet.
##
## M2-Planet 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.
##
## M2-Planet 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 M2-Planet. If not, see <http://www.gnu.org/licenses/>.
set -x
TMPDIR="test/test0001/tmp"
mkdir -p ${TMPDIR}
# Build the test
bin/M2-Mesoplanet \
-f test/test0001/return.c \
-o ${TMPDIR}/return.c \
|| exit 1
sha256sum -c test/test0001/proof.answer || exit 2
exit 0