Commit 931e90f3 authored by Tom Barbalet's avatar Tom Barbalet

Update with gui run

parent c660ca88
Pipeline #118500007 passed with stages
in 53 minutes and 20 seconds
......@@ -105,6 +105,18 @@ coverage_object_string:
- rm *.gc*
- rm test_object_string
- rm *.o
coverage_gui:
stage: test
script:
- cd test
- ./test_gui_wo_exec.sh --coverage
- ./test_gui
- gcov -n -w *.gcda
- rm *.gc*
- rm test_gui
- rm *.o
test_sim:
stage: test
......
......@@ -42,11 +42,11 @@
#ifndef _WIN32
#include "shared.h"
#include "../apetoolkit/shared.h"
#else
#include "..\toolkit\shared.h"
#include "..\apetoolkit\shared.h"
#endif
......
/****************************************************************
test_gui.c
=============================================================
Copyright 1996-2020 Tom Barbalet. All rights reserved.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
This software is a continuing work of Tom Barbalet, begun on
13 June 1996. No apes or cats were harmed in the writing of
this software.
****************************************************************/
#include <stdio.h>
#include <time.h>
#include "../apetoolkit/toolkit.h"
#include "../apetoolkit/shared.h"
#include "../script/script.h"
#include "../sim/sim.h"
#include "../entity/entity.h"
#include "../universe/universe.h"
#include "../gui/gui.h"
void test_gui_run(void)
{
n_int counter = 0;
n_int tickCounter = 0x12738291;
n_byte drawBuffer[512 * 512 * 4];
shared_init(0,tickCounter);
tickCounter += 2601;
shared_init(1,tickCounter);
tickCounter += 2601;
shared_init(2,tickCounter);
tickCounter += 2601;
while (counter < (512*4))
{
(void) shared_cycle(tickCounter, 0);
tickCounter += 2601;
(void) shared_cycle(tickCounter, 1);
tickCounter += 2601;
(void) shared_cycle(tickCounter, 2);
tickCounter += 2601;
shared_draw(drawBuffer, 0, 512, 512, 0);
tickCounter += 2601;
shared_draw(drawBuffer, 0, 512, 512, 1);
tickCounter += 2601;
shared_draw(drawBuffer, 0, 512, 512, 2);
tickCounter += 2601;
counter ++;
}
shared_close();
}
int main(int argc, const char * argv[])
{
printf(" --- test gui --- start -----------------------------------------------\n");
test_gui_run();
printf(" --- test gui --- end -----------------------------------------------\n");
return 0;
}
#!/bin/bash
# test.sh
#
# =============================================================
#
# Copyright 1996-2020 Tom Barbalet. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use,
# copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following
# conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
#
# This software is a continuing work of Tom Barbalet, begun on
# 13 June 1996. No apes or cats were harmed in the writing of
# this software.
SOURCEDIR=..
if [ $# -ge 1 -a "$1" == "--debug" ]
then
CFLAGS=-g
else
CFLAGS=-O2
fi
if [ $# -ge 1 -a "$1" == "--coverage" ]
then
COMMANDLINEE="-ftest-coverage -fprofile-arcs"
else
COMMANDLINEE=-DCOMMAND_LINE_EXPLICIT
fi
gcc ${CFLAGS} ${COMMANDLINEE} -c ../apetoolkit/*.c -lz -lm -lpthread -w
gcc ${CFLAGS} ${COMMANDLINEE} -c ../toolkit2/*.c -lz -lm -lpthread -w
gcc ${CFLAGS} ${COMMANDLINEE} -c ../script/*.c -lz -lm -lpthread -w
gcc ${CFLAGS} ${COMMANDLINEE} -c ../sim/*.c -lz -lm -lpthread -w
gcc ${CFLAGS} ${COMMANDLINEE} -c ../entity/*.c -lz -lm -lpthread -w
gcc ${CFLAGS} ${COMMANDLINEE} -c ../universe/*.c -lz -lm -lpthread -w
gcc ${CFLAGS} ${COMMANDLINEE} -c ../gui/*.c -lz -lm -lpthread -w
gcc ${CFLAGS} ${COMMANDLINEE} -c ../gui/shared.c -lz -lm -lpthread -w
gcc ${CFLAGS} ${COMMANDLINEE} -c test_gui.c -o test_gui.o -lz -lm -lpthread -w
if [ $? -ne 0 ]
then
exit 1
fi
gcc ${CFLAGS} ${COMMANDLINEE} -I/usr/include -o test_gui *.o -lz -lm -lpthread -w
if [ $? -ne 0 ]
then
exit 1
fi
rm test_gui.o
\ No newline at end of file
......@@ -84,5 +84,3 @@ exit 1
fi
rm test_sim_time.o
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment