Skip to content

Commit

Permalink
Refine SimMock deployment paths.
Browse files Browse the repository at this point in the history
Signed-off-by: Rule Timothy (CC/EMT2) <[email protected]>
  • Loading branch information
timrulebosch committed Nov 29, 2023
1 parent 9352943 commit 5e1d360
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ target_include_directories(mocks
PRIVATE
${DSE_CLIB_INCLUDE_DIR}
${DSE_NCODEC_INCLUDE_DIR}
../../..
../..
)
2 changes: 1 addition & 1 deletion dse/modelc/mocks/simmock.c → dse/mocks/simmock.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <string.h>
#include <dse/testing.h>
#include <dse/ncodec/codec.h>
#include <dse/modelc/mocks/simmock.h>
#include <dse/mocks/simmock.h>


/* Private interface from ncodec.c */
Expand Down
6 changes: 3 additions & 3 deletions dse/modelc/mocks/simmock.h → dse/mocks/simmock.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
//
// SPDX-License-Identifier: Apache-2.0

#ifndef DSE_MODELC_MOCKS_SIMMOCK_H_
#define DSE_MODELC_MOCKS_SIMMOCK_H_
#ifndef DSE_MOCKS_SIMMOCK_H_
#define DSE_MOCKS_SIMMOCK_H_

#include <stdbool.h>
#include <dse/logger.h>
Expand Down Expand Up @@ -175,4 +175,4 @@ void simmock_print_scalar_signals(SimMock* mock, int level);
void simmock_print_network_frames(SimMock* mock, int level);


#endif // DSE_MODELC_MOCKS_SIMMOCK_H_
#endif // DSE_MOCKS_SIMMOCK_H_
14 changes: 11 additions & 3 deletions dse/modelc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ endif()

# Targets
# =======
set(DSE_MOCK_DIR ${CMAKE_SOURCE_DIR}/../mocks)
set(DSE_MODELC_PUBLIC_HEADERS
gateway.h
mcl.h
Expand All @@ -194,7 +195,7 @@ add_subdirectory(adapter)
add_subdirectory(controller)
add_subdirectory(model)
if(UNIX)
add_subdirectory(mocks)
add_subdirectory(${DSE_MOCK_DIR} ${CMAKE_CURRENT_BINARY_DIR}/mocks)
endif()

# Model C (static)
Expand Down Expand Up @@ -325,8 +326,15 @@ install(
if(UNIX)
install(
FILES
mocks/simmock.c
mocks/simmock.h
${DSE_MOCK_DIR}/simmock.h
DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}/dse/mocks
COMPONENT
modelc
)
install(
FILES
${DSE_MOCK_DIR}/simmock.c
DESTINATION
mocks
COMPONENT
Expand Down
2 changes: 1 addition & 1 deletion dse/modelc/examples/apis/simmock_configure.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <dse/testing.h>
#include <dse/modelc/mocks/simmock.h>
#include <dse/mocks/simmock.h>

int test_setup(void** state)
{
Expand Down
2 changes: 1 addition & 1 deletion dse/modelc/examples/apis/simmock_frame_check.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <dse/testing.h>
#include <dse/modelc/mocks/simmock.h>
#include <dse/mocks/simmock.h>

void test_network__frame_check(void** state)
{
Expand Down
2 changes: 1 addition & 1 deletion dse/modelc/examples/apis/simmock_signal_check.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <dse/testing.h>
#include <dse/modelc/mocks/simmock.h>
#include <dse/mocks/simmock.h>

#define SIG_task_init_done 1
#define SIG_task_5_active 2
Expand Down

0 comments on commit 5e1d360

Please sign in to comment.